Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
guru-aot committed Dec 20, 2024
1 parent bf06bdb commit 1ecdbc5
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,19 +323,19 @@ export class AssessmentSequentialProcessingService {
const totals = await this.applicationRepo
.createQueryBuilder("application")
.select(
"COALESCE(SUM(CAST(currentAssessment.workflowData -> 'calculatedData' ->> 'totalFederalFSC' AS NUMERIC)),0)",
"SUM((currentAssessment.workflowData -> 'calculatedData' ->> 'totalFederalFSC')::NUMERIC)",
FullTimeStudentContributionType.FederalFSC,
)
.addSelect(
"COALESCE(SUM(CAST(currentAssessment.workflowData -> 'calculatedData' ->> 'totalProvincialFSC' AS NUMERIC)),0)",
"SUM((currentAssessment.workflowData -> 'calculatedData' ->> 'totalProvincialFSC')::NUMERIC)",
FullTimeStudentContributionType.ProvincialFSC,
)
.addSelect(
"COALESCE(SUM(CAST(currentAssessment.workflowData -> 'calculatedData' ->> 'exemptScholarshipsBursaries' AS NUMERIC)),0)",
"SUM((currentAssessment.workflowData -> 'calculatedData' ->> 'exemptScholarshipsBursaries')::NUMERIC)",
FullTimeStudentContributionType.ScholarshipsBursaries,
)
.addSelect(
"COALESCE(SUM(CAST(currentAssessment.workflowData -> 'calculatedData' ->> 'studentSpouseContributionWeeks' AS NUMERIC)),0)",
"SUM((currentAssessment.workflowData -> 'calculatedData' ->> 'studentSpouseContributionWeeks')::NUMERIC)",
FullTimeStudentContributionType.SpouseContributionWeeks,
)
.innerJoin("application.currentAssessment", "currentAssessment")
Expand All @@ -361,7 +361,7 @@ export class AssessmentSequentialProcessingService {

return Object.keys(FullTimeStudentContributionType).map((key) => ({
contribution: key as FullTimeStudentContributionType,
total: +totals[key],
total: +totals[key] || 0,
}));
}

Expand Down

0 comments on commit 1ecdbc5

Please sign in to comment.