Skip to content

Commit 2c1d1f2

Browse files
#3922 - PT Monthly Loan Balance - Update Balance (#3928)
Adjusted the CSL balance imported to have 2 decimals places.
1 parent d6ce0a5 commit 2c1d1f2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

sources/packages/backend/apps/queue-consumers/src/processors/schedulers/esdc-integration/student-loan-balances/_tests_/student-loan-balances-part-time-integration.scheduler.e2e-spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ describe(
105105
expect(studentLoanBalance).toEqual([
106106
{
107107
balanceDate: "2023-12-31",
108-
cslBalance: 148154,
108+
cslBalance: 1481.54,
109109
},
110110
]);
111111
});
@@ -330,7 +330,7 @@ describe(
330330
},
331331
{
332332
balanceDate: currentBalanceDate,
333-
cslBalance: 148154,
333+
cslBalance: 1481.54,
334334
},
335335
]);
336336
});

sources/packages/backend/libs/integrations/src/esdc-integration/student-loan-balances/student-loan-balances-files/student-loan-balances-file-response.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ export class StudentLoanBalancesFileResponse {
3838
return getDateOnlyFromFormat(this.line.substring(91, 99), DATE_FORMAT);
3939
}
4040
/**
41-
* Date of birth of the student to match and update the student loan balance.
41+
* CSL balance. Expected 7 characters where the last 2 positions should be considered decimals.
4242
*/
4343
get cslBalance(): number {
44-
return +this.line.substring(13, 20);
44+
// Divide by 100 to convert to 2 decimal places.
45+
// TODO: centralize in a util to have decimals parsed.
46+
return +this.line.substring(13, 20) / 100;
4547
}
4648
}

0 commit comments

Comments
 (0)