feat: add nominee, auto-debit, charges UI for SB/CA/FD/RD accounts; enforce required fields

- SB/CA/FD/RD Currency Step: add Nomination Facility toggle with multi-nominee form
  (NomineeFormComponent), auto-debit facility toggle, dormancy alert panel
- SB/CA/FD/RD Preview Step: display nominees list, auto-debit status, dormancy info
- FD/RD create component: validate Deposit Tenure, Monthly Installment (RD), and
  Customer Segment are filled before submit; show clear alert messages on missing fields
- FD account details step: remove duplicate Currency section (already shown in
  Currency & Account Status Configuration step)
- CA/SB create component: handle duplicate externalId API error with user-friendly alert
  instead of raw error display

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Nitesh Yadav
2026-05-20 08:08:08 +05:30
co-authored by Claude Sonnet 4.6
parent 37ac15f42c
commit 3df7d100df
29 changed files with 1658 additions and 443 deletions
@@ -98,7 +98,7 @@
[currentAccountTermsForm]="currentAccountTermsForm"
[currentAccount]="currentAccount"
[currentAccountDigital]="currentAccountDigital"
[currentAccountNominee]="currentAccountNominee"
[currentAccountNominees]="currentAccountCurrencyStep?.nominees ?? []"
[currentAccountCurrencyFlags]="currentAccountCurrencyFlags"
(submitEvent)="submit()"
>
@@ -118,10 +118,6 @@ export class CreateCurrentAccountComponent {
return this.currentAccountDigitalStep?.currentAccountDigital ?? null;
}
get currentAccountNominee() {
return this.currentAccountCurrencyStep?.liveNomineeData ?? null;
}
get currentAccountCurrencyFlags() {
return {
balanceSwapOption: this.currentAccountCurrencyStep?.balanceSwapOption ?? false,
@@ -142,6 +138,23 @@ export class CreateCurrentAccountComponent {
});
return;
}
if (
this.currentAccountProductTemplate?.nominationFacility &&
(this.currentAccountCurrencyStep?.nominees ?? []).length === 0
) {
this.alertService.alert({
type: 'Error',
message: 'Nomination Facility is enabled for this product. Please add at least one nominee before submitting.'
});
return;
}
if (this.currentAccountProductTemplate?.introducerRequired && !this.currentAccountDetailsStep.introducerId) {
this.alertService.alert({
type: 'Error',
message: 'Introducer is required for this product. Please select an introducer before submitting.'
});
return;
}
const locale = this.settingsService.language.code;
const dateFormat = this.settingsService.dateFormat;
const monthDayFormat = 'dd MMMM';
@@ -185,27 +198,45 @@ export class CreateCurrentAccountComponent {
currentAccount.groupId = this.currentAccountTemplate.groupId;
}
const nominee = this.currentAccountNominee;
if (nominee) {
currentAccount.nominee = {
nomineeClientId: nominee.nomineeClientId,
nominationType: nominee.nominationType,
relationshipId: nominee.relationshipId,
percentageShare: nominee.percentageShare,
nomineeIsMinor: nominee.nomineeIsMinor,
...(nominee.guardianClientId ? { guardianClientId: nominee.guardianClientId } : {}),
remarks: nominee.remarks
};
const nominees = this.currentAccountCurrencyStep?.nominees ?? [];
if (nominees.length > 0) {
currentAccount.nominees = nominees.map((n: any) => ({
nomineeClientId: n.nomineeClientId,
nominationType: n.nominationType,
relationshipId: n.relationshipId,
percentageShare: n.percentageShare,
nomineeIsMinor: n.nomineeIsMinor,
...(n.guardianClientId ? { guardianClientId: n.guardianClientId } : {}),
remarks: n.remarks
}));
}
this.currentAccountsService.createCurrentAccount(currentAccount).subscribe((response: any) => {
this.router.navigate(
[
'../',
response.resourceId
],
{ relativeTo: this.route }
);
this.currentAccountsService.createCurrentAccount(currentAccount).subscribe({
next: (response: any) => {
this.router.navigate(
[
'../',
response.resourceId
],
{ relativeTo: this.route }
);
},
error: (error: any) => {
const errorCode =
error?.error?.errors?.[0]?.userMessageGlobalisationCode ?? error?.error?.userMessageGlobalisationCode;
if (errorCode === 'error.msg.savings.account.duplicate.product.for.client') {
this.alertService.alert({
type: 'Error',
message:
'This client already has an active Current account with the selected product. Please choose a different product.'
});
} else if (errorCode === 'error.msg.savings.account.duplicate.externalid') {
this.alertService.alert({
type: 'Error',
message: 'An account with this External ID already exists. Please use a unique External ID.'
});
}
}
});
}
}