Saltar al contenido

shiftSwaps

Módulo Crew · 6 operaciones

List shift swap rows

GET/shift-swaps

A swap request. A crew member cannot approve their own swap. Returns a cursor page of shift swap rows the caller may see. The default order is `created_at` ascending. Supports sparse fieldsets and the filter grammar.

Create a shift swap

POST/shift-swaps

A swap request. A crew member cannot approve their own swap. Creates a shift swap. Requires `Idempotency-Key`; a replay returns the original response. The organization is derived from the credential or the parent row, never from the body.

Get a shift swap

GET/shift-swaps/{id}

A swap request. A crew member cannot approve their own swap. Returns one shift swap with its `ETag`. A shift swap the caller may not see returns 404.

Approve a shift swap

POST/shift-swaps/{id}/approve

Records an approval decision on the shift swap. A crew member cannot approve their own swap. Spend authority and separation of duties are enforced in the approval RPC; a refusal returns 422 and names the rule. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.

Decline a shift swap

POST/shift-swaps/{id}/decline

Declines the swap request. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.

Withdraw a shift swap

POST/shift-swaps/{id}/withdraw

Withdraws the caller's own swap request. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.