Skip to content
Italo Pessoa edited this page Oct 9, 2024 · 1 revision
sequenceDiagram
    participant OrdersMicroservice
    participant Neo4jCronjob
    participant PaymentMicroservice
    participant KitchenMicroservice

    OrdersMicroservice->>+Neo4jCronjob: OrderCreated event
    PaymentMicroservice->>OrdersMicroservice: PaymentCreated event
    activate OrdersMicroservice
    OrdersMicroservice->>OrdersMicroservice: Update OrderPayment
    deactivate OrdersMicroservice
    PaymentMicroservice->>OrdersMicroservice: PaymentConfirmed event
    activate OrdersMicroservice
    OrdersMicroservice->>OrdersMicroservice: Update Order Status (Received)
    deactivate OrdersMicroservice
    OrdersMicroservice->>+KitchenMicroservice: OrderStatusUpdated event (Received)
    activate KitchenMicroservice
    KitchenMicroservice->>KitchenMicroservice: Add Order to production list
    deactivate KitchenMicroservice

    KitchenMicroservice->>OrdersMicroservice: UpdateOrderStatus command (InPreparation)
    activate OrdersMicroservice
    OrdersMicroservice->>OrdersMicroservice: Update Order Status (InPreparation)
    deactivate OrdersMicroservice
    OrdersMicroservice->>+KitchenMicroservice: OrderStatusUpdated event (InPreparation)
    activate KitchenMicroservice
    KitchenMicroservice->>KitchenMicroservice: Update production list
    deactivate KitchenMicroservice

    KitchenMicroservice->>OrdersMicroservice: UpdateOrderStatus command (Ready)
    activate OrdersMicroservice
    OrdersMicroservice->>OrdersMicroservice: Update Order Status (Ready)
    deactivate OrdersMicroservice
    OrdersMicroservice->>+KitchenMicroservice: OrderStatusUpdated event (Ready)
    activate KitchenMicroservice
    KitchenMicroservice->>KitchenMicroservice: Update production list
    deactivate KitchenMicroservice

    KitchenMicroservice->>OrdersMicroservice: UpdateOrderStatus command (Completed)
    activate OrdersMicroservice
    OrdersMicroservice->>OrdersMicroservice: Update Order Status (Completed)
    deactivate OrdersMicroservice
    OrdersMicroservice->>+KitchenMicroservice: OrderStatusUpdated event (Completed)
    activate KitchenMicroservice
    KitchenMicroservice->>KitchenMicroservice: Update production list
    deactivate KitchenMicroservice
Loading