- features
- shop-catalog, shop-suppliers
Shop: the catalog¶✎ edit
Categories nest, products know their margin and whether they're running low, and each comes from a supplier.
$val coffee = dom.find (cls = "Category", key = "coffee")
$expect coffee.parent is "drinks"
$val earl = dom.find (cls = "Product", key = "tea-earl")
$expect earl.low
$expect earl.margin == 5.7
$val beans = dom.find (cls = "Product", key = "coffee-beans")
$expect not beans.low
$val sup = dom.find (cls = "Supplier", key = beans.supplier)
$expect sup.name is "Roastworks Co."