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

petshop-scene-addCartItem.spp

petshop/cart/petshop-scene-addCartItem.spp

Download original file · Petstore source contents

1domain petshop;23Scenario serial addCartItem(Buyer, Cart, Goods, CartAdditionAgreement, CartLine[]) {4    checkBuyerCredential;5    checkGoodsCredential;6    initializeCartAdditionAgreement;7    checkCartAdditionAgreementInput;89    parallel {10        findBuyer;11        findGoods;12    }1314    identify(Buyer);15    identify(Goods);16    checkGoodsSale;17    locateBuyerCart;18    prepareCartAdditionAgreementReceipt;19    findCart;20    identify(Cart);21    checkCart;22    captureCartLines;23    addCartProduct;24    transaction {25        deleteCartLine;26        insertCartLine(Cart.lines);27        updateCart;28        insertReceipt(CartAdditionAgreement.receipt);29    }30}