import { AccountNumberCheck } from "./SubSystem/AccountNumberChecker" ; import { DummyBank } from "./SubSystem/DummyBank" ; import { FundsCheck } from "./SubSystem/FundsChecker" ; import { SecurityCodeCheck } from "./SubSystem/SecurityCodeChecker" ; export class BankAccountFacade { private accountNumber : number ; private securityCode : number ; acctChecker : AccountNumberCheck ; codeChecker : SecurityCodeCheck ; fundChecker : FundsCheck ; bankWelcome : DummyBank ; constructor ( newAcctNum , newSecCode ) { this . accountNumber = newAcctNum ; this . securityCode = newSecCode ; this . bankWelcome = new DummyBank ( ) ; this . acctChecker = new AccountNumberCheck ( ) ; this . codeChecker = new SecurityCodeCheck ( ) ; this . fundChecker = new FundsCheck ( ) ; } public getAccountNumber ( ) { return this . accountNumber ; } public getSecurityCode ( ) { return this . securityCode ; } public withdrawCash ( cashToGet ) { if ( this . acctChecker . accountActive ( this . getAccountNumber ( ) ) && this . codeChecker . isCodeCorrect ( this . getSecurityCode ( ) ) && this . fundChecker . haveEnoughMoney ( cashToGet ) ) { console . log ( "Transaction Complete\n" ) ; } else { console . log ( "Transaction Failed\n" ) ; } } public depositCash ( cashToDeposit ) { if ( this . acctChecker . accountActive ( this . getAccountNumber ( ) ) && this . codeChecker . isCodeCorrect ( this . getSecurityCode ( ) ) ) { this . fundChecker . makeDeposit ( cashToDeposit ) ; console . log ( "Transaction Complete\n" ) ; } else { console . log ( "Transaction Failed\n" ) ; } } }