aws-samples / industry-reference-models

Apache License 2.0
4 stars 0 forks source link

Create Order Workflow #4

Open paulfryer opened 1 week ago

paulfryer commented 1 week ago

Workflow Description

The Create Order workflow should orchestrate over all the systems needed to create a new order.

Example Visual Workflow

Example Mocked Workflow Note: This example diagram is showing Lambda, but the actual workflow should orchestrate over API Gateway. The API Gateway endpoints should use IAM_ROLE for authentication.

Workflow Steps

Sequence Step Name Details
1 createOrder The task of this function is to create an order object with order metadata like orderId, creation time etc.
2 setOrderDetails Add the details provide by the API input like product ids, quantity, shopper id etc. to the order object
3 batchGetProductDetails Get the product details, title, img url etc. for the product ids in the order object
4 batchGetProductPrices Get the product prices for the product ids in the order object
5 batchGetProductPromotions Get the product promotions for the product ids in the order object
6 getShopperDetails Get shopper details like loyalty status for the shopper id in the order object
7 getTaxes Get taxes for the products in the order using product details, prices, promotions, addresses etc.
8 validate Validate data like taxes, inventory etc. in the order object, identifying the state of the order, in progress, ready to sign etc.
9 saveOrder Save the order to the database - S3, DynamoDB etc.This step may also include index generation for list and search operations.

Dependent Issues

5 We need to build out the Tax Model to so the getTaxes to provide support for the getTaxes step.

6 We need to create the Promotions Model so the check out process can check for promotions.

paulfryer commented 1 week ago

Candidate workflow based on API Gateway calls, not Lambda. image