Context
Emails, notifications, audit records, storage cleanup, and blockchain reconciliation are side effects of database changes. Executing them inline couples request success to external services; executing them after commit without durable coordination can lose work.
Scope
- Add an outbox model written in the same transaction as domain changes.
- Build a worker with atomic claiming, visibility timeout/lease, heartbeat, bounded retries, and dead-letter handling.
- Define versioned event payloads and idempotent consumers.
- Implement initial consumers for transactional email and one operational side effect.
- Add replay, inspection, and redrive tooling with audit records.
- Define retention and safe payload redaction.
Acceptance criteria
Relevant areas
Prisma models, payout/application/support mutations, email-service.ts, future notifications and escrow reconciliation.
Context
Emails, notifications, audit records, storage cleanup, and blockchain reconciliation are side effects of database changes. Executing them inline couples request success to external services; executing them after commit without durable coordination can lose work.
Scope
Acceptance criteria
Relevant areas
Prisma models, payout/application/support mutations,
email-service.ts, future notifications and escrow reconciliation.