%%{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/>)