Stage 5: on-call schedule

- Migration 005: schedule_entries table (date TEXT UNIQUE, one person per day)
- POST /api/schedule — assign user to one or more dates in a single
  transaction; any date conflict rejects the whole request (409)
- GET /api/schedule — list all entries ordered by date, optional ?from/?to
- GET /api/schedule/current — today's on-call user (UTC date), 404 if none
- DELETE /api/schedule/{id} — remove an entry (204)
This commit is contained in:
Niklas Ye
2026-05-20 22:28:23 +02:00
parent c3348a410a
commit f8f209dcba
4 changed files with 227 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
package models
import "time"
type ScheduleEntry struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
Username string `json:"username"`
Date string `json:"date"` // YYYY-MM-DD
CreatedAt time.Time `json:"created_at"`
}