Skip to main content

Bridge Mapping (TSheet → Domain)

Maps MCA GetTsheet responses to the internal TeeSheet model.

Source: libs/tee-time-services/src/lib/bridge/tee-sheet-bridge.service.ts

Highlights & edge‑cases

  • Club/course selection
    • Filters by courseCodeFilter when provided; otherwise merges all courses in the club.
  • Time parsing
    • ShortDesc (e.g., 09:10) is parsed relative to the sheetDate.
  • Starting tee
    • From StartingHole when present; falls back to parsing LongDesc (e.g., 1ST TEE).
  • Slots
    • SlotDetail is normalized to an array; produces { slot, available, blocked, reservationNumber, players }.
  • Players
    • Coerces PlayerNumber to string to handle numeric payloads.
    • Minimal player fields are mapped; many fields are optional in the domain model.
  • Metadata
    • intervalMinutes, crossoverBreak, offlineReason extracted from GolfCourseSummary when available.

Error handling

  • Missing club/course codes yield warnings and return null.
  • Per‑course parsing errors are caught and logged; processing continues for other courses.

Output

Returns a TeeSheet with tee‑times sorted ascending by date.