petshop-scene-cancelPaidShopOrder.spp
petshop/order/petshop-scene-cancelPaidShopOrder.spp
Download original file · Petstore source contents
1domain petshop;23Scenario serial cancelPaidShopOrder(Buyer, Merchant, StockLine[], ShopOrder, PaidCancellationAgreement) {4checkBuyerCredential;5initializePaidCancellationAgreement;6checkPaidCancellationAgreementInput;78configureMerchantLookup;9parallel {10findBuyer;11findMerchant;12findShopOrder;13}14identify(Buyer);15identify(Merchant);16identify(ShopOrder);17checkOrderOwner;18prepareOrderInventory;19findStockLine;20identify(StockLine[]);21checkPaidCancellation;22checkReservedInventory;23preparePaidCancellation;24prepareCancellationRefund;25preparePaidCancellationAgreementReceipt;26transaction {27releasePaidInventory bounds {28StockLine[].available: [0, null];29StockLine[].reserved: [0, null];30};31refundCancellationFunds bounds {32Buyer.wallet: [0, null];33Merchant.cash: [0, null];34};35updateShopOrder;3637insertReceipt(PaidCancellationAgreement.receipt);38}39}