bankdeposit-scene-reverseCash.spp
bankdeposit/reversal/bankdeposit-scene-reverseCash.spp
Download original file · Bank deposit source contents
1domain bankdeposit;23Scenario serial reverseCash(4DepositAccount,5CashSettlementAccount,6InterestIncomeAccount,7CollectionInterestIncomeAccount,8PrincipalRecoveryAccount,9AccountEligibility,10CashAccountControl,11CashDepositAgreement,12CashReversalAgreement,13DepositReversalCapacity,14DepositAccrualState,15CashReversalMetadataPlan,16DepositOperatorFacts,17CashChannel,18CashFailureRecord,19DepositPostingLine[],20CashReversalPostingLine[],21DepositPostingTotals22) {23parallel {24findDepositAccount;25findCashSettlementAccount;26findInterestIncomeAccount;27findCollectionInterestIncomeAccount;28findPrincipalRecoveryAccount;29findAccountEligibility;30findCashDepositAgreement;31findDepositAccrualState;32}33identify(depositAccount);34identify(cashSettlementAccount);35identify(interestIncomeAccount);36identify(collectionInterestIncomeAccount);37identify(principalRecoveryAccount);38identify(accountEligibility);39identify(cashDepositAgreement);40identify(depositAccrualState);41checkAccountParticipants;42checkOriginalDepositAccount;43checkOriginalSettlementAccounts;44checkBankDepositCashReversalPath;45checkCoreDepositReversalEligibility;46checkOriginalCashMovement;47listDepositPostings;48checkOriginalDepositPostings;49checkCashReversalCapacity;50checkCashReversalFacts;51calculateBankDepositCashReversalMetadata;52prepareCashReversalAgreement;53prepareCashReversalPostings;54checkDepositPostings;55transaction {56reverseCashDeposit bounds {57cashSettlementAccount.balance: [null, null];58depositAccount.interestBase: [0, null];59depositAccount.overdraftInterest: [null, 0];60depositAccount.collectionInterest: [null, 0];61depositAccount.overdraftPrincipal: [null, 0];62};63deriveOverdraftExposure;64completeCashReversal;65updateDepositAccrualState;66updateAccountEligibility;67updateCashDepositAgreement;68insertCashReversalAgreement;69attachCashReversalPostings;70insertCashReversalPostingLine;71} fail(cashReversalAgreement) {72recordReversalFailure;73if (ResultInfo.failure.recoveryStatus == "ROLLED_BACK"74|| ResultInfo.failure.recoveryStatus == "REVERSED") {75confirmNoCashMovement;76}77transaction {78insertCashFailureRecord;79}80}81}