bankdeposit-80-bank-qualification.spp
bankdeposit/admission/bankdeposit-80-bank-qualification.spp
Download original file · Bank deposit source contents
1domain bankdeposit;23// the legacy query module: decoded account and operator facts, with business selection in SPP.45Role DepositBankProfile {6boolean normalSavings;7boolean restrictedSubtype;8String openingBranch;9String openingProvince;10String subbranch;11String area;12String areaProvince;13String depositRange;14String proprietaryRange;15boolean cardLinked;16String accountSeries;17boolean cardRecordFound;18String cardLoss;19String cardStatus;20String passbookLoss;21boolean groupSubaccount;22}2324Role DepositOperatorFacts {25String branch;26String province;27String subbranch;28String area;29String areaProvince;30boolean accountingCentre;31String transactionPrefix;32String operationCode;33String tellerFamily;34int tellerNumber;35boolean numericTeller;36String mode;37boolean agencySigned;38boolean corporateTransfer;39String settlementChannel;40}4142Role DepositNotices {43String cardWarning;44String passbookWarning;45}4647atomic calculate assessDepositDocumentNotices(48DepositBankProfile,49DepositOperatorFacts,50CashChannel,51DepositNotices52) {53depositNotices.cardWarning = BLANK;54depositNotices.passbookWarning = BLANK;55boolean applies = !depositOperatorFacts.agencySigned56&& depositOperatorFacts.numericTeller57&& (depositOperatorFacts.mode == "Online"58|| depositOperatorFacts.mode == "Mode8");59if (applies) {60if (depositBankProfile.accountSeries == "49927"61&& depositBankProfile.cardLinked62&& depositBankProfile.cardRecordFound63&& cashChannel.businessCode != "CR0"64&& (depositBankProfile.cardLoss == "Oral"65|| depositBankProfile.cardLoss == "Written")66&& depositBankProfile.cardStatus != "Cancelled") {67depositNotices.cardWarning = "WN200";68}69if (depositBankProfile.passbookLoss == "Oral" || depositBankProfile.passbookLoss == "Written") {70depositNotices.passbookWarning = "WN201";71}72}73}7475atomic check checkDepositBranchRange(DepositBankProfile, DepositOperatorFacts, CashChannel) {76boolean specificPermission = depositOperatorFacts.transactionPrefix == "FL06002"77|| depositOperatorFacts.transactionPrefix == "AG02891"78|| depositOperatorFacts.transactionPrefix == "SA01120"79|| depositOperatorFacts.transactionPrefix == "FL06615"80|| depositOperatorFacts.transactionPrefix == "FL06618";81boolean commonException = depositOperatorFacts.transactionPrefix == "RE04081"82|| depositOperatorFacts.transactionPrefix == "RE04082"83|| depositOperatorFacts.transactionPrefix == "RE04001"84|| depositOperatorFacts.transactionPrefix == "RE04013"85|| depositOperatorFacts.transactionPrefix == "RE04047"86|| depositOperatorFacts.transactionPrefix == "RE04057"87|| depositOperatorFacts.transactionPrefix == "CR05220";88boolean agencyException = cashChannel.businessCode == "AG0"89&& (depositOperatorFacts.operationCode == "1732"90|| depositOperatorFacts.operationCode == "1762"91|| depositOperatorFacts.operationCode == "1725");92boolean outerException = depositOperatorFacts.transactionPrefix == "RE04001"93|| depositOperatorFacts.transactionPrefix == "RE04013"94|| depositOperatorFacts.transactionPrefix == "RE04047"95|| depositOperatorFacts.transactionPrefix == "RE04057"96|| depositOperatorFacts.transactionPrefix == "RE04067"97|| depositOperatorFacts.transactionPrefix == "AG01765"98|| depositOperatorFacts.transactionPrefix == "AG02899"99|| depositOperatorFacts.transactionPrefix == "RE04066";100boolean specialTeller = depositOperatorFacts.tellerFamily == "UH"101&& depositOperatorFacts.tellerNumber >= 0102&& depositOperatorFacts.tellerNumber <= 9;103if ((depositOperatorFacts.operationCode == "1751"104|| depositOperatorFacts.operationCode == "1176"105|| depositOperatorFacts.operationCode == "1172")106&& depositOperatorFacts.tellerFamily == "O"107&& depositOperatorFacts.tellerNumber >= 56108&& depositOperatorFacts.tellerNumber <= 99) {109specialTeller = true;110}111if (depositOperatorFacts.operationCode == "1751"112&& depositOperatorFacts.tellerFamily == "ZD"113&& depositOperatorFacts.tellerNumber >= 0114&& depositOperatorFacts.tellerNumber <= 9) {115specialTeller = true;116}117boolean applies = !depositBankProfile.cardLinked118&& cashChannel.businessCode != "FL0"119&& cashChannel.businessCode != "RE0"120&& cashChannel.businessCode != "AG0"121&& (!depositOperatorFacts.accountingCentre122|| depositBankProfile.openingProvince != depositOperatorFacts.province)123&& !outerException124&& !specificPermission125&& !specialTeller;126boolean groupException = depositBankProfile.groupSubaccount127&& (depositOperatorFacts.settlementChannel == "HVP"128|| depositOperatorFacts.settlementChannel == "BEP"129|| depositOperatorFacts.settlementChannel == "NXY");130boolean checksRange = depositOperatorFacts.mode != "CentralBatch"131&& !depositOperatorFacts.corporateTransfer132&& depositOperatorFacts.transactionPrefix != "CR05220"133&& !groupException;134if (applies) {135if (depositBankProfile.normalSavings) {136require(137depositBankProfile.depositRange == "SameBranch"138|| depositBankProfile.depositRange == "Subbranch"139|| depositBankProfile.depositRange == "City"140|| depositBankProfile.depositRange == "Province"141|| depositBankProfile.depositRange == "All",142RejectionCode.INVALID_DEPOSIT_RANGE143);144if (checksRange) {145if (depositBankProfile.depositRange == "SameBranch"146&& depositBankProfile.openingBranch != depositOperatorFacts.branch147&& !commonException) {148require(false, RejectionCode.EN134);149}150if (depositBankProfile.depositRange == "Subbranch") {151require(152depositBankProfile.subbranch != BLANK && depositOperatorFacts.subbranch != BLANK,153RejectionCode.DEPOSIT_SUBBRANCH_RELATION_NOT_FOUND154);155require(156depositBankProfile.subbranch == depositOperatorFacts.subbranch,157RejectionCode.EN470158);159}160if (depositBankProfile.depositRange == "City") {161require(162depositBankProfile.area != BLANK && depositOperatorFacts.area != BLANK,163RejectionCode.DEPOSIT_AREA_NOT_FOUND164);165require(depositBankProfile.area == depositOperatorFacts.area, RejectionCode.EN470);166}167if (depositBankProfile.depositRange == "Province") {168require(169depositBankProfile.areaProvince != BLANK170&& depositOperatorFacts.areaProvince != BLANK,171RejectionCode.DEPOSIT_AREA_NOT_FOUND172);173require(174depositBankProfile.areaProvince == depositOperatorFacts.areaProvince,175RejectionCode.EN470176);177}178}179} else {180if ((depositBankProfile.proprietaryRange == "SameBranch"181|| depositBankProfile.proprietaryRange == "WithdrawOnly")182&& depositBankProfile.openingBranch != depositOperatorFacts.branch183&& depositOperatorFacts.mode != "CentralBatch"184&& !depositOperatorFacts.corporateTransfer185&& !commonException186&& !(depositBankProfile.restrictedSubtype187&& agencyException)) {188require(false, RejectionCode.EN134);189}190}191}192// This subtype check is outside the outer range gate in the source.193if (depositBankProfile.restrictedSubtype194&& depositBankProfile.openingBranch != depositOperatorFacts.branch195&& !agencyException196&& !commonException197&& depositOperatorFacts.transactionPrefix != "AG01765"198&& depositOperatorFacts.transactionPrefix != "AG02899"199&& depositOperatorFacts.transactionPrefix != "RE04066"200&& depositOperatorFacts.transactionPrefix != "RE04035"201&& !specificPermission) {202require(false, RejectionCode.EN134);203}204}205206atomic calculate mergeDepositNotices(AdmissionDecision, DepositNotices) {207if (admissionDecision.executable208&& (depositNotices.cardWarning != BLANK209|| depositNotices.passbookWarning != BLANK)) {210admissionDecision.status = AdmissionStatus.WARNING;211}212}213214// the legacy deposit program and the legacy query module. Reversal uses its own eligibility path.215216atomic check checkCoreDepositReversalEligibility(217CashAccountControl,218AccountEligibility,219DepositOperatorFacts220) {221require(accountEligibility.status != AccountStatus.CLOSED, RejectionCode.EO082);222require(cashAccountControl.cancelledOn == 0, RejectionCode.EN113);223require(224accountEligibility.status != AccountStatus.FROZEN225|| depositOperatorFacts.transactionPrefix == "SA01116",226RejectionCode.EN111227);228}229230atomic check checkDepositOperatorBinding(DepositOperatorFacts, DepositFeeContext) {231require(232depositOperatorFacts.branch == depositFeeContext.branchNumber233&& depositOperatorFacts.area == depositFeeContext.regionCode,234RejectionCode.DEPOSIT_OPERATOR_CONTEXT_MISMATCH235);236require(237depositOperatorFacts.operationCode == "1102" && depositOperatorFacts.transactionPrefix == "SA01102",238RejectionCode.UNSUPPORTED_DEPOSIT_OPERATOR_PATH239);240}241242readonly Scenario serial assessReversalEligibility(243CashAccountControl,244AccountEligibility,245DepositOperatorFacts246) {247checkCoreDepositReversalEligibility;248}