feat: swap improvements
This commit is contained in:
1 parent
c3d4a325a0
commit
0dac4b24bc
15 files changed
+1484
-139
No files matched your search
+14
-6
@@ -68,16 +68,24 @@ Every assignment on a lunch schedule page has a **Regenerate** button. An admini
|
||||
|
||||
`open` → `pending_approval` → `approved`
|
||||
|
||||
Other terminal states: `rejected`, `cancelled`.
|
||||
Other terminal states: `rejected`, `cancelled`, `reverted`.
|
||||
|
||||
- A member can offer one of their future/current assignments to a specific active member or to anyone.
|
||||
- A swap is always **one shift for one shift**: it is created on `/swaps/new` (its own page, so the rota keeps showing only who works each day) and names both shifts. The person giving the first shift is the requester; the person owning the second one is the target. There are no open offers.
|
||||
- The two shifts must belong to the same schedule. The people of a schedule are the ones in its rotation, in its monthly pattern, or already holding one of its shifts.
|
||||
- When a swap is approved or accepted, **both** assignments change hands at once: the target takes the requester's shift and the requester takes the target's shift. Both become `swap` and both people are notified.
|
||||
- One person can work several days in a month, so each side of the exchange is chosen from a list of the month's future shifts, grouped by schedule: the requester picks "O turno que passo" (their own shifts) and "O turno que quero em troca" (someone else's shifts of that schedule). A member only sees their own shifts on the first list; an administrator sees all of them.
|
||||
- A shift can only be part of one open request at a time, on either side.
|
||||
- An administrator can open a request for someone else's shift. The request is still recorded against the person who owns the shift, so the ownership rule below keeps working; unassigned and past shifts cannot be requested.
|
||||
- `/admin/assign` is the day-by-day picker for administrators: pick a day, then put someone on one of its shifts with **Atribuir**. This is a direct assignment, never a change request. It sets the assignment source to `manual`, cancels any open request that involves that shift, and notifies both the new and the previous person. `Sem atribuição` clears it. The date must match one of the schedule's weekdays.
|
||||
- The requester cannot accept their own request.
|
||||
- A targeted request can only be accepted/rejected by that target.
|
||||
- An open request can be accepted by any other active member who can sign in.
|
||||
- Only the person the request names can accept it or decline it.
|
||||
- If the schedule requires manager approval, acceptance moves to `pending_approval`.
|
||||
- Nobody can decline their own request; the requester cancels it instead. An administrator may decline any `open` or `pending_approval` request.
|
||||
- An administrator can approve a `pending_approval` request (it goes to whoever accepted it) or an `open` one, choosing another person of the same schedule when there is no named partner. Approval and decline are available both in `/swaps` and on the rota page next to the shift.
|
||||
- Approval transfers the assignment and sets its source to `swap`.
|
||||
- If the requester no longer owns the assignment, the request must not be applied.
|
||||
- On a schedule's configuration page, an administrator can complete an `open` or `pending_approval` request on someone's behalf by choosing any other active member. This is the only way a rota-only person gives up or receives a shift. The same ownership rule applies, other open requests for that assignment are cancelled, and the requester and the new person are both notified. Past dates are refused.
|
||||
- Only an administrator can revert an approved two-sided swap: both shifts go back to the people who had them, their source becomes `manual` (the original source cannot be recovered) and a note records the revert. If either shift changed after the swap, the revert is refused and the day-by-day assignment must be used instead.
|
||||
- If either person no longer owns their own shift, the request must not be applied and is cancelled.
|
||||
- On a schedule's configuration page, an administrator can complete an `open` or `pending_approval` request on someone's behalf by choosing another person who works that same schedule. This is the only way a rota-only person gives up or receives a shift. The same ownership rule applies, other open requests for that assignment are cancelled, and the requester and the new person are both notified. Past dates are refused.
|
||||
|
||||
## Notifications
|
||||
|
||||
|
||||
Reference in new issue
Block a user