Skip to main content

Alerts

TeeTime “alerts” are operator- or system-generated notifications that surface time-sensitive conditions to staff and/or players. In practice, TeeTime uses:

  • Real-time tee-sheet events over WebSocket (starter/admin dashboards).
  • Messaging templates (WhatsApp-first, plus push/in-app/SMS/email fallbacks) for player/staff notifications.

This page documents the alert families that exist today and where they’re emitted.

Pace alerts

When a group falls behind pace, TeeTime can emit:

  • WebSocket event: pace.alert
  • Messaging templates: tee.pace.alert (critical) and tee.pace.warning (warning)

The emitter is PaceAlertService, which is called when pace/check-in updates are processed.

Config:

  • PACE_ALERTS_ENABLED=true enables pace alerts.
  • PACE_WARNING_THRESHOLD_MINUTES (default 10)
  • PACE_CRITICAL_THRESHOLD_MINUTES (default 20)
  • PACE_FCM_ENABLED=true enables messaging delivery for pace alerts.

References:

  • libs/tee-time-services/src/lib/gateway/pace-alert.service.ts
  • libs/tee-time-services/src/lib/gateway/tee-sheet.gateway.ts
  • libs/tee-time-services/src/lib/messaging/teetime-messaging.types.ts

Weather alerts

Weather monitoring is a scheduled sweep that evaluates configured thresholds for courses and can:

  • Send player notifications using the tee.weather.alert template.
  • Optionally reconcile course status using CourseStatusService.evaluateForCourseDate(...).

Config:

  • WEATHER_ALERT_CRON (default 15 * * * *)
  • WEATHER_ALERT_CRON_TZ (default Africa/Johannesburg)
  • WEATHER_ALERT_LOOKAHEAD_HOURS (default 6)
  • WEATHER_ALERT_COOLDOWN_MINUTES (default 180)

Notes:

  • Delivery requires the messaging service + a resolver that can list monitored courses and resolve affected bookings.
  • If either is missing, the scheduler logs and no-ops (safe by default).

References:

  • libs/tee-time-services/src/lib/messaging/weather-alert-scheduler.service.ts
  • libs/tee-time-services/src/lib/messaging/weather-notification.service.ts
  • libs/tee-time-services/src/lib/messaging/weather-monitoring.port.ts
  • libs/tee-time-services/src/lib/messaging/teetime-messaging.types.ts

Waitlist notifications

Waitlist flows emit both real-time events (for admin dashboards) and player messaging templates:

  • Templates:
    • tee.waitlist.slot_available
    • tee.waitlist.offer_expired
    • tee.waitlist.confirmed
  • WebSocket events (non-exhaustive):
    • waitlist.joined, waitlist.left
    • waitlist.offer-created, waitlist.offer-accepted, waitlist.offer-declined, waitlist.offer-expired

References:

  • libs/tee-time-services/src/lib/gateway/tee-sheet.gateway.ts
  • libs/tee-time-services/src/lib/messaging/teetime-messaging.types.ts

Direct/bulk notices

The tee-time messaging adapter supports:

  • tee.player.message (direct)
  • tee.bulk.notice (bulk)

Channel priority is WhatsApp-first by default (TEETIME_CHANNEL_PRIORITY), and delivery is bridged into the messaging service via TeeTimeMessageQueueAdapter.

References:

  • libs/tee-time-services/src/lib/messaging/teetime-messaging.types.ts
  • libs/tee-time-services/src/lib/messaging/teetime-message-queue.adapter.ts