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(stockLines);21checkPaidCancellation;22checkReservedInventory;23preparePaidCancellation;24prepareCancellationRefund;25preparePaidCancellationAgreementReceipt;26transaction {27releasePaidInventory bounds {28stockLines.available: [0, null];29stockLines.reserved: [0, null];30};31refundCancellationFunds bounds {32buyer.wallet: [0, null];33merchant.cash: [0, null];34};35updateShopOrder;3637insertReceipt(paidCancellationAgreement.receipt);38}39}