TorbatYar/docs/architecture/adr/ADR-014.md
Mortezakoohjani e41ecfad4c Sync platform docs, infra, and module services with Accounting integration.
Include Loyalty/Communication/Sports Center backends and registry updates alongside production nginx and compose wiring.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 22:35:23 +03:30

3.0 KiB
Raw Blame History

ADR-014: Independent Sports Center Platform Service

Field Value
Status Accepted
Date 2026-07-24
Deciders Platform Architecture
Supersedes
Superseded by

Context

Gyms, clubs, and sports facilities need members, memberships, coaches, attendance/access, booking, training programs, competitions, and related operations. Embedding this inside CRM, Loyalty, Accounting, or Restaurant would couple unrelated domains and block reuse.

TorbatYar already has independent platform services for Loyalty (ADR-011) and Communication (ADR-012). Sports operations need the same independence with a dedicated database and permission tree.

Decision

  1. Introduce sports_center as an independent business platform service with sole ownership of sports_center_db (ADR-001).
  2. Permission prefix: sports_center.*. Publish-only domain events: sports_center.*.
  3. Row-level multi-tenancy via tenant_id (ADR-003).
  4. Consume Accounting, CRM, Loyalty, and Communication only via REST API and Events — never shared tables or foreign model imports.
  5. Financial journals only through Accounting Posting Engine (ADR-010).
  6. Messaging only through Communication (ADR-012).
  7. Loyalty points/rewards only through Loyalty (ADR-011).
  8. Implementation phases are registered as Phase 9.09.10 in phase-manifest.yaml; roadmap in sports-center-roadmap.md.
  9. Product AI and Automation remain optional and external (ai-architecture.md).

Consequences

Positive

  • Clear ownership for sports operations
  • Reusable integrations with platform services
  • Enforceable tenancy, audit, and boundary tests

Negative

  • Additional deployable service and database
  • Eventual consistency for cross-service customer views

Neutral

  • Scaffold may exist under backend/services/sports_center before Phase 9.0 implementation; registration precedes business code

Alternatives Considered

  1. Sports subsystem inside CRM — rejected (CRM is Sales-only).
  2. Sports tables inside Core — rejected (violates business-module boundaries and ADR-001).
  3. Per-tenant bespoke apps without a service — rejected (not SuperApp-native).