Skip to main content

API Surface

The Facilities Service exposes both REST and GraphQL APIs for managing facility resources.

Base URLs

EnvironmentURL
Productionhttps://facilities-api.digiwedge.com/api
UAThttps://facilities-api.uat.digiwedge.com/api
Localhttp://localhost:3106/api

Authentication

All endpoints require JWT authentication:

curl -H "Authorization: Bearer <token>" \
https://facilities-api.uat.digiwedge.com/api/facility-resources?tenantId=1

REST Endpoints

Facility Resources

MethodEndpointDescription
GET/facility-resourcesList resources (paginated, filtered)
GET/facility-resources/:idGet single resource
POST/facility-resourcesCreate resource
PUT/facility-resources/:idUpdate resource
DELETE/facility-resources/:idSoft delete resource

Maintenance Logs

MethodEndpointDescription
GET/maintenance-logsList maintenance logs
GET/maintenance-logs/:idGet single log
POST/maintenance-logsCreate log
PUT/maintenance-logs/:idUpdate log
DELETE/maintenance-logs/:idDelete log

Resource Usage

MethodEndpointDescription
GET/resource-usageList usage records
GET/resource-usage/:idGet single record
POST/resource-usageCreate usage record
PUT/resource-usage/:idUpdate record
DELETE/resource-usage/:idDelete record

Facility Reservations

MethodEndpointDescription
GET/facility-reservationsList reservations
GET/facility-reservations/:idGet reservation by ID
POST/facility-reservationsCreate reservation
POST/facility-reservations/:id/rescheduleReschedule reservation
POST/facility-reservations/:id/cancelCancel reservation
POST/facility-reservations/:id/no-showMark reservation no-show

Reservation Series

MethodEndpointDescription
GET/facility-reservations/seriesList reservation series
GET/facility-reservations/series/:idGet series by ID
POST/facility-reservations/seriesCreate series
PUT/facility-reservations/series/:idUpdate series
POST/facility-reservations/series/:id/cancelCancel series
POST/facility-reservations/series/:id/pausePause series
POST/facility-reservations/series/:id/resumeResume series

Availability

MethodEndpointDescription
POST/facility-resources/availabilityCheck availability for time window

Query Parameters

Common Parameters

ParameterTypeRequiredDescription
tenantIdnumberYesTenant scope
clubIdnumberNoClub scope

Pagination & Filtering

ParameterTypeDefaultDescription
skipnumber0Offset for pagination
takenumber25Limit (max 100)
typeResourceType-Filter by resource type
searchstring-Case-insensitive name search
includeInactivebooleanfalseInclude soft-deleted records

Example Requests

List Resources

GET /facility-resources?tenantId=1&type=DRIVING_RANGE&take=10

Response:

[
{
"id": 1,
"tenantId": 1,
"clubId": 10,
"name": "Range A",
"type": "DRIVING_RANGE",
"active": true,
"maintenanceRequired": false
}
]

Create Maintenance Log

POST /maintenance-logs?tenantId=1&clubId=10
Content-Type: application/json

{
"resourceId": 1,
"maintenanceType": "GREENS",
"description": "Aeration and top dressing",
"startTime": "2025-01-02T06:00:00Z",
"endTime": "2025-01-02T14:00:00Z"
}

Check Availability

POST /facility-resources/availability
Content-Type: application/json

{
"tenantId": 1,
"clubId": 10,
"type": "SIMULATOR",
"start": "2025-01-02T10:00:00Z",
"end": "2025-01-02T12:00:00Z"
}

Response:

[
{
"resourceId": 5,
"name": "Simulator Bay 1",
"type": "SIMULATOR",
"available": true
},
{
"resourceId": 6,
"name": "Simulator Bay 2",
"type": "SIMULATOR",
"available": true
}
]

Error Responses

StatusDescription
400Bad Request - Invalid parameters
401Unauthorized - Missing or invalid JWT
404Not Found - Resource doesn't exist in scope
500Internal Server Error
{
"statusCode": 404,
"message": "Facility resource not found for tenant/club scope",
"error": "Not Found"
}