%%{init: { "theme": "base", "themeVariables": { "fontSize": "18px", "background": "transparent", "actorBkg": "#038851", "actorTextColor": "#ffffff", "actorBorder": "#026139", "actorLineColor": "#94a3b8", "signalColor": "#64748b", "signalTextColor": "#059669", "noteBkgColor": "#e6f4ee", "noteTextColor": "#02502f", "noteBorderColor": "#038851", "activationBkgColor": "#c6ebdc", "activationBorderColor": "#026139", "sequenceNumberColor": "#ffffff" }, "sequence": { "useMaxWidth": true, "actorMargin": 70, "width": 150, "height": 60, "boxMargin": 12, "noteMargin": 14, "messageMargin": 50, "diagramMarginX": 20, "diagramMarginY": 20, "actorFontSize": 18, "actorFontWeight": 700, "noteFontSize": 15, "noteFontFamily": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace", "messageFontSize": 16, "messageFontWeight": 700, "noteAlign": "left", "mirrorActors": false } }}%%
sequenceDiagram
autonumber
participant LOYALTY PLATFORM as Loyalty Platform
participant KIOSK as Kiosk
participant DLVRCT as Deliverect
participant POS PLATFORM as POS
Note over LOYALTY PLATFORM,POS PLATFORM: ๐ญ โ ๐ฃ๐ฟ๐ผ๐ฑ๐๐ฐ๐ & ๐ ๐ฒ๐ป๐ ๐ฆ๐๐ป๐ฐ<br/>โน๏ธ The POS is the source of truth for product data. Products are<br/>synced into Deliverect, which builds and publishes menus<br/>to the Kiosk channel.
POS PLATFORM->>DLVRCT: sync product data
DLVRCT->>KIOSK: sync menus
Note over LOYALTY PLATFORM,POS PLATFORM: ๐ฎ โ ๐๐๐๐๐ผ๐บ๐ฒ๐ฟ ๐๐ฑ๐ฒ๐ป๐๐ถ๐ณ๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป<br/>โน๏ธ The customer scans their loyalty app at the Kiosk.<br/>The customer is identified and a basket is opened, with a<br/>Basket Id used to track the order end-to-end.
LOYALTY PLATFORM->>+KIOSK: scan loyalty app (identify customer)
KIOSK-->>-LOYALTY PLATFORM: Basket Id
Note right of KIOSK: 200 OK<br/>(<br/>#160;#160;"customerId": "customer-1",<br/>#160;#160;"basketId": "basket-1"<br/>)
Note over LOYALTY PLATFORM,POS PLATFORM: ๐ฏ โ ๐ข๐ฟ๐ฑ๐ฒ๐ฟ & ๐ฃ๐ฎ๐๐บ๐ฒ๐ป๐<br/>โน๏ธ The customer completes their order on the Kiosk and pays.<br/>The completed order is passed to Deliverect for parsing.
KIOSK->>KIOSK: complete order
KIOSK->>KIOSK: take payment
KIOSK->>+DLVRCT: submit order
DLVRCT->>DLVRCT: parse order
DLVRCT->>+POS PLATFORM: send order
Note right of DLVRCT: โน๏ธ Basket Id is included<br/>(<br/>#160;#160;"basketId": "basket-1",<br/>#160;#160;"items": [ ... ]<br/>)
deactivate POS PLATFORM
deactivate DLVRCT
Note over LOYALTY PLATFORM,POS PLATFORM: ๐ฐ โ ๐ข๐ฟ๐ฑ๐ฒ๐ฟ ๐ฆ๐๐ฎ๐๐๐ & ๐๐ผ๐๐ฎ๐น๐๐ ๐ฅ๐ฒ๐ฑ๐ฒ๐บ๐ฝ๐๐ถ๐ผ๐ป<br/>โน๏ธ The POS sends order status updates back to Deliverect, which<br/>fans them out as webhooks to the Kiosk and to the Loyalty Platform,<br/>where the loyalty redemption is applied.
POS PLATFORM->>+DLVRCT: Order Status
Note right of DLVRCT: ("Accepted")
POS PLATFORM->>DLVRCT: Order Status
Note right of DLVRCT: ("Finalised")
DLVRCT->>KIOSK: webhook: Order Status
Note right of KIOSK: ("Accepted" / "Finalised")
DLVRCT->>-LOYALTY PLATFORM: webhook: Loyalty Redemption
Note right of LOYALTY PLATFORM: (<br/>#160;#160;"basketId": "basket-1",<br/>#160;#160;"status": "finalised",<br/>#160;#160;"loyalty": "redeemed"<br/>)