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.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
---
|
||||
type: Frontend Module
|
||||
title: Zustand stores
|
||||
description: authStore, attendanceStore, and adminStore — where all app/fetch logic lives, keeping components thin.
|
||||
description: authStore, attendanceStore, adminStore, shiftPlanningStore, adminShiftStore, closureStore, adminPayrollStore — where all app/fetch logic lives, keeping components thin.
|
||||
resource: frontend/src/store
|
||||
tags: [frontend, zustand, state]
|
||||
timestamp: 2026-08-12T00:00:00Z
|
||||
timestamp: 2026-08-16T00:00:00Z
|
||||
---
|
||||
|
||||
# Zustand stores
|
||||
@@ -54,9 +54,31 @@ plus (if an employee is selected) `selectEmployee()` together, so the
|
||||
summary and the detail chart always show the same period. `removeEmployee`
|
||||
calls the soft-delete endpoint — see [employees](/docs/data-model/employees.md).
|
||||
|
||||
# `shiftPlanningStore.ts` / `adminShiftStore.ts`
|
||||
|
||||
Employee and admin sides of shift planning, kept as two separate stores
|
||||
(not one shared with a role flag) since the shapes barely overlap — the
|
||||
employee store tracks `available`/`mine` slot lists for a period, the
|
||||
admin store tracks the full per-period slot list plus create/update/assign
|
||||
actions. Both hold their own `period` ("YYYY-MM") and re-fetch on
|
||||
`prevPeriod`/`nextPeriod`, same pattern as `adminStore`'s `month`.
|
||||
|
||||
# `closureStore.ts` / `adminPayrollStore.ts`
|
||||
|
||||
Employee and admin sides of the month-end/payroll workflow. `closureStore`
|
||||
is small — `{ period, closure, summary }` plus `confirm()`.
|
||||
`adminPayrollStore` owns the per-period overview rows and the
|
||||
`saveAdjustments`/`lock`/`reopen`/`markPaid` actions, each just POSTing and
|
||||
then re-`load()`-ing rather than optimistically patching local state —
|
||||
deliberate, since the server recomputes `base_amount` from live attendance
|
||||
data on several of these calls and the UI should always reflect that, not
|
||||
a stale client guess.
|
||||
|
||||
# Related
|
||||
|
||||
- [attendance_events](/docs/data-model/attendance-events.md) — the state
|
||||
machine and `Session` shape these stores fetch
|
||||
- [shift_slots](/docs/data-model/shift-slots.md), [month_closures](/docs/data-model/month-closures.md), [payroll](/docs/data-model/payroll.md)
|
||||
- [Attendance API](/docs/api/attendance-routes.md)
|
||||
- [Admin API](/docs/api/admin-routes.md)
|
||||
- [Shift planning routes](/docs/api/shifts-routes.md), [Closure routes](/docs/api/closure-routes.md)
|
||||
|
||||
Reference in New Issue
Block a user