petshop-10-services.spp
petshop/catalogue/petshop-10-services.spp
Download original file · Petstore source contents
1domain petshop;23atomic query importCatalogue(Goods, Goods[]);45atomic query listProducts(Goods, Goods[]);67atomic check checkGoodsCredential(Goods) {8require(goods.sku != BLANK, RejectionCode.ITEM_REQUIRED);9}1011atomic check checkGoodsSale(Goods) {12require(goods.active, RejectionCode.PRODUCT_UNAVAILABLE);13}1415atomic calculate prepareInventorySelection(Goods[], StockLine[]) {16stockLines = new StockLine[] {17};18for (Goods product : goodss) {19StockLine stock = new StockLine();20stock.goods = product;21stockLines = append(stockLines, stock);22}23}2425atomic calculate initializeInventory(Goods[], StockLine[], StockSupply[]);