Examples

Shift rota

Built with the mantine-schedule skill

Resources
Mon 16
Tue 17
Wed 18
Thu 19
Fri 20
Sat 21
Sun 22
00:00
01:00
02:00
03:00
04:00
05:00
06:00
07:00
08:00
09:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
17:00
18:00
19:00
20:00
21:00
22:00
23:00
00:00
01:00
02:00
03:00
04:00
05:00
06:00
07:00
08:00
09:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
17:00
18:00
19:00
20:00
21:00
22:00
23:00
00:00
01:00
02:00
03:00
04:00
05:00
06:00
07:00
08:00
09:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
17:00
18:00
19:00
20:00
21:00
22:00
23:00
00:00
01:00
02:00
03:00
04:00
05:00
06:00
07:00
08:00
09:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
17:00
18:00
19:00
20:00
21:00
22:00
23:00
00:00
01:00
02:00
03:00
04:00
05:00
06:00
07:00
08:00
09:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
17:00
18:00
19:00
20:00
21:00
22:00
23:00
00:00
01:00
02:00
03:00
04:00
05:00
06:00
07:00
08:00
09:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
17:00
18:00
19:00
20:00
21:00
22:00
23:00
00:00
01:00
02:00
03:00
04:00
05:00
06:00
07:00
08:00
09:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
17:00
18:00
19:00
20:00
21:00
22:00
23:00
Kitchen

Marta Silva

40 / 40 h

Tom Becker

32 / 32 h

Aisha Khan

24 / 32 h

Luis Ortega

24 / 20 h
Bar

Nina Petrova

40 / 40 h

Jonas Weber

32 / 32 h

Chloé Martin

24 / 24 h

Omar Haddad

16 / 16 h
Floor

Sofia Rossi

32 / 40 h

Ben Carter

32 / 32 h

Lena Fischer

24 / 24 h

Yuki Tanaka

16 / 20 h

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.