Shift Management
Define shift schedules, log shift activities, generate handover reports, and compare shift performance.
Shift definitions
List definitions
GET /shifts/definitions
Auth: Bearer JWT (any role)
| Parameter | Type | Default |
|---|---|---|
active_only | boolean | true |
Create a definition
POST /shifts/definitions
Auth: Bearer JWT (admin)
{
"name": "Morning Shift",
"start_time": "06:00",
"end_time": "14:00",
"color": "#3B82F6",
"is_active": true
}
Update / Delete
PUT /shifts/definitions/{id} | DELETE /shifts/definitions/{id}
Shift logs
List logs
GET /shifts/logs
| Parameter | Type | Description |
|---|---|---|
machine_id | uuid | Filter by machine |
from_date | date | Start date |
to_date | date | End date |
status | string | active, completed, cancelled |
Create a log
POST /shifts/logs
Auth: Bearer JWT (admin, operator)
Update / Delete a log
PATCH /shifts/logs/{id} | DELETE /shifts/logs/{id}
Handover reports
GET /shifts/logs/{log_id}/handover
Auth: Bearer JWT (any role)
Generates a handover report with context from the last 24 hours, including alerts, downtime events, and maintenance activities.
Shift comparison
GET /shifts/comparison
Compare performance metrics (OEE, downtime, output) across shifts.
Active shifts
GET /shifts/active
Returns all currently active shift logs.