@composable-os/pack-rostering 0.0.0-stage → 0.1.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +109 -0
- package/dist/blocks/rostering-away/away-list.d.ts +8 -0
- package/dist/blocks/rostering-away/away-list.js +101 -0
- package/dist/blocks/rostering-checklist/checklist.d.ts +9 -0
- package/dist/blocks/rostering-checklist/checklist.js +132 -0
- package/dist/blocks/rostering-checklist/my-shifts-with-checklist.d.ts +11 -0
- package/dist/blocks/rostering-checklist/my-shifts-with-checklist.js +6 -0
- package/dist/blocks/rostering-checklists/checklists.d.ts +11 -0
- package/dist/blocks/rostering-checklists/checklists.js +76 -0
- package/dist/blocks/rostering-my-availability/my-availability.d.ts +7 -0
- package/dist/blocks/rostering-my-availability/my-availability.js +143 -0
- package/dist/blocks/rostering-my-calendar/my-calendar.d.ts +6 -0
- package/dist/blocks/rostering-my-calendar/my-calendar.js +92 -0
- package/dist/blocks/rostering-my-shifts/my-hours.d.ts +6 -0
- package/dist/blocks/rostering-my-shifts/my-hours.js +63 -0
- package/dist/blocks/rostering-my-shifts/my-shifts.d.ts +17 -0
- package/dist/blocks/rostering-my-shifts/my-shifts.js +53 -0
- package/dist/blocks/rostering-native-checklist/checklist-screen.d.ts +8 -0
- package/dist/blocks/rostering-native-checklist/checklist-screen.js +110 -0
- package/dist/blocks/rostering-native-my-availability/my-availability-screen.d.ts +7 -0
- package/dist/blocks/rostering-native-my-availability/my-availability-screen.js +110 -0
- package/dist/blocks/rostering-native-my-calendar/my-calendar-screen.d.ts +10 -0
- package/dist/blocks/rostering-native-my-calendar/my-calendar-screen.js +72 -0
- package/dist/blocks/rostering-native-my-shifts/my-hours-screen.d.ts +6 -0
- package/dist/blocks/rostering-native-my-shifts/my-hours-screen.js +60 -0
- package/dist/blocks/rostering-native-my-shifts/my-shifts-screen.d.ts +12 -0
- package/dist/blocks/rostering-native-my-shifts/my-shifts-screen.js +56 -0
- package/dist/blocks/rostering-native-offers/offers-screen.d.ts +7 -0
- package/dist/blocks/rostering-native-offers/offers-screen.js +56 -0
- package/dist/blocks/rostering-native-roster/roster-screen.d.ts +7 -0
- package/dist/blocks/rostering-native-roster/roster-screen.js +31 -0
- package/dist/blocks/rostering-offers/offers.d.ts +7 -0
- package/dist/blocks/rostering-offers/offers.js +52 -0
- package/dist/blocks/rostering-patterns/patterns.d.ts +7 -0
- package/dist/blocks/rostering-patterns/patterns.js +58 -0
- package/dist/blocks/rostering-pay/pay.d.ts +7 -0
- package/dist/blocks/rostering-pay/pay.js +160 -0
- package/dist/blocks/rostering-qualifications/qualifications.d.ts +6 -0
- package/dist/blocks/rostering-qualifications/qualifications.js +48 -0
- package/dist/blocks/rostering-week/assign.d.ts +12 -0
- package/dist/blocks/rostering-week/assign.js +99 -0
- package/dist/blocks/rostering-week/week.d.ts +13 -0
- package/dist/blocks/rostering-week/week.js +82 -0
- package/dist/client/index.d.ts +3113 -0
- package/dist/client/index.js +654 -0
- package/dist/index.d.ts +1594 -0
- package/dist/index.js +541 -0
- package/dist/tools.d.ts +1094 -0
- package/dist/tools.js +1047 -0
- package/package.json +36 -4
- package/README.md +0 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
// Rostering (stage 45 step 4, ADR 0626): who works when. Duties that are not classes (cleaning,
|
|
2
|
+
// opening up), the weekly pattern of each (a duty series and its regular person), the dated duty
|
|
3
|
+
// shifts the host makes from it, and the roster's tools over every shift on the host: Bookings'
|
|
4
|
+
// classes too, when it is installed, through the host's own read. It requires nothing: a business
|
|
5
|
+
// with shifts and no classes uses it alone, and a cleaner is not a coach.
|
|
6
|
+
//
|
|
7
|
+
// Everything that is a rule is the host's, declared here (ADR 0404):
|
|
8
|
+
// - a duty series makes its shifts ahead in local time across clock changes (`recurring`, ADR
|
|
9
|
+
// 0500), as far ahead as the duty horizon setting says (8 weeks by default, decision 17); a
|
|
10
|
+
// person or time changed by hand on one date stays that date's own (ADR 0620);
|
|
11
|
+
// - a duty shift is its person's shift (`staffed`, ADR 0621): one staff account is never on two
|
|
12
|
+
// overlapping shifts, classes and duties alike, refused by the database for every writer, and
|
|
13
|
+
// each write answers its warnings (away, not qualified for the duty, nobody on it);
|
|
14
|
+
// - offers, takes, the cut-off, unavailability, qualifications, the notices and who may roster
|
|
15
|
+
// are the host's (ADRs 0622 to 0625), read from this pack's settings (`staffing`);
|
|
16
|
+
// - who is on a duty shift, and a duty series' regular person, are a person's to change
|
|
17
|
+
// (`personApproves`): an assistant's change waits for a person.
|
|
18
|
+
// The tools in tools.ts compose the host's tool-only `staffing.*` operations (and `checklist.*`
|
|
19
|
+
// for a duty shift's checklist) and add no rules.
|
|
20
|
+
//
|
|
21
|
+
// Who may do what (the permissions are the pack's, ADRs 0600 and 0625):
|
|
22
|
+
// - `rostering:team`: the team role's (a cleaner with no other access): the roster, their own
|
|
23
|
+
// shifts, offers and takes, their unavailability, their calendar feed;
|
|
24
|
+
// - `rostering:roster`: the same tools, grantable, for an account with another role (a coach's
|
|
25
|
+
// `bookings.coach`); ordinary staff hold the tools anyway;
|
|
26
|
+
// - `rostering:manage`: restricted, held by admins and by grant only (decision 16, nobody at
|
|
27
|
+
// first): put people on shifts, qualifications, others' unavailability, the uncovered shifts,
|
|
28
|
+
// marking a shift not worked. Its holders are the rosterers the host tells and lets roster
|
|
29
|
+
// (`staffing.rosters`);
|
|
30
|
+
// - `rostering:pay` (step 6, ADR 0627): restricted, held by admins and by grant only: who is
|
|
31
|
+
// counted for pay, the pay periods' totals, lock, reopen and export. Every pay tool is a
|
|
32
|
+
// person's only (`humanOnly`): an assistant never reads or changes pay, whatever is granted.
|
|
33
|
+
// The host holds no rates and no money: hours and counts, which payroll applies rates to.
|
|
34
|
+
// - every rostered person's own totals for a pay period (`myPayPeriods`, `myPay`, the team's;
|
|
35
|
+
// the owner's decision of 2026-11-24): their own hours and shifts only, a person's own read
|
|
36
|
+
// (`humanOnly`), worked out exactly as the pay totals are; nothing about anyone else.
|
|
37
|
+
// - every rostered person's own private calendar feed (step 5, ADR 0628): `feed`, `feedRotate`
|
|
38
|
+
// and `feedRevoke`, the team's, a person's own acts; the host serves the feed and keeps only
|
|
39
|
+
// its token's hash.
|
|
40
|
+
// The screens (step 7, ADR 0629) are this pack's blocks (blocks/) over its headless entry
|
|
41
|
+
// (client/): they show what the tools answer and decide nothing.
|
|
42
|
+
//
|
|
43
|
+
// A duty may carry a checklist (step 4b, ADR 0650): a template the business writes in Settings →
|
|
44
|
+
// Checklists, picked on the duty (`checklist`, a person's to change). Each of its shifts gets a run
|
|
45
|
+
// of it, made by the host, which the shift's person ticks off (`checklist`, `tick`,
|
|
46
|
+
// `checklistDone`), and whoever rosters reads how they went (`checklistRuns`) and adds corrections
|
|
47
|
+
// (`checklistCorrect`). Who ticks, the window, a done run never changing, and who reads a run are
|
|
48
|
+
// the host's (the `checklists` declaration below); every checklist tool is a person's own.
|
|
49
|
+
import { defineExtension } from "@composable-os/sdk";
|
|
50
|
+
import { assign, away, awayFor, awayList, back, candidates, check, checklist, checklistCorrect, checklistDone, checklistRuns, exportPeriod, feed, feedRevoke, feedRotate, follow, lock, markNotWorked, me, mine, myAway, myPay, myPayPeriods, offer, offers, patterns, payBases, payBasis, people, periods, periodTotals, planCheck, qualifications, qualify, reopen, setPattern, take, tick, uncovered, week, withdraw, } from "./tools.js";
|
|
51
|
+
const WEEKDAYS = [
|
|
52
|
+
{ value: "mon", label: "Monday" },
|
|
53
|
+
{ value: "tue", label: "Tuesday" },
|
|
54
|
+
{ value: "wed", label: "Wednesday" },
|
|
55
|
+
{ value: "thu", label: "Thursday" },
|
|
56
|
+
{ value: "fri", label: "Friday" },
|
|
57
|
+
{ value: "sat", label: "Saturday" },
|
|
58
|
+
{ value: "sun", label: "Sunday" },
|
|
59
|
+
];
|
|
60
|
+
const COLOURS = ["slate", "red", "orange", "amber", "green", "teal", "blue", "violet", "pink"].map((value) => ({ value, label: value[0]?.toUpperCase() + value.slice(1) }));
|
|
61
|
+
export default defineExtension({
|
|
62
|
+
id: "rostering",
|
|
63
|
+
version: "0.1.0",
|
|
64
|
+
contractVersion: 1,
|
|
65
|
+
label: "Rostering",
|
|
66
|
+
description: "Who works when: duties that are not classes, their weekly pattern and dated shifts, and the " +
|
|
67
|
+
"roster of every shift, with offers, takes and time off.",
|
|
68
|
+
permissions: {
|
|
69
|
+
operations: [
|
|
70
|
+
"staffing.week",
|
|
71
|
+
"staffing.check",
|
|
72
|
+
"staffing.assign",
|
|
73
|
+
"staffing.offer",
|
|
74
|
+
"staffing.withdraw",
|
|
75
|
+
"staffing.take",
|
|
76
|
+
"staffing.offers",
|
|
77
|
+
"staffing.away",
|
|
78
|
+
"staffing.back",
|
|
79
|
+
"staffing.awayList",
|
|
80
|
+
"staffing.qualify",
|
|
81
|
+
"staffing.qualifications",
|
|
82
|
+
"staffing.uncovered",
|
|
83
|
+
"staffing.markNotWorked",
|
|
84
|
+
"staffing.payBasis",
|
|
85
|
+
"staffing.payBases",
|
|
86
|
+
"staffing.payPeriod.list",
|
|
87
|
+
"staffing.payPeriod.totals",
|
|
88
|
+
"staffing.payPeriod.lock",
|
|
89
|
+
"staffing.payPeriod.reopen",
|
|
90
|
+
"staffing.payPeriod.export",
|
|
91
|
+
"staffing.myPay.periods",
|
|
92
|
+
"staffing.myPay",
|
|
93
|
+
"staffing.me",
|
|
94
|
+
"staffing.candidates",
|
|
95
|
+
"staffing.people",
|
|
96
|
+
"staffing.patterns",
|
|
97
|
+
"staffing.setPattern",
|
|
98
|
+
"staffing.follow",
|
|
99
|
+
"staffing.planCheck",
|
|
100
|
+
"staffing.feed.status",
|
|
101
|
+
"staffing.feed.rotate",
|
|
102
|
+
"staffing.feed.revoke",
|
|
103
|
+
"checklist.forRecord",
|
|
104
|
+
"checklist.tick",
|
|
105
|
+
"checklist.complete",
|
|
106
|
+
"checklist.runs",
|
|
107
|
+
"checklist.correct",
|
|
108
|
+
],
|
|
109
|
+
modules: ["ops"],
|
|
110
|
+
},
|
|
111
|
+
objects: {
|
|
112
|
+
duty: {
|
|
113
|
+
label: "Duty",
|
|
114
|
+
plural: "Duties",
|
|
115
|
+
icon: "clipboard-list",
|
|
116
|
+
titleField: "name",
|
|
117
|
+
description: "A kind of work that is not a class: cleaning, opening up. Its shifts are made by duty " +
|
|
118
|
+
"series; who may do it is a qualification.",
|
|
119
|
+
navigation: "settings",
|
|
120
|
+
fields: {
|
|
121
|
+
name: { type: "text", label: "Name", required: true },
|
|
122
|
+
colour: { type: "select", label: "Colour", options: COLOURS },
|
|
123
|
+
lengthMinutes: {
|
|
124
|
+
type: "number",
|
|
125
|
+
label: "Usual length (minutes)",
|
|
126
|
+
min: 5,
|
|
127
|
+
max: 1440,
|
|
128
|
+
step: 1,
|
|
129
|
+
default: 60,
|
|
130
|
+
},
|
|
131
|
+
place: { type: "text", label: "Where" },
|
|
132
|
+
instructions: { type: "longText", label: "What to do" },
|
|
133
|
+
// A checklist its shifts' people tick off (step 4b, ADR 0650): what staff are asked to
|
|
134
|
+
// do, so a person's to change (an assistant's change waits for a person).
|
|
135
|
+
checklist: {
|
|
136
|
+
type: "checklist",
|
|
137
|
+
label: "Checklist",
|
|
138
|
+
description: "Ticked off on each of its shifts by whoever is on it. Empty: none.",
|
|
139
|
+
personApproves: true,
|
|
140
|
+
},
|
|
141
|
+
active: { type: "boolean", label: "Active", default: true },
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
dutyseries: {
|
|
145
|
+
label: "Duty series",
|
|
146
|
+
plural: "Duty series",
|
|
147
|
+
icon: "calendar-sync",
|
|
148
|
+
titleField: "title",
|
|
149
|
+
titleDefault: { from: ["duty"] },
|
|
150
|
+
description: "A duty on chosen weekdays at a local time, from a date, with its regular person. The " +
|
|
151
|
+
"host makes its shifts ahead.",
|
|
152
|
+
navigation: "main",
|
|
153
|
+
navigationOrder: 41,
|
|
154
|
+
fields: {
|
|
155
|
+
title: { type: "text", label: "Title" },
|
|
156
|
+
duty: { type: "relation", label: "Duty", to: "rostering.duty", required: true },
|
|
157
|
+
weekdays: { type: "multiSelect", label: "Weekdays", options: WEEKDAYS, required: true },
|
|
158
|
+
time: {
|
|
159
|
+
type: "text",
|
|
160
|
+
label: "Starts at (local time)",
|
|
161
|
+
description: "HH:MM in the series' time zone, e.g. 18:00.",
|
|
162
|
+
required: true,
|
|
163
|
+
},
|
|
164
|
+
length: {
|
|
165
|
+
type: "number",
|
|
166
|
+
label: "Length (minutes)",
|
|
167
|
+
required: true,
|
|
168
|
+
min: 5,
|
|
169
|
+
max: 1440,
|
|
170
|
+
step: 1,
|
|
171
|
+
},
|
|
172
|
+
firstDate: { type: "date", label: "First date", required: true },
|
|
173
|
+
lastDate: { type: "date", label: "Last date", description: "Empty: ongoing." },
|
|
174
|
+
timezone: { type: "timezone", label: "Time zone" },
|
|
175
|
+
// The pattern's person: a person's to change (an assistant's change waits for a person).
|
|
176
|
+
staff: {
|
|
177
|
+
type: "user",
|
|
178
|
+
label: "Regular person",
|
|
179
|
+
description: "Who works it every week. Empty: each shift is made with nobody on it.",
|
|
180
|
+
personApproves: true,
|
|
181
|
+
},
|
|
182
|
+
state: {
|
|
183
|
+
type: "select",
|
|
184
|
+
label: "State",
|
|
185
|
+
track: "timeline",
|
|
186
|
+
options: [
|
|
187
|
+
{ value: "active", label: "Active" },
|
|
188
|
+
{ value: "ended", label: "Ended" },
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
states: {
|
|
193
|
+
field: "state",
|
|
194
|
+
initial: "active",
|
|
195
|
+
moves: [{ from: "active", to: "ended", by: ["staff"], final: true }],
|
|
196
|
+
},
|
|
197
|
+
recurring: {
|
|
198
|
+
generates: "shift",
|
|
199
|
+
link: "series",
|
|
200
|
+
rule: {
|
|
201
|
+
weekdays: "weekdays",
|
|
202
|
+
time: "time",
|
|
203
|
+
length: "length",
|
|
204
|
+
from: "firstDate",
|
|
205
|
+
until: "lastDate",
|
|
206
|
+
zone: "timezone",
|
|
207
|
+
},
|
|
208
|
+
into: { starts: "startsAt", ends: "endsAt", zone: "timezone", changed: "changed" },
|
|
209
|
+
copy: { title: "title", duty: "duty", staff: "staff" },
|
|
210
|
+
cancel: "cancelled",
|
|
211
|
+
ended: { field: "state", in: ["ended"] },
|
|
212
|
+
// Eight weeks ahead (decision 17), unless the duty horizon setting says otherwise.
|
|
213
|
+
horizonDays: 56,
|
|
214
|
+
horizonSetting: "dutyHorizonDays",
|
|
215
|
+
},
|
|
216
|
+
indexes: [["state"], ["duty"]],
|
|
217
|
+
},
|
|
218
|
+
shift: {
|
|
219
|
+
label: "Duty shift",
|
|
220
|
+
plural: "Duty shifts",
|
|
221
|
+
icon: "calendar-clock",
|
|
222
|
+
titleField: "title",
|
|
223
|
+
titleDefault: { from: ["duty"] },
|
|
224
|
+
description: "One dated duty shift: made by a duty series, or a one-off. Its person works it; nobody " +
|
|
225
|
+
"is ever on two shifts at once.",
|
|
226
|
+
navigation: "main",
|
|
227
|
+
navigationOrder: 40,
|
|
228
|
+
fields: {
|
|
229
|
+
title: { type: "text", label: "Title" },
|
|
230
|
+
// Which duty, and so which checklist, a shift is: a person's to change (ADR 0650).
|
|
231
|
+
duty: {
|
|
232
|
+
type: "relation",
|
|
233
|
+
label: "Duty",
|
|
234
|
+
to: "rostering.duty",
|
|
235
|
+
required: true,
|
|
236
|
+
personApproves: true,
|
|
237
|
+
},
|
|
238
|
+
series: {
|
|
239
|
+
type: "relation",
|
|
240
|
+
label: "Duty series",
|
|
241
|
+
to: "rostering.dutyseries",
|
|
242
|
+
readOnly: true,
|
|
243
|
+
description: "The series that made it. Empty for a one-off shift.",
|
|
244
|
+
},
|
|
245
|
+
startsAt: { type: "datetime", label: "Starts", required: true },
|
|
246
|
+
endsAt: { type: "datetime", label: "Ends", required: true },
|
|
247
|
+
// Left empty, the organisation's zone (ADR 0460).
|
|
248
|
+
timezone: { type: "timezone", label: "Time zone", required: true },
|
|
249
|
+
// Who works it: a person's to change (ADR 0626). Empty: nobody (uncovered).
|
|
250
|
+
staff: { type: "user", label: "Person", personApproves: true },
|
|
251
|
+
notes: { type: "longText", label: "Notes" },
|
|
252
|
+
state: {
|
|
253
|
+
type: "select",
|
|
254
|
+
label: "State",
|
|
255
|
+
track: "timeline",
|
|
256
|
+
options: [
|
|
257
|
+
{ value: "scheduled", label: "Scheduled" },
|
|
258
|
+
{ value: "cancelled", label: "Cancelled" },
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
changed: {
|
|
262
|
+
type: "boolean",
|
|
263
|
+
label: "Changed from its series",
|
|
264
|
+
readOnly: true,
|
|
265
|
+
description: "Moved, or its state changed, by hand: its series no longer changes it. A person " +
|
|
266
|
+
"changed by hand alone stays this shift's own, and later changes to its series still " +
|
|
267
|
+
"reach the rest.",
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
states: {
|
|
271
|
+
field: "state",
|
|
272
|
+
initial: "scheduled",
|
|
273
|
+
moves: [
|
|
274
|
+
{ from: "scheduled", to: "cancelled", by: ["staff", "host"] },
|
|
275
|
+
{ from: "cancelled", to: "scheduled", by: ["staff"] },
|
|
276
|
+
],
|
|
277
|
+
},
|
|
278
|
+
// A duty shift is its person's shift (ADR 0621): the time claim, the warnings, offers and
|
|
279
|
+
// takes are the host's, across classes and duties alike.
|
|
280
|
+
staffed: {
|
|
281
|
+
who: { field: "staff" },
|
|
282
|
+
starts: "startsAt",
|
|
283
|
+
ends: "endsAt",
|
|
284
|
+
zone: "timezone",
|
|
285
|
+
kind: "duty",
|
|
286
|
+
live: ["scheduled"],
|
|
287
|
+
place: "duty.place",
|
|
288
|
+
pattern: { link: "series", who: "staff" },
|
|
289
|
+
},
|
|
290
|
+
// Its duty's checklist, ticked off by its person from its start until 2 hours after its end
|
|
291
|
+
// (ADR 0650): the runs, who ticks, a done run kept unchanged and who reads it are the host's.
|
|
292
|
+
checklists: {
|
|
293
|
+
template: "duty.checklist",
|
|
294
|
+
who: "staff",
|
|
295
|
+
opens: "startsAt",
|
|
296
|
+
closes: "endsAt",
|
|
297
|
+
live: ["scheduled"],
|
|
298
|
+
},
|
|
299
|
+
indexes: [["startsAt"], ["staff"], ["state", "startsAt"], ["series"]],
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
views: {
|
|
303
|
+
shifts: {
|
|
304
|
+
label: "Duty shifts",
|
|
305
|
+
object: "rostering.shift",
|
|
306
|
+
sort: { field: "startsAt", direction: "asc" },
|
|
307
|
+
columns: ["title", "startsAt", "endsAt", "staff", "state", "changed"],
|
|
308
|
+
},
|
|
309
|
+
series: {
|
|
310
|
+
label: "Duty series",
|
|
311
|
+
object: "rostering.dutyseries",
|
|
312
|
+
columns: ["title", "duty", "weekdays", "time", "length", "staff", "firstDate", "state"],
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
// The roster's numbers (decisions 17 and 21; the uncovered window a guess): a person's to change.
|
|
316
|
+
settings: {
|
|
317
|
+
offerCutoffMinutes: {
|
|
318
|
+
type: "number",
|
|
319
|
+
label: "Offers close (minutes before a shift)",
|
|
320
|
+
description: "A shift can be offered and taken in the app until this many minutes before it starts; " +
|
|
321
|
+
"then its offer lapses and whoever rosters reassigns it.",
|
|
322
|
+
default: 60,
|
|
323
|
+
min: 0,
|
|
324
|
+
max: 1440,
|
|
325
|
+
personApproves: true,
|
|
326
|
+
},
|
|
327
|
+
uncoveredDays: {
|
|
328
|
+
type: "number",
|
|
329
|
+
label: "Warn about shifts with nobody on them (days ahead)",
|
|
330
|
+
description: "Whoever rosters hears of shifts with nobody on them this many days ahead, every morning " +
|
|
331
|
+
"and at once when one becomes uncovered.",
|
|
332
|
+
default: 14,
|
|
333
|
+
min: 1,
|
|
334
|
+
max: 62,
|
|
335
|
+
personApproves: true,
|
|
336
|
+
},
|
|
337
|
+
dutyHorizonDays: {
|
|
338
|
+
type: "number",
|
|
339
|
+
label: "Duty shifts are made (days ahead)",
|
|
340
|
+
description: "How far ahead each duty series' shifts are made: 56 days is eight weeks.",
|
|
341
|
+
default: 56,
|
|
342
|
+
min: 7,
|
|
343
|
+
max: 120,
|
|
344
|
+
personApproves: true,
|
|
345
|
+
},
|
|
346
|
+
// The pay period (decision 20, ADR 0627): fortnightly by default, from a date the business
|
|
347
|
+
// chooses (until it is set, nothing is totalled), or monthly from a day of the month.
|
|
348
|
+
payPeriod: {
|
|
349
|
+
type: "select",
|
|
350
|
+
label: "Pay period",
|
|
351
|
+
description: "How long each pay period is. Totals are made per period, for payroll.",
|
|
352
|
+
options: [
|
|
353
|
+
{ value: "weekly", label: "Weekly" },
|
|
354
|
+
{ value: "fortnightly", label: "Fortnightly" },
|
|
355
|
+
{ value: "monthly", label: "Monthly" },
|
|
356
|
+
],
|
|
357
|
+
default: "fortnightly",
|
|
358
|
+
personApproves: true,
|
|
359
|
+
},
|
|
360
|
+
payPeriodStart: {
|
|
361
|
+
type: "text",
|
|
362
|
+
label: "A pay period starts on (weekly or fortnightly)",
|
|
363
|
+
description: "The date one pay period starts, YYYY-MM-DD (it fixes the weekday). Until it is set, " +
|
|
364
|
+
"nothing is totalled.",
|
|
365
|
+
personApproves: true,
|
|
366
|
+
},
|
|
367
|
+
payPeriodDay: {
|
|
368
|
+
type: "number",
|
|
369
|
+
label: "A monthly pay period starts on day",
|
|
370
|
+
description: "The day of the month each monthly pay period starts, 1 to 28.",
|
|
371
|
+
default: 1,
|
|
372
|
+
min: 1,
|
|
373
|
+
max: 28,
|
|
374
|
+
personApproves: true,
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
// The host's roster rules read these (ADRs 0626 and 0627): who rosters, who handles pay, and
|
|
378
|
+
// the settings above.
|
|
379
|
+
staffing: {
|
|
380
|
+
rosters: "rostering:manage",
|
|
381
|
+
pays: "rostering:pay",
|
|
382
|
+
settings: {
|
|
383
|
+
offerCutoffMinutes: "offerCutoffMinutes",
|
|
384
|
+
uncoveredDays: "uncoveredDays",
|
|
385
|
+
payPeriod: "payPeriod",
|
|
386
|
+
payPeriodStart: "payPeriodStart",
|
|
387
|
+
payPeriodDay: "payPeriodDay",
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
// Someone rostered who has no other access (a cleaner): the roster and their own shifts, offers
|
|
391
|
+
// and takes, their time off, nothing else (ADR 0436). No record reads: only its tools.
|
|
392
|
+
roles: {
|
|
393
|
+
team: {
|
|
394
|
+
label: "Rostered team",
|
|
395
|
+
description: "Sees the roster and their own shifts, offers and takes shifts, says when they are away, " +
|
|
396
|
+
"has their own calendar feed and sees their own hours for each pay period. Nothing else: " +
|
|
397
|
+
"no records, no people, no settings.",
|
|
398
|
+
permissions: ["rostering:team"],
|
|
399
|
+
read: [],
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
// The team's tools for an account with another role (a coach), and the rosterers' permission
|
|
403
|
+
// (decision 16: the owner and admins hold it; it is granted to nobody at first).
|
|
404
|
+
grantable: ["rostering:roster", "rostering:manage", "rostering:pay"],
|
|
405
|
+
grantableLabels: {
|
|
406
|
+
"rostering:roster": "Rostering: see the roster and their own shifts, offer and take shifts, say when they are " +
|
|
407
|
+
"away, have their own calendar feed and see their own hours for each pay period. For a " +
|
|
408
|
+
"coach or anyone with another role who is rostered.",
|
|
409
|
+
"rostering:manage": "Rostering, rosters others: put people on shifts, say who may do which work, record " +
|
|
410
|
+
"others' time off and see everyone's, see shifts with nobody on them, mark a shift not " +
|
|
411
|
+
"worked, and see how everyone's checklists went and tick one for someone. Admins hold it.",
|
|
412
|
+
"rostering:pay": "Rostering, pay: say who is counted for pay, see each pay period's hours and shifts, lock, " +
|
|
413
|
+
"reopen and export them for payroll. No rates or money are held. Admins hold it.",
|
|
414
|
+
},
|
|
415
|
+
// Held by admins and by grant only (ADR 0625): a member does not hold the rosterers' tools or
|
|
416
|
+
// pay.
|
|
417
|
+
restricted: ["rostering:manage", "rostering:pay"],
|
|
418
|
+
tools: {
|
|
419
|
+
me,
|
|
420
|
+
week,
|
|
421
|
+
mine,
|
|
422
|
+
offers,
|
|
423
|
+
offer,
|
|
424
|
+
withdraw,
|
|
425
|
+
take,
|
|
426
|
+
away,
|
|
427
|
+
back,
|
|
428
|
+
myAway,
|
|
429
|
+
feed,
|
|
430
|
+
feedRotate,
|
|
431
|
+
feedRevoke,
|
|
432
|
+
myPayPeriods,
|
|
433
|
+
myPay,
|
|
434
|
+
assign,
|
|
435
|
+
check,
|
|
436
|
+
qualify,
|
|
437
|
+
qualifications,
|
|
438
|
+
awayFor,
|
|
439
|
+
awayList,
|
|
440
|
+
uncovered,
|
|
441
|
+
markNotWorked,
|
|
442
|
+
candidates,
|
|
443
|
+
checklist,
|
|
444
|
+
tick,
|
|
445
|
+
checklistDone,
|
|
446
|
+
checklistRuns,
|
|
447
|
+
checklistCorrect,
|
|
448
|
+
follow,
|
|
449
|
+
people,
|
|
450
|
+
patterns,
|
|
451
|
+
setPattern,
|
|
452
|
+
planCheck,
|
|
453
|
+
payBasis,
|
|
454
|
+
payBases,
|
|
455
|
+
periods,
|
|
456
|
+
periodTotals,
|
|
457
|
+
lock,
|
|
458
|
+
reopen,
|
|
459
|
+
export: exportPeriod,
|
|
460
|
+
},
|
|
461
|
+
// Staff screens in the product's admin (stage 47, ADR 0660), each gated by the tools that decide
|
|
462
|
+
// who may use it (its main read and the write it is for; the host refuses the rest): the team's screens for the rostered team (the
|
|
463
|
+
// `rostering.team` role, `rostering:roster` granted to another role, and any member, who holds
|
|
464
|
+
// the team's tools); the rosterers' for admins and those granted `rostering:manage`
|
|
465
|
+
// (restricted); pay for admins and those granted `rostering:pay` (restricted, a person's only).
|
|
466
|
+
// The roster's assign controls show inside the week for a rosterer, from the host's `me`.
|
|
467
|
+
screens: {
|
|
468
|
+
roster: {
|
|
469
|
+
label: "Roster",
|
|
470
|
+
block: "rostering-week",
|
|
471
|
+
export: "RosterWeek",
|
|
472
|
+
nav: { group: "Rostering", order: 10 },
|
|
473
|
+
opens: ["week"],
|
|
474
|
+
},
|
|
475
|
+
myShifts: {
|
|
476
|
+
label: "My shifts",
|
|
477
|
+
// My shifts with each duty's checklist under it (step 4b) and My hours.
|
|
478
|
+
block: "rostering-checklist",
|
|
479
|
+
export: "MyShiftsWithChecklist",
|
|
480
|
+
nav: { group: "Rostering", order: 20 },
|
|
481
|
+
opens: ["mine", "offer"],
|
|
482
|
+
},
|
|
483
|
+
offers: {
|
|
484
|
+
label: "Offers",
|
|
485
|
+
block: "rostering-offers",
|
|
486
|
+
export: "OffersToMe",
|
|
487
|
+
nav: { group: "Rostering", order: 30 },
|
|
488
|
+
opens: ["offers", "take"],
|
|
489
|
+
},
|
|
490
|
+
myTimeOff: {
|
|
491
|
+
label: "My time off",
|
|
492
|
+
block: "rostering-my-availability",
|
|
493
|
+
export: "MyAvailability",
|
|
494
|
+
nav: { group: "Rostering", order: 40 },
|
|
495
|
+
opens: ["myAway", "away"],
|
|
496
|
+
},
|
|
497
|
+
myCalendar: {
|
|
498
|
+
label: "My calendar",
|
|
499
|
+
block: "rostering-my-calendar",
|
|
500
|
+
export: "MyCalendar",
|
|
501
|
+
nav: { group: "Rostering", order: 50 },
|
|
502
|
+
opens: ["feed", "feedRotate"],
|
|
503
|
+
},
|
|
504
|
+
patterns: {
|
|
505
|
+
label: "Patterns",
|
|
506
|
+
block: "rostering-patterns",
|
|
507
|
+
export: "Patterns",
|
|
508
|
+
nav: { group: "Rostering", order: 60 },
|
|
509
|
+
opens: ["patterns", "setPattern"],
|
|
510
|
+
},
|
|
511
|
+
qualifications: {
|
|
512
|
+
label: "Who may do what",
|
|
513
|
+
block: "rostering-qualifications",
|
|
514
|
+
export: "Qualifications",
|
|
515
|
+
nav: { group: "Rostering", order: 70 },
|
|
516
|
+
opens: ["qualifications", "qualify"],
|
|
517
|
+
},
|
|
518
|
+
timeOff: {
|
|
519
|
+
label: "Time off",
|
|
520
|
+
block: "rostering-away",
|
|
521
|
+
export: "TimeOff",
|
|
522
|
+
nav: { group: "Rostering", order: 80 },
|
|
523
|
+
opens: ["awayList", "awayFor"],
|
|
524
|
+
},
|
|
525
|
+
pay: {
|
|
526
|
+
label: "Pay",
|
|
527
|
+
block: "rostering-pay",
|
|
528
|
+
export: "Pay",
|
|
529
|
+
nav: { group: "Rostering", order: 90 },
|
|
530
|
+
opens: ["periods", "lock"],
|
|
531
|
+
},
|
|
532
|
+
// The duties' checklists by checklist and date (step 4b): the rosterers' (rostering:manage).
|
|
533
|
+
checklists: {
|
|
534
|
+
label: "Checklists",
|
|
535
|
+
block: "rostering-checklists",
|
|
536
|
+
export: "ChecklistRuns",
|
|
537
|
+
nav: { group: "Rostering", order: 85 },
|
|
538
|
+
opens: ["checklistRuns", "checklistCorrect"],
|
|
539
|
+
},
|
|
540
|
+
},
|
|
541
|
+
});
|