@feedmepos/mf-hrm-portal 2.2.5-dev → 2.2.5-dev.10
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-DgcWZ3SZ.js → ApprovalCodeList-BsDMMSIz.js} +4 -4
- package/dist/{AuditLogList-vWKMMGvd.js → AuditLogList-CGNZdtmn.js} +18 -17
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-DuhXogXK.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-C6MoToqi.js} +2 -2
- package/dist/EmployeeList-B_OuDWWQ.js +787 -0
- package/dist/{FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js → FormItem.vue_vue_type_script_setup_true_lang-CUnlKsxk.js} +1 -1
- package/dist/{GrantUserList-BAW0C1bA.js → GrantUserList-Bd0lXmFo.js} +5 -5
- package/dist/{Main-NzpdRNB3.js → Main-B66lSeOv.js} +5 -5
- package/dist/{Main-Wr6cTqfM.js → Main-CzHSNHsH.js} +2 -2
- package/dist/{Main-B7Nn8CLQ.js → Main-njRQ1tFk.js} +9 -9
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
- package/dist/{PermissionSetList-D6AFOleD.js → PermissionSetList-GTI6Cwj5.js} +18 -18
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bzq2_BMn.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C-QEQ-js.js} +1052 -1052
- package/dist/{RoleList-BuqpmXn_.js → RoleList-CmHgtM0m.js} +7 -7
- package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-SFqxftRx.js +426 -0
- package/dist/ScheduleButton.vue_vue_type_script_setup_true_lang-CrWfo-zF.js +690 -0
- package/dist/ScheduleGeneralPage-DxFxJN5j.js +320 -0
- package/dist/SchedulePage-cJDI3-E7.js +14647 -0
- package/dist/SchedulePositionPage-n1wUShIM.js +293 -0
- package/dist/ScheduleSelect.vue_vue_type_script_setup_true_lang-B8W4sTsA.js +242 -0
- package/dist/SelectFilter-CG13h83-.js +264 -0
- package/dist/TeamMemberList-ByZt3VqN.js +1154 -0
- package/dist/{TimesheetList-B5FyVyCz.js → TimesheetList-Dv0-W--W.js} +54 -53
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-C99Jr6Ax.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-DIo6h5-a.js} +2 -2
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/{app-8samJY5z.js → app-SCXGJ95F.js} +3146 -2553
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-Ba4X_9nY.js → dayjs.min-DqMLPYv-.js} +1 -1
- package/dist/{employee-BcFgm8Rt.js → employee-DT_xYQkz.js} +3 -3
- package/dist/{iteration-Dhdew1jW.js → iteration-B5dB9ecy.js} +1 -1
- package/dist/{lodash-CJ3mHku0.js → lodash-CRHFapxI.js} +1 -1
- package/dist/{role-BViYS7RK.js → role-CJm8pXaw.js} +1 -1
- package/dist/{rule-Dxt1ZSQS.js → rule-AJm-eVzJ.js} +276 -272
- package/dist/src/api/schedule/index.d.ts +41 -0
- package/dist/src/components/form/OutletRoleAssignment.vue.d.ts +16 -0
- package/dist/src/components/layout/AppSidebar.vue.d.ts +2 -0
- package/dist/src/components/layout/PortalShell.vue.d.ts +12 -0
- package/dist/src/components/layout/withShell.d.ts +14 -0
- package/dist/src/helpers/outlet-role-assignment.d.ts +40 -0
- package/dist/src/helpers/rule.d.ts +15 -0
- package/dist/src/router/shared.d.ts +4 -1
- package/dist/src/types/schedule.d.ts +232 -0
- package/dist/src/views/scheduling/ScheduleGeneralPage.vue.d.ts +3 -0
- package/dist/src/views/scheduling/SchedulePage.vue.d.ts +3 -0
- package/dist/src/views/scheduling/SchedulePositionPage.vue.d.ts +3 -0
- package/dist/src/views/scheduling/components/ScheduleAddEmployeeIdentitySection.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleAddEmployeeModal.vue.d.ts +10 -0
- package/dist/src/views/scheduling/components/ScheduleAddEmployeeModeStep.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleAddEmployeePosAccessSection.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleAddEmployeePositionsSection.vue.d.ts +10 -0
- package/dist/src/views/scheduling/components/ScheduleAddEmployeeSchedulingSection.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleAddPickPopover.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleAddPositionModal.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleAllShiftsRow.vue.d.ts +22 -0
- package/dist/src/views/scheduling/components/ScheduleAreaRows.vue.d.ts +34 -0
- package/dist/src/views/scheduling/components/ScheduleAssignEmployeePopover.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleAutoScheduleModal.vue.d.ts +10 -0
- package/dist/src/views/scheduling/components/ScheduleButton.vue.d.ts +23 -0
- package/dist/src/views/scheduling/components/ScheduleChangeEmployeeModal.vue.d.ts +8 -0
- package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +24 -0
- package/dist/src/views/scheduling/components/ScheduleCostRail.vue.d.ts +8 -0
- package/dist/src/views/scheduling/components/ScheduleDateRangePopover.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleDayNotePopover.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleDayTimeline.vue.d.ts +12 -0
- package/dist/src/views/scheduling/components/ScheduleDemandRow.vue.d.ts +23 -0
- package/dist/src/views/scheduling/components/ScheduleDemandSheet.vue.d.ts +10 -0
- package/dist/src/views/scheduling/components/ScheduleDotsIcon.vue.d.ts +2 -0
- package/dist/src/views/scheduling/components/ScheduleEmployeeDetailPanel.vue.d.ts +12 -0
- package/dist/src/views/scheduling/components/ScheduleEmployeeIdentity.vue.d.ts +17 -0
- package/dist/src/views/scheduling/components/ScheduleEmployeeMenu.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleFilterBar.vue.d.ts +18 -0
- package/dist/src/views/scheduling/components/ScheduleGapPopover.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleGridHeader.vue.d.ts +18 -0
- package/dist/src/views/scheduling/components/ScheduleGridSkeleton.vue.d.ts +2 -0
- package/dist/src/views/scheduling/components/ScheduleLeaveEditModal.vue.d.ts +8 -0
- package/dist/src/views/scheduling/components/ScheduleLegendBar.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleOnboardingWelcome.vue.d.ts +12 -0
- package/dist/src/views/scheduling/components/ScheduleOnboardingWizard.vue.d.ts +9 -0
- package/dist/src/views/scheduling/components/ScheduleOpenShiftCardMenu.vue.d.ts +14 -0
- package/dist/src/views/scheduling/components/SchedulePdfPreview.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/SchedulePublishModal.vue.d.ts +8 -0
- package/dist/src/views/scheduling/components/ScheduleReviewBar.vue.d.ts +12 -0
- package/dist/src/views/scheduling/components/ScheduleSelect.vue.d.ts +54 -0
- package/dist/src/views/scheduling/components/ScheduleSelectExistingEmployeeModal.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleShiftCardMenu.vue.d.ts +12 -0
- package/dist/src/views/scheduling/components/ScheduleShiftCell.vue.d.ts +35 -0
- package/dist/src/views/scheduling/components/ScheduleShiftHeadcountEditor.vue.d.ts +10 -0
- package/dist/src/views/scheduling/components/ScheduleShiftImpact.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleShiftMoreOptions.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleShiftPopover.vue.d.ts +16 -0
- package/dist/src/views/scheduling/components/ScheduleShiftRepeatDaysRow.vue.d.ts +8 -0
- package/dist/src/views/scheduling/components/ScheduleShiftSegmentsEditor.vue.d.ts +8 -0
- package/dist/src/views/scheduling/components/ScheduleShiftWhoPicker.vue.d.ts +25 -0
- package/dist/src/views/scheduling/components/ScheduleStackPopover.vue.d.ts +14 -0
- package/dist/src/views/scheduling/components/ScheduleStaffRail.vue.d.ts +18 -0
- package/dist/src/views/scheduling/components/ScheduleStaffRows.vue.d.ts +60 -0
- package/dist/src/views/scheduling/components/ScheduleStatsRow.vue.d.ts +12 -0
- package/dist/src/views/scheduling/components/ScheduleSwapShiftsModal.vue.d.ts +8 -0
- package/dist/src/views/scheduling/components/ScheduleTimePickerPopover.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleTopbar.vue.d.ts +20 -0
- package/dist/src/views/scheduling/composables/schedule-add-employee-form.d.ts +72 -0
- package/dist/src/views/scheduling/composables/schedule-board-helpers.d.ts +38 -0
- package/dist/src/views/scheduling/composables/schedule-day-meta.d.ts +29 -0
- package/dist/src/views/scheduling/composables/schedule-employee-profile.d.ts +7 -0
- package/dist/src/views/scheduling/composables/schedule-popover-position.d.ts +16 -0
- package/dist/src/views/scheduling/composables/schedule-shift-time.d.ts +14 -0
- package/dist/src/views/scheduling/composables/schedule-week-cache.d.ts +10 -0
- package/dist/src/views/scheduling/composables/scheduleAutoSolver.d.ts +21 -0
- package/dist/src/views/scheduling/composables/useCollapsedList.d.ts +9 -0
- package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +98 -0
- package/dist/src/views/scheduling/composables/useScheduleAddPick.d.ts +73 -0
- package/dist/src/views/scheduling/composables/useScheduleAllShiftsRow.d.ts +77 -0
- package/dist/src/views/scheduling/composables/useScheduleAreaBoard.d.ts +50 -0
- package/dist/src/views/scheduling/composables/useScheduleAreaDragDrop.d.ts +18 -0
- package/dist/src/views/scheduling/composables/useScheduleAssign.d.ts +122 -0
- package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +143 -0
- package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +426 -0
- package/dist/src/views/scheduling/composables/useScheduleCellState.d.ts +27 -0
- package/dist/src/views/scheduling/composables/useScheduleClashDetection.d.ts +18 -0
- package/dist/src/views/scheduling/composables/useScheduleCopyWeek.d.ts +19 -0
- package/dist/src/views/scheduling/composables/useScheduleCostRail.d.ts +43 -0
- package/dist/src/views/scheduling/composables/useScheduleDayNote.d.ts +48 -0
- package/dist/src/views/scheduling/composables/useScheduleDayTimeline.d.ts +77 -0
- package/dist/src/views/scheduling/composables/useScheduleDemand.d.ts +76 -0
- package/dist/src/views/scheduling/composables/useScheduleDemandRow.d.ts +45 -0
- package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +145 -0
- package/dist/src/views/scheduling/composables/useScheduleDragDrop.d.ts +22 -0
- package/dist/src/views/scheduling/composables/useScheduleEmployeeIdentity.d.ts +41 -0
- package/dist/src/views/scheduling/composables/useScheduleEmployeeMenu.d.ts +35 -0
- package/dist/src/views/scheduling/composables/useScheduleEmployeeProfile.d.ts +16 -0
- package/dist/src/views/scheduling/composables/useScheduleExport.d.ts +26 -0
- package/dist/src/views/scheduling/composables/useScheduleFilterBar.d.ts +14 -0
- package/dist/src/views/scheduling/composables/useScheduleGapPopover.d.ts +82 -0
- package/dist/src/views/scheduling/composables/useScheduleLeave.d.ts +70 -0
- package/dist/src/views/scheduling/composables/useScheduleLegend.d.ts +15 -0
- package/dist/src/views/scheduling/composables/useScheduleLegendBar.d.ts +35 -0
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1316 -0
- package/dist/src/views/scheduling/composables/useScheduleOpenShiftCard.d.ts +23 -0
- package/dist/src/views/scheduling/composables/useScheduleOutlet.d.ts +20 -0
- package/dist/src/views/scheduling/composables/useSchedulePositionModal.d.ts +50 -0
- package/dist/src/views/scheduling/composables/useSchedulePositions.d.ts +32 -0
- package/dist/src/views/scheduling/composables/useSchedulePublish.d.ts +93 -0
- package/dist/src/views/scheduling/composables/useScheduleRangeCalendar.d.ts +27 -0
- package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +189 -0
- package/dist/src/views/scheduling/composables/useScheduleSettings.d.ts +54 -0
- package/dist/src/views/scheduling/composables/useScheduleSetupBanner.d.ts +18 -0
- package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +163 -0
- package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +181 -0
- package/dist/src/views/scheduling/composables/useScheduleStaffRail.d.ts +23 -0
- package/dist/src/views/scheduling/composables/useScheduleStatsRow.d.ts +25 -0
- package/dist/src/views/scheduling/composables/useScheduleTimePicker.d.ts +49 -0
- package/dist/src/views/scheduling/composables/useScheduleTopbar.d.ts +10 -0
- package/dist/src/views/scheduling/composables/useScheduleViewportFit.d.ts +9 -0
- package/dist/src/views/scheduling/data.d.ts +110 -0
- package/dist/src/views/scheduling/locales/index.d.ts +496 -0
- package/dist/src/views/scheduling/schedule-store.d.ts +151 -0
- package/dist/src/views/scheduling/types.d.ts +324 -0
- package/dist/src/views/team/components/PortalConditionForm.vue.d.ts +2 -2
- package/dist/src/views/team/condition-builders/ConditionBuilderForm.vue.d.ts +2 -2
- package/dist/src/views/team/member/TeamMemberMasterUser.vue.d.ts +12 -3
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useReportPermissions-BiyAfGvZ.js → useReportPermissions-Cg3lV70m.js} +3 -3
- package/package.json +1 -1
- package/dist/EmployeeList-Cu4RxVQX.js +0 -889
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-BUI0Xsgc.js +0 -85
- package/dist/SelectFilter-ATOm0hdn.js +0 -269
- package/dist/TeamMemberList-M6HA9BWu.js +0 -1248
|
@@ -0,0 +1,690 @@
|
|
|
1
|
+
import { onMounted as le, onBeforeUnmount as ce, ref as T, shallowRef as b, reactive as v, watch as de, computed as z, defineComponent as fe, createElementBlock as me, openBlock as pe, renderSlot as ye } from "vue";
|
|
2
|
+
import { useCoreStore as he } from "@feedmepos/mf-common";
|
|
3
|
+
import { g as y, b as m, u as ve } from "./restaurant-BTpBmfBV.js";
|
|
4
|
+
import { E as W, u as we } from "./employee-DT_xYQkz.js";
|
|
5
|
+
function Ge(e) {
|
|
6
|
+
let t = null;
|
|
7
|
+
function n() {
|
|
8
|
+
if (!t) return;
|
|
9
|
+
t.style.height = "";
|
|
10
|
+
const o = t.getBoundingClientRect().top;
|
|
11
|
+
t.style.height = `${Math.max(0, window.innerHeight - o)}px`;
|
|
12
|
+
}
|
|
13
|
+
le(() => {
|
|
14
|
+
var o;
|
|
15
|
+
t = ((o = e.value) == null ? void 0 : o.closest(".sch-page")) ?? null, n(), window.addEventListener("resize", n);
|
|
16
|
+
}), ce(() => {
|
|
17
|
+
window.removeEventListener("resize", n), t && (t.style.height = "");
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
const p = {
|
|
21
|
+
async generateAutoSchedule(e, t) {
|
|
22
|
+
return y(
|
|
23
|
+
await m(`restaurants/${e}/schedules`).post(
|
|
24
|
+
"auto-schedule/generate",
|
|
25
|
+
t
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
},
|
|
29
|
+
/** One outlet's whole board over `[from, to]` (inclusive, 'YYYY-MM-DD'). */
|
|
30
|
+
async readBoard(e, t, n) {
|
|
31
|
+
return y(
|
|
32
|
+
await m(`restaurants/${e}/schedules`).get("board", {
|
|
33
|
+
params: { from: t, to: n }
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
},
|
|
37
|
+
/** Creates or updates the employee's shared business-level scheduling profile. */
|
|
38
|
+
async createEmployeeProfile(e, t) {
|
|
39
|
+
return y(await m("schedules").post("employees", t));
|
|
40
|
+
},
|
|
41
|
+
/** Edits the employee's shared business-level scheduling profile. */
|
|
42
|
+
async updateEmployeeProfile(e, t, n) {
|
|
43
|
+
return y(
|
|
44
|
+
await m("schedules").post("employees", { employeeId: t, ...n })
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
/** Positions are shared across the business. */
|
|
48
|
+
async createPosition(e) {
|
|
49
|
+
return y(await m("schedules").post("positions", e));
|
|
50
|
+
},
|
|
51
|
+
async updatePosition(e, t) {
|
|
52
|
+
return y(await m("schedules").post(`positions/${e}`, t));
|
|
53
|
+
},
|
|
54
|
+
/** Deleting one position is `deletePositions` with a single-id array — the backend's
|
|
55
|
+
* `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
|
|
56
|
+
async deletePosition(e) {
|
|
57
|
+
await m("schedules").delete("positions", {
|
|
58
|
+
params: { ids: e }
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
/** Creates one flat demand interval. */
|
|
62
|
+
async createDemand(e, t) {
|
|
63
|
+
return y(
|
|
64
|
+
await m(`restaurants/${e}/schedules`).post("demands", t)
|
|
65
|
+
);
|
|
66
|
+
},
|
|
67
|
+
/** Deletes a batch of demands in one request — e.g. `saveDemand` replacing a whole
|
|
68
|
+
* day/weekday's demand rows wholesale. Deleting one demand is just this with a single-id
|
|
69
|
+
* array. */
|
|
70
|
+
async deleteDemands(e, t) {
|
|
71
|
+
return y(
|
|
72
|
+
await m(`restaurants/${e}/schedules`).delete("demands", {
|
|
73
|
+
params: { ids: t.join(",") }
|
|
74
|
+
})
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
/** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
|
|
78
|
+
async saveScheduleDay(e, t, n) {
|
|
79
|
+
return y(
|
|
80
|
+
await m(`restaurants/${e}/schedules`).post(
|
|
81
|
+
`days/${t}`,
|
|
82
|
+
n
|
|
83
|
+
)
|
|
84
|
+
);
|
|
85
|
+
},
|
|
86
|
+
/** A one-off shift assignment. */
|
|
87
|
+
async createAssignment(e, t) {
|
|
88
|
+
return y(
|
|
89
|
+
await m(`restaurants/${e}/schedules`).post("assignments", t)
|
|
90
|
+
);
|
|
91
|
+
},
|
|
92
|
+
async updateAssignment(e, t, n) {
|
|
93
|
+
return y(
|
|
94
|
+
await m(`restaurants/${e}/schedules`).post(
|
|
95
|
+
`assignments/${t}`,
|
|
96
|
+
n
|
|
97
|
+
)
|
|
98
|
+
);
|
|
99
|
+
},
|
|
100
|
+
/** Deletes a batch of assignments in one request — e.g. a shift split into several segments
|
|
101
|
+
* getting replaced wholesale. Deleting one assignment is just this with a single-id
|
|
102
|
+
* array. */
|
|
103
|
+
async deleteAssignments(e, t) {
|
|
104
|
+
return y(
|
|
105
|
+
await m(`restaurants/${e}/schedules`).delete("assignments", {
|
|
106
|
+
params: { ids: t.join(",") }
|
|
107
|
+
})
|
|
108
|
+
);
|
|
109
|
+
},
|
|
110
|
+
/** Flips a batch of assignments to one status in a single request — e.g. Publish sending
|
|
111
|
+
* every DRAFT shift on the board to PUBLISHED at once. */
|
|
112
|
+
async bulkUpdateAssignmentStatus(e, t) {
|
|
113
|
+
return y(
|
|
114
|
+
await m(`restaurants/${e}/schedules`).post(
|
|
115
|
+
"assignments/bulk-status",
|
|
116
|
+
t
|
|
117
|
+
)
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
function R(e) {
|
|
122
|
+
const t = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), o = String(e.getDate()).padStart(2, "0");
|
|
123
|
+
return `${t}-${n}-${o}`;
|
|
124
|
+
}
|
|
125
|
+
function B(e, t) {
|
|
126
|
+
const n = new Date(e);
|
|
127
|
+
return n.setDate(n.getDate() + t), n;
|
|
128
|
+
}
|
|
129
|
+
const j = 6, i = b(null), V = T(!1), K = T(!1), C = T(null), xe = T(!1), _ = T(0), u = T(""), F = T([]);
|
|
130
|
+
let P = null, N = null, I = null, H = null;
|
|
131
|
+
function X(e) {
|
|
132
|
+
return e === u.value ? !1 : (u.value = e, i.value = null, P = null, N = null, C.value = null, H = null, F.value = [], I = null, _.value += 1, !0);
|
|
133
|
+
}
|
|
134
|
+
async function Y(e) {
|
|
135
|
+
if (!(!e || H === e)) {
|
|
136
|
+
K.value = !0;
|
|
137
|
+
try {
|
|
138
|
+
await ge(e);
|
|
139
|
+
} finally {
|
|
140
|
+
K.value = !1;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
async function ge(e) {
|
|
145
|
+
const t = await W.readEmployeesPage({
|
|
146
|
+
limit: 500,
|
|
147
|
+
offset: 0,
|
|
148
|
+
restaurantIds: [e]
|
|
149
|
+
});
|
|
150
|
+
e === u.value && (F.value = t.items, H = e, _.value += 1, Oe().then((n) => {
|
|
151
|
+
e === u.value && (te.value = n, _.value += 1);
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
async function q() {
|
|
155
|
+
const e = u.value;
|
|
156
|
+
e && (H = null, await Y(e));
|
|
157
|
+
}
|
|
158
|
+
async function ee(e, t) {
|
|
159
|
+
const n = we(), o = (await ne(!0)).find((l) => l._id === e);
|
|
160
|
+
if (!o) throw new Error("Could not find this employee");
|
|
161
|
+
const s = o.restaurantRole.map((l) => ({
|
|
162
|
+
restaurantId: l.restaurantId,
|
|
163
|
+
roleId: l.roleId
|
|
164
|
+
})), a = t(s);
|
|
165
|
+
if (!a.length)
|
|
166
|
+
throw new Error("An employee must keep at least 1 location, otherwise they are deleted. To delete them, use the Employee page.");
|
|
167
|
+
(o.isMasterUser ? "master" : "user") === "master" ? await n.updateMasterEmployee(e, {
|
|
168
|
+
user: { name: o.name, passcode: o.passcode, code: o.code ?? "" },
|
|
169
|
+
roles: a,
|
|
170
|
+
previousRoles: s
|
|
171
|
+
}) : await n.updateEmployee(e, {
|
|
172
|
+
user: { name: o.name, passcode: o.passcode },
|
|
173
|
+
roles: a,
|
|
174
|
+
previousRoles: s
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
async function ze(e, t) {
|
|
178
|
+
const n = u.value;
|
|
179
|
+
if (!n) throw new Error("No outlet selected");
|
|
180
|
+
await ee(e, (o) => [
|
|
181
|
+
...o.filter((s) => s.restaurantId !== n),
|
|
182
|
+
{ restaurantId: n, roleId: t }
|
|
183
|
+
]), await q();
|
|
184
|
+
}
|
|
185
|
+
async function Ee(e, t) {
|
|
186
|
+
const n = new Set(t);
|
|
187
|
+
n.size && (await ee(e, (o) => o.filter((s) => !n.has(s.restaurantId))), await q());
|
|
188
|
+
}
|
|
189
|
+
async function je(e) {
|
|
190
|
+
if (!u.value) throw new Error("No outlet selected");
|
|
191
|
+
await Ee(e, [u.value]);
|
|
192
|
+
}
|
|
193
|
+
const te = b({}), $ = b([]);
|
|
194
|
+
let D = null;
|
|
195
|
+
async function Ae() {
|
|
196
|
+
const n = await W.readEmployeesPage({ limit: 500, offset: 0 }), o = Math.min(10, Math.ceil(n.total / 500)), s = await Promise.all(
|
|
197
|
+
Array.from(
|
|
198
|
+
{ length: Math.max(0, o - 1) },
|
|
199
|
+
(a, r) => W.readEmployeesPage({ limit: 500, offset: (r + 1) * 500 })
|
|
200
|
+
)
|
|
201
|
+
);
|
|
202
|
+
return [...n.items, ...s.flatMap((a) => a.items)];
|
|
203
|
+
}
|
|
204
|
+
function ne(e = !1) {
|
|
205
|
+
if (!e) {
|
|
206
|
+
if (D) return D;
|
|
207
|
+
if ($.value.length) return Promise.resolve($.value);
|
|
208
|
+
}
|
|
209
|
+
const t = Ae().then((n) => ($.value = n, n)).finally(() => {
|
|
210
|
+
D === t && (D = null);
|
|
211
|
+
});
|
|
212
|
+
return D = t, t;
|
|
213
|
+
}
|
|
214
|
+
async function Oe() {
|
|
215
|
+
const e = {};
|
|
216
|
+
try {
|
|
217
|
+
(await ne()).forEach((t) => {
|
|
218
|
+
e[t._id] = [...new Set(t.restaurantRole.map((n) => n.restaurantId))];
|
|
219
|
+
});
|
|
220
|
+
} catch {
|
|
221
|
+
return e;
|
|
222
|
+
}
|
|
223
|
+
return e;
|
|
224
|
+
}
|
|
225
|
+
function J(e, t) {
|
|
226
|
+
return P !== null && N !== null && P <= e && N >= t;
|
|
227
|
+
}
|
|
228
|
+
async function Se(e) {
|
|
229
|
+
const t = R(e), n = R(B(e, 6));
|
|
230
|
+
J(t, n) || I && (await I, J(t, n)) || await ae(
|
|
231
|
+
B(e, -7 * j),
|
|
232
|
+
B(e, 7 * j)
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
async function Ve() {
|
|
236
|
+
!P || !N || await ae(/* @__PURE__ */ new Date(`${P}T00:00:00`), /* @__PURE__ */ new Date(`${N}T00:00:00`));
|
|
237
|
+
}
|
|
238
|
+
async function Ke(e) {
|
|
239
|
+
if (!u.value) throw new Error("No outlet selected");
|
|
240
|
+
const t = await p.createEmployeeProfile(u.value, e);
|
|
241
|
+
i.value && (i.value.employees.push(t), _.value += 1);
|
|
242
|
+
}
|
|
243
|
+
async function Xe(e, t) {
|
|
244
|
+
if (!u.value) throw new Error("No outlet selected");
|
|
245
|
+
const n = await p.updateEmployeeProfile(u.value, e, t);
|
|
246
|
+
if (i.value) {
|
|
247
|
+
const o = i.value.employees.findIndex((s) => s.employeeId === e);
|
|
248
|
+
o > -1 && (i.value.employees[o] = n);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
async function Je(e) {
|
|
252
|
+
const t = await p.createPosition(e);
|
|
253
|
+
i.value && (i.value = { ...i.value, positions: [...i.value.positions, t] });
|
|
254
|
+
}
|
|
255
|
+
async function Qe(e, t) {
|
|
256
|
+
const n = await p.updatePosition(e, t);
|
|
257
|
+
i.value && (i.value = {
|
|
258
|
+
...i.value,
|
|
259
|
+
positions: i.value.positions.map((o) => o.id === e ? n : o)
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
async function Ze(e) {
|
|
263
|
+
await p.deletePosition(e), i.value && (i.value = {
|
|
264
|
+
...i.value,
|
|
265
|
+
positions: i.value.positions.filter((t) => t.id !== e)
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
async function qe(e, t) {
|
|
269
|
+
if (!u.value) throw new Error("No outlet selected");
|
|
270
|
+
const n = await p.saveScheduleDay(u.value, e, t);
|
|
271
|
+
if (i.value) {
|
|
272
|
+
const o = i.value.days.filter((s) => s.date !== e);
|
|
273
|
+
n && o.push(n), i.value = { ...i.value, days: o };
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
async function et(e) {
|
|
277
|
+
var s;
|
|
278
|
+
if (!u.value) throw new Error("No outlet selected");
|
|
279
|
+
const t = (((s = i.value) == null ? void 0 : s.demands) ?? []).filter(
|
|
280
|
+
(a) => e.date ? a.date === e.date : a.dayOfWeek === e.dayOfWeek
|
|
281
|
+
), n = e.periods.flatMap((a) => {
|
|
282
|
+
const r = (a.roles ?? []).filter((h) => h.positionName && h.headcount > 0), l = r.reduce((h, c) => h + c.headcount, 0), f = {
|
|
283
|
+
...e.date ? { date: e.date } : { dayOfWeek: e.dayOfWeek },
|
|
284
|
+
startTime: a.startTime,
|
|
285
|
+
endTime: a.endTime
|
|
286
|
+
};
|
|
287
|
+
return [
|
|
288
|
+
...r.map((h) => ({
|
|
289
|
+
...f,
|
|
290
|
+
headcount: h.headcount,
|
|
291
|
+
position: { positionId: h.positionId, positionName: h.positionName }
|
|
292
|
+
})),
|
|
293
|
+
...a.headcount > l ? [{ ...f, headcount: a.headcount - l }] : []
|
|
294
|
+
];
|
|
295
|
+
});
|
|
296
|
+
t.length && await p.deleteDemands(
|
|
297
|
+
u.value,
|
|
298
|
+
t.map((a) => a.id)
|
|
299
|
+
);
|
|
300
|
+
const o = await Promise.all(
|
|
301
|
+
n.map((a) => p.createDemand(u.value, a))
|
|
302
|
+
);
|
|
303
|
+
if (i.value) {
|
|
304
|
+
const a = i.value.demands.filter((r) => !t.some((l) => l.id === r.id));
|
|
305
|
+
i.value = { ...i.value, demands: [...a, ...o] };
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
async function tt(e, t) {
|
|
309
|
+
if (!u.value) throw new Error("No outlet selected");
|
|
310
|
+
const n = i.value;
|
|
311
|
+
if (!n || n.demands.some((a) => a.date === t)) return 0;
|
|
312
|
+
const o = n.demands.filter((a) => a.date === e);
|
|
313
|
+
if (!o.length) return 0;
|
|
314
|
+
const s = await Promise.all(
|
|
315
|
+
o.map(
|
|
316
|
+
(a) => p.createDemand(u.value, {
|
|
317
|
+
date: t,
|
|
318
|
+
startTime: a.startTime,
|
|
319
|
+
endTime: a.endTime,
|
|
320
|
+
headcount: a.headcount,
|
|
321
|
+
...a.position ? { position: { positionId: a.position.positionId, positionName: a.position.positionName } } : {}
|
|
322
|
+
})
|
|
323
|
+
)
|
|
324
|
+
);
|
|
325
|
+
return i.value && (i.value = { ...i.value, demands: [...i.value.demands, ...s] }), s.length;
|
|
326
|
+
}
|
|
327
|
+
async function nt(e) {
|
|
328
|
+
if (!u.value) throw new Error("No outlet selected");
|
|
329
|
+
return p.createAssignment(u.value, e);
|
|
330
|
+
}
|
|
331
|
+
async function at(e, t) {
|
|
332
|
+
if (!u.value) throw new Error("No outlet selected");
|
|
333
|
+
return p.updateAssignment(u.value, e, t);
|
|
334
|
+
}
|
|
335
|
+
async function st(e) {
|
|
336
|
+
if (!u.value) throw new Error("No outlet selected");
|
|
337
|
+
e.length && await p.deleteAssignments(u.value, e);
|
|
338
|
+
}
|
|
339
|
+
async function ot(e) {
|
|
340
|
+
if (!u.value) throw new Error("No outlet selected");
|
|
341
|
+
return p.bulkUpdateAssignmentStatus(u.value, e);
|
|
342
|
+
}
|
|
343
|
+
async function ae(e, t) {
|
|
344
|
+
const n = u.value;
|
|
345
|
+
if (!n) {
|
|
346
|
+
C.value = "No outlet selected";
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
const o = R(e), s = R(t);
|
|
350
|
+
V.value = !0, C.value = null;
|
|
351
|
+
const a = (async () => {
|
|
352
|
+
try {
|
|
353
|
+
const r = await p.readBoard(n, o, s);
|
|
354
|
+
if (u.value !== n) return;
|
|
355
|
+
i.value = r, P = o, N = s, _.value += 1;
|
|
356
|
+
} catch (r) {
|
|
357
|
+
if (u.value !== n) return;
|
|
358
|
+
C.value = r instanceof Error ? r.message : "Could not load the schedule";
|
|
359
|
+
} finally {
|
|
360
|
+
u.value === n && (V.value = !1);
|
|
361
|
+
}
|
|
362
|
+
})();
|
|
363
|
+
I = a;
|
|
364
|
+
try {
|
|
365
|
+
await a;
|
|
366
|
+
} finally {
|
|
367
|
+
I === a && (I = null);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
const se = "unassigned", rt = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], it = "All Stations", ut = [
|
|
371
|
+
{ id: se, label: "Unassigned", roles: [], system: !0 }
|
|
372
|
+
], oe = 1e6, Q = [
|
|
373
|
+
"#903E1F",
|
|
374
|
+
"#5F090A",
|
|
375
|
+
"#0A5384",
|
|
376
|
+
"#1F5F3E",
|
|
377
|
+
"#5B2C6F",
|
|
378
|
+
"#7D5A00",
|
|
379
|
+
"#0F5C5C",
|
|
380
|
+
"#6E2142"
|
|
381
|
+
], Te = v([]), re = v([]);
|
|
382
|
+
function Ie(e) {
|
|
383
|
+
var t;
|
|
384
|
+
return (t = re.find((n) => n.name === e)) == null ? void 0 : t.id;
|
|
385
|
+
}
|
|
386
|
+
function lt(e) {
|
|
387
|
+
if (e)
|
|
388
|
+
return { positionId: Ie(e), positionName: e };
|
|
389
|
+
}
|
|
390
|
+
const ct = v({}), Pe = v({ name: "" }), Z = v([]), L = v({});
|
|
391
|
+
v([]);
|
|
392
|
+
v([]);
|
|
393
|
+
const dt = v({}), ft = v([]), mt = v([]), pt = [1, 1, 1, 1, 1, 1, 1], O = v({
|
|
394
|
+
coverage: {},
|
|
395
|
+
openFrom: "00:00",
|
|
396
|
+
openTo: "24:00",
|
|
397
|
+
dayHours: Array.from({ length: 7 }, () => []),
|
|
398
|
+
payRate: {
|
|
399
|
+
NORMAL: { overtime: 1 },
|
|
400
|
+
REST_DAY: { regular: 1, overtime: 1 },
|
|
401
|
+
PUBLIC_HOLIDAY: { regular: 1, overtime: 1 }
|
|
402
|
+
},
|
|
403
|
+
otAfterDaily: 0,
|
|
404
|
+
salesForecast: 0,
|
|
405
|
+
closedWeekdays: [],
|
|
406
|
+
labourTarget: 0,
|
|
407
|
+
budgetFromSales: !1,
|
|
408
|
+
budget: 0,
|
|
409
|
+
otCapHours: 0,
|
|
410
|
+
otBudget: 0,
|
|
411
|
+
notify: {
|
|
412
|
+
waConnected: !1,
|
|
413
|
+
waNumber: "",
|
|
414
|
+
waDisplayName: "",
|
|
415
|
+
defaults: { wa: !1, push: !1, email: !1 }
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
function k(e) {
|
|
419
|
+
return (e + 6) % 7;
|
|
420
|
+
}
|
|
421
|
+
function yt(e) {
|
|
422
|
+
return (e + 1) % 7;
|
|
423
|
+
}
|
|
424
|
+
function M(e, t) {
|
|
425
|
+
e.splice(0, e.length, ...t);
|
|
426
|
+
}
|
|
427
|
+
function Ne(e, t) {
|
|
428
|
+
const n = (a) => {
|
|
429
|
+
const [r, l] = a.split(":").map(Number);
|
|
430
|
+
return (r || 0) * 60 + (l || 0);
|
|
431
|
+
}, o = n(e);
|
|
432
|
+
let s = n(t);
|
|
433
|
+
return s <= o && (s += 1440), (s - o) / 60;
|
|
434
|
+
}
|
|
435
|
+
function De(e) {
|
|
436
|
+
var n;
|
|
437
|
+
const t = e.trim().split(/\s+/).filter(Boolean);
|
|
438
|
+
return t.length ? (t[0][0] + (((n = t[1]) == null ? void 0 : n[0]) ?? "")).toUpperCase() : "??";
|
|
439
|
+
}
|
|
440
|
+
const ie = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map();
|
|
441
|
+
function ht(e) {
|
|
442
|
+
return ie.get(e);
|
|
443
|
+
}
|
|
444
|
+
function Le(e) {
|
|
445
|
+
const t = U.get(e);
|
|
446
|
+
if (t !== void 0) return t;
|
|
447
|
+
const n = oe + U.size + 1;
|
|
448
|
+
return U.set(e, n), ie.set(n, e), n;
|
|
449
|
+
}
|
|
450
|
+
function Re(e) {
|
|
451
|
+
Pe.name = (e == null ? void 0 : e.outlet.name) ?? "", M(Te, (e == null ? void 0 : e.positions.map((a) => a.name)) ?? []), M(re, (e == null ? void 0 : e.positions) ?? []);
|
|
452
|
+
const t = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], n = Array.from({ length: 7 }, () => []);
|
|
453
|
+
for (const a of t) n[k(a.dayOfWeek)] = a.closed ? [] : a.hours;
|
|
454
|
+
M(O.dayHours, n);
|
|
455
|
+
const o = t.filter((a) => !a.closed).flatMap((a) => a.hours);
|
|
456
|
+
O.openFrom = o.length ? o.map((a) => a.start).reduce((a, r) => r < a ? r : a) : "00:00", O.openTo = o.length ? o.map((a) => a.end).reduce((a, r) => r > a ? r : a) : "24:00", M(
|
|
457
|
+
O.closedWeekdays,
|
|
458
|
+
t.filter((a) => a.closed).map((a) => k(a.dayOfWeek)).sort((a, r) => a - r)
|
|
459
|
+
);
|
|
460
|
+
const s = e == null ? void 0 : e.settings.payRate;
|
|
461
|
+
O.payRate.NORMAL.overtime = (s == null ? void 0 : s.NORMAL.overtime) ?? 1, O.payRate.REST_DAY.regular = (s == null ? void 0 : s.REST_DAY.regular) ?? 1, O.payRate.REST_DAY.overtime = (s == null ? void 0 : s.REST_DAY.overtime) ?? 1, O.payRate.PUBLIC_HOLIDAY.regular = (s == null ? void 0 : s.PUBLIC_HOLIDAY.regular) ?? 1, O.payRate.PUBLIC_HOLIDAY.overtime = (s == null ? void 0 : s.PUBLIC_HOLIDAY.overtime) ?? 1;
|
|
462
|
+
}
|
|
463
|
+
de(i, Re, { immediate: !0 });
|
|
464
|
+
function _e(e) {
|
|
465
|
+
return e.reduce(
|
|
466
|
+
(t, n) => n.employmentType === "FULLTIME" ? Math.max(t, n.workingHour) : t,
|
|
467
|
+
0
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
function ke(e, t) {
|
|
471
|
+
if (e.wage.type === "HOURLY") return e.wage.amount;
|
|
472
|
+
const n = e.workingHour || t;
|
|
473
|
+
return n ? e.wage.amount / (n * (52 / 12)) : 0;
|
|
474
|
+
}
|
|
475
|
+
function Me(e, t) {
|
|
476
|
+
return e.employmentType === "FULLTIME" ? 100 : !t || !e.workingHour ? 0 : Math.min(99, Math.round(e.workingHour / t * 100));
|
|
477
|
+
}
|
|
478
|
+
function Ce(e, t) {
|
|
479
|
+
var n;
|
|
480
|
+
return {
|
|
481
|
+
start: e.startTime,
|
|
482
|
+
end: e.endTime,
|
|
483
|
+
role: ((n = e.position) == null ? void 0 : n.positionName) || t,
|
|
484
|
+
// Mongo distinguishes a draft from a published/confirmed assignment; the board's third
|
|
485
|
+
// state ('ot') is a costing outcome, never something stored.
|
|
486
|
+
status: e.status === "DRAFT" ? "pending" : "confirmed",
|
|
487
|
+
breakMins: e.breakMinutes,
|
|
488
|
+
// Carried through so an edit updates this same ShiftAssignments document instead of
|
|
489
|
+
// creating a duplicate — see useScheduleBoard's commitShift/persistSlot.
|
|
490
|
+
assignmentId: e.id
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
function Fe(e) {
|
|
494
|
+
return {
|
|
495
|
+
employeeId: e._id,
|
|
496
|
+
name: e.name,
|
|
497
|
+
employmentType: "FULLTIME",
|
|
498
|
+
workingHour: 0,
|
|
499
|
+
wage: { type: "HOURLY", amount: 0 },
|
|
500
|
+
primaryPosition: null,
|
|
501
|
+
secondaryPositions: [],
|
|
502
|
+
availability: []
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
function He(e) {
|
|
506
|
+
const t = L[u.value];
|
|
507
|
+
return !t || !e.includes(t) ? e : [t, ...e.filter((n) => n !== t)];
|
|
508
|
+
}
|
|
509
|
+
function Be(e) {
|
|
510
|
+
var o;
|
|
511
|
+
const n = (te.value[e] ?? ((o = F.value.find((s) => s._id === e)) == null ? void 0 : o.restaurantRole.map((s) => s.restaurantId)) ?? []).map((s) => L[s]).filter((s) => !!s);
|
|
512
|
+
return n.length ? He([...new Set(n)]) : void 0;
|
|
513
|
+
}
|
|
514
|
+
function vt(e = []) {
|
|
515
|
+
const t = i.value;
|
|
516
|
+
if (!t) return [];
|
|
517
|
+
const n = new Map(t.employees.map((r) => [r.employeeId, r])), o = F.value.map(
|
|
518
|
+
(r) => n.get(r._id) ?? Fe(r)
|
|
519
|
+
), s = _e(o), a = /* @__PURE__ */ new Map();
|
|
520
|
+
for (const r of t.assignments) {
|
|
521
|
+
const l = `${r.employeeId}|${r.date}`, f = a.get(l);
|
|
522
|
+
f ? f.push(r) : a.set(l, [r]);
|
|
523
|
+
}
|
|
524
|
+
return o.map((r) => {
|
|
525
|
+
var G, x;
|
|
526
|
+
const l = Le(r.employeeId), f = ((G = r.primaryPosition) == null ? void 0 : G.positionName) ?? "", h = [
|
|
527
|
+
(x = r.primaryPosition) == null ? void 0 : x.positionName,
|
|
528
|
+
...r.secondaryPositions.map((A) => A.positionName)
|
|
529
|
+
].filter((A) => !!A), c = e.map((A) => {
|
|
530
|
+
const d = (a.get(`${r.employeeId}|${R(A)}`) ?? []).filter((w) => w.startTime && w.endTime).map((w) => Ce(w, f)).sort((w, ue) => w.start.localeCompare(ue.start));
|
|
531
|
+
return d.length ? d.length === 1 ? d[0] : d : null;
|
|
532
|
+
}), g = Array.from(
|
|
533
|
+
{ length: 7 },
|
|
534
|
+
(A, E) => r.availability.some((d) => k(d.dayOfWeek) === E)
|
|
535
|
+
), S = Array.from({ length: 7 }, (A, E) => {
|
|
536
|
+
const d = r.availability.find((w) => k(w.dayOfWeek) === E);
|
|
537
|
+
return { from: (d == null ? void 0 : d.start) ?? "", to: (d == null ? void 0 : d.end) ?? "" };
|
|
538
|
+
});
|
|
539
|
+
return {
|
|
540
|
+
id: l,
|
|
541
|
+
name: r.name,
|
|
542
|
+
role: f,
|
|
543
|
+
initials: De(r.name),
|
|
544
|
+
color: Q[(l - oe - 1) % Q.length],
|
|
545
|
+
// Gross hours actually rostered this week — the figure the cost rail multiplies by
|
|
546
|
+
// the rate. Contracted hours are a separate question, answered by RULES.contract.
|
|
547
|
+
// Rounded to one decimal — `hoursBetween` divides by 60, so an unrounded sum reads
|
|
548
|
+
// as a long, meaningless float (e.g. 31.983333333333334) everywhere this is shown
|
|
549
|
+
// verbatim, matching the rounding `employeeLoadOf`'s own hours figure already uses.
|
|
550
|
+
weekHours: Math.round(
|
|
551
|
+
c.reduce(
|
|
552
|
+
(A, E) => A + (Array.isArray(E) ? E : E && "start" in E ? [E] : []).reduce(
|
|
553
|
+
(d, w) => d + Ne(w.start, w.end),
|
|
554
|
+
0
|
|
555
|
+
),
|
|
556
|
+
0
|
|
557
|
+
) * 10
|
|
558
|
+
) / 10,
|
|
559
|
+
pct: Me(r, s),
|
|
560
|
+
contractHours: r.workingHour || void 0,
|
|
561
|
+
// Every outlet the POS says this person works at, not just this one — the Add / Edit form
|
|
562
|
+
// shows them, and saving keeps them.
|
|
563
|
+
locations: Be(r.employeeId),
|
|
564
|
+
rate: ke(r, s),
|
|
565
|
+
positions: h,
|
|
566
|
+
shifts: c,
|
|
567
|
+
// Remarks live in their own collection in the older scheduling design and are not
|
|
568
|
+
// part of this board's payload yet.
|
|
569
|
+
remarks: [],
|
|
570
|
+
section: se,
|
|
571
|
+
payBasis: r.wage.type === "HOURLY" ? "hourly" : "monthly",
|
|
572
|
+
payAmount: r.wage.amount,
|
|
573
|
+
availDays: g,
|
|
574
|
+
availHours: S
|
|
575
|
+
};
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
function wt() {
|
|
579
|
+
return [];
|
|
580
|
+
}
|
|
581
|
+
function gt() {
|
|
582
|
+
var o, s;
|
|
583
|
+
const e = i.value, t = {}, n = {};
|
|
584
|
+
for (const a of (e == null ? void 0 : e.demands) ?? []) {
|
|
585
|
+
const r = a.date ? t[o = a.date] ?? (t[o] = []) : a.dayOfWeek !== null ? n[s = k(a.dayOfWeek)] ?? (n[s] = []) : null;
|
|
586
|
+
if (!r) continue;
|
|
587
|
+
let l = r.find((f) => f.from === a.startTime && f.to === a.endTime);
|
|
588
|
+
l || (l = { from: a.startTime, to: a.endTime, n: 0, roles: [] }, r.push(l)), l.n += a.headcount, a.position && l.roles.push({ position: a.position.positionName, n: a.headcount });
|
|
589
|
+
}
|
|
590
|
+
return { byDate: t, byWeekday: n };
|
|
591
|
+
}
|
|
592
|
+
function Et() {
|
|
593
|
+
const e = he(), { restaurants: t, readRestaurants: n } = ve(), o = T(!1), s = z(
|
|
594
|
+
() => [...t.value].map((c) => ({ value: c._id, label: c.profile.name })).sort((c, g) => c.label.localeCompare(g.label))
|
|
595
|
+
), a = z(() => {
|
|
596
|
+
var c;
|
|
597
|
+
return ((c = e.currentRestaurant.value) == null ? void 0 : c._id) ?? "";
|
|
598
|
+
});
|
|
599
|
+
async function r(c, g) {
|
|
600
|
+
return X(c) ? (await Promise.all([Y(c), Se(g)]), !0) : !1;
|
|
601
|
+
}
|
|
602
|
+
const l = (c) => !!c && s.value.some((g) => g.value === c);
|
|
603
|
+
async function f() {
|
|
604
|
+
var g;
|
|
605
|
+
await n(), Z.splice(0, Z.length, ...s.value.map((S) => S.label)), Object.keys(L).forEach((S) => delete L[S]), s.value.forEach((S) => L[S.value] = S.label);
|
|
606
|
+
const c = l(u.value) ? u.value : l(a.value) ? a.value : ((g = s.value[0]) == null ? void 0 : g.value) ?? "";
|
|
607
|
+
return c && X(c), o.value = !0, c;
|
|
608
|
+
}
|
|
609
|
+
async function h() {
|
|
610
|
+
const c = await f();
|
|
611
|
+
return c && await Y(c), c;
|
|
612
|
+
}
|
|
613
|
+
return { options: s, ready: o, outletId: u, resolve: h, resolveOutlet: f, switchTo: r };
|
|
614
|
+
}
|
|
615
|
+
const $e = ["data-hierarchy", "data-size", "data-icon"], At = /* @__PURE__ */ fe({
|
|
616
|
+
__name: "ScheduleButton",
|
|
617
|
+
props: {
|
|
618
|
+
hierarchy: { default: "primary" },
|
|
619
|
+
size: { default: "sm" },
|
|
620
|
+
iconOnly: { type: Boolean, default: !1 }
|
|
621
|
+
},
|
|
622
|
+
setup(e) {
|
|
623
|
+
return (t, n) => (pe(), me("button", {
|
|
624
|
+
type: "button",
|
|
625
|
+
class: "sch-button",
|
|
626
|
+
"data-hierarchy": e.hierarchy,
|
|
627
|
+
"data-size": e.size,
|
|
628
|
+
"data-icon": e.iconOnly ? "only" : void 0
|
|
629
|
+
}, [
|
|
630
|
+
ye(t.$slots, "default")
|
|
631
|
+
], 8, $e));
|
|
632
|
+
}
|
|
633
|
+
});
|
|
634
|
+
export {
|
|
635
|
+
Je as $,
|
|
636
|
+
it as A,
|
|
637
|
+
R as B,
|
|
638
|
+
dt as C,
|
|
639
|
+
et as D,
|
|
640
|
+
ft as E,
|
|
641
|
+
Ie as F,
|
|
642
|
+
xe as G,
|
|
643
|
+
Ge as H,
|
|
644
|
+
Et as I,
|
|
645
|
+
V as J,
|
|
646
|
+
K,
|
|
647
|
+
Z as L,
|
|
648
|
+
C as M,
|
|
649
|
+
Y as N,
|
|
650
|
+
Pe as O,
|
|
651
|
+
Te as P,
|
|
652
|
+
Ve as Q,
|
|
653
|
+
ct as R,
|
|
654
|
+
ut as S,
|
|
655
|
+
gt as T,
|
|
656
|
+
se as U,
|
|
657
|
+
je as V,
|
|
658
|
+
rt as W,
|
|
659
|
+
re as X,
|
|
660
|
+
Ze as Y,
|
|
661
|
+
Qe as Z,
|
|
662
|
+
At as _,
|
|
663
|
+
vt as a,
|
|
664
|
+
F as a0,
|
|
665
|
+
O as b,
|
|
666
|
+
wt as c,
|
|
667
|
+
_ as d,
|
|
668
|
+
i as e,
|
|
669
|
+
st as f,
|
|
670
|
+
ot as g,
|
|
671
|
+
ht as h,
|
|
672
|
+
nt as i,
|
|
673
|
+
Xe as j,
|
|
674
|
+
mt as k,
|
|
675
|
+
yt as l,
|
|
676
|
+
L as m,
|
|
677
|
+
He as n,
|
|
678
|
+
u as o,
|
|
679
|
+
lt as p,
|
|
680
|
+
ze as q,
|
|
681
|
+
Ee as r,
|
|
682
|
+
qe as s,
|
|
683
|
+
Ke as t,
|
|
684
|
+
at as u,
|
|
685
|
+
ne as v,
|
|
686
|
+
q as w,
|
|
687
|
+
pt as x,
|
|
688
|
+
Se as y,
|
|
689
|
+
tt as z
|
|
690
|
+
};
|