bankdeposit-scene-bookOverdraftClaims.spp
bankdeposit/accrual/bankdeposit-scene-bookOverdraftClaims.spp
Download original file · Bank deposit source contents
1domain bankdeposit;23Contract OverdraftCharge {4BigDecimal(19, 2) interest;5BigDecimal(19, 2) collection;6BigDecimal(19, 2) principal;7}89atomic check checkOverdraftCharge(OverdraftCharge) {10require(11overdraftCharge.interest >= 0 && overdraftCharge.collection >= 0 && overdraftCharge.principal >= 0,12RejectionCode.E115513);14}1516quantum update originateClaims(17OverdraftCharge,18DepositAccount,19InterestIncomeAccount,20CollectionInterestIncomeAccount,21CashSettlementAccount22) {23depositAccount.overdraftInterest -> interestIncomeAccount.balance : overdraftCharge.interest;24depositAccount.collectionInterest -> collectionInterestIncomeAccount.balance : overdraftCharge.collection;25depositAccount.overdraftPrincipal -> cashSettlementAccount.balance : overdraftCharge.principal;26}2728Scenario serial bookOverdraftClaims(29OverdraftCharge,30DepositAccount,31InterestIncomeAccount,32CollectionInterestIncomeAccount,33CashSettlementAccount34) {35parallel {36findDepositAccount;37findInterestIncomeAccount;38findCollectionInterestIncomeAccount;39findCashSettlementAccount;40}41identify(depositAccount);42identify(interestIncomeAccount);43identify(collectionInterestIncomeAccount);44identify(cashSettlementAccount);45checkOverdraftCharge;46transaction {47originateClaims bounds {48depositAccount.overdraftInterest: [null, 0];49depositAccount.collectionInterest: [null, 0];50depositAccount.overdraftPrincipal: [null, 0];51interestIncomeAccount.balance: [0, null];52collectionInterestIncomeAccount.balance: [0, null];53};54deriveOverdraftExposure;55}56}