/** * 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 }; } } // Note: a new account always starts with every digital facility off, even if the product has // its own defaults configured -- those are enabled deliberately, one at a time, after the // account is created and active, not inherited automatically at opening. @Input() currentAccountProductTemplate: any; get currentAccountDigital() { return { accountFacilityConfig: { ...this.facilityConfig } }; } }