feat: staff and the schedule on v2; managers give staff passwords (platform-v2 step 6.11, KI-014)
- staff: PUT /api/waiters/{id}/password (set, change, or take away; 6+ chars)
so the password sign-in mode works for everyone; PUT /{id}/pin with the PIN in
the body (was in the address: reset-pin?pin= removed); PINs 4-6 digits when
adding; a password can be given when adding; has_password on staff; editing
clears emptied fields and keeps usernames unique; delete only without history
(orders, items, shifts) and never yourself
- schedule: times checked (schedule.bad_time), one person's overlapping shifts
refused (schedule.overlap, past midnight understood), everyone active can be
scheduled (the kitchen too), changes need core.staff.manage
- manager: src/pages/staff (list with search and filters, person dialog with
photo, PIN / password dialog, zones) and src/pages/schedule (by person, by
hour with opening hours, shift dialog with clash check, view settings kept in
the browser); the never-used "automatic start/close" switches dropped; v1
StaffTab and SchedulePage removed; ApprovalsPage loads with useLiveQuery
- tests: test_staff_v2.py (done-when on a paired screen), staff.test.mjs, e2e
manager.mjs (add, password, sign-in on a paired till, a shift and a clash)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -259,8 +259,15 @@ CODES: dict[str, tuple[int, str]] = {
|
||||
"staff.role_invalid": (400, "There is no role {role}."),
|
||||
"staff.avatar_type": (400, "The photo must be a picture file."),
|
||||
"staff.assignment_exists": (400, "That assignment already exists."),
|
||||
"staff.pin_invalid": (422, "A PIN is {min} to {max} digits."),
|
||||
"staff.username_needed": (422, "Every person needs a username."),
|
||||
"staff.password_own": (409, "Change your own password from your profile."),
|
||||
"staff.delete_self": (409, "You can't delete yourself."),
|
||||
"staff.has_history": (409, "{name} has orders or shifts on record, so they can't be deleted. Block them instead: they can't sign in, and the reports keep their name."),
|
||||
"staff.assignment_not_found": (404, "Assignment not found."),
|
||||
"schedule.shift_not_found": (404, "Scheduled shift not found."),
|
||||
"schedule.bad_time": (422, "Times are written like 09:30."),
|
||||
"schedule.overlap": (409, "{name} already has a shift from {start} to {end} that day."),
|
||||
"setup.done": (409, "Setup is already done: a manager account exists."),
|
||||
"shift.already_active": (400, "This person already has a shift going."),
|
||||
"shift.start_needs_manager": (403, "Starting the shift needs a manager's approval."),
|
||||
|
||||
Reference in New Issue
Block a user