bankdeposit-00-model.spp
bankdeposit/account/bankdeposit-00-model.spp
Download original file · Bank deposit source contents
1domain bankdeposit;23Entity BankAccount {4String accountNumber;5}67Role CashSettlementAccount {8String accountNumber;9quantum BigDecimal(19, 2) balance;10}1112Role CashAccountControl {13String controllingInstitution;14String controlStatus;15int cancelledOn;16String productKind;17}1819Role DepositAccrualState {20String accountNumber;21int lastProductDate;22BigDecimal(25, 2) normalProduct;23BigDecimal(25, 2) overdraftProduct;24BigDecimal(25, 2) overdraftInterestProduct;25BigDecimal(25, 2) actualProduct;26BigDecimal(25, 2) agreementProduct;27int overdraftDays;28int overdraftInterestDays;29}3031Role DepositInterestPolicy {32boolean normalEnabled;33BigDecimal(19, 2) normalUnit;34BigDecimal(19, 2) overdraftUnit;35}3637Role DepositDetailPolicy {38int itemCount;39}4041atomic check checkCashControl(CashAccountControl, AccountEligibility) {42require(cashAccountControl.controllingInstitution == BLANK, RejectionCode.EN432);43require(44cashAccountControl.controlStatus != "PayNoReceive" && cashAccountControl.controlStatus != "Locked",45RejectionCode.EN43246);47require(accountEligibility.status != AccountStatus.FROZEN, RejectionCode.EG877);48require(cashAccountControl.cancelledOn == 0, RejectionCode.EN113);49require(cashAccountControl.productKind != "RealEstate", RejectionCode.EI090);50}5152atomic calculate describeAccountBalance(DepositAccount, AccountEligibility) {53accountEligibility.accountBalance = depositAccount.interestBase54+ depositAccount.overdraftInterest55+ depositAccount.collectionInterest56+ depositAccount.overdraftPrincipal;57}5859atomic check checkAccountParticipants(DepositAccount, AccountEligibility, DepositAccrualState) {60require(61depositAccount.accountNumber == accountEligibility.accountNumber62&& depositAccount.accountNumber == depositAccrualState.accountNumber,63RejectionCode.ACCOUNT_PARTICIPANTS_MISMATCH64);65}6667atomic calculate deriveOverdraftExposure(DepositAccount) {68depositAccount.overdraftExposure = -depositAccount.overdraftPrincipal;69}