Repository navigation
Red flags: auto-clear returned/missed payments made good later - #12
Merged
Merged
Conversation
A returned or missed debt payment is downgraded from a red flag to a "made good" state when the debt caught back up: a returned payment re-made the same month (the month nets positive again), or a later/extra payment in another month. Extra payments beyond the one a month owed form a pool that clears the oldest outstanding deficits first; payment amount is never compared, matching the rest of the audit. Made-good flags carry severity "cleared" and drop out of the red count (so the warning banner clears) while staying visible under a "Made good" section for the audit trail. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Red-flag debt-payment alerts (returned payments, missed months) now auto-clear once the debt is caught back up — a returned payment re-made the same month, or later/extra payments that make an earlier arrears good. Resolved flags are downgraded from
redto a newclearedstate: they drop out of the red count and banner but stay visible under a Made good section for the audit trail.How make-goods are reconciled
Reconciliation is on cumulative dollars, not posting counts. Over the audited (past-grace) months a debt owes one
expected_amountpayment per month; if the net dollars actually received (returns netted out) meet or beat that total, the debt has caught up, so the oldest arrears clear first and only a genuine remaining shortfall (in whole payments, ceil) stays red.expected_amount_cents, missed months are left flagged rather than risk hiding an unpaid month (conservative). Returned-same-month clearing (month net goes back positive) still applies since it's unambiguous.Verification
cleared, red count 0.Reviewer notes
Reconciliation logic reviewed by two independent model-family reviewers to zero blocking findings. An early event-count design that could let a missed month fund its own clearing (and let split postings inflate a make-good credit) was replaced by the dollars-based model above.