petshop-20-calculations.spp
petshop/fulfillment/petshop-20-calculations.spp
Download original file · Petstore source contents
1domain petshop;23atomic calculate prepareShipment(ShopOrder, ShipmentAgreement) {4shipmentAgreement.shippedQuantity = 0;5for (OrderLine line : shopOrder.lines) {6shipmentAgreement.shippedQuantity += line.quantity;7}8shopOrder.status = OrderStatus.SHIPPED;9shopOrder.tracking = shipmentAgreement.tracking;10}1112atomic calculate prepareDelivery(ShopOrder) {13shopOrder.status = OrderStatus.DELIVERED;14}