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

petshop-00-model.spp

petshop/order/petshop-00-model.spp

Download original file · Petstore source contents

1domain petshop;23Role OrderLine {4    business("Order-line reference used to verify individual items during delivery and returns") String lineNumber;5    Goods goods;6    String name;7    int quantity;8    BigDecimal(19, 2) unitPrice;9    BigDecimal(19, 2) amount;10}1112take Goods as OrderLine {13    Goods goods = Goods;14    String name = name;15    BigDecimal unitPrice = price;16}1718Contract ShopOrder {19    business("Order reference presented to the buyer") String orderNumber;20    Buyer buyer;21    OrderStatus status;22    OrderLine[] lines;23    int reservedQuantity;24    BigDecimal(19, 2) subtotal;25    BigDecimal(19, 2) discount;26    BigDecimal(19, 2) shipping;27    BigDecimal(19, 2) total;28    String address;29    String tracking;30    String reason;31}3233Contract UnpaidCancellationAgreement {34    Buyer buyer;35    ShopOrder order;36    String reason;37    Receipt receipt;38    int releasedQuantity;39}4041Contract PaidCancellationAgreement {42    Buyer buyer;43    Merchant seller;44    ShopOrder order;45    String reason;46    Receipt receipt;47    int releasedQuantity;48    BigDecimal(19, 2) refundAmount;49}