amazon_story Pub

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<-{omniId:"123"})

add book1 view cart

add book1 view cart

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 contains "book1")

send::  msg cust.addToCart  (customer<-"John", sku<-"book2", quantity:Number<-2)

expect::  (cart contains "book2")

send::  msg cart.checkout  (customer<-"John", shipAddr<-"123", billing<-"bil123")

/$expect inv.low (sku=="book1") /$expect shipping.send

send::  msg diesel.memdb.clear 


Was this useful?    

By: Razie | 2017-04-06 .. 2017-05-24 | Tags: story , dsl , amazon


Viewed 111 times ( | Print ) this page.

You need to log in to post a comment!

© Copyright DieselApps, 2012-2020, all rights reserved.