fix(clients): stale signature bug, monthly turnover/annual income fields, senior citizen/PWD classification

- Fix signature-document reads picking the oldest upload instead of the latest across 7 call
  sites (CKYC tab, view/delete-signature dialogs, edit-wizard preview, cashier transaction entry,
  signatory service, record-master) by sorting on document id instead of an unsorted find().
- Add Monthly Turnover and Annual Income fields alongside the renamed Yearly Turnover field.
- Add Senior Citizen (auto-detected from DOB) and Person with Disability classification, with a
  required disability-certificate upload gate before client creation can proceed.
- Add Graduate and Diploma as distinct Education Levels, with diploma-specific degree options.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-28 10:49:28 +05:30
co-authored by Claude Sonnet 5
parent a9c60083bf
commit cb4260b7a3
11 changed files with 367 additions and 16 deletions
@@ -331,6 +331,18 @@ export class CreateClientComponent {
return;
}
// PWD gate — disability type + certificate are mandatory when PWD is checked
// (Senior Citizen proof upload is optional, not gated here)
if (!this.clientGeneralStep?.seniorPwdDocsComplete) {
this.clientGeneralStep?.markSeniorPwdDocsTouched();
this.snackBar.open(
'Select the disability type and upload the Disability Certificate before continuing.',
'Close',
{ duration: 5000 }
);
return;
}
// Sanctions verification gate — Verify Client must be clicked before save
if (!this.clientGeneralStep?.sanctionsVerified) {
this.dialog
@@ -469,6 +481,29 @@ export class CreateClientComponent {
clearInterval(progressInterval);
this.saveProgress = 100;
this.createdClientId = response.resourceId;
// Senior Citizen / PWD supporting documents — uploaded after creation, same pattern as
// the KYC step's photo/signature uploads (the generic /clients/{id}/documents endpoint
// needs a real clientId, which only exists once createClient() has returned).
if (this.clientGeneralStep?.seniorCitizenProofFile) {
const seniorCitizenProofForm = new FormData();
seniorCitizenProofForm.append('file', this.clientGeneralStep.seniorCitizenProofFile);
seniorCitizenProofForm.append('name', 'seniorCitizenProof');
seniorCitizenProofForm.append('description', 'Senior Citizen Proof (Age/ID Proof)');
this.clientsService
.uploadClientDocument(this.createdClientId, seniorCitizenProofForm)
.subscribe({ error: () => {} });
}
if (this.clientGeneralStep?.pwdCertificateFile) {
const pwdCertificateForm = new FormData();
pwdCertificateForm.append('file', this.clientGeneralStep.pwdCertificateFile);
pwdCertificateForm.append('name', 'pwdCertificate');
pwdCertificateForm.append('description', 'Disability Certificate');
this.clientsService
.uploadClientDocument(this.createdClientId, pwdCertificateForm)
.subscribe({ error: () => {} });
}
// Brief delay to show 100% before transitioning
setTimeout(() => {
this.savingClient = false;