TorbatYar/docs/phase-handover/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

106 lines
3.8 KiB
Markdown

# Phase Handover — 9.1 Sports Center Membership Catalog
> Mandatory starting point for Phase 9.2 — Member Management.
## Overview
Phase 9.1 delivered the **Membership Catalog** on `sports-center-service` / `sports_center_db` (port **8006**, version **0.9.1.0**). Commercial definitions, pricing models, age groups, sport categories, rules, and renewal/freeze/expiration policies are in place. **Member enrollment workflows were not implemented.**
## Completed Scope
- Nine catalog aggregates + extended MembershipType links
- Validators for age ranges, pricing/billing/rule kinds, money amounts, catalog ref integrity
- Publish-only catalog events
- Permissions trees for catalog modules
- Alembic `0002_phase_91_membership_catalog`
- `/capabilities` endpoint advertising catalog readiness
- Tests + docs + registry/manifest updates
## Created / Extended Modules
| Module | Notes |
| --- | --- |
| Sport Categories | New |
| Age Groups | New |
| Pricing Models | New (config only; not Accounting) |
| Membership Packages | New |
| Membership Plans | New |
| Membership Rules | New |
| Renewal Policies | New |
| Freezing Rules | New |
| Expiration Policies | New |
| Membership Types | Extended with catalog refs |
## Models
See `app/models/catalog.py` and additive columns on `MembershipType` in `app/models/foundation.py`.
## Repositories / Services / Validators
- `app/repositories/catalog.py`
- `app/services/catalog.py` (+ MembershipTypeService catalog ref checks)
- `app/validators/catalog.py`
## Public APIs
Listed in [sports-center-phase-9-1.md](../sports-center-phase-9-1.md). Soft delete via `POST /{id}/delete`.
## Events
`sports_center.sport_category.*`, `age_group.*`, `pricing_model.*`, `membership_package.*`, `membership_plan.*`, `membership_rule.*`, `renewal_policy.*`, `freezing_rule.*`, `expiration_policy.*`, `membership_type.updated`.
## Database Changes
Additive only within `sports_center_db`. No Core/CRM/Loyalty/Communication schema changes.
## Migration History
| Revision | Description |
| --- | --- |
| `0001_initial` | Phase 9.0 foundation |
| `0002_phase_91_membership_catalog` | Phase 9.1 catalog |
## Known Limitations
- No member/family/medical/card/QR/waiver workflows
- Rule `expression` JSON is stored; evaluation engine deferred to assignment workflows
- Route-level permission enforcement still deferred (same as 9.0)
- Pricing amounts are not posted to Accounting
## Extension Points
- Attach catalog refs when creating MembershipType / Plan / Package
- Evaluate MembershipRule expressions in Phase 9.2+ assignment services
- Map pricing_model.external_price_ref to Accounting/payment later (9.8)
## Dependencies
- Phase 9.0 foundation complete
- Core entitlement / JWT / tenant headers
- Optional future: Accounting, CRM, Loyalty, Communication (contracts only)
## Next Phase Entry (9.2 — Member Management)
Implement members, family members, medical information, emergency contacts, membership assignment, card/QR/digital membership, waivers, documents/attachments, status management — consuming this catalog. Do **not** rebuild catalog tables. Do **not** implement coach/attendance/booking engines.
Entry checklist:
1. Read this handover + [sports-center-phase-9-1.md](../sports-center-phase-9-1.md)
2. Follow [ai-framework/](../ai-framework/README.md)
3. Start from `sports-center-9.2` in [phase-manifest.yaml](../ai-framework/phase-manifest.yaml)
## Completion Sign-Off
- [x] Quality gates passed
- [x] Tests green
- [x] Documentation updated
- [x] Progress / next-steps / registries / manifests updated
- [x] No unfinished claimed deliverables
## Related Documents
- [Phase 9.1](../sports-center-phase-9-1.md)
- [Phase 9.0 Handover](phase-9-0.md)
- [ADR-014](../architecture/adr/ADR-014.md)
- [Module Registry](../module-registry.md#sports_center)