Domain Model: Westside Basketball

arch-domain-westside-basketball Architecture

architecture

Domain Model

The business entities and their relationships. Answers: what are the things and how do they relate?

Key relationships

  • Tenant is the org (Westside Kings & Queens). Multi-tenant by design, single-tenant in practice.
  • Parent owns the waiver and registration token. One parent can register multiple players (siblings). Has phone for contact.
  • Player is the athlete. Linked to one parent and optionally one team. Has contract status, subscription status, and jersey fields. contract_status changing to signed triggers the welcome email with GroupMe share link.
  • Team groups players by division/age. Assigned a coach. Stores groupme_group_id and groupme_share_url — the link between our DB and GroupMe. Parents self-join via share link.
  • Registration is the join — links a player to a tenant with payment status.
  • Coach is independent — onboarded via 1099 contractor agreement + Stripe Connect.
  • Order/Product handles jersey and fee purchases via Stripe Checkout.
  • GroupMe is external — not modeled in our DB beyond two columns on Team. GroupMe API is the source of truth for membership. We query it on demand for audits, not replicate it.
  • PracticeSchedule defines recurring practice slots. Linked to a tenant and optionally a team. Keyed by division + day_of_week + start_time. Supports team-level overrides (team_id FK) or division-wide defaults (team_id null). is_active flag allows soft-disable without deletion.
  • Event models one-off occurrences: tournaments, games, camps, tryouts. event_type enum distinguishes category. Supports hierarchical nesting via parent_event_id self-referential FK — a tournament contains child game events. Optionally scoped to a team or division.