From 0d3d83799b28b7d9cb9fa43fa482ddc844fa54dc Mon Sep 17 00:00:00 2001 From: Nitesh Yadav Date: Tue, 28 Apr 2026 16:22:26 +0530 Subject: [PATCH] save saving ui update and current account update priview section --- .../create-current-account.component.ts | 23 +- .../current-account-details-step.component.ts | 96 ++++--- ...urrent-account-preview-step.component.html | 269 +++++++++++++++++- ...urrent-account-preview-step.component.scss | 93 +++++- ...deposits-account-details-step.component.ts | 35 ++- .../savings-account-details-step.component.ts | 8 +- src/environments/.env.ts | 5 +- 7 files changed, 476 insertions(+), 53 deletions(-) diff --git a/src/app/current-accounts/create-current-account/create-current-account.component.ts b/src/app/current-accounts/create-current-account/create-current-account.component.ts index 1329e5312..4c4c17a11 100644 --- a/src/app/current-accounts/create-current-account/create-current-account.component.ts +++ b/src/app/current-accounts/create-current-account/create-current-account.component.ts @@ -135,20 +135,37 @@ export class CreateCurrentAccountComponent { const locale = this.settingsService.language.code; const dateFormat = this.settingsService.dateFormat; const monthDayFormat = 'dd MMMM'; - const currentAccount = { - ...this.currentAccount, + const details = this.currentAccount; + + const currentAccount: any = { + ...details, ...this.currentAccountCurrencyStep.currencyStepData, + ...(this.currentAccountDigitalStep?.currentAccountDigital ?? {}), charges: [], - submittedOnDate: this.dateUtils.formatDate(this.currentAccount.submittedOnDate, dateFormat), + submittedOnDate: this.dateUtils.formatDate(details.submittedOnDate, dateFormat), dateFormat, monthDayFormat, locale }; + + if (details.establishmentDate) { + currentAccount.establishmentDate = this.dateUtils.formatDate(details.establishmentDate, dateFormat); + } + if (details.startOperationDate) { + currentAccount.startOperationDate = this.dateUtils.formatDate(details.startOperationDate, dateFormat); + } + + // strip UI-only flags not needed by backend + delete currentAccount.isNonIndividualClient; + if (this.currentAccountTemplate.clientId) { currentAccount.clientId = this.currentAccountTemplate.clientId; } else { currentAccount.groupId = this.currentAccountTemplate.groupId; } + + console.log('Current Account Payload:', JSON.stringify(currentAccount, null, 2)); + this.currentAccountsService.createCurrentAccount(currentAccount).subscribe((response: any) => { this.router.navigate( [ diff --git a/src/app/current-accounts/current-account-stepper/current-account-details-step/current-account-details-step.component.ts b/src/app/current-accounts/current-account-stepper/current-account-details-step/current-account-details-step.component.ts index 3cc5083de..cd2f8d1e4 100644 --- a/src/app/current-accounts/current-account-stepper/current-account-details-step/current-account-details-step.component.ts +++ b/src/app/current-accounts/current-account-stepper/current-account-details-step/current-account-details-step.component.ts @@ -117,6 +117,8 @@ export class CurrentAccountDetailsStepComponent implements OnInit { clientCif: string; sharePercentage: number; isMandatory: boolean; + signingAuthority?: string; + role?: string; }> = []; modeOfOperation = ''; @@ -159,7 +161,12 @@ export class CurrentAccountDetailsStepComponent implements OnInit { guardianRelationship = ''; minorDob: Date | null = null; - readonly guardianRelationshipOptions = ['Father', 'Mother', 'Legal Guardian', 'Court Appointed Guardian']; + readonly guardianRelationshipOptions = [ + 'Father', + 'Mother', + 'Legal Guardian', + 'Court Appointed Guardian' + ]; constructor() { this.createCurrentAccountDetailsForm(); @@ -209,8 +216,14 @@ export class CurrentAccountDetailsStepComponent implements OnInit { createCurrentAccountDetailsForm() { this.currentAccountDetailsForm = this.formBuilder.group({ - productId: ['', Validators.required], - submittedOnDate: ['', Validators.required], + productId: [ + '', + Validators.required + ], + submittedOnDate: [ + '', + Validators.required + ], fieldOfficerId: [''], externalId: [''], balanceSwapOption: [false], @@ -357,7 +370,9 @@ export class CurrentAccountDetailsStepComponent implements OnInit { alert(`Account holder with CIF ${result.clientCif} is already added.`); return; } - this.jointHolders = [...this.jointHolders, { ...result, isMandatory: false }]; + this.jointHolders = [ + ...this.jointHolders, + { ...result, isMandatory: false }]; this.autoSetModeOfOperation(); } }); @@ -414,7 +429,9 @@ export class CurrentAccountDetailsStepComponent implements OnInit { alert(`Partner with CIF ${result.clientCif} is already added.`); return; } - this.relatedClients = [...this.relatedClients, { ...result, isMandatory: false }]; + this.relatedClients = [ + ...this.relatedClients, + { ...result, isMandatory: false }]; this.autoSetSignatoryRights(); } }); @@ -457,6 +474,48 @@ export class CurrentAccountDetailsStepComponent implements OnInit { value.introducerName = this.introducerName; value.introducerCif = this.introducerCif; } + value.isNonIndividualClient = this.isNonIndividualClient; + + // accountStatus applies to all client types + value.accountStatus = this.selectedAccountStatus || null; + if (this.selectedAccountStatus === 'INDIVIDUAL_MALE' && this.selectedSpecialCategory) + value.specialCategory = this.selectedSpecialCategory; + if (this.selectedAccountStatus === 'INDIVIDUAL_FEMALE' && this.selectedWeakerSection) + value.weakerSection = this.selectedWeakerSection; + if (this.selectedAccountStatus === 'JOINT') { + value.modeOfOperation = this.modeOfOperation || null; + value.jointHolders = [ + { + clientId: this.primaryClientId, + clientName: this.primaryClientName, + clientCif: this.primaryClientCif, + sharePercentage: this.primaryHolderShare, + isMandatory: true, + isPrimary: true, + signingAuthority: 'Mandatory', + role: 'Primary Account Holder' + }, + ...this.jointHolders.map((h) => ({ + clientId: h.clientId, + clientName: h.clientName, + clientCif: h.clientCif, + sharePercentage: h.sharePercentage, + isMandatory: h.isMandatory, + isPrimary: false, + signingAuthority: h.signingAuthority || (h.isMandatory ? 'Mandatory' : 'Optional'), + role: h.role || 'Co-Holder' + })) + ]; + } + if (this.selectedAccountStatus === 'MINOR') { + value.guardianClientId = this.guardianClientId; + value.guardianName = this.guardianName; + value.guardianCif = this.guardianCif; + value.guardianRelationship = this.guardianRelationship; + value.minorDob = this.minorDob ? this.dateUtils.formatDate(this.minorDob, 'yyyy-MM-dd') : null; + } + + // non-individual: partners are a separate dataset if (this.isNonIndividualClient) { value.signatoryRights = this.signatoryRights || null; value.partners = this.relatedClients.map((c) => ({ @@ -466,33 +525,6 @@ export class CurrentAccountDetailsStepComponent implements OnInit { sharePercentage: c.sharePercentage, isMandatory: c.isMandatory })); - } else { - if (this.selectedAccountStatus) value.accountStatus = this.selectedAccountStatus; - if (this.selectedAccountStatus === 'INDIVIDUAL_MALE' && this.selectedSpecialCategory) - value.specialCategory = this.selectedSpecialCategory; - if (this.selectedAccountStatus === 'INDIVIDUAL_FEMALE' && this.selectedWeakerSection) - value.weakerSection = this.selectedWeakerSection; - if (this.selectedAccountStatus === 'JOINT') { - value.modeOfOperation = this.modeOfOperation || null; - value.jointHolders = [ - { - clientId: this.primaryClientId, - clientName: this.primaryClientName, - clientCif: this.primaryClientCif, - sharePercentage: this.primaryHolderShare, - isMandatory: true, - isPrimary: true - }, - ...this.jointHolders.map((h) => ({ ...h, isPrimary: false })) - ]; - } - if (this.selectedAccountStatus === 'MINOR') { - value.guardianClientId = this.guardianClientId; - value.guardianName = this.guardianName; - value.guardianCif = this.guardianCif; - value.guardianRelationship = this.guardianRelationship; - value.minorDob = this.minorDob ? this.dateUtils.formatDate(this.minorDob, 'yyyy-MM-dd') : null; - } } return value; } diff --git a/src/app/current-accounts/current-account-stepper/current-account-preview-step/current-account-preview-step.component.html b/src/app/current-accounts/current-account-stepper/current-account-preview-step/current-account-preview-step.component.html index 222c0c142..04797de4c 100644 --- a/src/app/current-accounts/current-account-stepper/current-account-preview-step/current-account-preview-step.component.html +++ b/src/app/current-accounts/current-account-stepper/current-account-preview-step/current-account-preview-step.component.html @@ -42,6 +42,18 @@ Unassigned } + @if (currentAccount?.establishmentDate) { +
+ Establishment Date + {{ currentAccount.establishmentDate | dateFormat }} +
+ } + @if (currentAccount?.startOperationDate) { +
+ Start of Operation Date + {{ currentAccount.startOperationDate | dateFormat }} +
+ } @@ -157,7 +169,262 @@ } - + + @if (currentAccount?.accountStatus) { +
+
+ + Status of Account + RBI Guidelines +
+
+ +
+ + @switch (currentAccount.accountStatus) { + @case ('INDIVIDUAL_MALE') { + Individual (Male) + } + @case ('INDIVIDUAL_FEMALE') { + Individual (Female) + } + @case ('SINGLE') { + Single Account + } + @case ('JOINT') { + Joint Account + } + @case ('MINOR') { + Minor Account + } + @case ('SENIOR_CITIZEN') { + Senior Citizen + } + @default { + {{ currentAccount.accountStatus }} + } + } + +
+ + + @if (currentAccount.accountStatus === 'JOINT') { +
+
+ Mode of Operation + + @switch (currentAccount.modeOfOperation) { + @case ('EITHER_OR_SURVIVOR') { + Either or Survivor + } + @case ('FORMER_OR_SURVIVOR') { + Former or Survivor + } + @case ('JOINTLY') { + Jointly + } + @case ('ANYONE_OR_SURVIVOR') { + Anyone or Survivor + } + @default { + {{ currentAccount.modeOfOperation || '—' }} + } + } + +
+
+ @if (currentAccount.jointHolders?.length) { +
+ + + + + + + + + + + + + @for (holder of currentAccount.jointHolders; track holder.clientId; let i = $index) { + + + + + + + + + } + +
Sr.Holder NameCIF No.Ownership %SigningRole
{{ i + 1 }} + {{ holder.clientName || holder.displayName || '—' }} + @if (holder.isPrimary) { + Primary + } + {{ holder.clientCif || holder.cifNumber || '—' }}{{ holder.sharePercentage ?? '—' }}% + + {{ holder.signingAuthority || (holder.isMandatory ? 'Mandatory' : 'Optional') }} + + + {{ holder.role || (holder.isPrimary ? 'Primary Account Holder' : 'Co-Holder') }} +
+
+ } + } + + + @if (currentAccount.accountStatus === 'INDIVIDUAL_MALE' && currentAccount.specialCategory) { +
+
+ Special Category + + @switch (currentAccount.specialCategory) { + @case ('DEFENCE') { + Defence Personnel + } + @case ('EX_SERVICEMAN') { + Ex-Serviceman + } + @case ('GOVT_EMPLOYEE') { + Government Employee + } + @case ('PHYSICALLY_CHALLENGED') { + Physically Challenged + } + @case ('NRI') { + NRI (Non-Resident Indian) + } + @case ('NONE') { + None / General + } + @default { + {{ currentAccount.specialCategory }} + } + } + +
+
+ } + + + @if (currentAccount.accountStatus === 'INDIVIDUAL_FEMALE' && currentAccount.weakerSection) { +
+
+ Weaker Section + + @switch (currentAccount.weakerSection) { + @case ('BPL') { + BPL (Below Poverty Line) + } + @case ('SC_ST') { + SC / ST Category + } + @case ('MINORITY') { + Minority Community + } + @case ('SHG') { + Self Help Group Member + } + @case ('PMJDY') { + PMJDY Beneficiary + } + @case ('NONE') { + None / General + } + @default { + {{ currentAccount.weakerSection }} + } + } + +
+
+ } + + + @if (currentAccount.accountStatus === 'MINOR') { +
+ @if (currentAccount.guardianName) { +
+ Guardian Name + {{ currentAccount.guardianName }} +
+ } + @if (currentAccount.guardianCif) { +
+ Guardian CIF + {{ currentAccount.guardianCif }} +
+ } + @if (currentAccount.guardianRelationship) { +
+ Relationship + {{ currentAccount.guardianRelationship }} +
+ } + @if (currentAccount.minorDob) { +
+ Minor DOB + {{ currentAccount.minorDob | dateFormat }} +
+ } +
+ } +
+
+ } + + + @if (currentAccount?.isNonIndividualClient) { +
+
+ + Partners / Related Clients + @if (currentAccount?.signatoryRights) { + {{ + currentAccount.signatoryRights + }} + } +
+
+ @if (currentAccount?.partners?.length) { +
+ + + + + + + + + + + + @for (p of currentAccount.partners; track p.clientId; let i = $index) { + + + + + + + + } + +
Sr.Partner / Client NameCIF No.Ownership %Signing
{{ i + 1 }}{{ p.clientName || '—' }}{{ p.clientCif || '—' }}{{ p.sharePercentage ?? '—' }}% + + {{ p.isMandatory ? 'Mandatory' : 'Optional' }} + +
+
+ } @else { +

No related clients / partners added.

+ } +
+
+ } + +
diff --git a/src/app/current-accounts/current-account-stepper/current-account-preview-step/current-account-preview-step.component.scss b/src/app/current-accounts/current-account-stepper/current-account-preview-step/current-account-preview-step.component.scss index fcfa95163..b65af385a 100644 --- a/src/app/current-accounts/current-account-stepper/current-account-preview-step/current-account-preview-step.component.scss +++ b/src/app/current-accounts/current-account-stepper/current-account-preview-step/current-account-preview-step.component.scss @@ -112,11 +112,6 @@ font-weight: 500; } -.preview-muted { - color: #94a3b8; - font-style: italic; -} - .preview-mono { font-family: monospace; font-size: 0.88rem; @@ -376,3 +371,91 @@ .margin-t { margin-top: 1em; } + +// ── Status of Account ───────────────────────────────────────────── +.preview-soa-status-row { + display: flex; + align-items: center; + gap: 10px; +} + +.preview-soa-tile { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 8px 20px; + border-radius: 999px; + font-size: 14px; + font-weight: 700; + background: #eff6ff; + color: #1d4ed8; + border: 2px solid #bfdbfe; + + i { + font-size: 16px; + } + + &--entity { + background: #fef3c7; + color: #92400e; + border-color: #fde68a; + } +} + +.preview-soa-table-wrap { + margin-top: 14px; + overflow-x: auto; + border-radius: 8px; + border: 1px solid #e2e8f0; +} + +.preview-soa-tbl { + width: 100%; + border-collapse: collapse; + font-size: 13px; +} + +.preview-soa-th { + background: #f8fafc; + padding: 8px 12px; + text-align: left; + font-weight: 600; + color: #475569; + border-bottom: 1px solid #e2e8f0; + white-space: nowrap; +} + +.preview-soa-td { + padding: 10px 12px; + border-bottom: 1px solid #f1f5f9; + color: #0f172a; + vertical-align: middle; +} + +.preview-soa-tr--primary { + background: #f0f9ff; + + .preview-soa-td { + font-weight: 600; + } +} + +.preview-soa-primary-tag { + display: inline-block; + margin-left: 6px; + padding: 1px 8px; + border-radius: 999px; + font-size: 10px; + font-weight: 700; + background: #dbeafe; + color: #1d4ed8; + border: 1px solid #bfdbfe; + vertical-align: middle; +} + +.preview-muted { + color: #94a3b8; + font-size: 13px; + font-style: italic; + margin: 0; +} diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.ts index 5f8e0063b..1bf189d93 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.ts @@ -105,6 +105,8 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit { clientCif: string; sharePercentage: number; isMandatory: boolean; + signingAuthority?: string; + role?: string; }> = []; modeOfOperation = ''; @@ -147,7 +149,12 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit { guardianRelationship = ''; minorDob: Date | null = null; - readonly guardianRelationshipOptions = ['Father', 'Mother', 'Legal Guardian', 'Court Appointed Guardian']; + readonly guardianRelationshipOptions = [ + 'Father', + 'Mother', + 'Legal Guardian', + 'Court Appointed Guardian' + ]; // ── Deposit Account Link ─────────────────────────────────────────────── dalSelectedType: 'SAVINGS' | 'CURRENT' | null = null; @@ -212,7 +219,9 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit { this.dalLoading = false; this.cdr.detectChanges(); }, - error: () => { this.dalLoading = false; } + error: () => { + this.dalLoading = false; + } }); } @@ -319,8 +328,14 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit { */ createRecurringDepositsAccountDetailsForm() { this.recurringDepositAccountDetailsForm = this.formBuilder.group({ - productId: ['', Validators.required], - submittedOnDate: ['', Validators.required], + productId: [ + '', + Validators.required + ], + submittedOnDate: [ + '', + Validators.required + ], fieldOfficerId: [''], externalId: [''], balanceSwapOption: [false], @@ -424,7 +439,9 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit { alert(`Account holder with CIF ${result.clientCif} is already added.`); return; } - this.jointHolders = [...this.jointHolders, { ...result, isMandatory: false }]; + this.jointHolders = [ + ...this.jointHolders, + { ...result, isMandatory: false }]; this.autoSetModeOfOperation(); } }); @@ -490,7 +507,9 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit { clientCif: this.primaryClientCif, sharePercentage: this.primaryHolderShare, isMandatory: true, - isPrimary: true + isPrimary: true, + signingAuthority: 'Mandatory', + role: 'Primary Account Holder' }, ...this.jointHolders.map((h) => ({ clientId: h.clientId, @@ -498,7 +517,9 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit { clientCif: h.clientCif, sharePercentage: h.sharePercentage, isMandatory: h.isMandatory, - isPrimary: false + isPrimary: false, + signingAuthority: h.signingAuthority || (h.isMandatory ? 'Mandatory' : 'Optional'), + role: h.role || 'Co-Holder' })) ]; } diff --git a/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts b/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts index d9d9558a3..28fb63a38 100644 --- a/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts +++ b/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts @@ -416,7 +416,9 @@ export class SavingsAccountDetailsStepComponent implements OnInit { cifNumber: this.primaryClientCif, sharePercentage: this.primaryHolderShare, isMandatory: true, - isPrimary: true + isPrimary: true, + signingAuthority: 'Mandatory', + role: 'Primary Account Holder' }, ...this.jointHolders.map((h) => ({ clientId: h.clientId, @@ -425,8 +427,8 @@ export class SavingsAccountDetailsStepComponent implements OnInit { sharePercentage: h.sharePercentage, isPrimary: false, isMandatory: h.isMandatory, - signingAuthority: h.signingAuthority || null, - role: h.role || null + signingAuthority: h.signingAuthority || (h.isMandatory ? 'Mandatory' : 'Optional'), + role: h.role || 'Co-Holder' })) ]; } diff --git a/src/environments/.env.ts b/src/environments/.env.ts index 6dc70b65f..e826c099c 100644 --- a/src/environments/.env.ts +++ b/src/environments/.env.ts @@ -5,12 +5,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! /* tslint:disable */ export default { 'mifos_x': { - 'version': '260427', - 'hash': '65345f99' + 'version': '260428', + 'hash': '31b2490f' }, 'allow_switching_backend_instance': true };