Tee Time System Overview
High‑level map of the TeeTime stack (API, domain services, data, and client entry points) with pointers to deeper docs.
Surface areas
- API – NestJS backend (
apps/teetime/teetime-backend) exposes/api/*and/admin/*(Swagger at/api/docs). Domain logic lives in@digiwedge/tee-time-services. - Frontends – Customer web/mobile (
teetime-frontend), admin portal (teetime-admin), and docs site (teetime-docs). Frontends use the workspace client@digiwedge/teetime-api-client. - Identity – JWT from IDP → Player mapping via
UserIdentity(/api/players/me/*auto-creates on first use). Buddies/favorites/me endpoints depend on this mapping. - Data – PostgreSQL (
@prisma/teetime), Redis caches, optional provider data stores (GolfNow/Lightspeed/Foreup bridges). - Benefits & reciprocity – Eligibility/reciprocity module (SAGA/GolfRSA/DotGolf/Nedbank/Discovery) with agreements + network memberships. Visitor pricing and streams accept
{ tenantId, membershipNumber, providerCode }to apply reciprocity discounts. - Competitions –
TournamentsModule(entries, scoring, draws, posting, exports) shares the main Tee Time DB and integrates with tee sheets for entry sync (seetournaments/index.md). - Background/eventing – Domain outbox, enrichment workers, and pricing/search caches (see
events-and-outbox.md,tee-time-enrichment.md,caching-and-freshness.md).
Core user flows (at a glance)
- Search & pricing –
/courses/:courseId/tee-times/visitor|member,/clubs/tee-sheet/stream, andgetClubPricingroutes use the pricing rules engine, eligibility context (tenantId/membership/provider), and provider adapters. Seepricing-rules-engine.md,multi-club-stream.md,search-engine.md. - Booking – Hold/confirm/cancel/reschedule flows plus tee-sheet enrichment; see
booking-internal.md,tee-time-enrichment.md,providers-booking.md. - Players & relationships – Favorites, preferences, and buddies:
/api/players/me/buddiesnow returns contact details underbuddy.{firstName,lastName,fullName,email,phoneNumber}(aliasesname/surname/phoneremain for compatibility). Seeidentity-mapping.md./api/players/me/favorites,/api/players/me/preferencesfollow the same identity resolution.
- Benefits & eligibility – Search/pricing and streams forward optional
{ tenantId, membershipNumber, providerCode }to apply reciprocity discounts. Eligibility lookups degrade to standard visitor pricing on failure. Seebenefits.mdandassociations.md. - Geo & weather – IP location + forecast endpoints; see
location-services.md. - Competitions – Entries/draws/results, tee-sheet sync, handicap posting, and CSV exports live under
/api/competitions/*; seetournaments.md. - Admin –
/admin/*controllers for tee-sheet maintenance, course setup, pricing visibility, and reporting; seeadmin-portal.md,operations.md.
Integrations
- Provider adapters (GolfNow, Lightspeed, Foreup) via bridge services; see
providers-booking.mdandbridge-mapping.md. - Eligibility/association providers (SAGA/GolfRSA/DotGolf/Nedbank/Discovery) drive reciprocity discounts and handicap posting; see
benefits.mdandassociations.md. - Notifications: buddy invites (WhatsApp/SMS) and domain events; see
events-and-outbox.md. - Competitions: scoring/series/exports + tee-sheet sync and handicap posting; see
tournaments/index.md.
Where to go next
architecture.md– deployment/topology and ingress.configuration.md– environment variables and provider configs.benefits.md/associations.md– eligibility + reciprocity data flows.tournaments/index.md– competitions, posting, tee-sheet sync, exports.security.md– authN/Z, audiences, and request guards.testing.md– unit/integration/e2e guidance.troubleshooting.md– common operational runbooks.