Order amended (v0.0.1)

Indicates an order has been changed

Overview

The OrderAmended event is triggered whenever an existing order is modified. This event ensures that all relevant services are notified of changes to an order, such as updates to order items, quantities, shipping information, or status. The event allows the system to maintain consistency and ensure that all dependent services can react appropriately to the amendments.

Example payload

Example Payload
{
"orderId": "123e4567-e89b-12d3-a456-426614174000",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"amendedItems": [
{
"productId": "789e1234-b56c-78d9-e012-3456789fghij",
"productName": "Example Product",
"oldQuantity": 2,
"newQuantity": 3,
"unitPrice": 29.99,
"totalPrice": 89.97
}
],
"orderStatus": "confirmed",
"totalAmount": 150.75,
"timestamp": "2024-07-04T14:48:00Z"
}

Schema (Avro)

schema.avro
{ "type": "record", "name": "OrderAmendedEvent", "namespace": "com.example.events", "fields": [ { "name": "orderId", "type": "string", "doc": "The unique identifier of the order that was amended." }, { "name": "userId", "type": "string", "doc": "The unique identifier of the user who placed the order." }, { "name": "amendedItems", "type": { "type": "array", "items": { "type": "record", "name": "AmendedItem", "fields": [ { "name": "productId", "type": "string", "doc": "The unique identifier of the product." }, { "name": "productName", "type": "string", "doc": "The name of the product." }, { "name": "oldQuantity", "type": "int", "doc": "The original quantity of the product ordered." }, { "name": "newQuantity", "type": "int", "doc": "The new quantity of the product ordered." }, { "name": "unitPrice", "type": "double", "doc": "The price per unit of the product." }, { "name": "totalPrice", "type": "double", "doc": "The total price for this order item (newQuantity * unitPrice)." } ] } }, "doc": "A list of items that were amended in the order, each containing product details and updated quantities." }, { "name": "orderStatus", "type": "string", "doc": "The current status of the order after the amendment." }, { "name": "totalAmount", "type": "double", "doc": "The total amount of the order after the amendment." }, { "name": "timestamp", "type": "string", "doc": "The date and time when the order was amended, in ISO 8601 format." } ] }

Schema (JSON)

schema.json
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "OrderAmendedEvent", "type": "object", "properties": { "orderId": { "type": "string", "format": "uuid", "description": "The unique identifier of the order that was amended." }, "userId": { "type": "string", "format": "uuid", "description": "The unique identifier of the user who placed the order." }, "amendedItems": { "type": "array", "description": "A list of items that were amended in the order, each containing product details and updated 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." }, "oldQuantity": { "type": "integer", "description": "The original quantity of the product ordered." }, "newQuantity": { "type": "integer", "description": "The new 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 (newQuantity * unitPrice)." } }, "required": ["productId", "productName", "oldQuantity", "newQuantity", "unitPrice", "totalPrice"] } }, "orderStatus": { "type": "string", "description": "The current status of the order after the amendment." }, "totalAmount": { "type": "number", "format": "float", "description": "The total amount of the order after the amendment." }, "timestamp": { "type": "string", "format": "date-time", "description": "The date and time when the order was amended, in ISO 8601 format." } }, "required": ["orderId", "userId", "amendedItems", "orderStatus", "totalAmount", "timestamp"], "additionalProperties": false }
Event-driven architecture documentation: Awesome Fake Company