An amazon use case: order a new product.
First, a seller can define the new product, via either a B2B API
send::
msg catalog.addProduct (name="prod1"
, sku="prod1"
)
expect:: (productId is defined
)
send::
msg cart.create (customer="John"
, metadata :JSON)
send::
msg catalog.addProduct (name="Book1"
, sku="book1"
, quantity:Number=3
)
expect:: (productId is number
)
A customer will now order it and checkout
send::
msg cust.addToCart (customer="John"
, sku="book1"
, quantity:Number=2
)
expect:: ( ((cart as String) contains "book1")
)
send::
msg cust.addToCart (customer="John"
, sku="book2"
, quantity:Number=2
)
expect:: ( ((cart as String) contains "book2")
)
send::
msg cart.checkout (customer="John"
, shipAddr="123"
, billing="bil123"
)
/$expect inv.low (sku=="book1")
/$expect shipping.send
You need to log in to post a comment!