-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2303 - Total eligible amount in NOA screen #2365
Conversation
.../packages/backend/apps/api/src/route-controllers/assessment/assessment.controller.service.ts
Outdated
Show resolved
Hide resolved
.../packages/backend/apps/api/src/route-controllers/assessment/assessment.controller.service.ts
Outdated
Show resolved
Hide resolved
sources/packages/backend/apps/api/src/route-controllers/assessment/models/assessment.dto.ts
Show resolved
Hide resolved
@@ -58,6 +58,7 @@ export interface AssessmentNOAAPIOutDTO { | |||
offeringStudyEndDate: string; | |||
msfaaNumber: string; | |||
disbursement: unknown; | |||
eligibleAmount: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -58,6 +58,7 @@ export interface AssessmentNOAAPIOutDTO { | |||
offeringStudyEndDate: string; | |||
msfaaNumber: string; | |||
disbursement: unknown; | |||
eligibleAmount: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes if you are talking about the form.io not saving the assessmentData by the PartTime application, yes there are fields that are used only for FullTime application.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My question is, does part time noa require Living Allowance, Other allowable cost and Total Assessed Cost ? or they are disregarded part time NOA.
I am doubtful that they may be needed for PT noa as well. But I may be wrong.
But if they are needed, the value is never going to come for PT application unless I am missing something.
@JasonCTang @michesmith can you please confirm on the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have confirmed with @HRAGANBC regarding this and there will be a future ticket that needs displaying of several other fields in the NOA screen. Will connect the ticket with out ticket for continuation.
disbursement.valueAmount; | ||
}); | ||
const firstDisbursementScheduleAwards = {}; | ||
firstDisbursementSchedule.disbursementValues.forEach( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor. can use a common method to create disbursement schedule awards.
Nice to see NOA details getting better. Please have a look at the comments. |
...llers/assessment/_tests_/e2e/assessment.institutions.controller.getAssessmentNOA.e2e-spec.ts
Outdated
Show resolved
Hide resolved
...llers/assessment/_tests_/e2e/assessment.institutions.controller.getAssessmentNOA.e2e-spec.ts
Show resolved
Hide resolved
...llers/assessment/_tests_/e2e/assessment.institutions.controller.getAssessmentNOA.e2e-spec.ts
Show resolved
Hide resolved
sources/packages/backend/libs/test-utils/src/factories/disbursement-schedule.ts
Outdated
Show resolved
Hide resolved
sources/packages/backend/libs/test-utils/src/factories/disbursement-schedule.ts
Outdated
Show resolved
Hide resolved
|
||
disbursementSchedule.disbursementValues.forEach((disbursementValue) => { | ||
disbursementScheduleAwards[ | ||
`disbursement${disbursementNumber}${disbursementValue.valueCode.toLowerCase()}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a possibility of having a repeated valueCode
creating a key conflict (duplicate key)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No there will not be any
sources/packages/backend/libs/test-utils/src/factories/disbursement-schedule.ts
Outdated
Show resolved
Hide resolved
sources/packages/backend/libs/test-utils/src/factories/disbursement-schedule.ts
Outdated
Show resolved
Hide resolved
sources/packages/backend/libs/test-utils/src/factories/disbursement-schedule.ts
Outdated
Show resolved
Hide resolved
...llers/assessment/_tests_/e2e/assessment.institutions.controller.getAssessmentNOA.e2e-spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes. 👍
Wanted to know the outcome of the comment https://github.com/bcgov/SIMS/pull/2365/files#r1346112384 from @JasonCTang @michesmith
...llers/assessment/_tests_/e2e/assessment.institutions.controller.getAssessmentNOA.e2e-spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, please take a look at the comments.
.reduce( | ||
(accumulator, disbursementValue) => | ||
accumulator + disbursementValue.valueAmount, | ||
0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO: Specifying 0
as the initial value explicitly to the reduce
is not required here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating an accumulator in the start, in case if the array is null, then the value returned will be 0.
totalValueAmount + | ||
(schedule.disbursementValues || []).reduce( | ||
(sum, disbursementValue) => sum + disbursementValue.valueAmount, | ||
0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/bcgov/SIMS/pull/2365/files#r1346581248
Same can be done for line 271
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @guru-aot 👍 Added an info and a minor suggestion comment.
Kudos, SonarCloud Quality Gate passed!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing the changes, looks good 👍
Total eligible amount is not showing for NOA (part-time and full-time)