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

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) {4    checkBuyerCredential;5    initializePaidCancellationAgreement;6    checkPaidCancellationAgreementInput;78    configureMerchantLookup;9    parallel {10        findBuyer;11        findMerchant;12        findShopOrder;13    }14    identify(Buyer);15    identify(Merchant);16    identify(ShopOrder);17    checkOrderOwner;18    prepareOrderInventory;19    findStockLine;20    identify(StockLine[]);21    checkPaidCancellation;22    checkReservedInventory;23    preparePaidCancellation;24    prepareCancellationRefund;25    preparePaidCancellationAgreementReceipt;26    transaction {27        releasePaidInventory bounds {28            StockLine[].available: [0, null];29            StockLine[].reserved: [0, null];30        };31        refundCancellationFunds bounds {32            Buyer.wallet: [0, null];33            Merchant.cash: [0, null];34        };35        updateShopOrder;3637        insertReceipt(PaidCancellationAgreement.receipt);38    }39}