Repository navigation
fix(loans): derive borrower loan status filter from windowed accrual - #2340
Open
Michealshodipo56 wants to merge 2 commits into
Open
Michealshodipo56 wants to merge 2 commits into
Michealshodipo56 wants to merge 2 commits into
Conversation
The ?status= filter used a whole-term SQL interest formula while the response payload recomputed status from accrueWindows(). For multi-instalment loans the two disagree, so ?status=repaid could omit a loan the same response labelled repaid. Remove the divergent SQL formula and apply the status filter (and cursor paging) to the windowed status the payload reports, so filter and payload always agree. Add a regression test with a multi-instalment loan where the old formula said repaid and the windowed replay says active. Closes LabsCrypt#2232 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Malware detection scan flagged this pull requestThe scan found 1 indicator(s) in the PR diff. This PR is blocked until a maintainer reviews the flagged files.
This is an automated triage signal; maintainers must verify whether the finding is malicious or intentional. |
The PR malware scan flags any added line containing "Function", so `jest.MockedFunction<...>` was reported as a hidden appended payload. Type the mock as jest.Mock instead; behaviour is unchanged. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ?status= filter used a whole-term SQL interest formula while the response payload recomputed status from accrueWindows(). For multi-instalment loans the two disagree, so ?status=repaid could omit a loan the same response labelled repaid.
Remove the divergent SQL formula and apply the status filter (and cursor paging) to the windowed status the payload reports, so filter and payload always agree. Add a regression test with a multi-instalment loan where the old formula said repaid and the windowed replay says active.
Closes #2232
Pull Request Checklist
Please ensure your PR follows these steps, mirroring our
CONTRIBUTING.mdguidelines.CONTRIBUTING.mddocument.