Tee Time Events Worker
Last updated: 2025-09-30
Background NestJS worker that consumes Tee Time events from BullMQ and performs domain actions (booking confirmations, reminders). A minimal HTTP server exposes health, metrics, and Swagger docs.
- App:
apps/teetime/events-worker - Queue:
tee-time-events(seeTEE_TIME_QUEUEin@digiwedge/tee-time-servicesor override viaOUTBOX_EVENT_QUEUE) - Swagger:
/api/docs
Jobs
Supported job names (exported as TeeTimeEvents):
teetime.booking.confirmed- Default provider:
tee-time(internal DB). Payload:{
"tenantId": 1,
"slotId": 12345,
"contactName": "Jane Golfer",
"contactEmail": "jane@example.com",
"contactPhone": "+27111222333",
"externalRef": "WEB-ABC123"
}
- Default provider:
teetime.booking.reminder- Payload:
{ "clubId": number }
- Payload:
HTTP endpoints
GET /api– basic livenessGET /api/metrics– Prometheus expositionGET /api/health– Redis + queue status and app infoGET /api/docs– Swagger UI
Configuration
Required
REDIS_HOST,REDIS_PORT(and optionalREDIS_PASSWORD)TEETIME_DATABASE_URL– PostgreSQL URL for tee‑sheet data
Optional
CACHE_NAMESPACE– cache key prefix (defaultdefault)MCA_SA_LIVE_V1_URL– SQL Server URL (legacy MCA writes only)OUTBOX_EVENT_QUEUE– overrides the default queue name (tee-time-events)OPENMETEO_BASE_URL,OPENMETEO_APIKEY– only used if weather/geocoding is invokedPORT– HTTP port (default3003in container)
DLQ
Failed jobs (after max retries) are copied to tee-time-events:dlq. Use Nx
targets to list, requeue, or purge (see project project.json).
Notes
- The worker uses
TeeTimeServicesModule. The module wires a no‑op outbox by default. Provide a customEVENT_BUS/repository to publish domain events to a broker if required.