Send order completed notificationv1.0.0 · JSON Schema
Shared Finance completion command consumed by Notification to render and submit a completed-order email.
1. Send an Order Completion Email
After Ordering API marks an order as Completed and emits OrderStatusChangedToCompleteIntegrationEvent, Notification consumes CompleteOrderCommand to send an order completion email.
Payload details
id: UUIDv7 generated byIntegrationEvent(Guid.CreateVersion7()).creationDate: UTC ISO 8601 timestamp (DateTime.UtcNow).orderId: UUID of the completed order (used as the Kafka partition key).fullName: Optional customer display name (nulldefaults to"Customer"in Notification).email: Optional recipient email address (nullor whitespace skips SMTP delivery).totalMoney: Order total (decimal).
Example payload
{ "id": "01960a1b-6a02-7b00-8a9b-0c1d2e3f4d02", "creationDate": "2026-11-25T16:25:00Z", "orderId": "01960a1b-3c4d-7e00-8a9b-0c1d2e3f4a99", "fullName": "Minh Nguyen", "email": "minh.nguyen@bookworm.dev", "totalMoney": 59.98}Using this example
Notification deduplicates by command.Id for 24 hours, renders the completion MJML email template, and submits it to SMTP without mutating order state.
using BookWorm.Chassis.EventBus;using BookWorm.Chassis.EventBus.Idempotency;using BookWorm.Contracts;using Wolverine;using Wolverine.Attributes;
// Integration command contract (BookWorm.Contracts)public sealed record CompleteOrderCommand( Guid OrderId, string? FullName, string? Email, decimal TotalMoney) : IntegrationEvent;
// 1. Publishing via Wolverine IMessageBusawait bus.PublishAsync( new CompleteOrderCommand( Guid.Parse("01960a1b-3c4d-7e00-8a9b-0c1d2e3f4a99"), "Minh Nguyen", "minh.nguyen@bookworm.dev", 59.98m ));
// 2. Consuming in Notification with Wolverine + IIntegrationEventIdempotencyGuardinternal sealed class CompleteOrderCommandHandler( ISender sender, IIntegrationEventIdempotencyGuard idempotencyGuard){ [WolverineHandler] public async Task Handle(CompleteOrderCommand command, CancellationToken cancellationToken) { await idempotencyGuard.ExecuteAsync( command.Id, nameof(CompleteOrderCommandHandler), async ct => { if (!string.IsNullOrWhiteSpace(command.Email)) { await sender.SendEmailAsync(command, ct); } }, cancellationToken: cancellationToken ); }}1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "title": "CompleteOrderCommand",
4 "type": "object",
5 "additionalProperties": false,
6 "required": ["id", "creationDate", "orderId", "totalMoney"],
7 "properties": {
8 "id": { "type": "string", "format": "uuid" },
9 "creationDate": { "type": "string", "format": "date-time" },
10 "orderId": { "type": "string", "format": "uuid" },
11 "fullName": { "type": ["string", "null"] },
12 "email": { "type": ["string", "null"] },
13 "totalMoney": { "type": "number" }
14 }
15}
16