Golf Cart API Surface
REST
| Endpoint | Description |
|---|---|
GET /golf-carts | List carts (filters: tenantId, clubId, condition, cartType, lowBattery, skip, take) |
GET /golf-carts/:id | Get cart by id (scope by tenantId) |
POST /golf-carts | Create cart (creates facility resource + cart details) |
PUT /golf-carts/:id | Update cart metadata (scope by tenantId) |
DELETE /golf-carts/:id | Soft-delete resource + delete cart (rejects active assignment) |
PUT /golf-carts/:id/battery | Update battery (0-100 validation) |
PUT /golf-carts/:id/location | Update GPS + zone |
PUT /golf-carts/:id/condition | Update condition/damage notes |
GET /golf-carts/:id/assignments | Assignment history |
POST /golf-carts/:id/assign | Assign to booking/player |
POST /golf-carts/assignments/:id/return | Return cart, update meters |
GET /golf-carts/available | Available carts (type/capacity filters) |
POST /golf-carts/auto-assign | Auto-assign best available cart |
GET /golf-carts/:id/incidents | Incident history (optional unresolved filter) |
POST /golf-carts/:id/incidents | Report incident |
PUT /golf-carts/incidents/:id/resolve | Resolve incident |
GET /golf-carts/fleet/summary | Fleet summary (counts, avg battery, maintenance/incident counts) |
GET /golf-carts/analytics/utilization | Utilization report (windowed) |
GET /golf-carts/zones | Carts by zone |
GET /golf-carts/zones/summary | Zone counts + in-use/available |
GET /golf-carts/maintenance/predictive | Predictive maintenance candidates |
GET /golf-carts/service-history | (via /golf-carts/:id/service-history) history by cart |
POST /golf-carts/:id/schedule-maintenance | Schedule maintenance |
POST /golf-carts/:id/mark-serviced | Mark serviced + reset flags |
GraphQL (highlights)
- Queries:
golfCarts(filters: GolfCartFilterInput!)golfCart(id: Int!, tenantId: Int!)availableCarts(...)fleetSummary(tenantId: Int!, clubId: Int)utilizationReport(input: UtilizationRequestInput!)cartsByZone(input: ZoneQueryInput!)zoneSummary(tenantId: Int!, clubId: Int)predictiveMaintenance(input: PredictiveMaintenanceInput!)
- Mutations:
createGolfCart,updateGolfCart,updateGolfCartBattery,updateGolfCartLocation,updateGolfCartCondition,removeGolfCartassignCart,returnCart,autoAssignCartreportCartIncident,resolveCartIncidentscheduleCartMaintenance,markServiced
See libs/facilities/facilities-service/src/lib/golf-cart.* for DTOs and resolver wiring.