Files
eatme/docs/api/closure-routes.md
Michal Pemcak 94933cac5c Update OKF docs bundle, README, and CLAUDE.md for today's features
Documents the shift planning and closure/payroll modules (new tables,
routes, stores), the dark redesign, and the docker-compose-broken-host
workaround. Adds CLAUDE.md pointing agents at docs/. Translates README to
English and keeps host-specific infrastructure details out of the repo.
2026-08-16 18:41:11 +02:00

1.2 KiB

type, title, description, resource, tags, timestamp
type title description resource tags timestamp
API Endpoint Closure routes (employee) GET /api/closure, POST /api/closure/confirm — the employee's own month-end confirmation. backend/src/routes/closure.ts
api
payroll
2026-08-16T00:00:00Z

Closure routes (employee)

Mounted at /api/closure. Every route requires requireAuth + requireEmployee.

Examples

GET /api/closure?period=YYYY-MM
200 -> { "closure": MonthClosure, "summary": ClosureSummary }

Lazily creates the closure row (waiting_employee) the first time this period is opened. summary (worked_minutes, shift_count, earned_estimate) is always computed live from attendance_events — never stored on the closure row itself.

POST /api/closure/confirm
Body: { "period": "YYYY-MM" }
200 -> { "ok": true }
400 -> "V tomto měsíci máš stále otevřenou směnu." (open shift blocks it)
     | "Docházka je už uzamčena." (already locked)

Related