Order Service
The order service provides the bounded context Order.
It is responsible for managing orders of users.
Domain Model
info
Imported entities from other bounded contexts are marked with a dashed border.
Technology Stack
- Language: Rust
- Framework: axum
- GraphQL Library: async_graphql
- Database: MongoDB
Events
This section lists events that are defined or used by the order service.
Published Events
order/order/created
This event is published when an order is placed, which means its order status is set to PLACED.
{
id: string;
userId: string;
createdAt: string;
orderStatus: OrderStatus;
placedAt: string;
rejectionReason?: RejectionReason;
orderItems: OrderItem[];
shipmentAddressId: string;
invoiceAddressId: string;
compensatableOrderAmount: number;
paymentInformationId: string;
paymentAuthorization?: PaymentAuthorization;
vatNumber?: string;
}
order/order-compensation/created
This event is published when an order should be compensated due to a failed shipment.
{
id: string,
orderId: string,
orderItemIds: string[],
triggeredAt: DateTime,
amountToCompensate: number
}
Subscribed Events
- catalog/product-variant-version/created: Used to obtain the current product variant versions for product variants.
- discount/coupon/created: Used to validate the existence of coupons.
- tax/tax-rate-version/created: Used to obtain the current tax rate versions for tax rates.
- shipment/shipment-method/created: Used to validate the existence of shipment methods.
- user/user/created: Used to validate that orders belong to an existing user.
- address/user-address/created: Used to validate that addresses exist for a user.
- address/user-address/archived: Used to validate that addresses exist for a user.
- shipment/shipment/creation-failed: Used to trigger order compensation for a shipment.