1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Outbox - Atomic commit of aggregates with publishable outbox messages.
//!
//! This module provides the outbox message type and commit helpers:
//! - `OutboxMessage` - publishable message envelope plus delivery state
//! - `OutboxMessageStatus` - Message status (Pending, InFlight, Published, Failed)
//! - `OutboxCommit` - Helper for aggregate + outbox commits
//!
//! Outbox messages are durable publication work items. Their payload can be a
//! domain event, integration event, command, or generic transport message.
//! Aggregate `EventRecord`s are replayable model history and are not
//! automatically published as domain events.
//!
//! ## Separation of Concerns
//!
//! The outbox pattern has two distinct phases:
//! 1. **Commit phase** (this module) - Atomically commit aggregate event records + outbox message
//! 2. **Worker phase** (see `outbox_worker` module) - Drain outbox and publish messages to external systems
//!
//! Outbox messages are explicit publication records. Aggregate event records are
//! replayable write-side history; they do not automatically become domain or
//! integration events until application code creates an `OutboxMessage` for that
//! publication.
//!
//! ## Example
//!
//! ```ignore
//! use distributed::OutboxMessage;
//!
//! // Create aggregate and domain event outbox message
//! let mut order = Order::new();
//! order.create("order-1", ...);
//!
//! let outbox = OutboxMessage::create("order-1:created", "OrderCreated", payload);
//!
//! // Commit in one async repository batch
//! repo.outbox(outbox).commit(&mut order).await?;
//! ```
// Outbox message record
pub use ;
pub use validate_outbox_message_table_write;
pub use ;
// Commit helpers
pub use ;