Aller au contenu principal

Staff

Base path: /api/staff

info

Note: the full path is /api/staff/staff for the staff list, due to the route structure.

GET /staff/staff

Get all staff members.

Auth: Logged in

Response:

[
{ "id": 1, "name": "Admin", "email": "admin@salon.nl", "role": "admin" },
{ "id": 2, "name": "Lisa", "email": "lisa@salon.nl", "role": "staff" }
]

POST /staff/staff

Create a new staff member.

Auth: Admin

FieldTypeRequiredDefault
namestringYes
emailstringYes
passwordstring (min 8)Yes
rolestringNostaff

Errors: 409 — Email already in use


PUT /staff/staff/:id

Update a staff member.

Auth: Admin


DELETE /staff/staff/:id

Delete a staff member.

Auth: Admin


Shifts (Schedule)

GET /staff/shifts

Get the shift records for all staff members.

POST /staff/shifts

Create a new shift entry.

PUT /staff/shifts/:id

Update a shift entry.

DELETE /staff/shifts/:id

Delete a shift entry.

GET /staff/default-shifts

Get the default (template) shifts per staff member.

POST /staff/default-shifts/save-week

Save a full week of shifts as defaults for a staff member.

POST /staff/default-shifts/apply

Apply saved default shifts to a specific date range.

DELETE /staff/default-shifts/:staffId

Remove all default shifts for a staff member.


Time Off

GET /staff/time-off

Get time-off entries.

POST /staff/time-off

Create a time-off entry.

FieldTypeRequired
staff_idintegerYes
start_datedateYes
end_datedateYes
reasonstringNo

DELETE /staff/time-off/:id

Delete a time-off entry.