@feedmepos/mf-hrm-portal 2.3.2-dev.3 → 2.3.2-dev.4
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/dist/{ApprovalCodeList-D3U4nvlF.js → ApprovalCodeList-BPTnWcra.js} +14 -15
- package/dist/{AuditLogList-qGCW7tf0.js → AuditLogList-CvEF4bit.js} +12 -12
- package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CPX0sv64.js +459 -0
- package/dist/EmployeeList-CANPsrQY.js +896 -0
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-mdfK9rtZ.js +90 -0
- package/dist/{GrantUserList-C71pal0N.js → GrantUserList-DPj_6Wsg.js} +15 -16
- package/dist/{Main-CCdTWngg.js → Main-BWRMirTY.js} +11 -11
- package/dist/{Main-BWJPyEU1.js → Main-Cob4hcf-.js} +5 -5
- package/dist/Main-DXcSgkhR.js +101 -0
- package/dist/MyPosProfile-Bp7-pATz.js +301 -0
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +126 -0
- package/dist/{PermissionSetList-BS-oBunI.js → PermissionSetList-DvAW1q0c.js} +45 -46
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DmbI5vgH.js +4243 -0
- package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-C8hcooKP.js +1831 -0
- package/dist/RoleForm.vue_vue_type_script_setup_true_lang-Bq8-aBSv.js +547 -0
- package/dist/RoleList-DsrHgU4s.js +274 -0
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-BXihM4sl.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CRR18xmB.js} +1 -1
- package/dist/{ScheduleGeneralPage-DpNvWNGs.js → ScheduleGeneralPage-C_Kj9wmp.js} +2 -2
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-DIYLOF9N.js → ScheduleModal.vue_vue_type_script_setup_true_lang-3oQ6lE86.js} +187 -186
- package/dist/{SchedulePage-QW-cYvu2.js → SchedulePage-9dFXxWwZ.js} +13 -13
- package/dist/{SchedulePositionPage-BtFfVo2N.js → SchedulePositionPage-Dea5X8Sa.js} +3 -3
- package/dist/{SelectFilter-BXeVKgHN.js → SelectFilter-Dr9lB6Ta.js} +1 -1
- package/dist/TeamMemberList-Bu9QNP9W.js +2086 -0
- package/dist/{TimesheetList-D-bESKe5.js → TimesheetList-B98l028z.js} +9 -9
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-D0zAVqCa.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-DIQ7kjG8.js} +3 -3
- package/dist/{app-D-MUq9Ab.js → app-BHQJX4L4.js} +6398 -3459
- package/dist/app.js +3 -3
- package/dist/{approval-code-BXUiojPH.js → approval-code-w0rZJeYU.js} +1 -1
- package/dist/{dayjs.min-BZ1pM-6M.js → dayjs.min-C4H4diN8.js} +34 -34
- package/dist/{employee-HQEU8fjb.js → employee-BEwUmdt6.js} +48 -47
- package/dist/{grant-user-CBJ3gEgW.js → grant-user-DdxPMH5_.js} +1 -1
- package/dist/{iteration-ogxW2-Tv.js → iteration-DBHifssn.js} +1 -1
- package/dist/{lodash-Def4gaas.js → lodash-DqZsWm-0.js} +1 -1
- package/dist/member-grant-DOigVnBR.js +55 -0
- package/dist/restaurant-2xCb2x26.js +51 -0
- package/dist/{role-JDoDFVd9.js → role-C8STcmLJ.js} +5 -4
- package/dist/{rule-DPtqlnz-.js → rule-BkL34-Ma.js} +105 -100
- package/dist/src/api/my-pos-profile/index.d.ts +5 -0
- package/dist/src/api/sso-provider/index.d.ts +5 -0
- package/dist/src/api/staff-invite/index.d.ts +16 -0
- package/dist/src/components/CollapsibleWrapper.vue.d.ts +11 -3
- package/dist/src/components/form/SegmentedTabs.vue.d.ts +23 -0
- package/dist/src/composables/useMenuAccess.d.ts +56 -0
- package/dist/src/composables/useSsoProviders.d.ts +19 -0
- package/dist/src/composables/useStaffInviteProviders.d.ts +8 -0
- package/dist/src/helpers/member-grant.d.ts +36 -0
- package/dist/src/helpers/my-pos-profile.d.ts +37 -0
- package/dist/src/helpers/pos-assignment-rows.d.ts +28 -0
- package/dist/src/helpers/staff-invite.d.ts +54 -0
- package/dist/src/helpers/string.d.ts +10 -1
- package/dist/src/router/menu-access-guard.d.ts +17 -0
- package/dist/src/router/shared.d.ts +3 -1
- package/dist/src/stores/restaurant.d.ts +7 -7
- package/dist/src/stores/team.d.ts +30 -0
- package/dist/src/types/my-pos-profile.d.ts +25 -0
- package/dist/src/types/sso-provider.d.ts +10 -0
- package/dist/src/types/staff-invite.d.ts +100 -0
- package/dist/src/types/team.d.ts +17 -1
- package/dist/src/views/hr/locales/index.d.ts +20 -0
- package/dist/src/views/hr/role/RoleForm.vue.d.ts +29 -2
- package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +2 -0
- package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +4 -0
- package/dist/src/views/my-pos-profile/locales/index.d.ts +200 -0
- package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
- package/dist/src/views/team/components/BasePermission.vue.d.ts +11 -0
- package/dist/src/views/team/components/ConditionPermission.vue.d.ts +11 -0
- package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +51 -0
- package/dist/src/views/team/{member/MemberInfo.vue.d.ts → components/MemberStatusBadge.vue.d.ts} +2 -2
- package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +21 -0
- package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +44 -0
- package/dist/src/views/team/components/PosRolePermission.vue.d.ts +11 -0
- package/dist/src/views/team/locales/index.d.ts +716 -0
- package/dist/src/views/team/member/AddMemberForm.vue.d.ts +48 -3
- package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +11 -0
- package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +35 -0
- package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +19 -0
- package/dist/src/views/team/member/TeamMemberList.vue.d.ts +1 -0
- package/dist/string-DZQ1uNjn.js +22 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-DZCdxlCd.js → useAppStore-BUmFt2dT.js} +1 -1
- package/dist/{useLoading-Nygx2zn8.js → useLoading-oHRj4RgU.js} +1 -1
- package/dist/{useReportPermissions-CxV7Dz1B.js → useReportPermissions-CpcyfEuV.js} +5 -5
- package/package.json +1 -1
- package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-B0VcRYUg.js +0 -438
- package/dist/EmployeeList-Bd73xDCX.js +0 -776
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-cLEnrtC6.js +0 -45
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
- package/dist/Main-DGf0bQvy.js +0 -96
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +0 -243
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CkOAT-oX.js +0 -4167
- package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DQcgZ0nF.js +0 -35
- package/dist/RoleList-B_7UnVNb.js +0 -740
- package/dist/TeamMemberList-DoisBYnk.js +0 -1154
- package/dist/restaurant-D2mfKHaH.js +0 -1880
- package/dist/string-VNuQNweN.js +0 -15
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { onMounted as Re, onBeforeUnmount as $e, ref as S, reactive as T, shallowRef as Ae, watch as Be, computed as Y, defineComponent as xe, createElementBlock as M, openBlock as C, renderSlot as Xe, useAttrs as
|
|
1
|
+
import { onMounted as Re, onBeforeUnmount as $e, ref as S, reactive as T, shallowRef as Ae, watch as Be, computed as Y, defineComponent as xe, createElementBlock as M, openBlock as C, renderSlot as Xe, useAttrs as pa, nextTick as ke, normalizeClass as he, createElementVNode as x, createBlock as ha, mergeProps as va, toDisplayString as z, Teleport as ga, createCommentVNode as G, withDirectives as Da, unref as Ee, vModelText as wa, Fragment as be, renderList as Ha, createTextVNode as Aa, withModifiers as Ea, normalizeStyle as ba } from "vue";
|
|
2
2
|
import { useRoute as Pa, useRouter as Sa } from "vue-router";
|
|
3
3
|
import { useCoreStore as Je, useI18n as ka } from "@feedmepos/mf-common";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
4
|
+
import { u as Ca } from "./restaurant-2xCb2x26.js";
|
|
5
|
+
import { g, b as p } from "./app-BHQJX4L4.js";
|
|
6
|
+
import { E as Ce, u as Ze } from "./employee-BEwUmdt6.js";
|
|
7
|
+
import { t as Fe, d as Ma } from "./rule-BkL34-Ma.js";
|
|
8
|
+
function io(e) {
|
|
8
9
|
let a = null;
|
|
9
10
|
function t() {
|
|
10
11
|
if (!a) return;
|
|
@@ -40,7 +41,7 @@ function Oa(e) {
|
|
|
40
41
|
const a = (Me(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, o = t < 12 ? "am" : "pm", i = t % 12 || 12;
|
|
41
42
|
return n ? `${i}:${String(n).padStart(2, "0")}${o}` : `${i}${o}`;
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
+
function ro(e) {
|
|
44
45
|
return Oa(Na(e % 1440));
|
|
45
46
|
}
|
|
46
47
|
function ea(e) {
|
|
@@ -52,36 +53,36 @@ function ea(e) {
|
|
|
52
53
|
return d < 0 && (d += 24 * 60), t + d;
|
|
53
54
|
}, 0) : Math.max(0, e && !Array.isArray(e) ? e.breakMins ?? 0 : 0);
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
+
function lo(e, a) {
|
|
56
57
|
var o;
|
|
57
58
|
const t = a ?? qe(e.start, e.end), n = (o = e.breaks) != null && o.length ? e.breaks.reduce((i, u) => i + (u.breakPayType === "UNPAID" ? ea([u]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
|
|
58
59
|
return Math.max(0, t - Math.min(t, n));
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
+
function uo(e) {
|
|
61
62
|
const a = Math.max(0, Math.round(e ?? 0));
|
|
62
63
|
return a ? [{ type: "DURATION", minutes: a, breakPayType: "UNPAID" }] : [];
|
|
63
64
|
}
|
|
64
|
-
const ne = 500, Ia = 10, _e = 6,
|
|
65
|
+
const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
65
66
|
async completeOnboarding(e, a) {
|
|
66
67
|
return g(
|
|
67
|
-
await
|
|
68
|
+
await p(`restaurants/${e}/schedules`).post("onboarding", a)
|
|
68
69
|
);
|
|
69
70
|
},
|
|
70
71
|
async listEmployeeProfiles(e) {
|
|
71
72
|
return g(
|
|
72
|
-
await
|
|
73
|
+
await p("schedules").get("employees", {
|
|
73
74
|
params: e != null && e.length ? { ids: e.join(",") } : void 0
|
|
74
75
|
})
|
|
75
76
|
);
|
|
76
77
|
},
|
|
77
78
|
async listEmployeeConfigs(e) {
|
|
78
79
|
return g(
|
|
79
|
-
await
|
|
80
|
+
await p(`restaurants/${e}/schedules`).get("employee-configs")
|
|
80
81
|
);
|
|
81
82
|
},
|
|
82
83
|
async saveEmployeeConfigs(e, a) {
|
|
83
84
|
return g(
|
|
84
|
-
await
|
|
85
|
+
await p(`restaurants/${e}/schedules`).post(
|
|
85
86
|
"employee-configs/reorder",
|
|
86
87
|
a
|
|
87
88
|
)
|
|
@@ -89,17 +90,17 @@ const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
|
89
90
|
},
|
|
90
91
|
async getSettings(e) {
|
|
91
92
|
return g(
|
|
92
|
-
await
|
|
93
|
+
await p(`restaurants/${e}/schedules`).get("settings")
|
|
93
94
|
);
|
|
94
95
|
},
|
|
95
96
|
async saveSettings(e, a) {
|
|
96
97
|
return g(
|
|
97
|
-
await
|
|
98
|
+
await p(`restaurants/${e}/schedules`).post("settings", a)
|
|
98
99
|
);
|
|
99
100
|
},
|
|
100
101
|
async generateAutoSchedule(e, a) {
|
|
101
102
|
return g(
|
|
102
|
-
await
|
|
103
|
+
await p(`restaurants/${e}/schedules`).post(
|
|
103
104
|
"auto-schedule/generate",
|
|
104
105
|
a
|
|
105
106
|
)
|
|
@@ -107,14 +108,14 @@ const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
|
107
108
|
},
|
|
108
109
|
async getAutoScheduleCapabilities(e) {
|
|
109
110
|
return g(
|
|
110
|
-
await
|
|
111
|
+
await p(`restaurants/${e}/schedules`).get(
|
|
111
112
|
"auto-schedule/capabilities"
|
|
112
113
|
)
|
|
113
114
|
);
|
|
114
115
|
},
|
|
115
116
|
async applyAutoSchedule(e, a) {
|
|
116
117
|
return g(
|
|
117
|
-
await
|
|
118
|
+
await p(`restaurants/${e}/schedules`).post(
|
|
118
119
|
"auto-schedule/apply",
|
|
119
120
|
a
|
|
120
121
|
)
|
|
@@ -123,58 +124,58 @@ const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
|
123
124
|
/** One outlet's whole board over `[from, to]` (inclusive, 'YYYY-MM-DD'). */
|
|
124
125
|
async readBoard(e, a, t) {
|
|
125
126
|
return g(
|
|
126
|
-
await
|
|
127
|
+
await p(`restaurants/${e}/schedules`).get("board", {
|
|
127
128
|
params: { from: a, to: t }
|
|
128
129
|
})
|
|
129
130
|
);
|
|
130
131
|
},
|
|
131
132
|
async createTimeOff(e, a) {
|
|
132
133
|
return g(
|
|
133
|
-
await
|
|
134
|
+
await p(`restaurants/${e}/schedules`).post("time-off", a)
|
|
134
135
|
);
|
|
135
136
|
},
|
|
136
137
|
async updateTimeOffStatus(e, a, t) {
|
|
137
138
|
return g(
|
|
138
|
-
await
|
|
139
|
+
await p(`restaurants/${e}/schedules`).post(
|
|
139
140
|
`time-off/${a}/status`,
|
|
140
141
|
t
|
|
141
142
|
)
|
|
142
143
|
);
|
|
143
144
|
},
|
|
144
145
|
async deleteTimeOff(e, a) {
|
|
145
|
-
await
|
|
146
|
+
await p(`restaurants/${e}/schedules`).delete(`time-off/${a}`);
|
|
146
147
|
},
|
|
147
148
|
/** Creates or updates the employee's shared business-level scheduling profile. */
|
|
148
149
|
async createEmployeeProfile(e, a) {
|
|
149
|
-
return g(await
|
|
150
|
+
return g(await p("schedules").post("employees", a));
|
|
150
151
|
},
|
|
151
152
|
/** Edits the employee's shared business-level scheduling profile. */
|
|
152
153
|
async updateEmployeeProfile(e, a, t) {
|
|
153
154
|
return g(
|
|
154
|
-
await
|
|
155
|
+
await p("schedules").post("employees", { employeeId: a, ...t })
|
|
155
156
|
);
|
|
156
157
|
},
|
|
157
158
|
async validatePosAccess(e) {
|
|
158
|
-
await
|
|
159
|
+
await p("schedules").post("employees/validate-pos-access", e);
|
|
159
160
|
},
|
|
160
161
|
/** Positions are shared across the business. */
|
|
161
162
|
async createPosition(e) {
|
|
162
|
-
return g(await
|
|
163
|
+
return g(await p("schedules").post("positions", e));
|
|
163
164
|
},
|
|
164
165
|
async updatePosition(e, a) {
|
|
165
|
-
return g(await
|
|
166
|
+
return g(await p("schedules").post(`positions/${e}`, a));
|
|
166
167
|
},
|
|
167
168
|
/** Deleting one position is `deletePositions` with a single-id array — the backend's
|
|
168
169
|
* `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
|
|
169
170
|
async deletePosition(e) {
|
|
170
|
-
await
|
|
171
|
+
await p("schedules").delete("positions", {
|
|
171
172
|
params: { ids: e }
|
|
172
173
|
});
|
|
173
174
|
},
|
|
174
175
|
/** Creates one flat demand interval. */
|
|
175
176
|
async createDemand(e, a) {
|
|
176
177
|
return g(
|
|
177
|
-
await
|
|
178
|
+
await p(`restaurants/${e}/schedules`).post("demands", a)
|
|
178
179
|
);
|
|
179
180
|
},
|
|
180
181
|
/** Deletes a batch of demands in one request — e.g. `saveDemand` replacing a whole
|
|
@@ -182,7 +183,7 @@ const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
|
182
183
|
* array. */
|
|
183
184
|
async deleteDemands(e, a) {
|
|
184
185
|
return g(
|
|
185
|
-
await
|
|
186
|
+
await p(`restaurants/${e}/schedules`).delete("demands", {
|
|
186
187
|
params: { ids: a.join(",") }
|
|
187
188
|
})
|
|
188
189
|
);
|
|
@@ -190,7 +191,7 @@ const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
|
190
191
|
/** Atomically replaces one date/weekday's flattened demand rows. */
|
|
191
192
|
async replaceDemands(e, a) {
|
|
192
193
|
return g(
|
|
193
|
-
await
|
|
194
|
+
await p(`restaurants/${e}/schedules`).post(
|
|
194
195
|
"demands/replace",
|
|
195
196
|
a
|
|
196
197
|
)
|
|
@@ -199,7 +200,7 @@ const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
|
199
200
|
/** Atomically replaces several date/weekday demand generations. */
|
|
200
201
|
async bulkReplaceDemands(e, a) {
|
|
201
202
|
return g(
|
|
202
|
-
await
|
|
203
|
+
await p(`restaurants/${e}/schedules`).post(
|
|
203
204
|
"demands/bulk-replace",
|
|
204
205
|
a
|
|
205
206
|
)
|
|
@@ -208,7 +209,7 @@ const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
|
208
209
|
/** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
|
|
209
210
|
async saveScheduleDay(e, a, t) {
|
|
210
211
|
return g(
|
|
211
|
-
await
|
|
212
|
+
await p(`restaurants/${e}/schedules`).post(
|
|
212
213
|
`days/${a}`,
|
|
213
214
|
t
|
|
214
215
|
)
|
|
@@ -217,12 +218,12 @@ const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
|
217
218
|
/** A one-off shift assignment. */
|
|
218
219
|
async createAssignment(e, a) {
|
|
219
220
|
return g(
|
|
220
|
-
await
|
|
221
|
+
await p(`restaurants/${e}/schedules`).post("assignments", a)
|
|
221
222
|
);
|
|
222
223
|
},
|
|
223
224
|
async updateAssignment(e, a, t) {
|
|
224
225
|
return g(
|
|
225
|
-
await
|
|
226
|
+
await p(`restaurants/${e}/schedules`).patch(
|
|
226
227
|
`assignments/${a}`,
|
|
227
228
|
t
|
|
228
229
|
)
|
|
@@ -231,7 +232,7 @@ const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
|
231
232
|
/** Atomically applies assignment updates, creates, and deletes used by moves and swaps. */
|
|
232
233
|
async bulkSaveAssignments(e, a) {
|
|
233
234
|
return g(
|
|
234
|
-
await
|
|
235
|
+
await p(`restaurants/${e}/schedules`).post(
|
|
235
236
|
"assignments/bulk",
|
|
236
237
|
a
|
|
237
238
|
)
|
|
@@ -240,13 +241,13 @@ const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
|
240
241
|
/** Replaces demand and/or assignments in one backend transaction. */
|
|
241
242
|
async copySchedule(e, a) {
|
|
242
243
|
return g(
|
|
243
|
-
await
|
|
244
|
+
await p(`restaurants/${e}/schedules`).post("copy", a)
|
|
244
245
|
);
|
|
245
246
|
},
|
|
246
247
|
/** Clears demand and/or assignments in one backend transaction. */
|
|
247
248
|
async clearSchedule(e, a) {
|
|
248
249
|
return g(
|
|
249
|
-
await
|
|
250
|
+
await p(`restaurants/${e}/schedules`).post("clear", a)
|
|
250
251
|
);
|
|
251
252
|
},
|
|
252
253
|
/** Deletes a batch of assignments in one request — e.g. a shift split into several segments
|
|
@@ -254,7 +255,7 @@ const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
|
254
255
|
* array. */
|
|
255
256
|
async deleteAssignments(e, a) {
|
|
256
257
|
return g(
|
|
257
|
-
await
|
|
258
|
+
await p(`restaurants/${e}/schedules`).delete("assignments", {
|
|
258
259
|
params: { ids: a.join(",") }
|
|
259
260
|
})
|
|
260
261
|
);
|
|
@@ -262,7 +263,7 @@ const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
|
262
263
|
/** Removes all assignments for an employee from the inclusive removal date onward. */
|
|
263
264
|
async deleteEmployeeFutureAssignments(e, a, t) {
|
|
264
265
|
return g(
|
|
265
|
-
await
|
|
266
|
+
await p(`restaurants/${e}/schedules`).delete(
|
|
266
267
|
"assignments/employee-future",
|
|
267
268
|
{ params: { employeeId: a, from: t } }
|
|
268
269
|
)
|
|
@@ -272,7 +273,7 @@ const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
|
272
273
|
* every DRAFT shift on the board to PUBLISHED at once. */
|
|
273
274
|
async bulkUpdateAssignmentStatus(e, a) {
|
|
274
275
|
return g(
|
|
275
|
-
await
|
|
276
|
+
await p(`restaurants/${e}/schedules`).patch(
|
|
276
277
|
"assignments/bulk-status",
|
|
277
278
|
a
|
|
278
279
|
)
|
|
@@ -344,13 +345,13 @@ const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
|
344
345
|
businessEmployees: Pe,
|
|
345
346
|
positions: Ta,
|
|
346
347
|
positionRecords: W,
|
|
347
|
-
rolePositions:
|
|
348
|
+
rolePositions: mo,
|
|
348
349
|
outlet: Ra,
|
|
349
350
|
locationOptions: Ke,
|
|
350
351
|
locationLabelById: se,
|
|
351
|
-
compensationGroupMeta:
|
|
352
|
-
existingStaff:
|
|
353
|
-
shiftTemplates:
|
|
352
|
+
compensationGroupMeta: yo,
|
|
353
|
+
existingStaff: fo,
|
|
354
|
+
shiftTemplates: po,
|
|
354
355
|
rules: N
|
|
355
356
|
} = ta;
|
|
356
357
|
function $a() {
|
|
@@ -383,18 +384,18 @@ function ho(e, a = /* @__PURE__ */ new Date()) {
|
|
|
383
384
|
const t = ie(Le(a), e * Ne);
|
|
384
385
|
return Array.from({ length: Ne }, (n, o) => ie(t, o));
|
|
385
386
|
}
|
|
386
|
-
function
|
|
387
|
+
function vo(e, a) {
|
|
387
388
|
const t = (i) => Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()), n = t(Le(e)), o = t(Le(a));
|
|
388
389
|
return Math.trunc((o - n) / (Ne * 24 * 60 * 60 * 1e3));
|
|
389
390
|
}
|
|
390
391
|
const oa = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
|
|
391
|
-
function
|
|
392
|
+
function go(e) {
|
|
392
393
|
return `scheduling.days.short.${oa[(e % 7 + 7) % 7]}`;
|
|
393
394
|
}
|
|
394
|
-
function
|
|
395
|
+
function Do(e) {
|
|
395
396
|
return `scheduling.days.long.${oa[(e % 7 + 7) % 7]}`;
|
|
396
397
|
}
|
|
397
|
-
function
|
|
398
|
+
function wo(e, a = "en-US") {
|
|
398
399
|
return !e || e.startsWith("en") ? a : e.startsWith("th") ? "th-TH-u-ca-gregory" : e;
|
|
399
400
|
}
|
|
400
401
|
const j = Ba, xa = {
|
|
@@ -404,7 +405,7 @@ const j = Ba, xa = {
|
|
|
404
405
|
loadFailed: "Could not load the schedule"
|
|
405
406
|
};
|
|
406
407
|
let Oe = null;
|
|
407
|
-
function
|
|
408
|
+
function Ho(e) {
|
|
408
409
|
Oe = e;
|
|
409
410
|
}
|
|
410
411
|
function A(e) {
|
|
@@ -440,7 +441,7 @@ async function Fa(e) {
|
|
|
440
441
|
const t = await w.saveEmployeeConfigs(a, { configs: e });
|
|
441
442
|
V.value = t, J.value += 1;
|
|
442
443
|
}
|
|
443
|
-
async function
|
|
444
|
+
async function Ao(e) {
|
|
444
445
|
const a = m.value;
|
|
445
446
|
if (!a) throw new Error(A("noOutlet"));
|
|
446
447
|
const t = await w.saveSettings(a, e);
|
|
@@ -458,7 +459,7 @@ async function _a(e, a) {
|
|
|
458
459
|
) + 100 : null);
|
|
459
460
|
await Fa([{ employeeId: e, enabled: a, displayOrder: n }]);
|
|
460
461
|
}
|
|
461
|
-
async function
|
|
462
|
+
async function Eo(e, a = j(/* @__PURE__ */ new Date())) {
|
|
462
463
|
const t = m.value;
|
|
463
464
|
if (!t) throw new Error(A("noOutlet"));
|
|
464
465
|
await w.deleteEmployeeFutureAssignments(t, e, a), r.value && (r.value = {
|
|
@@ -491,24 +492,24 @@ async function Ua(e, a) {
|
|
|
491
492
|
previousRoles: o
|
|
492
493
|
}), await X(!0);
|
|
493
494
|
}
|
|
494
|
-
async function
|
|
495
|
+
async function bo(e, a, t = "", n = !0) {
|
|
495
496
|
const o = [...new Set(a.filter(Boolean))];
|
|
496
497
|
o.length && (await Ua(e, (i) => [
|
|
497
498
|
...i.filter((u) => !o.includes(u.restaurantId)),
|
|
498
499
|
...o.map((u) => ({ restaurantId: u, roleId: t }))
|
|
499
500
|
]), n && m.value && o.includes(m.value) && await _a(e, !0), await Te());
|
|
500
501
|
}
|
|
501
|
-
async function
|
|
502
|
-
const n = Ze(), o = (t == null ? void 0 : t._id) === e ? t : (await X(!0)).find((
|
|
502
|
+
async function Po(e, a, t) {
|
|
503
|
+
const n = Ze(), o = (t == null ? void 0 : t._id) === e ? t : (await X(!0)).find((h) => h._id === e);
|
|
503
504
|
if (!o) throw new Error(A("employeeNotFound"));
|
|
504
|
-
const i = (
|
|
505
|
+
const i = (h) => h.slice().sort((H, $) => H.restaurantId.localeCompare($.restaurantId)).map((H) => `${H.restaurantId}:${H.roleId}`).join("|"), u = i(o.restaurantRole) !== i(a.roles), s = o.name !== a.name || o.passcode !== a.passcode || o.isMasterUser !== a.masterUser || a.masterUser && (o.code ?? "") !== a.masterCode;
|
|
505
506
|
if (!u && !s) return;
|
|
506
|
-
const d = o.restaurantRole.map((
|
|
507
|
-
restaurantId:
|
|
508
|
-
roleId:
|
|
509
|
-
})), D = o.isMasterUser ? (await Fe.readTeamMembers()).find((
|
|
507
|
+
const d = o.restaurantRole.map((h) => ({
|
|
508
|
+
restaurantId: h.restaurantId,
|
|
509
|
+
roleId: h.roleId
|
|
510
|
+
})), D = o.isMasterUser ? (await Fe.readTeamMembers()).find((h) => h.doc.posUserId === e) : void 0;
|
|
510
511
|
if (D) {
|
|
511
|
-
const
|
|
512
|
+
const h = Ma(), H = h.getPermissionAssignmentByUserId(D.id) ?? await h.readPermissionAssignmentByUserId(D.id), $ = a.masterUser ? {
|
|
512
513
|
code: a.masterCode,
|
|
513
514
|
name: a.name,
|
|
514
515
|
passcode: a.passcode,
|
|
@@ -523,12 +524,12 @@ async function bo(e, a, t) {
|
|
|
523
524
|
return;
|
|
524
525
|
}
|
|
525
526
|
if (a.masterUser) {
|
|
526
|
-
const
|
|
527
|
+
const h = {
|
|
527
528
|
user: { name: a.name, passcode: a.passcode, code: a.masterCode },
|
|
528
529
|
roles: a.roles,
|
|
529
530
|
previousRoles: d
|
|
530
531
|
};
|
|
531
|
-
o.isMasterUser ? await n.updateMasterEmployee(e,
|
|
532
|
+
o.isMasterUser ? await n.updateMasterEmployee(e, h) : await n.migrateToMasterUser(e, h);
|
|
532
533
|
} else
|
|
533
534
|
o.isMasterUser ? await n.updateMasterEmployee(e, {
|
|
534
535
|
user: { name: o.name, passcode: o.passcode, code: o.code ?? "" },
|
|
@@ -590,18 +591,18 @@ async function za(e) {
|
|
|
590
591
|
ie(e, 7 * _e)
|
|
591
592
|
);
|
|
592
593
|
}
|
|
593
|
-
async function
|
|
594
|
+
async function So() {
|
|
594
595
|
!Z || !q || await ia(/* @__PURE__ */ new Date(`${Z}T00:00:00`), /* @__PURE__ */ new Date(`${q}T00:00:00`));
|
|
595
596
|
}
|
|
596
|
-
async function
|
|
597
|
+
async function ko(e) {
|
|
597
598
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
598
599
|
const a = await w.createEmployeeProfile(m.value, e);
|
|
599
600
|
r.value && (r.value.employees.push(a), J.value += 1);
|
|
600
601
|
}
|
|
601
|
-
async function
|
|
602
|
+
async function Co(e) {
|
|
602
603
|
await w.validatePosAccess(e);
|
|
603
604
|
}
|
|
604
|
-
async function
|
|
605
|
+
async function Mo(e, a) {
|
|
605
606
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
606
607
|
const t = await w.updateEmployeeProfile(m.value, e, a);
|
|
607
608
|
if (r.value) {
|
|
@@ -612,11 +613,11 @@ async function Co(e, a) {
|
|
|
612
613
|
});
|
|
613
614
|
}
|
|
614
615
|
}
|
|
615
|
-
async function
|
|
616
|
+
async function No(e) {
|
|
616
617
|
const a = await w.createPosition(e);
|
|
617
618
|
r.value && (r.value = { ...r.value, positions: [...r.value.positions, a] });
|
|
618
619
|
}
|
|
619
|
-
async function
|
|
620
|
+
async function Lo(e, a) {
|
|
620
621
|
const t = await w.updatePosition(e, a);
|
|
621
622
|
if (r.value) {
|
|
622
623
|
const n = r.value.positions.find((i) => i.id === e), o = (i) => i.positionId === e || !i.positionId && i.positionName === (n == null ? void 0 : n.name);
|
|
@@ -633,13 +634,13 @@ async function No(e, a) {
|
|
|
633
634
|
};
|
|
634
635
|
}
|
|
635
636
|
}
|
|
636
|
-
async function
|
|
637
|
+
async function Oo(e) {
|
|
637
638
|
await w.deletePosition(e), r.value && (r.value = {
|
|
638
639
|
...r.value,
|
|
639
640
|
positions: r.value.positions.filter((a) => a.id !== e)
|
|
640
641
|
});
|
|
641
642
|
}
|
|
642
|
-
async function
|
|
643
|
+
async function Io(e, a) {
|
|
643
644
|
var o;
|
|
644
645
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
645
646
|
const t = (o = r.value) == null ? void 0 : o.days.find((i) => i.date === e), n = await w.saveScheduleDay(m.value, e, {
|
|
@@ -671,7 +672,7 @@ function Va(e) {
|
|
|
671
672
|
demands: a
|
|
672
673
|
};
|
|
673
674
|
}
|
|
674
|
-
async function
|
|
675
|
+
async function To(e) {
|
|
675
676
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
676
677
|
if (!e.length) return;
|
|
677
678
|
const a = e.map(Va), t = e.length === 1 ? await w.replaceDemands(m.value, a[0]) : await w.bulkReplaceDemands(m.value, { replacements: a });
|
|
@@ -681,19 +682,19 @@ async function Io(e) {
|
|
|
681
682
|
}
|
|
682
683
|
sa();
|
|
683
684
|
}
|
|
684
|
-
async function
|
|
685
|
+
async function Ro(e) {
|
|
685
686
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
686
687
|
return w.generateAutoSchedule(m.value, e);
|
|
687
688
|
}
|
|
688
|
-
async function
|
|
689
|
+
async function $o() {
|
|
689
690
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
690
691
|
return w.getAutoScheduleCapabilities(m.value);
|
|
691
692
|
}
|
|
692
|
-
async function
|
|
693
|
+
async function Bo(e) {
|
|
693
694
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
694
695
|
return w.applyAutoSchedule(m.value, e);
|
|
695
696
|
}
|
|
696
|
-
async function
|
|
697
|
+
async function xo(e) {
|
|
697
698
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
698
699
|
const a = await w.bulkSaveAssignments(m.value, e);
|
|
699
700
|
if (r.value) {
|
|
@@ -704,11 +705,11 @@ async function Bo(e) {
|
|
|
704
705
|
}
|
|
705
706
|
return sa(), a;
|
|
706
707
|
}
|
|
707
|
-
async function
|
|
708
|
+
async function Yo(e) {
|
|
708
709
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
709
710
|
return w.copySchedule(m.value, e);
|
|
710
711
|
}
|
|
711
|
-
async function
|
|
712
|
+
async function Fo(e) {
|
|
712
713
|
var t;
|
|
713
714
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
714
715
|
const a = await w.clearSchedule(m.value, e);
|
|
@@ -727,7 +728,7 @@ async function Yo(e) {
|
|
|
727
728
|
}
|
|
728
729
|
return a;
|
|
729
730
|
}
|
|
730
|
-
async function
|
|
731
|
+
async function _o(e) {
|
|
731
732
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
732
733
|
if (e.length && (await w.deleteAssignments(m.value, e), r.value)) {
|
|
733
734
|
const a = new Set(e);
|
|
@@ -737,12 +738,12 @@ async function Fo(e) {
|
|
|
737
738
|
};
|
|
738
739
|
}
|
|
739
740
|
}
|
|
740
|
-
async function
|
|
741
|
+
async function Uo(e) {
|
|
741
742
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
742
743
|
const a = await w.createTimeOff(m.value, e);
|
|
743
744
|
return r.value && (r.value = { ...r.value, timeOff: [...r.value.timeOff, a] }), a;
|
|
744
745
|
}
|
|
745
|
-
async function
|
|
746
|
+
async function Wo(e, a) {
|
|
746
747
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
747
748
|
const t = await w.updateTimeOffStatus(m.value, e, a);
|
|
748
749
|
return t && r.value && (r.value = {
|
|
@@ -750,14 +751,14 @@ async function Uo(e, a) {
|
|
|
750
751
|
timeOff: r.value.timeOff.map((n) => n.id === e ? t : n)
|
|
751
752
|
}), t;
|
|
752
753
|
}
|
|
753
|
-
async function
|
|
754
|
+
async function Ko(e) {
|
|
754
755
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
755
756
|
await w.deleteTimeOff(m.value, e), r.value && (r.value = {
|
|
756
757
|
...r.value,
|
|
757
758
|
timeOff: r.value.timeOff.filter((a) => a.id !== e)
|
|
758
759
|
});
|
|
759
760
|
}
|
|
760
|
-
async function
|
|
761
|
+
async function zo(e) {
|
|
761
762
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
762
763
|
const a = await w.bulkUpdateAssignmentStatus(m.value, e);
|
|
763
764
|
if (r.value && a.length) {
|
|
@@ -1006,7 +1007,7 @@ const ja = "AE", Ga = "Asia/Dubai", Qa = {
|
|
|
1006
1007
|
day: 25,
|
|
1007
1008
|
name: "Christmas Day"
|
|
1008
1009
|
}
|
|
1009
|
-
],
|
|
1010
|
+
], pt = {
|
|
1010
1011
|
2026: {
|
|
1011
1012
|
"2026-01-01": "New Year's Day",
|
|
1012
1013
|
"2026-01-16": "Isra Mi'raj",
|
|
@@ -1046,14 +1047,14 @@ const ja = "AE", Ga = "Asia/Dubai", Qa = {
|
|
|
1046
1047
|
"2027-12-25": "Christmas Day",
|
|
1047
1048
|
"2027-12-26": "Isra Mi'raj"
|
|
1048
1049
|
}
|
|
1049
|
-
},
|
|
1050
|
+
}, ht = {
|
|
1050
1051
|
countryCode: ut,
|
|
1051
1052
|
timezone: dt,
|
|
1052
1053
|
payRate: ct,
|
|
1053
1054
|
overtime: mt,
|
|
1054
1055
|
workingHours: yt,
|
|
1055
1056
|
recurringPublicHolidays: ft,
|
|
1056
|
-
publicHolidays:
|
|
1057
|
+
publicHolidays: pt
|
|
1057
1058
|
}, vt = "MO", gt = "Asia/Macau", Dt = {
|
|
1058
1059
|
NORMAL: {
|
|
1059
1060
|
overtime: 1.5
|
|
@@ -1714,7 +1715,7 @@ const ja = "AE", Ga = "Asia/Dubai", Qa = {
|
|
|
1714
1715
|
recurringPublicHolidays: un,
|
|
1715
1716
|
publicHolidays: dn,
|
|
1716
1717
|
holidayNames: cn
|
|
1717
|
-
}, yn = "VN", fn = "Asia/Ho_Chi_Minh",
|
|
1718
|
+
}, yn = "VN", fn = "Asia/Ho_Chi_Minh", pn = {
|
|
1718
1719
|
NORMAL: {
|
|
1719
1720
|
overtime: 1.5
|
|
1720
1721
|
},
|
|
@@ -1726,7 +1727,7 @@ const ja = "AE", Ga = "Asia/Dubai", Qa = {
|
|
|
1726
1727
|
regular: 2,
|
|
1727
1728
|
overtime: 3
|
|
1728
1729
|
}
|
|
1729
|
-
},
|
|
1730
|
+
}, hn = {
|
|
1730
1731
|
maxHoursPerMonth: 40
|
|
1731
1732
|
}, vn = {
|
|
1732
1733
|
fullTime: {
|
|
@@ -1789,12 +1790,12 @@ const ja = "AE", Ga = "Asia/Dubai", Qa = {
|
|
|
1789
1790
|
}, wn = {
|
|
1790
1791
|
countryCode: yn,
|
|
1791
1792
|
timezone: fn,
|
|
1792
|
-
payRate:
|
|
1793
|
-
overtime:
|
|
1793
|
+
payRate: pn,
|
|
1794
|
+
overtime: hn,
|
|
1794
1795
|
workingHours: vn,
|
|
1795
1796
|
recurringPublicHolidays: gn,
|
|
1796
1797
|
publicHolidays: Dn
|
|
1797
|
-
}, je = { AE: et, BN: lt, ID:
|
|
1798
|
+
}, je = { AE: et, BN: lt, ID: ht, MO: bt, MV: Ot, MY: Ft, PK: Gt, SG: tn, TH: mn, VN: wn };
|
|
1798
1799
|
function Hn(e) {
|
|
1799
1800
|
if (typeof e == "string") return e.toUpperCase();
|
|
1800
1801
|
if (e && typeof e == "object" && "code" in e) {
|
|
@@ -1806,7 +1807,7 @@ function Hn(e) {
|
|
|
1806
1807
|
function An(e) {
|
|
1807
1808
|
return je[Hn(e)] ?? je.MY;
|
|
1808
1809
|
}
|
|
1809
|
-
function
|
|
1810
|
+
function Vo(e, a, t) {
|
|
1810
1811
|
var o, i;
|
|
1811
1812
|
const n = En(e, a);
|
|
1812
1813
|
return !n || !t ? n : ((i = (o = e.holidayNames) == null ? void 0 : o[t.slice(0, 2).toLowerCase()]) == null ? void 0 : i[n]) ?? n;
|
|
@@ -1818,7 +1819,7 @@ function En(e, a) {
|
|
|
1818
1819
|
const n = Number(a.slice(5, 7)), o = Number(a.slice(8, 10));
|
|
1819
1820
|
return ((u = e.recurringPublicHolidays.find((s) => s.month === n && s.day === o)) == null ? void 0 : u.name) ?? null;
|
|
1820
1821
|
}
|
|
1821
|
-
const bn = Je(), ra = "unassigned",
|
|
1822
|
+
const bn = Je(), ra = "unassigned", jo = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], Go = "All Stations", Qo = [{ id: ra, label: "Assigned", roles: [], system: !0 }], Ge = [
|
|
1822
1823
|
"#903E1F",
|
|
1823
1824
|
"#5F090A",
|
|
1824
1825
|
"#0A5384",
|
|
@@ -1833,7 +1834,7 @@ function Pn(e) {
|
|
|
1833
1834
|
const a = e.trim().toLocaleLowerCase();
|
|
1834
1835
|
return (t = W.find((n) => n.name.toLocaleLowerCase() === a)) == null ? void 0 : t.id;
|
|
1835
1836
|
}
|
|
1836
|
-
function
|
|
1837
|
+
function Xo(e, a) {
|
|
1837
1838
|
if (e)
|
|
1838
1839
|
return { positionId: a ?? Pn(e), positionName: e };
|
|
1839
1840
|
}
|
|
@@ -1842,22 +1843,22 @@ function re(e, a = W) {
|
|
|
1842
1843
|
if (e)
|
|
1843
1844
|
return (e.positionId && ((t = a.find((n) => n.id === e.positionId)) == null ? void 0 : t.name)) ?? e.positionName;
|
|
1844
1845
|
}
|
|
1845
|
-
function
|
|
1846
|
+
function Jo(e, a = W) {
|
|
1846
1847
|
var t, n;
|
|
1847
1848
|
if (e)
|
|
1848
1849
|
return e.positionId ? (t = a.find((o) => o.id === e.positionId)) == null ? void 0 : t.name : (n = a.find((o) => o.name.toLocaleLowerCase() === e.positionName.toLocaleLowerCase())) == null ? void 0 : n.name;
|
|
1849
1850
|
}
|
|
1850
|
-
function
|
|
1851
|
+
function Zo(e, a) {
|
|
1851
1852
|
return a ? !W.some((t) => t.id === a) : !!e && !W.some((t) => t.name.toLocaleLowerCase() === e.toLocaleLowerCase());
|
|
1852
1853
|
}
|
|
1853
|
-
const
|
|
1854
|
+
const qo = [1, 1, 1, 1, 1, 1, 1];
|
|
1854
1855
|
function ue(e) {
|
|
1855
1856
|
return (e + 6) % 7;
|
|
1856
1857
|
}
|
|
1857
|
-
function
|
|
1858
|
+
function es(e) {
|
|
1858
1859
|
return (e + 1) % 7;
|
|
1859
1860
|
}
|
|
1860
|
-
function
|
|
1861
|
+
function pe(e, a) {
|
|
1861
1862
|
e.splice(0, e.length, ...a);
|
|
1862
1863
|
}
|
|
1863
1864
|
function Sn(e, a) {
|
|
@@ -1869,7 +1870,7 @@ function kn(e) {
|
|
|
1869
1870
|
return a.length ? (a[0][0] + (((t = a[1]) == null ? void 0 : t[0]) ?? "")).toUpperCase() : "??";
|
|
1870
1871
|
}
|
|
1871
1872
|
const la = /* @__PURE__ */ new Map(), Se = /* @__PURE__ */ new Map();
|
|
1872
|
-
function
|
|
1873
|
+
function as(e) {
|
|
1873
1874
|
return la.get(e);
|
|
1874
1875
|
}
|
|
1875
1876
|
function Cn(e) {
|
|
@@ -1878,16 +1879,16 @@ function Cn(e) {
|
|
|
1878
1879
|
const t = aa + Se.size + 1;
|
|
1879
1880
|
return Se.set(e, t), la.set(t, e), t;
|
|
1880
1881
|
}
|
|
1881
|
-
function
|
|
1882
|
+
function ts(e) {
|
|
1882
1883
|
return e.sourceId || String(e.id);
|
|
1883
1884
|
}
|
|
1884
1885
|
function Mn(e) {
|
|
1885
|
-
Ra.name = (e == null ? void 0 : e.outlet.name) ?? "",
|
|
1886
|
+
Ra.name = (e == null ? void 0 : e.outlet.name) ?? "", pe(Ta, (e == null ? void 0 : e.positions.map((s) => s.name)) ?? []), pe(W, (e == null ? void 0 : e.positions) ?? []);
|
|
1886
1887
|
const a = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], t = Array.from({ length: 7 }, () => []);
|
|
1887
1888
|
for (const s of a) t[ue(s.dayOfWeek)] = s.closed ? [] : s.hours;
|
|
1888
|
-
|
|
1889
|
+
pe(N.dayHours, t);
|
|
1889
1890
|
const n = a.filter((s) => !s.closed).flatMap((s) => s.hours);
|
|
1890
|
-
N.openFrom = n.length ? n.map((s) => s.start).reduce((s, d) => d < s ? d : s) : "00:00", N.openTo = n.length ? n.map((s) => s.end).reduce((s, d) => d > s ? d : s) : "24:00",
|
|
1891
|
+
N.openFrom = n.length ? n.map((s) => s.start).reduce((s, d) => d < s ? d : s) : "00:00", N.openTo = n.length ? n.map((s) => s.end).reduce((s, d) => d > s ? d : s) : "24:00", pe(
|
|
1891
1892
|
N.closedWeekdays,
|
|
1892
1893
|
a.filter((s) => s.closed).map((s) => ue(s.dayOfWeek)).sort((s, d) => s - d)
|
|
1893
1894
|
);
|
|
@@ -1984,7 +1985,7 @@ function xn(e) {
|
|
|
1984
1985
|
const t = (na.value[e] ?? ((n = le.value.find((o) => o._id === e)) == null ? void 0 : n.restaurantRole.map((o) => o.restaurantId)) ?? []).map((o) => se[o]).filter((o) => !!o);
|
|
1985
1986
|
return t.length ? Bn([...new Set(t)]) : void 0;
|
|
1986
1987
|
}
|
|
1987
|
-
function
|
|
1988
|
+
function ns(e = []) {
|
|
1988
1989
|
const a = r.value;
|
|
1989
1990
|
if (!a) return [];
|
|
1990
1991
|
const t = new Map(a.employees.map((s) => [s.employeeId, s])), n = new Map(
|
|
@@ -2003,7 +2004,7 @@ function ts(e = []) {
|
|
|
2003
2004
|
code: void 0,
|
|
2004
2005
|
passcode: "",
|
|
2005
2006
|
isMasterUser: !1
|
|
2006
|
-
}, D = we(s),
|
|
2007
|
+
}, D = we(s), h = Cn(s.employeeId), H = new Set(W.map((v) => v.id)), $ = new Set(W.map((v) => v.name.toLocaleLowerCase())), F = (v) => v.positionId ? H.has(v.positionId) : $.has(v.positionName.toLocaleLowerCase()), B = re(s.primaryPosition), f = !!s.primaryPosition && F(s.primaryPosition), b = s.secondaryPositions.filter(F).map((v) => re(v)).filter((v) => !!v), _ = B ? f ? [B, ...b] : [] : b, I = [
|
|
2007
2008
|
...B && !f ? [B] : [],
|
|
2008
2009
|
...s.secondaryPositions.filter((v) => !F(v)).map((v) => re(v)).filter((v) => !!v)
|
|
2009
2010
|
], de = _[0] ?? "", K = e.map((v) => {
|
|
@@ -2020,7 +2021,7 @@ function ts(e = []) {
|
|
|
2020
2021
|
return { from: (E == null ? void 0 : E.start) ?? "", to: (E == null ? void 0 : E.end) ?? "" };
|
|
2021
2022
|
});
|
|
2022
2023
|
return {
|
|
2023
|
-
id:
|
|
2024
|
+
id: h,
|
|
2024
2025
|
sourceId: s.employeeId,
|
|
2025
2026
|
// Employee page edits update the POS employee name. Use that as the display
|
|
2026
2027
|
// source so Scheduling reflects those changes after its roster refresh.
|
|
@@ -2034,7 +2035,7 @@ function ts(e = []) {
|
|
|
2034
2035
|
employmentType: s.employmentType,
|
|
2035
2036
|
role: de,
|
|
2036
2037
|
initials: kn(d.name),
|
|
2037
|
-
color: Ge[(
|
|
2038
|
+
color: Ge[(h - aa - 1) % Ge.length],
|
|
2038
2039
|
// Gross hours actually rostered this week — the figure the cost rail multiplies by
|
|
2039
2040
|
// the rate. Contracted hours are a separate question, answered by RULES.contract.
|
|
2040
2041
|
// Rounded to one decimal — `hoursBetween` divides by 60, so an unrounded sum reads
|
|
@@ -2074,10 +2075,10 @@ function ts(e = []) {
|
|
|
2074
2075
|
};
|
|
2075
2076
|
});
|
|
2076
2077
|
}
|
|
2077
|
-
function
|
|
2078
|
+
function os() {
|
|
2078
2079
|
return [];
|
|
2079
2080
|
}
|
|
2080
|
-
function
|
|
2081
|
+
function ss() {
|
|
2081
2082
|
var n, o;
|
|
2082
2083
|
const e = r.value, a = {}, t = {};
|
|
2083
2084
|
for (const i of (e == null ? void 0 : e.demands) ?? []) {
|
|
@@ -2092,7 +2093,7 @@ function os() {
|
|
|
2092
2093
|
}
|
|
2093
2094
|
return { byDate: a, byWeekday: t };
|
|
2094
2095
|
}
|
|
2095
|
-
function
|
|
2096
|
+
function is() {
|
|
2096
2097
|
const e = Je(), { restaurants: a, readRestaurants: t } = Ca(), n = Pa(), o = Sa(), i = S(!1);
|
|
2097
2098
|
let u = () => !0;
|
|
2098
2099
|
const s = Y(
|
|
@@ -2104,7 +2105,7 @@ function ss() {
|
|
|
2104
2105
|
var f;
|
|
2105
2106
|
return ((f = e.currentRestaurant.value) == null ? void 0 : f._id) ?? "";
|
|
2106
2107
|
});
|
|
2107
|
-
async function
|
|
2108
|
+
async function h(f, b) {
|
|
2108
2109
|
return f !== m.value && !await u(f) || !ze(f) ? !1 : (localStorage.setItem(d(), f), n.query.restaurantId !== f && o.replace({ query: { ...n.query, restaurantId: f } }), await Promise.all([Ie(f), za(b)]), !0);
|
|
2109
2110
|
}
|
|
2110
2111
|
function H(f) {
|
|
@@ -2121,9 +2122,9 @@ function ss() {
|
|
|
2121
2122
|
const f = await F();
|
|
2122
2123
|
return f && await Ie(f), f;
|
|
2123
2124
|
}
|
|
2124
|
-
return { options: s, ready: i, outletId: m, resolve: B, resolveOutlet: F, switchTo:
|
|
2125
|
+
return { options: s, ready: i, outletId: m, resolve: B, resolveOutlet: F, switchTo: h, setBeforeSwitch: H };
|
|
2125
2126
|
}
|
|
2126
|
-
const Yn = ["data-hierarchy", "data-size", "data-icon"],
|
|
2127
|
+
const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe({
|
|
2127
2128
|
__name: "ScheduleButton",
|
|
2128
2129
|
props: {
|
|
2129
2130
|
hierarchy: { default: "primary" },
|
|
@@ -2156,7 +2157,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe
|
|
|
2156
2157
|
}, Qn = ["aria-selected", "onClick"], Xn = {
|
|
2157
2158
|
key: 0,
|
|
2158
2159
|
class: "fx-opt-text"
|
|
2159
|
-
}, Jn = { key: 0 },
|
|
2160
|
+
}, Jn = { key: 0 }, ls = /* @__PURE__ */ xe({
|
|
2160
2161
|
inheritAttrs: !1,
|
|
2161
2162
|
__name: "ScheduleSelect",
|
|
2162
2163
|
props: {
|
|
@@ -2174,7 +2175,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe
|
|
|
2174
2175
|
},
|
|
2175
2176
|
emits: ["update:modelValue", "toggle"],
|
|
2176
2177
|
setup(e, { emit: a }) {
|
|
2177
|
-
const { t } = ka(), n = e, o = a, i =
|
|
2178
|
+
const { t } = ka(), n = e, o = a, i = pa(), u = Y(() => i.class ?? ""), s = S(!1), d = S(!1), D = S(null), h = S(null), H = S(null), $ = Y(() => n.teleport !== !1 && d.value);
|
|
2178
2179
|
Re(() => {
|
|
2179
2180
|
d.value = typeof document < "u" && !!document.body;
|
|
2180
2181
|
});
|
|
@@ -2202,7 +2203,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe
|
|
|
2202
2203
|
return l;
|
|
2203
2204
|
}), K = 5, L = 8;
|
|
2204
2205
|
function ee() {
|
|
2205
|
-
const l = H.value, y =
|
|
2206
|
+
const l = H.value, y = h.value;
|
|
2206
2207
|
if (!l || !y) return;
|
|
2207
2208
|
const c = y.getBoundingClientRect(), O = window.innerWidth || document.documentElement.clientWidth, R = window.innerHeight || document.documentElement.clientHeight;
|
|
2208
2209
|
l.style.minWidth = `${Math.round(c.width)}px`, l.style.maxWidth = `${Math.max(180, Math.round(O - L * 2))}px`;
|
|
@@ -2222,7 +2223,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe
|
|
|
2222
2223
|
function me(l) {
|
|
2223
2224
|
const y = H.value, c = l.target;
|
|
2224
2225
|
if (y && c && c !== document && y.contains(c)) return;
|
|
2225
|
-
const O =
|
|
2226
|
+
const O = h.value;
|
|
2226
2227
|
if (!O) return;
|
|
2227
2228
|
const R = O.getBoundingClientRect(), ae = window.innerHeight || document.documentElement.clientHeight;
|
|
2228
2229
|
if (R.bottom < 0 || R.top > ae) {
|
|
@@ -2250,7 +2251,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe
|
|
|
2250
2251
|
function U(l) {
|
|
2251
2252
|
var y;
|
|
2252
2253
|
if (l.key === "Escape")
|
|
2253
|
-
l.preventDefault(), P(), (y =
|
|
2254
|
+
l.preventDefault(), P(), (y = h.value) == null || y.focus();
|
|
2254
2255
|
else if (l.key === "Enter") {
|
|
2255
2256
|
l.preventDefault();
|
|
2256
2257
|
const c = I.value.find((O) => !O.disabled);
|
|
@@ -2287,7 +2288,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe
|
|
|
2287
2288
|
var y;
|
|
2288
2289
|
if (l.key === "Escape") {
|
|
2289
2290
|
if (!s.value) return;
|
|
2290
|
-
l.preventDefault(), P(), (y =
|
|
2291
|
+
l.preventDefault(), P(), (y = h.value) == null || y.focus();
|
|
2291
2292
|
return;
|
|
2292
2293
|
}
|
|
2293
2294
|
if (l.key === "Enter" || l.key === " ") {
|
|
@@ -2299,11 +2300,11 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe
|
|
|
2299
2300
|
return $e(k), (l, y) => (C(), M("div", {
|
|
2300
2301
|
ref_key: "rootEl",
|
|
2301
2302
|
ref: D,
|
|
2302
|
-
class:
|
|
2303
|
+
class: he(["fx-sel", u.value])
|
|
2303
2304
|
}, [
|
|
2304
2305
|
x("button", va({
|
|
2305
2306
|
ref_key: "btnEl",
|
|
2306
|
-
ref:
|
|
2307
|
+
ref: h
|
|
2307
2308
|
}, l.$attrs, {
|
|
2308
2309
|
type: "button",
|
|
2309
2310
|
class: ["sch-input fx-btn", { "is-open": s.value }],
|
|
@@ -2315,7 +2316,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe
|
|
|
2315
2316
|
}), [
|
|
2316
2317
|
x("span", _n, z(F.value), 1)
|
|
2317
2318
|
], 16, Fn),
|
|
2318
|
-
(C(),
|
|
2319
|
+
(C(), ha(ga, {
|
|
2319
2320
|
to: "body",
|
|
2320
2321
|
disabled: !$.value
|
|
2321
2322
|
}, [
|
|
@@ -2324,7 +2325,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe
|
|
|
2324
2325
|
key: 0,
|
|
2325
2326
|
ref_key: "popEl",
|
|
2326
2327
|
ref: H,
|
|
2327
|
-
class:
|
|
2328
|
+
class: he(["fx-pop", { "fx-pop-rich": f.value }]),
|
|
2328
2329
|
role: "listbox",
|
|
2329
2330
|
"aria-multiselectable": e.multiple || void 0,
|
|
2330
2331
|
style: { visibility: "hidden" }
|
|
@@ -2352,7 +2353,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe
|
|
|
2352
2353
|
}, [
|
|
2353
2354
|
"heading" in c ? (C(), M("div", Gn, z(c.heading), 1)) : (C(), M("div", {
|
|
2354
2355
|
key: 1,
|
|
2355
|
-
class:
|
|
2356
|
+
class: he(["fx-opt", {
|
|
2356
2357
|
"is-on": B(c.option),
|
|
2357
2358
|
"is-off": c.option.disabled,
|
|
2358
2359
|
"is-new": c.option.command
|
|
@@ -2393,7 +2394,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe
|
|
|
2393
2394
|
], 8, ["disabled"]))
|
|
2394
2395
|
], 2));
|
|
2395
2396
|
}
|
|
2396
|
-
}), Zn = ["id", "aria-labelledby", "aria-label"], Qe = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',
|
|
2397
|
+
}), Zn = ["id", "aria-labelledby", "aria-label"], Qe = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', us = /* @__PURE__ */ xe({
|
|
2397
2398
|
__name: "ScheduleModal",
|
|
2398
2399
|
props: {
|
|
2399
2400
|
open: { type: Boolean },
|
|
@@ -2422,8 +2423,8 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe
|
|
|
2422
2423
|
if (d.key !== "Tab" || !o.value) return;
|
|
2423
2424
|
const D = Array.from(o.value.querySelectorAll(Qe));
|
|
2424
2425
|
if (!D.length) return;
|
|
2425
|
-
const
|
|
2426
|
-
d.shiftKey && document.activeElement ===
|
|
2426
|
+
const h = D[0], H = D[D.length - 1];
|
|
2427
|
+
d.shiftKey && document.activeElement === h ? (d.preventDefault(), H.focus()) : !d.shiftKey && document.activeElement === H && (d.preventDefault(), h.focus());
|
|
2427
2428
|
}
|
|
2428
2429
|
return Be(
|
|
2429
2430
|
() => t.open,
|
|
@@ -2436,13 +2437,13 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe
|
|
|
2436
2437
|
}), (d, D) => e.open ? (C(), M("div", {
|
|
2437
2438
|
key: 0,
|
|
2438
2439
|
class: "modal-overlay open",
|
|
2439
|
-
onClick: D[0] || (D[0] = Ea((
|
|
2440
|
+
onClick: D[0] || (D[0] = Ea((h) => n("close"), ["self"]))
|
|
2440
2441
|
}, [
|
|
2441
2442
|
x("div", {
|
|
2442
2443
|
id: e.id,
|
|
2443
2444
|
ref_key: "panel",
|
|
2444
2445
|
ref: o,
|
|
2445
|
-
class:
|
|
2446
|
+
class: he(["schedule-modal-panel", e.panelClass]),
|
|
2446
2447
|
style: ba(e.panelStyle),
|
|
2447
2448
|
role: "dialog",
|
|
2448
2449
|
"aria-modal": "true",
|
|
@@ -2456,101 +2457,101 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe
|
|
|
2456
2457
|
}
|
|
2457
2458
|
});
|
|
2458
2459
|
export {
|
|
2459
|
-
|
|
2460
|
-
|
|
2460
|
+
fo as $,
|
|
2461
|
+
Go as A,
|
|
2461
2462
|
Pn as B,
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2463
|
+
yo as C,
|
|
2464
|
+
co as D,
|
|
2465
|
+
ts as E,
|
|
2466
|
+
lo as F,
|
|
2466
2467
|
qe as G,
|
|
2467
2468
|
Me as H,
|
|
2468
2469
|
Oa as I,
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2470
|
+
po as J,
|
|
2471
|
+
Mo as K,
|
|
2472
|
+
Zo as L,
|
|
2472
2473
|
Na as M,
|
|
2473
|
-
|
|
2474
|
-
|
|
2474
|
+
Ko as N,
|
|
2475
|
+
Wo as O,
|
|
2475
2476
|
Ta as P,
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2477
|
+
Uo as Q,
|
|
2478
|
+
mo as R,
|
|
2479
|
+
Qo as S,
|
|
2479
2480
|
ge as T,
|
|
2480
2481
|
ra as U,
|
|
2481
|
-
|
|
2482
|
-
|
|
2482
|
+
Ao as V,
|
|
2483
|
+
jo as W,
|
|
2483
2484
|
V as X,
|
|
2484
2485
|
Fa as Y,
|
|
2485
2486
|
Ke as Z,
|
|
2486
|
-
|
|
2487
|
-
|
|
2487
|
+
es as _,
|
|
2488
|
+
ns as a,
|
|
2488
2489
|
Bn as a0,
|
|
2489
2490
|
w as a1,
|
|
2490
2491
|
ue as a2,
|
|
2491
2492
|
re as a3,
|
|
2492
2493
|
se as a4,
|
|
2493
|
-
|
|
2494
|
-
|
|
2494
|
+
Po as a5,
|
|
2495
|
+
ko as a6,
|
|
2495
2496
|
Te as a7,
|
|
2496
2497
|
X as a8,
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2498
|
+
bo as a9,
|
|
2499
|
+
io as aA,
|
|
2500
|
+
is as aB,
|
|
2501
|
+
Ho as aC,
|
|
2502
|
+
Oo as aD,
|
|
2503
|
+
No as aE,
|
|
2503
2504
|
le as aF,
|
|
2504
|
-
|
|
2505
|
+
Lo as aG,
|
|
2505
2506
|
_a as aa,
|
|
2506
|
-
|
|
2507
|
+
Co as ab,
|
|
2507
2508
|
j as ac,
|
|
2508
2509
|
Cn as ad,
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2510
|
+
Bo as ae,
|
|
2511
|
+
Ro as af,
|
|
2512
|
+
$o as ag,
|
|
2513
|
+
qo as ah,
|
|
2513
2514
|
za as ai,
|
|
2514
|
-
|
|
2515
|
+
Yo as aj,
|
|
2515
2516
|
Ra as ak,
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2517
|
+
ro as al,
|
|
2518
|
+
To as am,
|
|
2519
|
+
Do as an,
|
|
2519
2520
|
Ue as ao,
|
|
2520
|
-
|
|
2521
|
+
ss as ap,
|
|
2521
2522
|
We as aq,
|
|
2522
2523
|
ve as ar,
|
|
2523
2524
|
Ie as as,
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2525
|
+
Fo as at,
|
|
2526
|
+
Eo as au,
|
|
2527
|
+
rs as av,
|
|
2527
2528
|
oa as aw,
|
|
2528
|
-
|
|
2529
|
-
|
|
2529
|
+
ls as ax,
|
|
2530
|
+
us as ay,
|
|
2530
2531
|
W as az,
|
|
2531
2532
|
N as b,
|
|
2532
|
-
|
|
2533
|
+
os as c,
|
|
2533
2534
|
J as d,
|
|
2534
|
-
|
|
2535
|
-
|
|
2535
|
+
Xo as e,
|
|
2536
|
+
uo as f,
|
|
2536
2537
|
An as g,
|
|
2537
|
-
|
|
2538
|
+
Vo as h,
|
|
2538
2539
|
Ba as i,
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2540
|
+
Io as j,
|
|
2541
|
+
as as k,
|
|
2542
|
+
xo as l,
|
|
2543
|
+
_o as m,
|
|
2544
|
+
zo as n,
|
|
2544
2545
|
m as o,
|
|
2545
2546
|
r as p,
|
|
2546
|
-
|
|
2547
|
-
|
|
2547
|
+
wo as q,
|
|
2548
|
+
So as r,
|
|
2548
2549
|
La as s,
|
|
2549
2550
|
Le as t,
|
|
2550
|
-
|
|
2551
|
+
vo as u,
|
|
2551
2552
|
ie as v,
|
|
2552
2553
|
ho as w,
|
|
2553
2554
|
Ne as x,
|
|
2554
|
-
|
|
2555
|
-
|
|
2555
|
+
Jo as y,
|
|
2556
|
+
go as z
|
|
2556
2557
|
};
|