feat: BL-36/BL-37 – Update & Delete Contact API for DQ Stewards - #427
Merged
Conversation
…update-delete-api take pull from origin dev
Extend ICM sync to status effective date changes, remove unused AdminService wiring, align DIN docs with format-only validation, use FDD protected-status message, and assert WKL/batch delete order in tests.
Replace ON DELETE CASCADE on contact_audit_trail with RESTRICT (V28) and delete audit rows explicitly in the DQ hard-delete transaction before removing the contact.
…lete Extract ordered deleteAllContactDependencies with multi-case legal authority cleanup, MIS staging before case removal, documented table lists, and a pre-delete FK guard for batch, audit, and WKL rows.
CSAGuard on ContactsController requires AdminService; removing AdminModule broke SyncModule and CraModule integration tests.
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.
Delete empty 'use strict' barrel file; all imports use user-profile.constants directly.
Reject unknown csaStatus values in UpdateContactDto and updateContact using canonical CSA_STATUS codes (BL-36).
Resolve conflicts in contacts controller and service, keeping DQ update/delete imports (UserProfileDecorator, USER_PROFILE).
mdiapenabc
approved these changes
Aug 7, 2026
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
Implements the
updateContact(BL-36) anddeleteContact(BL-37) service methods for Data Quality Stewards to manually correct and permanently remove CSA child records containing erroneous data. Both operations are restricted to theDATA_QUALITY_STEWARDrole and cross-validated against ICM to prevent privilege escalation.Changes
updateContact(BL-36)DATA_QUALITY_STEWARDrole onlycsaStatusEffectiveDatevalues set in the futuredinorcsaStatuschanges; sync failures are logged but do not fail the updatedeleteContact(BL-37)audit_trail,contact_batch_details, andwkl_file_recordsShared
validateDQAuthorizationprivate helper reused by both methodsPROTECTED_CSA_STATUSESconstant (BL-35) enforced on both operationsHow This Was Tested
Unit tests added in
contacts.service.spec.tscovering:updateContact,deleteContactupdateContact,deleteContactupdateContact,deleteContactupdateContactupdateContactupdateContactupdateContactupdateContactupdateContactupdateContactdeleteContactdeleteContactRun tests locally:
npm run test -- contacts.service.spec.ts