feat: KYC re-verify UX, family/nominee tab gating, savings dialogs, cfcfrms shell
- KYC tab: fix Verify (PAN) and Send OTP (Aadhaar) being disabled in edit mode; unmask Aadhaar input and show on-file masked value as hint; resolve kycId from id/kycId/resourceId fallbacks. - Client stepper/view: add familyAllowed / nomineeAllowed predicates + CanActivate route guards. Family tab hidden for non-individuals, Nominee tab hidden for non-proprietor entities. Family-members step accepts a nomineeOnly input for proprietorship clients. Add/Edit/Delete buttons inside family-members and nominee tabs gated by canAdd. - cfcfrms: add cfcfrms-shell wrapper, restyle complaint/fraud/mule/escalate pages and dashboard. - Savings: identity-verify and transaction-confirm dialogs, manage / activate / add-charge flows, account preview styling. - Tasks, core shell, account-nominees, icons: minor style and behaviour updates. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
bf3e26a0d0
commit
b149fef72e
-7
@@ -57,13 +57,6 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
}
|
||||
|
||||
@if (savingsProductSelected) {
|
||||
<mat-form-field appearance="outline" class="sad-field">
|
||||
<mat-label>{{ 'labels.inputs.External ID' | translate }}</mat-label>
|
||||
<input matInput formControlName="externalId" />
|
||||
</mat-form-field>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
+47
-4
@@ -82,6 +82,10 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
|
||||
primaryClientCif = '';
|
||||
primaryClientId: number | null = null;
|
||||
primaryHolderShare = 0;
|
||||
/** Best-effort string label of the client's entity type
|
||||
* (e.g. "Individual", "Corporate", "MSME") — used to auto-fill the
|
||||
* Customer Segment dropdown when the product template lands. */
|
||||
private clientEntityType: string | null = null;
|
||||
|
||||
// ── Status of Account (RBI) ────────────────────────────────────────────
|
||||
readonly accountStatusOptions = [
|
||||
@@ -167,8 +171,7 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
|
||||
productId: this.savingsAccountTemplate.savingsProductId,
|
||||
submittedOnDate:
|
||||
this.savingsAccountTemplate.timeline.submittedOnDate &&
|
||||
new Date(this.savingsAccountTemplate.timeline.submittedOnDate),
|
||||
externalId: this.savingsAccountTemplate.externalId
|
||||
new Date(this.savingsAccountTemplate.timeline.submittedOnDate)
|
||||
});
|
||||
} else {
|
||||
this.savingsAccountDetailsForm.patchValue({
|
||||
@@ -193,11 +196,49 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
|
||||
this.autoDetectAccountStatus();
|
||||
}
|
||||
}
|
||||
this.clientEntityType = this.deriveEntityType(client);
|
||||
// Product template may have already arrived before the client did —
|
||||
// try the segment-apply both here and when the template lands.
|
||||
this.applyInferredCustomerSegment();
|
||||
this.cdr.detectChanges();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a best-effort label for the client's entity / customer type.
|
||||
* Tries `clientType` first (the explicit master), then falls back to
|
||||
* `clientClassification` and finally `legalForm`.
|
||||
*/
|
||||
private deriveEntityType(client: any): string | null {
|
||||
if (!client) return null;
|
||||
const direct =
|
||||
client.clientType?.value ??
|
||||
client.clientType?.name ??
|
||||
client.clientClassification?.value ??
|
||||
client.clientClassification?.name;
|
||||
if (direct && typeof direct === 'string') return direct;
|
||||
const legalForm = client.legalForm?.value ?? client.legalForm?.code ?? client.legalForm?.name;
|
||||
return typeof legalForm === 'string' ? legalForm : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* If `clientEntityType` and `customerSegmentOptions` are both ready, try
|
||||
* to match an option (exact then case-insensitive substring) and set it
|
||||
* as the selected Customer Segment. Falls through silently otherwise so
|
||||
* the existing product default stays in place.
|
||||
*/
|
||||
private applyInferredCustomerSegment(): void {
|
||||
if (!this.clientEntityType || !this.customerSegmentOptions?.length) return;
|
||||
const needle = this.clientEntityType.trim().toLowerCase();
|
||||
const match =
|
||||
this.customerSegmentOptions.find((o) => o.toLowerCase() === needle) ||
|
||||
this.customerSegmentOptions.find((o) => o.toLowerCase().includes(needle) || needle.includes(o.toLowerCase()));
|
||||
if (match) {
|
||||
this.selectedCustomerSegment = match;
|
||||
}
|
||||
}
|
||||
|
||||
/** Parse DOB from backend — handles array [yyyy, mm, dd] or string */
|
||||
private parseClientDob(dob: any): Date | null {
|
||||
if (!dob) return null;
|
||||
@@ -263,8 +304,7 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
fieldOfficerId: [''],
|
||||
externalId: ['']
|
||||
fieldOfficerId: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -279,6 +319,9 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
|
||||
this.customerSegmentOptions = this.extractOptions(response.customerSegmentOptions, response.customerSegment);
|
||||
this.selectedAccountType = response.accountType ?? null;
|
||||
this.selectedCustomerSegment = response.customerSegment ?? null;
|
||||
// Override the product's default segment with the one inferred
|
||||
// from the client's entity type when an option matches.
|
||||
this.applyInferredCustomerSegment();
|
||||
this.savingsAccountProductTemplate.emit(response);
|
||||
this.fieldOfficerData = response.fieldOfficerOptions;
|
||||
this.savingsProductSelected = true;
|
||||
|
||||
Reference in New Issue
Block a user