Skip to content

Commit

Permalink
show revenue on historic record after migration (#387)
Browse files Browse the repository at this point in the history
Signed-off-by: David <daveclaveau@gmail.com>
  • Loading branch information
davidclaveau authored Oct 4, 2024
1 parent e1f7849 commit 298801c
Showing 1 changed file with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand Down

0 comments on commit 298801c

Please sign in to comment.