From 298801ce0ae4dd6526f6dc3a3748534ec920cba4 Mon Sep 17 00:00:00 2001 From: Dave <62899351+davidclaveau@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:13:17 -0700 Subject: [PATCH] show revenue on historic record after migration (#387) Signed-off-by: David --- ...backcountry-camping-accordion.component.ts | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/app/enter-data/accordion-manager/backcountry-camping-accordion/backcountry-camping-accordion.component.ts b/src/app/enter-data/accordion-manager/backcountry-camping-accordion/backcountry-camping-accordion.component.ts index d164223..6de4051 100644 --- a/src/app/enter-data/accordion-manager/backcountry-camping-accordion/backcountry-camping-accordion.component.ts +++ b/src/app/enter-data/accordion-manager/backcountry-camping-accordion/backcountry-camping-accordion.component.ts @@ -57,17 +57,32 @@ export class BackcountryCampingAccordionComponent implements OnDestroy { } buildAccordion() { - // legacy data is vastly different + // BRS-368: business logic to show grossCampingRevenue after migration. + // Some records will be legacy and be vastly different, but some will have + // both attribute data - keep `if` logic to differentiate in the future. if (this.data?.isLegacy) { - this.summaries = [{ - attendanceItems: [ - { - itemName: 'People', - value: this.data?.people, - variance: this.variance?.value?.hasOwnProperty('people') - } - ] - }] + this.summaries = [ + { + attendanceItems: [ + { + itemName: 'People', + value: this.data?.people, + variance: this.variance?.value?.hasOwnProperty('people') + } + ], + revenueLabel: 'Net revenue', + revenueItems: [ + { + itemName: 'Gross camping revenue', + value: this.data?.grossCampingRevenue, + variance: this.variance?.value?.hasOwnProperty('grossCampingRevenue') + }, + ], + revenueTotal: this.formulaService.basicNetRevenue([ + this.data?.grossCampingRevenue, + ]), + }, + ]; } else { this.summaries = [ {