Skip to content

Commit

Permalink
ADJST-834 only count active adjustment days. (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldlharper authored Sep 20, 2024
1 parent 49473a6 commit 817a411
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions server/model/adjustmentsHubViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export default class AdjustmentsHubViewModel {

public getTotalDaysRelevantRemand() {
return this.relevantRemand.adjustments
.filter(a => a.status === 'ACTIVE')
.map(a => daysBetween(new Date(a.fromDate), new Date(a.toDate)))
.reduce((sum, current) => sum + current, 0)
}
Expand Down
6 changes: 6 additions & 0 deletions server/routes/hubRoutes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ const remandResult = {
{
fromDate: '2024-01-01',
toDate: '2024-01-20',
status: 'ACTIVE',
},
{
fromDate: '2023-01-01',
toDate: '2023-01-20',
status: 'INACTIVE',
},
],
} as RemandResult
Expand Down

0 comments on commit 817a411

Please sign in to comment.