Skip to content

Cart System - Add Items

(click to open at actual size)


Cart System - Add Items
Cart System - Add Items Source
cart-add-items.sd
-- render at https://sequencediagram.org
entryspacing 0.7
frame #lightblue Cart System - Add Items
participantspacing 2
entryspacing 0.5
bottomparticipants
actor "Customer" as customer #orange
lifelinestyle customer #lightgray:1:solid
participant "Louvelle Backend" as backend #D35DC5
lifelinestyle backend #lightgray:1:solid
database "Carts Table" as carts #lightgreen
lifelinestyle carts #lightgray:1:solid
database "Items Table" as items #lightblue
lifelinestyle items #lightgray:1:solid
participant "Temporal" as temp #orange
lifelinestyle temp #lightgray:1:solid
customer -> backend:Add To Cart
<color #gray>item id, user id</color>
backend -> items:Set Item Status: <color #blue>IN CART</color>
space 0.1
# First Item
alt FIRST ITEM
backend -> carts : Create Cart
activate carts
deactivateafter carts
backend -> temp: Create Cart Timer Workflow
activate temp
deactivateafter temp
temp --> backend:Return <color #green>WorkflowID</color>
parallel
rbox over temp:<align center>Cart Timer #1
<color #gray>10 Minutes</color>
space -4
parallelend
backend --> carts:Store <color #green>WorkflowID</color>
activate carts
deactivateafter carts
space
# Additional Items
else ADDITIONAL ITEMS
backend -> temp:Cancel Existing Timer <color #blue>(WorkflowID)
activate temp
deactivateafter temp
backend -> temp: Start New Timer Workflow
activate temp
deactivateafter temp
temp --> backend:Return <color #green>WorkflowID</color>
parallel
rbox over temp:<align center>Cart Timer #2
<color #gray>10 Minutes</color>
space -4
parallelend
backend --> carts:Store <color #green>WorkflowID</color>
activate carts
deactivateafter carts
space 2
end