TorbatYar/docs/sports-center-phase-9-1.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

92 lines
4.0 KiB
Markdown

# Phase 9.1 — Sports Center Membership Catalog
| Field | Value |
| --- | --- |
| Status | Complete |
| Module | sports_center (Membership Catalog) |
| Version | 0.9.1.0 |
| Database | `sports_center_db` |
| API Port | 8006 |
| ADR | ADR-001, ADR-003, ADR-006, ADR-014 |
| Previous | [Phase 9.0](sports-center-phase-9-0.md) · [Handover 9.0](phase-handover/phase-9-0.md) |
## Goal
Deliver the **Membership Catalog** for the independent Sports Center Platform: commercial and policy definitions that membership assignments (Phase 9.2) will consume.
This phase does **not** implement member enrollment workflows, cards/QR issuance, coach engines, attendance, or booking.
## Scope Completed
| Area | Deliverable |
| --- | --- |
| Membership Types | Extended with catalog links (package/plan/pricing/age/category/policies), transferability, sort order |
| Packages | `membership_packages` aggregate + APIs |
| Plans | `membership_plans` aggregate + APIs |
| Pricing Models | `pricing_models` (fixed/recurring/tiered/usage/custom) — amounts are catalog config, not Accounting journals |
| Age Groups | `age_groups` with min/max validation |
| Sport Categories | `sport_categories` catalog grouping |
| Membership Rules | Declarative `membership_rules` (eligibility/access/usage/transfer/custom) |
| Renewal Policies | `renewal_policies` |
| Freezing Rules | `freezing_rules` |
| Expiration Policies | `expiration_policies` |
| Validation | Age range, money amount, pricing/billing/rule enums, catalog ref integrity |
| Events | `sports_center.{sport_category,age_group,pricing_model,membership_package,membership_plan,membership_rule,renewal_policy,freezing_rule,expiration_policy,membership_type}.*` |
| APIs | Catalog routes under `/api/v1/*` + `/capabilities` |
| Docs | This file + handover + registries/manifests |
## Out of Scope
- Member / family / medical / card / waiver management (Phase 9.2)
- Coach & staff engines (Phase 9.3)
- Scheduling & booking (Phase 9.4)
- Attendance engine (Phase 9.5)
- Accounting postings / payment capture (Phase 9.8)
- AI analytics (Phase 9.9)
## Architecture Decisions
1. Catalog entities are independent aggregates with UUID refs only (no ORM relationship graphs).
2. Pricing amounts live in Sports Center as **configuration**; journals remain Accounting-only (ADR-010).
3. MembershipType remains the primary commercial product SKU; packages/plans/policies attach via optional refs.
4. Backward compatible: new MembershipType columns are nullable / defaulted; existing 9.0 APIs remain valid.
## Public APIs (new / extended)
| Resource | Prefix |
| --- | --- |
| Sport categories | `/api/v1/sport-categories` |
| Age groups | `/api/v1/age-groups` |
| Pricing models | `/api/v1/pricing-models` |
| Membership packages | `/api/v1/membership-packages` |
| Membership plans | `/api/v1/membership-plans` |
| Membership rules | `/api/v1/membership-rules` |
| Renewal policies | `/api/v1/renewal-policies` |
| Freezing rules | `/api/v1/freezing-rules` |
| Expiration policies | `/api/v1/expiration-policies` |
| Membership types | `/api/v1/membership-types` (extended fields) |
| Capabilities | `/capabilities` |
## Permissions
New trees: `sports_center.sport_categories.*`, `age_groups.*`, `pricing_models.*`, `membership_packages.*`, `membership_plans.*`, `membership_rules.*`, `renewal_policies.*`, `freezing_rules.*`, `expiration_policies.*`.
## Migration
| Revision | Description |
| --- | --- |
| `0002_phase_91_membership_catalog` | Catalog tables + MembershipType additive columns |
## Tests
Architecture, catalog API happy path, tenant isolation, age validation, capabilities, docs presence, permissions/events.
## Related Documents
- [Handover 9.1](phase-handover/phase-9-1.md)
- [Sports Center Roadmap](sports-center-roadmap.md)
- [ADR-014](architecture/adr/ADR-014.md)
- [Module Registry](module-registry.md#sports_center)
- [AI Framework](ai-framework/README.md)
- [Phase Manifest](ai-framework/phase-manifest.yaml)