feat: new buttons to assign to schedule

This commit is contained in:
jfmcarreira committed 2026-10-06 09:24:58 +01:00
1 parent 048e80ddba
commit ec3e9e46fe
7 files changed
+394 -44

No files matched your search

+9 -3
View File
@@ -22,7 +22,7 @@ This distinction is intentional: editing a rotation must not retroactively chang
- Saturdays only.
- Type: `rotation`.
- Has its own ordered member list.
- Uses an anchor date to continue the rotation across month boundaries.
- Continues after the previous assigned person's position in the rotation, including across month boundaries. The anchor date is the fallback when there is no usable previous assignee.
### Sunday Lunch
@@ -34,13 +34,19 @@ The data model supports a schedule matching multiple weekdays even though the se
## Rotation generation
For a rotation schedule, the member is chosen from the ordered active rotation members using the number of matching schedule days from the anchor date to the target date modulo member count.
For a rotation schedule, use the last assigned person on an earlier date in that same schedule as the reference. Choose the next active member after that person's position in the current rotation order, wrapping to the beginning. Unassigned dates are skipped when finding the reference. Manual assignments and completed swaps also supply the reference for later dates. Saturday and Sunday never use each other's assignees.
Inactive members are skipped as recipients, but their position can still supply the reference if they remain in the rotation. When no previous assignee exists, or that person has been removed from the rotation, fall back to the number of matching schedule days from the anchor date modulo the active member count. An empty active rotation leaves the shift unassigned.
Generation and explicit month/range application process dates chronologically, so each newly assigned date supplies the reference for the next date. Regenerating one assignment only recalculates that date; later existing assignments remain unchanged until an administrator explicitly applies the rotation.
Only missing assignments are generated. Existing rows are never rewritten.
An administrator can explicitly **Apply rotation** on a lunch schedule's month page. This recalculates that month's `generated` assignments using the current active rotation members and fills missing dates for that schedule. Manual assignments and completed swaps are preserved. Simply editing the rotation order still does not rewrite any assignment.
An administrator can choose **Use rotation** on a `manual` assignment to remove that override and immediately recalculate that date from the current rotation. Its source becomes `generated`; if there are no active rotation members, it remains unassigned until an administrator applies a configured rotation. These actions preserve assignment IDs and notes. If ownership changes, open or pending-approval change requests for the assignment are cancelled, and assignment-change notifications are attempted after saving.
Every assignment on a lunch schedule page has a **Regenerate** button. An administrator can explicitly regenerate any assignment, including an automatic assignment, manual override, or completed swap. It immediately recalculates that date from the current rotation and its source becomes `generated`; if there are no active rotation members, it becomes unassigned. These actions preserve assignment IDs, notes, and completed request history. If ownership changes, open or pending-approval change requests for the assignment are cancelled, and assignment-change notifications are attempted after saving.
**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.
## People and logins