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

petshop-scene-approveShopReturn.spp

petshop/returns/petshop-scene-approveShopReturn.spp

Download original file · Petstore source contents

1domain petshop;23Scenario serial approveShopReturn(Buyer, Merchant, StockLine[], ShopOrder, ReturnRefundAgreement) {4    checkBuyerCredential;5    initializeReturnRefundAgreement;67    configureMerchantLookup;8    parallel {9        findBuyer;10        findMerchant;11        findShopOrder;12    }13    identify(Buyer);14    identify(Merchant);15    identify(ShopOrder);16    checkOrderOwner;17    prepareOrderInventory;18    findStockLine;19    identify(StockLine[]);20    checkReturnApproval;21    checkSoldInventory;22    prepareReturnApproval;23    prepareReturnRefund;24    prepareReturnRefundAgreementReceipt;25    transaction {26        returnInventory bounds {27            StockLine[].available: [0, null];28            StockLine[].sold: [0, null];29        };30        refundReturnFunds bounds {31            Buyer.wallet: [0, null];32            Merchant.cash: [0, null];33        };34        updateShopOrder;3536        insertReceipt(ReturnRefundAgreement.receipt);37    }38}