Fix KYC update on verified records and client address duplication

- Allow KYC updates on VERIFIED records with mandatory remarks for audit trail;
  reset PAN verification when PAN number changes, moving status to IN_PROGRESS
- Fix client address duplicates: deactivate old addresses of same type on
  create/update, persist isActive flag (missing save), filter reads by is_active

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Aditya
2026-04-07 15:00:37 +05:30
co-authored by Claude Opus 4.6
parent 87e132f93d
commit 011239f399
6 changed files with 64 additions and 8 deletions
@@ -414,6 +414,19 @@ public class ClientKyc extends AbstractAuditableWithUTCDateTimeCustom<Long> {
this.kycStatus = ClientKycStatus.IN_PROGRESS.getValue();
}
/** Resets PAN verification flags so that re-verification is required (e.g. after DOB or PAN edit). */
public void resetPanVerification() {
this.panVerified = false;
this.panVerifiedOn = null;
this.panFullName = null;
this.panFirstName = null;
this.panLastName = null;
this.panCategory = null;
this.panStatus = null;
this.verifiedOn = null;
this.expiryDate = null;
}
/** Called after successful 3rd-party verification of all required documents. */
public void markVerified(final String ckycNumber) {
this.kycStatus = ClientKycStatus.VERIFIED.getValue();