Skip to main content

Course Tee Sheet Admin API

These endpoints power the TeeTime admin tee-sheet workspace (daily grid, settings, activity, staff notes, and offline controls).

All routes below are served under the backend’s global prefix (/api), e.g. GET /api/admin/courses/:courseId/tee-sheet/:date.

Auth & permissions

There are two guard styles used across the admin tee-sheet surface:

  • Admin audience guard (RequireAudience('teetime-admin')) for core tee-sheet admin controllers.
  • Club permission guard (ClubPermissionGuard) for course-scoped activity log and staff notes endpoints.

In practice, the admin UI uses a JWT that satisfies both for the relevant operations.

Daily tee sheet grid (admin)

Fetch the tee sheet grid for a course on a date, with DB-backed enrichment when a DB tee sheet exists:

  • GET /api/admin/courses/:courseId/tee-sheet/:date
  • GET /api/admin/courses/:courseId/tee-sheet/:date/stats (alias of the same response)

Response highlights:

  • Tee times with slot rows.
  • DB enrichment includes:
    • player.checkedIn (derived from booking check-in)
    • player.flags (player intelligence flags)
    • slot.hasCart / slot.hasItems (derived from cart and item reservations)

References:

  • apps/teetime/teetime-backend/src/admin/admin-course-tee-sheet.controller.ts
  • apps/teetime/teetime-backend/src/admin/dto/admin-tee-sheet.dto.ts

Settings (intervals, offline, weather thresholds, channels)

Settings are stored and enforced by the tee-sheet core service.

  • GET /api/admin/courses/:courseId/tee-sheet/settings?start=...&end=...
  • PUT /api/admin/courses/:courseId/tee-sheet/settings

The PUT accepts CourseTeeSheetDto and persists:

  • interval config: start, end, intervalMinutes, crossoverBreak
  • offline config: offlineReason
  • weather thresholds: weatherThresholds
  • block notifications: notifyPlayersOnBlocks
  • optional operating config:
    • startTime, endTime, numberOfTees
    • bookingChannels
    • operatingDays

References:

  • apps/teetime/teetime-backend/src/admin/course-tee-sheet-settings-admin.controller.ts
  • libs/tee-time-services/src/lib/dto/course-tee-sheet.dto.ts
  • libs/tee-sheet/tee-sheet-core/src/lib/tee-sheet.service.ts

Create/update/delete course tee sheets

Manage tee-sheet records (course/date/name):

  • POST /api/admin/course-tee-sheets
  • PATCH /api/admin/course-tee-sheets/:id
  • DELETE /api/admin/course-tee-sheets/:id

Reference:

  • apps/teetime/teetime-backend/src/admin/course-tee-sheet-admin.controller.ts

Tee sheet offline toggle (by teeSheetId)

Set offline status for a tee-sheet instance:

  • PATCH /api/admin/tee-sheets/:id/offline

Reference:

  • apps/teetime/teetime-backend/src/admin/tee-sheet-admin.controller.ts

Tee-time activity log (slot + booking history)

Fetch combined audit entries for a tee time (newest-first):

  • GET /api/admin/courses/:courseId/tee-times/:teeTimeId/activity?limit=50

Reference:

  • libs/tee-time-services/src/lib/facade/tee-time-activity.controller.ts

Staff notes (course tee-time notes)

Staff notes are course-scoped and tenant-scoped.

  • GET /api/admin/courses/:courseId/tee-times/:teeTimeId/staff-notes
  • POST /api/admin/courses/:courseId/tee-times/:teeTimeId/staff-notes

Reference:

  • libs/tee-time-services/src/lib/facade/staff-notes.controller.ts