Examples
Shift rota
Built with the mantine-schedule skill
Build the shift rota of a café chain: a manager plans who works when for the coming weeks.
Data:
- 12 hard-coded employees in 3 teams (kitchen, bar, floor), each with a contract of a number of hours per week
- 3 shift templates: morning 6:00–14:00, evening 14:00–22:00, night 22:00–6:00
- vacations: a few employees have hard-coded vacation days in the current and next weeks, generated relative to today
- about 40 shifts already planned in the current week
Rota:
- employees are rows grouped by team, with a week view and a month view; the week view starts on Monday
- the shift templates are listed in a panel next to the rota and are dragged onto an employee's day to create a shift of that template; a shift can also be dragged to another day or another employee
- vacation days are shown on the employee's row and nothing can be dropped on them
- an employee cannot have two shifts that overlap, and needs 11 hours of rest between the end of one shift and the start of the next; a drop that breaks a rule is rejected and the reason is shown in a notification
- each employee row shows the planned hours of the visible week next to the contract hours ("32 / 40 h"), with a warning when the planned hours go over the contract
- clicking a shift opens a small form to change its template, add a note or delete it
Value:
- "Publish rota" shows a short notification and displays the shifts of the visible week grouped by employee as JSON under the rota
The component is shown on a demo page that already has a title: do not add a page title or intro text.
Write tests for the component.