docker compose up -d
Happy path: CreateOrderCommand -> CommandCreatedEvent -> ProcessPaymentCommand -> PaymentProcessedEvent -> CreateShipmentCommand -> ShipmentCreatedEvent -> UpdateOrderStatusCommand(ORDER_COMPLETED) -> OrderStatusUpdatedEvent
Compensations:
- Payment Failed: PaymentFailedEvent -> UpdateOrderStatusCommand(ORDER_FAILED) -> OrderStatusUpdatedEvent
- Shipment Failed: ShipmentCreatedEvent(SHIPMENT_FAILED) -> CancelPaymentCommand -> PaymentCancelledEvent -> UpdateOrderStatusCommand(ORDER_FAILED) -> OrderStatusUpdatedEvent
Using Api Gateway: http://localhost:5555/docs
First Create a User Balance with balance 5000 for example:
Copy the returned user id for order creation
Create order with an amount less than user balance: 200 for example.
Create new order
Create an order with amount greater than user balance.
Failure is hard coded in Shipment Service (Service fails for any order with amount less than 20).