Include Loyalty/Communication/Sports Center backends and registry updates alongside production nginx and compose wiring. Co-authored-by: Cursor <cursoragent@cursor.com>
2.0 KiB
2.0 KiB
ADR-012: Independent Enterprise Communication Platform
| Field | Value |
|---|---|
| Status | Accepted |
| Date | 2026-07-24 |
| Deciders | Platform Architecture |
| Supersedes | — |
| Superseded by | — |
Context
Business modules (CRM, Loyalty, Restaurant, etc.) need SMS and future channels. Putting providers inside each module would duplicate credentials, break failover consistency, and couple tenants to modules they may not subscribe to.
Core already sends auth OTP via Payamak — that auth path stays separate for now, but platform messaging must be a shared infrastructure service.
Decision
- Introduce
communication-servicewith sole ownership ofcommunication_db(port 8005). - All outbound messaging (SMS first; email/push/social/voice later) goes through this service’s APIs and events.
- Provider adapters live only inside Communication.
- Dynamic contact sources resolve contacts via remote APIs — never copy business-module rows.
- Tenants may activate Communication independently of other business modules.
- Failures are tracked asynchronously; they must not abort calling business transactions.
Consequences
Positive
- Single provider registry, failover, templates, OTP, audit, and monitoring
- Clear module boundary for CRM
CommunicationProvidercontract fulfillment - Extensible channel model without rewriting consumers
Negative
- Additional deployable service and database
- Eventual consistency for delivery status
Neutral
- Core auth OTP may later hand off to Communication when explicitly migrated
Alternatives Considered
- Expand
sms_panel/notificationscaffolds separately — rejected; unified Communication owns multi-channel routing. - Keep providers in each business module — rejected; violates independence and DRY.