feat: add method to reset assignments

This commit is contained in:
jfmcarreira committed 2026-10-06 17:48:14 +01:00
1 parent 1d82097af1
commit 0ef61b3231
6 files changed
+530 -4

No files matched your search

+3
View File
@@ -32,6 +32,7 @@ Every start copies the SQLite file aside before anything else runs, using SQLite
- Generation fills a missing assignment with the person configured for that day of the month. Days 29 to 31 only apply to months that have them.
- There is no per-month configuration for Night: the same pattern is used every month.
- Existing assignments are never rewritten by a pattern change; they keep the person they already had.
- An administrator can explicitly **Apply pattern from** a chosen month and year on `/admin/schedules/<night id>`. It rewrites every existing `generated` night from the first day of that month onwards, in that month and every later one, to match the current pattern. It is the explicit way to push a corrected pattern onto shifts that already have a person. Assignment IDs, notes and completed request history are kept, `manual` assignments and completed swaps are preserved, days with nobody in the pattern are left as they are, and no assignment is ever created. Open and pending change requests on a rewritten shift are cancelled and the new and previous people are notified.
### Saturday Lunch (`Almoço - Sábados`)
@@ -64,6 +65,8 @@ Every assignment on a lunch schedule page has a **Regenerate** button. An admini
**Generate after date** fills missing shifts and recalculates automatic assignments in that schedule strictly after the selected reference date, through an explicit end date (inclusive). The range can span multiple months. Assignments on or before the reference date and after the end date are not edited. Manual assignments and completed swaps within the range are preserved and supply references for later dates. The default range covers the displayed month.
**Clear month and following** empties the `generated` shifts of a lunch schedule from the first day of a chosen month and year onwards, in that month and every later one, so they read as unassigned. No shift is deleted: rows keep their IDs, notes, source and completed request history, and stay `generated`, so **Apply rotation** or **Generate after date** fills them again. Manual assignments and completed swaps are never emptied. Open and pending change requests on an emptied shift are cancelled and the previous person is notified. Use it to force a recalculation from a known point instead of relying on the shifts that already exist.
## People and logins
- `email` and `phone` are optional.