Rosters and shifts
A shift you create is a draft until a manager publishes it. Changing a published shift makes it a draft again.
A roster is one location's week. Shiftly creates it when the first shift is placed in that week and places every shift into the right one, so you never create a roster yourself; reading a week nobody has rostered yet returns nothing. A manager publishes a roster in Shiftly, which tells staff about their shifts.
A shift is one person, or an open slot, working one position at one location between two instants. Your app creates shifts with roster:write and they arrive as unpublished drafts on the manager's roster. Your app can change or delete any shift that has not started. Changing a published shift makes it, and its roster, unpublished again, so staff hear about the change when a manager republishes. Once a shift has started it is read-only to your app; a change answers shift_started, and the manager makes it in Shiftly.
Breaks are planned from the award when you leave them out, and re-planned when you move a shift's start or end without sending breaks. A shift that would overlap another shift for the same person is refused with conflict and the clashing shift named.
Availability is when people have said they can and cannot work: each record is a rule that may repeat weekly, not a list of days. Open-shift requests are staff asking to work a published shift nobody holds, and shift swaps are staff offering a shift to a colleague. All three are read-only to partner apps; managers decide requests in Shiftly, and a swap's colleague answers it there.
To find someone for a shift, Who can cover a shift lists staff at its location who may work its position and are free: no overlapping shift, no leave and not unavailable.
- Rosters, Shifts, Open-shift requests, Shift swaps and Availability need roster:read; creating and changing shifts needs roster:write.
