Order cancelled (v0.0.1)

Indicates an order has been canceled

Overview

The OrderCancelled event is triggered whenever an existing order is cancelled. This event ensures that all relevant services are notified of the cancellation, allowing them to take appropriate actions such as updating inventory levels, refunding payments, and notifying the user. The event helps maintain consistency across the system by ensuring all dependent services are aware of the order cancellation.

Example payload

Example payload
{
"orderId": "123e4567-e89b-12d3-a456-426614174000",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"orderItems": [
{
"productId": "789e1234-b56c-78d9-e012-3456789fghij",
"productName": "Example Product",
"quantity": 2,
"unitPrice": 29.99,
"totalPrice": 59.98
}
],
"orderStatus": "cancelled",
"totalAmount": 59.98,
"cancellationReason": "Customer requested cancellation",
"timestamp": "2024-07-04T14:48:00Z"
}

Schema

JSON schema for the event.

JSON Schema
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "OrderCancelledEvent", "type": "object", "properties": { "orderId": { "type": "string", "format": "uuid", "description": "The unique identifier of the order that was cancelled." }, "userId": { "type": "string", "format": "uuid", "description": "The unique identifier of the user who placed the order." }, "orderItems": { "type": "array", "description": "A list of items included in the cancelled order, each containing product details and quantities.", "items": { "type": "object", "properties": { "productId": { "type": "string", "format": "uuid", "description": "The unique identifier of the product." }, "productName": { "type": "string", "description": "The name of the product." }, "quantity": { "type": "integer", "description": "The quantity of the product ordered." }, "unitPrice": { "type": "number", "format": "float", "description": "The price per unit of the product." }, "totalPrice": { "type": "number", "format": "float", "description": "The total price for this order item (quantity * unit price)." } }, "required": ["productId", "productName", "quantity", "unitPrice", "totalPrice"] } }, "orderStatus": { "type": "string", "description": "The current status of the order after cancellation.", "enum": ["cancelled"] }, "totalAmount": { "type": "number", "format": "float", "description": "The total amount of the order that was cancelled." }, "cancellationReason": { "type": "string", "description": "The reason for the order cancellation, if provided." }, "timestamp": { "type": "string", "format": "date-time", "description": "The date and time when the order was cancelled." } }, "required": ["orderId", "userId", "orderItems", "orderStatus", "totalAmount", "timestamp"], "additionalProperties": false }
Event-driven architecture documentation: Awesome Fake Company