S++Core systems, human-reviewable
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(stockLines);20    checkReturnApproval;21    checkSoldInventory;22    prepareReturnApproval;23    prepareReturnRefund;24    prepareReturnRefundAgreementReceipt;25    transaction {26        returnInventory bounds {27            stockLines.available: [0, null];28            stockLines.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}