fix: correct needs_review flag lifecycle for hold and eligibility - #435
Merged
Conversation
mdiapenabc
marked this pull request as draft
August 5, 2026 20:41
mdiapenabc
force-pushed
the
fix/needs-review-flag-lifecycle
branch
from
August 5, 2026 21:18
4c90598 to
75a369a
Compare
mdiapenabc
marked this pull request as ready for review
August 5, 2026 21:19
mdiapenabc
marked this pull request as draft
August 5, 2026 21:30
Centralize review flag clearing in updateCsaStatus for all transitions off on_hold (resume, set not eligible) and in forceUpdateCsaStatus for WKL/CRA bypass paths. Removes the duplicate clear on resumeContacts.
mdiapenabc
force-pushed
the
fix/needs-review-flag-lifecycle
branch
from
August 5, 2026 21:38
75a369a to
6875bef
Compare
mdiapenabc
marked this pull request as ready for review
August 6, 2026 14:03
plakkara-bc
approved these changes
Aug 6, 2026
mdiapenabc
added a commit
that referenced
this pull request
Aug 7, 2026
Re-sync contacts.service with dev after merge regressions: clear needsReview when leaving on_hold in updateCsaStatus and forceUpdateCsaStatus, remove duplicate clear from resumeContacts, and restore the corresponding unit tests.
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.
Description
needs_reviewis only set during eligibility upsert while a contact is On Hold. On dev, it was cleared on Resume only. Contacts that left hold via Set Not Eligible orforceUpdateCsaStatuskept a stale review flag, so many flagged records can show Needs Review even though they are no longer On Hold.Possible cause: Review was only cleared on Resume, not Set Not Eligible or force update off hold.
Fix: Clear review when leaving On Hold (Resume, Set Not Eligible, force update). No change to eligibility upsert or when review is set.
What changed
needsReviewinupdateCsaStatuswhen transitioning offon_hold(covers Resume and Set Not Eligible in one update)needsReviewinforceUpdateCsaStatuswhen leavingon_hold(WKL/CRA bypass)resumeContacts(same behaviour, single DB write)How to test
needs_reviewis set, then Resume, review flag cleared, status updatednot_eligible_out_of_paynpm test -- --run src/api/contacts/contacts.service.spec.tsinbackend/