update loan product code and rd,fd,saving,current account validation add

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Nitesh Yadav
2026-05-14 07:40:04 +05:30
co-authored by Claude Sonnet 4.6
parent ed45c8637e
commit d0370781e8
30 changed files with 1286 additions and 213 deletions
@@ -19,6 +19,7 @@ import { CurrentAccountDigitalStepComponent } from '../current-account-stepper/c
import { CurrentAccountsService } from '../current-accounts.service';
import { SettingsService } from 'app/settings/settings.service';
import { Dates } from 'app/core/utils/dates';
import { AlertService } from 'app/core/alert/alert.service';
import {
MatStepper,
MatStepperIcon,
@@ -60,6 +61,7 @@ export class CreateCurrentAccountComponent {
private dateUtils = inject(Dates);
private currentAccountsService = inject(CurrentAccountsService);
private settingsService = inject(SettingsService);
private alertService = inject(AlertService);
/** Current Account Template */
currentAccountTemplate: any;
@@ -132,6 +134,14 @@ export class CreateCurrentAccountComponent {
* Creates a new current account.
*/
submit() {
const detailsStep = this.currentAccountDetailsStep;
if (detailsStep.selectedAccountStatus === 'JOINT' && detailsStep.totalJointSharePercentage !== 100) {
this.alertService.alert({
type: 'Error',
message: `Total ownership is ${detailsStep.totalJointSharePercentage}%. It must equal 100% before submitting.`
});
return;
}
const locale = this.settingsService.language.code;
const dateFormat = this.settingsService.dateFormat;
const monthDayFormat = 'dd MMMM';
@@ -155,8 +165,19 @@ export class CreateCurrentAccountComponent {
currentAccount.startOperationDate = this.dateUtils.formatDate(details.startOperationDate, dateFormat);
}
// strip UI-only flags not needed by backend
delete currentAccount.isNonIndividualClient;
// Explicitly re-set partners from the details step to ensure all are included
if (this.currentAccountDetailsStep.isNonIndividualClient) {
currentAccount.isNonIndividualClient = true;
currentAccount.partners = this.currentAccountDetailsStep.relatedClients.map((c: any) => ({
clientId: c.clientId,
clientName: c.clientName,
clientCif: c.clientCif,
sharePercentage: c.sharePercentage,
isMandatory: c.isMandatory
}));
} else {
delete currentAccount.isNonIndividualClient;
}
if (this.currentAccountTemplate.clientId) {
currentAccount.clientId = this.currentAccountTemplate.clientId;