S++Business systems language
DEMO SOURCE · SPP / APP / PHYRead the book

cboddeposit-scene-reverseCash.spp

cboddeposit/reversal/cboddeposit-scene-reverseCash.spp

Download original file · Bank deposit source contents

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