Skip to content
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

#3922 - PT Monthly Loan Balance - Update Balance #3928

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe(
expect(studentLoanBalance).toEqual([
{
balanceDate: "2023-12-31",
cslBalance: 148154,
cslBalance: 1481.54,
},
]);
});
Expand Down Expand Up @@ -330,7 +330,7 @@ describe(
},
{
balanceDate: currentBalanceDate,
cslBalance: 148154,
cslBalance: 1481.54,
},
]);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ export class StudentLoanBalancesFileResponse {
return getDateOnlyFromFormat(this.line.substring(91, 99), DATE_FORMAT);
}
/**
* Date of birth of the student to match and update the student loan balance.
* CSL balance. Expected 7 characters where the last 2 positions should be considered decimals.
*/
get cslBalance(): number {
return +this.line.substring(13, 20);
// Divide by 100 to convert to 2 decimal places.
// TODO: centralize in a util to have decimals parsed.
return +this.line.substring(13, 20) / 100;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please add a TODO here to centralize this parse decimal logic ?. (It is already in sfas utils. we could move it to common place when refactoring).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw it on SFAS but did not felt worth enough to have a util method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added TODO to move on.

}
}
Loading