bankdeposit.app
bankdeposit/bankdeposit.app
Download original file · Bank deposit source contents
1domain bankdeposit;23application bankDeposit {4environment develop {5deploy bankdeposit;6transactions {7mode: LOCAL;8resource: cashRecordsResource;9ordinaryUpdates: PARALLEL;10}11}12environment testing {13deploy bankdeposit;14quantum {15system: UNIFIED_STORE;16resource: cashLedger;17}18}19}2021requests {22idempotency retention 3 days;23duplicateWindow 5 seconds;24}2526header requestContext {27unique String globalSerialNumber;28String callerId;29String requestSerialNumber;30String callMode;31String callOrigin;32}3334header responseContext {35String status(Default = "OK");36}3738tables entities {39table BANK_ACCOUNTS(BankAccount) {40primarykey(BankAccount.accountNumber);41}42}4344tables roles {45table INTEREST_SUBJECTS(InterestSubject) {46primarykey(InterestSubject.accountNumber);47}48table COLLECTION_SUBJECTS(CollectionSubject) {49primarykey(CollectionSubject.accountNumber);50}51table PRINCIPAL_SUBJECTS(PrincipalSubject) {52primarykey(PrincipalSubject.accountNumber);53}54table INTEREST_INCOME_ACCOUNTS(InterestIncomeAccount) {55primarykey(InterestIncomeAccount.accountNumber);56}57table COLLECTION_INCOME_ACCOUNTS(CollectionInterestIncomeAccount) {58primarykey(CollectionInterestIncomeAccount.accountNumber);59}60table PRINCIPAL_RECOVERY_ACCOUNTS(PrincipalRecoveryAccount) {61primarykey(PrincipalRecoveryAccount.accountNumber);62}63table CASH_REVERSAL_POSTINGS(CashReversalPostingLine) {64primarykey(CashReversalPostingLine.reversal, CashReversalPostingLine.slot);65foreignkey(CashReversalPostingLine.reversal) references CashReversalAgreement;66}67table ACCOUNT_ACCRUAL(DepositAccrualState) {68primarykey(DepositAccrualState.accountNumber);69}70table CASH_POSTINGS(DepositPostingLine) {71primarykey(DepositPostingLine.deposit, DepositPostingLine.slot);72foreignkey(DepositPostingLine.deposit) references CashDepositAgreement;73}74table DEPOSIT_ACCOUNTS(DepositAccount) {75primarykey(DepositAccount.accountNumber);76}77table CASH_SETTLEMENT_ACCOUNTS(CashSettlementAccount) {78primarykey(CashSettlementAccount.accountNumber);79}80table ACCOUNT_ELIGIBILITY(AccountEligibility) {81primarykey(AccountEligibility.accountNumber);82}83table FEE_RATES(DepositFeeRate) {84primarykey(DepositFeeRate.customerNumber, DepositFeeRate.tariff);85}86table CASH_FAILURES(CashFailureRecord) {87primarykey(CashFailureRecord.handlingNumber);88auto CashFailureRecord.handlingNumber prefix "FAILURE";89snapshot(CashFailureRecord.deposit, CashFailureRecord.reversal);90}91}9293tables contracts {94table CASH_DEPOSITS(CashDepositAgreement) {95snapshot(CashDepositAgreement.postingEvidence);96primarykey(CashDepositAgreement.depositNumber);97auto CashDepositAgreement.depositNumber prefix "DEPOSIT";98foreignkey(CashDepositAgreement.account) references DepositAccount;99foreignkey(CashDepositAgreement.settlement) references CashSettlementAccount;100foreignkey(CashDepositAgreement.interestIncome) references InterestIncomeAccount;101foreignkey(CashDepositAgreement.collectionIncome) references CollectionInterestIncomeAccount;102foreignkey(CashDepositAgreement.principalRecovery) references PrincipalRecoveryAccount;103}104table CASH_REVERSALS(CashReversalAgreement) {105primarykey(CashReversalAgreement.reversalNumber);106auto CashReversalAgreement.reversalNumber prefix "REVERSAL";107foreignkey(CashReversalAgreement.original) references CashDepositAgreement;108}109}110111scope {112local(in requestContext, out responseContext) {113quantum resource(114cashLedger,115CashSettlementAccount.balance,116DepositAccount.interestBase,117DepositAccount.overdraftInterest,118DepositAccount.collectionInterest,119DepositAccount.overdraftPrincipal,120InterestIncomeAccount.balance,121CollectionInterestIncomeAccount.balance122) settleCashDeposit;123quantum resource(124cashLedger,125CashSettlementAccount.balance,126DepositAccount.interestBase,127DepositAccount.overdraftInterest,128DepositAccount.collectionInterest,129DepositAccount.overdraftPrincipal,130InterestIncomeAccount.balance,131CollectionInterestIncomeAccount.balance132) reverseCashDeposit;133quantum resource(134cashLedger,135CashSettlementAccount.balance,136DepositAccount.interestBase,137DepositAccount.overdraftInterest,138DepositAccount.collectionInterest,139DepositAccount.overdraftPrincipal,140InterestIncomeAccount.balance,141CollectionInterestIncomeAccount.balance142) originateClaims;143duplicate key(144DepositAccount.accountNumber,145CashSettlementAccount.accountNumber146) facts(147DepositRequest,148CashChannel,149DepositFeeParty,150DepositFeeContext,151AuthorizationEvidence,152InterestIncomeAccount,153CollectionInterestIncomeAccount,154PrincipalRecoveryAccount155) window 5 seconds depositCash;156duplicate key(157DepositAccount.accountNumber,158CashDepositAgreement.depositNumber159) facts(CashReversalAgreement) window 5 seconds reverseCash;160}161}162163web {164expose openBankRepaymentAccounts;165expose openDepositAccount;166expose depositCash;167expose reverseCash;168expose previewCashReversal;169expose readDepositAccount;170expose readCashDeposit;171expose readCashReversal;172}