Register all active platform services and base features in core DB so admin can manage them, add delivery/hospitality/sports-center backend phases, update apps catalog and production deploy tooling. Co-authored-by: Cursor <cursoragent@cursor.com>
2.7 KiB
2.7 KiB
Event Template
Standards for domain and integration events.
Domain Events
- Emitted when an aggregate state change may matter inside or outside the service.
- Written via outbox in the same DB transaction as the write (ADR-006).
- Consumers treat events as facts; producers do not assume synchronous handling.
Integration Events
- Cross-service contracts for interoperability (same envelope).
- Stable payload fields; evolve additively when possible.
- Consumers must be idempotent (inbox /
event_id).
Naming
Preferred forms (follow the owning service’s established style):
| Style | Example | When |
|---|---|---|
{aggregate}.{past_tense} |
tenant.created |
Core / generic |
{service}.{aggregate}.{past_tense} |
crm.lead.created, loyalty.member.enrolled |
Namespaced business services |
Use past tense. Do not use generic names like update without the aggregate.
Versioning
- Envelope fields remain stable (event-driven-architecture.md).
- Payload additive changes preferred.
- Breaking payload changes: new event type or explicit
payload_versiondocumented in catalog and handover. - Never reuse an
event_typestring for a different meaning.
Payload Rules
Envelope (canonical):
{
"event_id": "uuid",
"event_type": "service.aggregate.past_tense",
"aggregate_type": "aggregate",
"aggregate_id": "uuid",
"tenant_id": "uuid|null",
"source_service": "service-name",
"payload": {},
"occurred_at": "ISO-8601"
}
Payload must:
- Include enough IDs for consumers to fetch details via API if needed
- Avoid embedding secrets or large binaries
- Prefer refs over duplicated foreign aggregates
- Remain JSON-serializable
Catalog & Registration
- List new events in the phase doc and event-catalog.md.
- Update module-registry.md Events fields.
- Update service-manifest.yaml event list.
Completeness
Outbox events for cross-service-relevant state changes are a mandatory phase artifact unless justified N/A (mandatory-phase-artifacts.md, enterprise-completeness.md). Missing event emission for in-scope integrations fails the Event Completeness gate.