66 lines
1.8 KiB
TypeScript
66 lines
1.8 KiB
TypeScript
/**
|
|
* Copyright since 2025 Mifos Initiative
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* 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/.
|
|
*/
|
|
|
|
import { Component, Input } from '@angular/core';
|
|
import { FormsModule } from '@angular/forms';
|
|
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
|
|
|
const DEFAULT_FACILITY_CONFIG = {
|
|
atmFacility: false,
|
|
atmWithdrawalFacility: false,
|
|
upiFacility: false,
|
|
posTransactionsFacility: false,
|
|
chequeBook: false,
|
|
impsFacility: false,
|
|
smsAlerts: false,
|
|
bbpsFacility: false,
|
|
insuranceCover: false,
|
|
bepgFacility: false,
|
|
neftFacility: false,
|
|
rtgsFacility: false,
|
|
interBankTotalCapFacility: false,
|
|
withdrawalFacility: false,
|
|
depositFacilityKyc: false,
|
|
virtualDebitCard: false,
|
|
internetBanking: false,
|
|
mobileBanking: false
|
|
};
|
|
|
|
@Component({
|
|
selector: 'mifosx-current-account-digital-step',
|
|
templateUrl: './current-account-digital-step.component.html',
|
|
styleUrls: ['./current-account-digital-step.component.scss'],
|
|
imports: [
|
|
...STANDALONE_SHARED_IMPORTS,
|
|
FormsModule
|
|
]
|
|
})
|
|
export class CurrentAccountDigitalStepComponent {
|
|
facilityConfig = { ...DEFAULT_FACILITY_CONFIG };
|
|
private hasExistingAccount = false;
|
|
|
|
@Input()
|
|
set existingAccount(value: any) {
|
|
if (value?.accountFacilityConfig) {
|
|
this.hasExistingAccount = true;
|
|
this.facilityConfig = { ...DEFAULT_FACILITY_CONFIG, ...value.accountFacilityConfig };
|
|
}
|
|
}
|
|
|
|
@Input()
|
|
set currentAccountProductTemplate(value: any) {
|
|
if (!this.hasExistingAccount && value?.accountFacilityConfig) {
|
|
this.facilityConfig = { ...DEFAULT_FACILITY_CONFIG, ...value.accountFacilityConfig };
|
|
}
|
|
}
|
|
|
|
get currentAccountDigital() {
|
|
return { accountFacilityConfig: { ...this.facilityConfig } };
|
|
}
|
|
}
|