save saving ui update and current account update priview section

This commit is contained in:
Nitesh Yadav
2026-04-28 16:22:26 +05:30
parent 31b2490f09
commit 0d3d83799b
7 changed files with 476 additions and 53 deletions
@@ -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(
[