@feedmepos/mf-hrm-portal 2.2.5-dev.4 → 2.2.5-dev.5
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-D0B_X3Sf.js → ApprovalCodeList-DqR6ouRS.js} +4 -4
- package/dist/{AuditLogList-D9anf4YQ.js → AuditLogList-CG2BiQX6.js} +17 -18
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-4oENMRO3.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-C7nMXx8R.js} +2 -2
- package/dist/{EmployeeList-DREDu3Ou.js → EmployeeList-CGZzol7v.js} +27 -29
- package/dist/{FormItem.vue_vue_type_script_setup_true_lang-CUnlKsxk.js → FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js} +1 -1
- package/dist/{GrantUserList-CLDshEN9.js → GrantUserList-D1fBv1KQ.js} +5 -5
- package/dist/{Main-lqlb8tPw.js → Main-BOt-Y1wv.js} +9 -9
- package/dist/{Main-QhQxU593.js → Main-CFoZot3K.js} +5 -5
- package/dist/{Main-DtMaG42L.js → Main-zg7fbEtx.js} +2 -2
- package/dist/{PermissionSetList-BK8yBpJJ.js → PermissionSetList-bJpwD62u.js} +10 -11
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-uSdvH81B.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C4C8Cvf4.js} +911 -912
- package/dist/{RoleList-D6AX6BqB.js → RoleList-DUVZ7dkO.js} +7 -7
- package/dist/SelectFilter-ATOm0hdn.js +269 -0
- package/dist/{TeamMemberList-BM5JoR6J.js → TeamMemberList-DAnM-DSd.js} +34 -36
- package/dist/{TimesheetList-Ch_f_PD5.js → TimesheetList-5sdcWjEf.js} +53 -54
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-CxqxqwyD.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-GhPw_mCW.js} +2 -2
- package/dist/{app-tDHL6k4G.js → app-D-cQzgkr.js} +2299 -2884
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-B_XWc0Hu.js → dayjs.min-DqFS0ebn.js} +1 -1
- package/dist/employee-DvvnCQMK.js +204 -0
- package/dist/{index-jxRluZiW.js → iteration-BjW8Cs9e.js} +726 -698
- package/dist/{lodash-D5vM3paU.js → lodash-wjhSWqez.js} +1 -1
- package/dist/{role-7ccipEEe.js → role-CEUcSmA6.js} +3 -4
- package/dist/{rule-7faruCdz.js → rule-Df8LOhxm.js} +70 -71
- package/dist/src/router/shared.d.ts +1 -4
- 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/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useReportPermissions-FieO4EAD.js → useReportPermissions-4wm7pJcK.js} +3 -3
- package/package.json +1 -1
- package/dist/ScheduleGeneralPage-DAECTCDu.js +0 -242
- package/dist/SchedulePage-CdFR7JuO.js +0 -10751
- package/dist/SchedulePositionPage-DTtKg0sx.js +0 -220
- package/dist/ScheduleSelect.vue_vue_type_script_setup_true_lang-BiuUrr50.js +0 -199
- package/dist/SelectFilter-CG13h83-.js +0 -264
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/employee-Bs_2vqBY.js +0 -139
- package/dist/index-Cz2b95YF.js +0 -70
- package/dist/iteration-CcXrOMQe.js +0 -30
- package/dist/src/api/schedule/index.d.ts +0 -44
- package/dist/src/components/layout/AppSidebar.vue.d.ts +0 -2
- package/dist/src/components/layout/PortalShell.vue.d.ts +0 -12
- package/dist/src/components/layout/withShell.d.ts +0 -14
- package/dist/src/types/schedule.d.ts +0 -232
- package/dist/src/views/scheduling/ScheduleGeneralPage.vue.d.ts +0 -4
- package/dist/src/views/scheduling/SchedulePage.vue.d.ts +0 -4
- package/dist/src/views/scheduling/SchedulePositionPage.vue.d.ts +0 -4
- package/dist/src/views/scheduling/components/ScheduleAddEmployeeIdentitySection.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleAddEmployeeModal.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleAddEmployeeModeStep.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleAddEmployeePosAccessSection.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleAddEmployeePositionsSection.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleAddEmployeeSchedulingSection.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleAddPickPopover.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleAllShiftsRow.vue.d.ts +0 -22
- package/dist/src/views/scheduling/components/ScheduleAreaRows.vue.d.ts +0 -34
- package/dist/src/views/scheduling/components/ScheduleAssignEmployeePopover.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleAutoScheduleModal.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleChangeEmployeeModal.vue.d.ts +0 -8
- package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +0 -24
- package/dist/src/views/scheduling/components/ScheduleCostRail.vue.d.ts +0 -8
- package/dist/src/views/scheduling/components/ScheduleDateRangePopover.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleDayNotePopover.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleDayTimeline.vue.d.ts +0 -12
- package/dist/src/views/scheduling/components/ScheduleDemandRow.vue.d.ts +0 -23
- package/dist/src/views/scheduling/components/ScheduleDemandSheet.vue.d.ts +0 -10
- package/dist/src/views/scheduling/components/ScheduleDotsIcon.vue.d.ts +0 -2
- package/dist/src/views/scheduling/components/ScheduleEmployeeDetailPanel.vue.d.ts +0 -12
- package/dist/src/views/scheduling/components/ScheduleEmployeeIdentity.vue.d.ts +0 -17
- package/dist/src/views/scheduling/components/ScheduleFilterBar.vue.d.ts +0 -18
- package/dist/src/views/scheduling/components/ScheduleGapPopover.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleGridHeader.vue.d.ts +0 -18
- package/dist/src/views/scheduling/components/ScheduleLeaveEditModal.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleLegendBar.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleOnboardingWelcome.vue.d.ts +0 -12
- package/dist/src/views/scheduling/components/ScheduleOnboardingWizard.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleOpenShiftCardMenu.vue.d.ts +0 -14
- package/dist/src/views/scheduling/components/SchedulePdfPreview.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/SchedulePublishModal.vue.d.ts +0 -8
- package/dist/src/views/scheduling/components/ScheduleReviewBar.vue.d.ts +0 -12
- package/dist/src/views/scheduling/components/ScheduleSelect.vue.d.ts +0 -24
- package/dist/src/views/scheduling/components/ScheduleSelectExistingEmployeeModal.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleShiftCardMenu.vue.d.ts +0 -12
- package/dist/src/views/scheduling/components/ScheduleShiftCell.vue.d.ts +0 -31
- package/dist/src/views/scheduling/components/ScheduleShiftHeadcountEditor.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleShiftImpact.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleShiftMoreOptions.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleShiftPopover.vue.d.ts +0 -14
- package/dist/src/views/scheduling/components/ScheduleShiftRepeatDaysRow.vue.d.ts +0 -8
- package/dist/src/views/scheduling/components/ScheduleShiftSegmentsEditor.vue.d.ts +0 -8
- package/dist/src/views/scheduling/components/ScheduleShiftWhoPicker.vue.d.ts +0 -25
- package/dist/src/views/scheduling/components/ScheduleStackPopover.vue.d.ts +0 -14
- package/dist/src/views/scheduling/components/ScheduleStaffRail.vue.d.ts +0 -16
- package/dist/src/views/scheduling/components/ScheduleStaffRows.vue.d.ts +0 -54
- package/dist/src/views/scheduling/components/ScheduleStatsRow.vue.d.ts +0 -12
- package/dist/src/views/scheduling/components/ScheduleSwapShiftsModal.vue.d.ts +0 -8
- package/dist/src/views/scheduling/components/ScheduleTimePickerPopover.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleTopbar.vue.d.ts +0 -22
- package/dist/src/views/scheduling/composables/schedule-add-employee-form.d.ts +0 -67
- package/dist/src/views/scheduling/composables/schedule-board-helpers.d.ts +0 -38
- package/dist/src/views/scheduling/composables/schedule-day-meta.d.ts +0 -29
- package/dist/src/views/scheduling/composables/schedule-employee-profile.d.ts +0 -7
- package/dist/src/views/scheduling/composables/schedule-shift-time.d.ts +0 -14
- package/dist/src/views/scheduling/composables/schedule-week-cache.d.ts +0 -10
- package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +0 -86
- package/dist/src/views/scheduling/composables/useScheduleAddPick.d.ts +0 -66
- package/dist/src/views/scheduling/composables/useScheduleAllShiftsRow.d.ts +0 -77
- package/dist/src/views/scheduling/composables/useScheduleAreaBoard.d.ts +0 -50
- package/dist/src/views/scheduling/composables/useScheduleAreaDragDrop.d.ts +0 -18
- package/dist/src/views/scheduling/composables/useScheduleAssign.d.ts +0 -113
- package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +0 -136
- package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +0 -415
- package/dist/src/views/scheduling/composables/useScheduleCellState.d.ts +0 -27
- package/dist/src/views/scheduling/composables/useScheduleClashDetection.d.ts +0 -18
- package/dist/src/views/scheduling/composables/useScheduleCopyWeek.d.ts +0 -17
- package/dist/src/views/scheduling/composables/useScheduleCostRail.d.ts +0 -43
- package/dist/src/views/scheduling/composables/useScheduleDayNote.d.ts +0 -48
- package/dist/src/views/scheduling/composables/useScheduleDayTimeline.d.ts +0 -82
- package/dist/src/views/scheduling/composables/useScheduleDemand.d.ts +0 -68
- package/dist/src/views/scheduling/composables/useScheduleDemandRow.d.ts +0 -45
- package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +0 -139
- package/dist/src/views/scheduling/composables/useScheduleDragDrop.d.ts +0 -22
- package/dist/src/views/scheduling/composables/useScheduleEmployeeIdentity.d.ts +0 -32
- package/dist/src/views/scheduling/composables/useScheduleEmployeeProfile.d.ts +0 -16
- package/dist/src/views/scheduling/composables/useScheduleExport.d.ts +0 -26
- package/dist/src/views/scheduling/composables/useScheduleFilterBar.d.ts +0 -14
- package/dist/src/views/scheduling/composables/useScheduleGapPopover.d.ts +0 -80
- package/dist/src/views/scheduling/composables/useScheduleLeave.d.ts +0 -20
- package/dist/src/views/scheduling/composables/useScheduleLegend.d.ts +0 -15
- package/dist/src/views/scheduling/composables/useScheduleLegendBar.d.ts +0 -35
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +0 -179
- package/dist/src/views/scheduling/composables/useScheduleOpenShiftCard.d.ts +0 -23
- package/dist/src/views/scheduling/composables/useScheduleOutlet.d.ts +0 -19
- package/dist/src/views/scheduling/composables/useSchedulePositions.d.ts +0 -32
- package/dist/src/views/scheduling/composables/useSchedulePublish.d.ts +0 -91
- package/dist/src/views/scheduling/composables/useScheduleRangeCalendar.d.ts +0 -18
- package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +0 -183
- package/dist/src/views/scheduling/composables/useScheduleSettings.d.ts +0 -54
- package/dist/src/views/scheduling/composables/useScheduleSetupBanner.d.ts +0 -18
- package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +0 -225
- package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +0 -174
- package/dist/src/views/scheduling/composables/useScheduleStaffRail.d.ts +0 -20
- package/dist/src/views/scheduling/composables/useScheduleStatsRow.d.ts +0 -25
- package/dist/src/views/scheduling/composables/useScheduleTimePicker.d.ts +0 -44
- package/dist/src/views/scheduling/composables/useScheduleTopbar.d.ts +0 -10
- package/dist/src/views/scheduling/data.d.ts +0 -105
- package/dist/src/views/scheduling/locales/index.d.ts +0 -496
- package/dist/src/views/scheduling/schedule-store.d.ts +0 -116
- package/dist/src/views/scheduling/types.d.ts +0 -311
- package/dist/useScheduleOutlet-CmIG5dwQ.js +0 -557
- package/dist/useSchedulePositions-DPVAgdB2.js +0 -103
|
@@ -1,557 +0,0 @@
|
|
|
1
|
-
import { ref as I, shallowRef as q, reactive as g, watch as ee, computed as U } from "vue";
|
|
2
|
-
import { useCoreStore as te } from "@feedmepos/mf-common";
|
|
3
|
-
import { g as p, b as f, u as ne } from "./restaurant-BTpBmfBV.js";
|
|
4
|
-
import { E as ae } from "./index-Cz2b95YF.js";
|
|
5
|
-
const m = {
|
|
6
|
-
async generateAutoSchedule(e, t) {
|
|
7
|
-
return p(
|
|
8
|
-
await f(`restaurants/${e}/schedules`).post(
|
|
9
|
-
"auto-schedule/generate",
|
|
10
|
-
t
|
|
11
|
-
)
|
|
12
|
-
);
|
|
13
|
-
},
|
|
14
|
-
/** One outlet's whole board over `[from, to]` (inclusive, 'YYYY-MM-DD'). */
|
|
15
|
-
async readBoard(e, t, a) {
|
|
16
|
-
return p(
|
|
17
|
-
await f(`restaurants/${e}/schedules`).get("board", {
|
|
18
|
-
params: { from: t, to: a }
|
|
19
|
-
})
|
|
20
|
-
);
|
|
21
|
-
},
|
|
22
|
-
/** Creates or updates the employee's shared business-level scheduling profile. */
|
|
23
|
-
async createEmployeeProfile(e, t) {
|
|
24
|
-
return p(await f("schedules").post("employees", t));
|
|
25
|
-
},
|
|
26
|
-
/** Edits the employee's shared business-level scheduling profile. */
|
|
27
|
-
async updateEmployeeProfile(e, t, a) {
|
|
28
|
-
return p(
|
|
29
|
-
await f("schedules").post("employees", { employeeId: t, ...a })
|
|
30
|
-
);
|
|
31
|
-
},
|
|
32
|
-
/** Positions are shared across the business. */
|
|
33
|
-
async createPosition(e) {
|
|
34
|
-
return p(
|
|
35
|
-
await f("schedules").post("positions", e)
|
|
36
|
-
);
|
|
37
|
-
},
|
|
38
|
-
async updatePosition(e, t) {
|
|
39
|
-
return p(
|
|
40
|
-
await f("schedules").post(
|
|
41
|
-
`positions/${e}`,
|
|
42
|
-
t
|
|
43
|
-
)
|
|
44
|
-
);
|
|
45
|
-
},
|
|
46
|
-
/** Deleting one position is `deletePositions` with a single-id array — the backend's
|
|
47
|
-
* `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
|
|
48
|
-
async deletePosition(e) {
|
|
49
|
-
await f("schedules").delete("positions", {
|
|
50
|
-
params: { ids: e }
|
|
51
|
-
});
|
|
52
|
-
},
|
|
53
|
-
/** Creates one flat demand interval. */
|
|
54
|
-
async createDemand(e, t) {
|
|
55
|
-
return p(
|
|
56
|
-
await f(`restaurants/${e}/schedules`).post("demands", t)
|
|
57
|
-
);
|
|
58
|
-
},
|
|
59
|
-
/** Deletes a batch of demands in one request — e.g. `saveDemand` replacing a whole
|
|
60
|
-
* day/weekday's demand rows wholesale. Deleting one demand is just this with a single-id
|
|
61
|
-
* array. */
|
|
62
|
-
async deleteDemands(e, t) {
|
|
63
|
-
return p(
|
|
64
|
-
await f(`restaurants/${e}/schedules`).delete("demands", {
|
|
65
|
-
params: { ids: t.join(",") }
|
|
66
|
-
})
|
|
67
|
-
);
|
|
68
|
-
},
|
|
69
|
-
/** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
|
|
70
|
-
async saveScheduleDay(e, t, a) {
|
|
71
|
-
return p(
|
|
72
|
-
await f(`restaurants/${e}/schedules`).post(
|
|
73
|
-
`days/${t}`,
|
|
74
|
-
a
|
|
75
|
-
)
|
|
76
|
-
);
|
|
77
|
-
},
|
|
78
|
-
/** A one-off shift assignment. */
|
|
79
|
-
async createAssignment(e, t) {
|
|
80
|
-
return p(
|
|
81
|
-
await f(`restaurants/${e}/schedules`).post(
|
|
82
|
-
"assignments",
|
|
83
|
-
t
|
|
84
|
-
)
|
|
85
|
-
);
|
|
86
|
-
},
|
|
87
|
-
async updateAssignment(e, t, a) {
|
|
88
|
-
return p(
|
|
89
|
-
await f(`restaurants/${e}/schedules`).post(
|
|
90
|
-
`assignments/${t}`,
|
|
91
|
-
a
|
|
92
|
-
)
|
|
93
|
-
);
|
|
94
|
-
},
|
|
95
|
-
/** Deletes a batch of assignments in one request — e.g. a shift split into several segments
|
|
96
|
-
* getting replaced wholesale. Deleting one assignment is just this with a single-id
|
|
97
|
-
* array. */
|
|
98
|
-
async deleteAssignments(e, t) {
|
|
99
|
-
return p(
|
|
100
|
-
await f(`restaurants/${e}/schedules`).delete(
|
|
101
|
-
"assignments",
|
|
102
|
-
{ params: { ids: t.join(",") } }
|
|
103
|
-
)
|
|
104
|
-
);
|
|
105
|
-
},
|
|
106
|
-
/** Flips a batch of assignments to one status in a single request — e.g. Publish sending
|
|
107
|
-
* every DRAFT shift on the board to PUBLISHED at once. */
|
|
108
|
-
async bulkUpdateAssignmentStatus(e, t) {
|
|
109
|
-
return p(
|
|
110
|
-
await f(`restaurants/${e}/schedules`).post(
|
|
111
|
-
"assignments/bulk-status",
|
|
112
|
-
t
|
|
113
|
-
)
|
|
114
|
-
);
|
|
115
|
-
},
|
|
116
|
-
// ── DEV-ONLY TEST HELPER — delete freely. See the matching block in
|
|
117
|
-
// apps/hrm-backend/src/schedule/schedule.controller.ts for the rest of what to remove
|
|
118
|
-
// alongside this: the backend route + service method, and the store wrapper + menu item
|
|
119
|
-
// on the portal side. ──
|
|
120
|
-
async devResetOutlet(e) {
|
|
121
|
-
return p(
|
|
122
|
-
await f(`restaurants/${e}/schedules`).delete("dev-reset")
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
function P(e) {
|
|
127
|
-
const t = e.getFullYear(), a = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
|
|
128
|
-
return `${t}-${a}-${r}`;
|
|
129
|
-
}
|
|
130
|
-
function _(e, t) {
|
|
131
|
-
const a = new Date(e);
|
|
132
|
-
return a.setDate(a.getDate() + t), a;
|
|
133
|
-
}
|
|
134
|
-
const W = 6, u = q(null), B = I(!1), R = I(null), L = I(0), i = I(""), C = I([]);
|
|
135
|
-
let S = null, T = null, A = null, F = null;
|
|
136
|
-
function Y(e) {
|
|
137
|
-
return e === i.value ? !1 : (i.value = e, u.value = null, S = null, T = null, R.value = null, F = null, C.value = [], A = null, L.value += 1, !0);
|
|
138
|
-
}
|
|
139
|
-
async function x(e) {
|
|
140
|
-
if (!e || F === e) return;
|
|
141
|
-
const t = await ae.readEmployeesPage({
|
|
142
|
-
limit: 500,
|
|
143
|
-
offset: 0,
|
|
144
|
-
restaurantIds: [e]
|
|
145
|
-
});
|
|
146
|
-
e === i.value && (C.value = t.items, F = e, L.value += 1);
|
|
147
|
-
}
|
|
148
|
-
function j(e, t) {
|
|
149
|
-
return S !== null && T !== null && S <= e && T >= t;
|
|
150
|
-
}
|
|
151
|
-
async function se(e) {
|
|
152
|
-
const t = P(e), a = P(_(e, 6));
|
|
153
|
-
j(t, a) || A && (await A, j(t, a)) || await K(
|
|
154
|
-
_(e, -7 * W),
|
|
155
|
-
_(e, 7 * W)
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
async function oe() {
|
|
159
|
-
!S || !T || await K(/* @__PURE__ */ new Date(`${S}T00:00:00`), /* @__PURE__ */ new Date(`${T}T00:00:00`));
|
|
160
|
-
}
|
|
161
|
-
async function Se(e) {
|
|
162
|
-
if (!i.value) throw new Error("No outlet selected");
|
|
163
|
-
const t = await m.createEmployeeProfile(i.value, e);
|
|
164
|
-
u.value && (u.value.employees.push(t), L.value += 1);
|
|
165
|
-
}
|
|
166
|
-
async function Te(e, t) {
|
|
167
|
-
if (!i.value) throw new Error("No outlet selected");
|
|
168
|
-
const a = await m.updateEmployeeProfile(i.value, e, t);
|
|
169
|
-
if (u.value) {
|
|
170
|
-
const r = u.value.employees.findIndex((o) => o.employeeId === e);
|
|
171
|
-
r > -1 && (u.value.employees[r] = a);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
async function Ie(e) {
|
|
175
|
-
const t = await m.createPosition(e);
|
|
176
|
-
u.value && (u.value = { ...u.value, positions: [...u.value.positions, t] });
|
|
177
|
-
}
|
|
178
|
-
async function Pe(e, t) {
|
|
179
|
-
const a = await m.updatePosition(e, t);
|
|
180
|
-
u.value && (u.value = {
|
|
181
|
-
...u.value,
|
|
182
|
-
positions: u.value.positions.map((r) => r.id === e ? a : r)
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
async function Ne(e) {
|
|
186
|
-
await m.deletePosition(e), u.value && (u.value = {
|
|
187
|
-
...u.value,
|
|
188
|
-
positions: u.value.positions.filter((t) => t.id !== e)
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
async function De(e, t) {
|
|
192
|
-
if (!i.value) throw new Error("No outlet selected");
|
|
193
|
-
const a = await m.saveScheduleDay(i.value, e, t);
|
|
194
|
-
if (u.value) {
|
|
195
|
-
const r = u.value.days.filter((o) => o.date !== e);
|
|
196
|
-
a && r.push(a), u.value = { ...u.value, days: r };
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
async function Re(e) {
|
|
200
|
-
var o;
|
|
201
|
-
if (!i.value) throw new Error("No outlet selected");
|
|
202
|
-
const t = (((o = u.value) == null ? void 0 : o.demands) ?? []).filter(
|
|
203
|
-
(n) => e.date ? n.date === e.date : n.dayOfWeek === e.dayOfWeek
|
|
204
|
-
), a = e.periods.flatMap((n) => {
|
|
205
|
-
const s = (n.roles ?? []).filter((l) => l.positionName && l.headcount > 0), c = s.reduce((l, v) => l + v.headcount, 0), y = {
|
|
206
|
-
...e.date ? { date: e.date } : { dayOfWeek: e.dayOfWeek },
|
|
207
|
-
startTime: n.startTime,
|
|
208
|
-
endTime: n.endTime
|
|
209
|
-
};
|
|
210
|
-
return [
|
|
211
|
-
...s.map((l) => ({
|
|
212
|
-
...y,
|
|
213
|
-
headcount: l.headcount,
|
|
214
|
-
position: { positionId: l.positionId, positionName: l.positionName }
|
|
215
|
-
})),
|
|
216
|
-
...n.headcount > c ? [{ ...y, headcount: n.headcount - c }] : []
|
|
217
|
-
];
|
|
218
|
-
});
|
|
219
|
-
t.length && await m.deleteDemands(
|
|
220
|
-
i.value,
|
|
221
|
-
t.map((n) => n.id)
|
|
222
|
-
);
|
|
223
|
-
const r = await Promise.all(
|
|
224
|
-
a.map((n) => m.createDemand(i.value, n))
|
|
225
|
-
);
|
|
226
|
-
if (u.value) {
|
|
227
|
-
const n = u.value.demands.filter((s) => !t.some((c) => c.id === s.id));
|
|
228
|
-
u.value = { ...u.value, demands: [...n, ...r] };
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
async function Le(e) {
|
|
232
|
-
if (!i.value) throw new Error("No outlet selected");
|
|
233
|
-
return m.generateAutoSchedule(i.value, e);
|
|
234
|
-
}
|
|
235
|
-
async function ke(e) {
|
|
236
|
-
if (!i.value) throw new Error("No outlet selected");
|
|
237
|
-
return m.createAssignment(i.value, e);
|
|
238
|
-
}
|
|
239
|
-
async function _e(e, t) {
|
|
240
|
-
if (!i.value) throw new Error("No outlet selected");
|
|
241
|
-
return m.updateAssignment(i.value, e, t);
|
|
242
|
-
}
|
|
243
|
-
async function He(e) {
|
|
244
|
-
if (!i.value) throw new Error("No outlet selected");
|
|
245
|
-
e.length && await m.deleteAssignments(i.value, e);
|
|
246
|
-
}
|
|
247
|
-
async function Fe(e) {
|
|
248
|
-
if (!i.value) throw new Error("No outlet selected");
|
|
249
|
-
return m.bulkUpdateAssignmentStatus(i.value, e);
|
|
250
|
-
}
|
|
251
|
-
async function Ce() {
|
|
252
|
-
if (!i.value) throw new Error("No outlet selected");
|
|
253
|
-
const { removed: e } = await m.devResetOutlet(i.value);
|
|
254
|
-
return await oe(), e;
|
|
255
|
-
}
|
|
256
|
-
async function K(e, t) {
|
|
257
|
-
const a = i.value;
|
|
258
|
-
if (!a) {
|
|
259
|
-
R.value = "No outlet selected";
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
const r = P(e), o = P(t);
|
|
263
|
-
B.value = !0, R.value = null;
|
|
264
|
-
const n = (async () => {
|
|
265
|
-
try {
|
|
266
|
-
const s = await m.readBoard(a, r, o);
|
|
267
|
-
if (i.value !== a) return;
|
|
268
|
-
u.value = s, S = r, T = o, L.value += 1;
|
|
269
|
-
} catch (s) {
|
|
270
|
-
if (i.value !== a) return;
|
|
271
|
-
R.value = s instanceof Error ? s.message : "Could not load the schedule";
|
|
272
|
-
} finally {
|
|
273
|
-
i.value === a && (B.value = !1);
|
|
274
|
-
}
|
|
275
|
-
})();
|
|
276
|
-
A = n;
|
|
277
|
-
try {
|
|
278
|
-
await n;
|
|
279
|
-
} finally {
|
|
280
|
-
A === n && (A = null);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
const V = "unassigned", Me = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], re = "Any position", $e = "All Stations", Ue = ["senior", "junior"], We = [
|
|
284
|
-
{ id: V, label: "Unassigned", roles: [], system: !0 }
|
|
285
|
-
], z = 1e6, G = [
|
|
286
|
-
"#903E1F",
|
|
287
|
-
"#5F090A",
|
|
288
|
-
"#0A5384",
|
|
289
|
-
"#1F5F3E",
|
|
290
|
-
"#5B2C6F",
|
|
291
|
-
"#7D5A00",
|
|
292
|
-
"#0F5C5C",
|
|
293
|
-
"#6E2142"
|
|
294
|
-
], ue = g([]), J = g([]);
|
|
295
|
-
function ie(e) {
|
|
296
|
-
var t;
|
|
297
|
-
return (t = J.find((a) => a.name === e)) == null ? void 0 : t.id;
|
|
298
|
-
}
|
|
299
|
-
function Be(e) {
|
|
300
|
-
if (e)
|
|
301
|
-
return { positionId: ie(e), positionName: e };
|
|
302
|
-
}
|
|
303
|
-
const Ye = g({}), le = g({ name: "" }), b = g([]);
|
|
304
|
-
g([]);
|
|
305
|
-
g([]);
|
|
306
|
-
const xe = g({}), je = g([]), Ge = g([]), be = [1, 1, 1, 1, 1, 1, 1], E = g({
|
|
307
|
-
coverage: {},
|
|
308
|
-
openFrom: "00:00",
|
|
309
|
-
openTo: "24:00",
|
|
310
|
-
dayHours: Array.from({ length: 7 }, () => []),
|
|
311
|
-
payRate: {
|
|
312
|
-
NORMAL: { overtime: 1 },
|
|
313
|
-
REST_DAY: { regular: 1, overtime: 1 },
|
|
314
|
-
PUBLIC_HOLIDAY: { regular: 1, overtime: 1 }
|
|
315
|
-
},
|
|
316
|
-
otAfterDaily: 0,
|
|
317
|
-
salesForecast: 0,
|
|
318
|
-
closedWeekdays: [],
|
|
319
|
-
labourTarget: 0,
|
|
320
|
-
budgetFromSales: !1,
|
|
321
|
-
budget: 0,
|
|
322
|
-
otCapHours: 0,
|
|
323
|
-
otBudget: 0,
|
|
324
|
-
notify: {
|
|
325
|
-
waConnected: !1,
|
|
326
|
-
waNumber: "",
|
|
327
|
-
waDisplayName: "",
|
|
328
|
-
defaults: { wa: !1, push: !1, email: !1 }
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
function N(e) {
|
|
332
|
-
return (e + 6) % 7;
|
|
333
|
-
}
|
|
334
|
-
function Ke(e) {
|
|
335
|
-
return (e + 1) % 7;
|
|
336
|
-
}
|
|
337
|
-
function D(e, t) {
|
|
338
|
-
e.splice(0, e.length, ...t);
|
|
339
|
-
}
|
|
340
|
-
function ce(e, t) {
|
|
341
|
-
const a = (n) => {
|
|
342
|
-
const [s, c] = n.split(":").map(Number);
|
|
343
|
-
return (s || 0) * 60 + (c || 0);
|
|
344
|
-
}, r = a(e);
|
|
345
|
-
let o = a(t);
|
|
346
|
-
return o <= r && (o += 1440), (o - r) / 60;
|
|
347
|
-
}
|
|
348
|
-
function de(e) {
|
|
349
|
-
var a;
|
|
350
|
-
const t = e.trim().split(/\s+/).filter(Boolean);
|
|
351
|
-
return t.length ? (t[0][0] + (((a = t[1]) == null ? void 0 : a[0]) ?? "")).toUpperCase() : "??";
|
|
352
|
-
}
|
|
353
|
-
const X = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map();
|
|
354
|
-
function Ve(e) {
|
|
355
|
-
return X.get(e);
|
|
356
|
-
}
|
|
357
|
-
function fe(e) {
|
|
358
|
-
const t = H.get(e);
|
|
359
|
-
if (t !== void 0) return t;
|
|
360
|
-
const a = z + H.size + 1;
|
|
361
|
-
return H.set(e, a), X.set(a, e), a;
|
|
362
|
-
}
|
|
363
|
-
function me(e) {
|
|
364
|
-
le.name = (e == null ? void 0 : e.outlet.name) ?? "", D(ue, (e == null ? void 0 : e.positions.map((n) => n.name)) ?? []), D(J, (e == null ? void 0 : e.positions) ?? []);
|
|
365
|
-
const t = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], a = Array.from({ length: 7 }, () => []);
|
|
366
|
-
for (const n of t) a[N(n.dayOfWeek)] = n.closed ? [] : n.hours;
|
|
367
|
-
D(E.dayHours, a);
|
|
368
|
-
const r = t.filter((n) => !n.closed).flatMap((n) => n.hours);
|
|
369
|
-
E.openFrom = r.length ? r.map((n) => n.start).reduce((n, s) => s < n ? s : n) : "00:00", E.openTo = r.length ? r.map((n) => n.end).reduce((n, s) => s > n ? s : n) : "24:00", D(
|
|
370
|
-
E.closedWeekdays,
|
|
371
|
-
t.filter((n) => n.closed).map((n) => N(n.dayOfWeek)).sort((n, s) => n - s)
|
|
372
|
-
);
|
|
373
|
-
const o = e == null ? void 0 : e.settings.payRate;
|
|
374
|
-
E.payRate.NORMAL.overtime = (o == null ? void 0 : o.NORMAL.overtime) ?? 1, E.payRate.REST_DAY.regular = (o == null ? void 0 : o.REST_DAY.regular) ?? 1, E.payRate.REST_DAY.overtime = (o == null ? void 0 : o.REST_DAY.overtime) ?? 1, E.payRate.PUBLIC_HOLIDAY.regular = (o == null ? void 0 : o.PUBLIC_HOLIDAY.regular) ?? 1, E.payRate.PUBLIC_HOLIDAY.overtime = (o == null ? void 0 : o.PUBLIC_HOLIDAY.overtime) ?? 1;
|
|
375
|
-
}
|
|
376
|
-
ee(u, me, { immediate: !0 });
|
|
377
|
-
function pe(e) {
|
|
378
|
-
return e.reduce(
|
|
379
|
-
(t, a) => a.employmentType === "FULLTIME" ? Math.max(t, a.workingHour) : t,
|
|
380
|
-
0
|
|
381
|
-
);
|
|
382
|
-
}
|
|
383
|
-
function ye(e, t) {
|
|
384
|
-
if (e.wage.type === "HOURLY") return e.wage.amount;
|
|
385
|
-
const a = e.workingHour || t;
|
|
386
|
-
return a ? e.wage.amount / (a * (52 / 12)) : 0;
|
|
387
|
-
}
|
|
388
|
-
function ve(e, t) {
|
|
389
|
-
return e.employmentType === "FULLTIME" ? 100 : !t || !e.workingHour ? 0 : Math.min(99, Math.round(e.workingHour / t * 100));
|
|
390
|
-
}
|
|
391
|
-
function he(e, t) {
|
|
392
|
-
var a;
|
|
393
|
-
return {
|
|
394
|
-
start: e.startTime,
|
|
395
|
-
end: e.endTime,
|
|
396
|
-
role: ((a = e.position) == null ? void 0 : a.positionName) || t,
|
|
397
|
-
// Mongo distinguishes a draft from a published/confirmed assignment; the board's third
|
|
398
|
-
// state ('ot') is a costing outcome, never something stored.
|
|
399
|
-
status: e.status === "DRAFT" ? "pending" : "confirmed",
|
|
400
|
-
breakMins: e.breakMinutes,
|
|
401
|
-
// Carried through so an edit updates this same ShiftAssignments document instead of
|
|
402
|
-
// creating a duplicate — see useScheduleBoard's commitShift/persistSlot.
|
|
403
|
-
assignmentId: e.id
|
|
404
|
-
};
|
|
405
|
-
}
|
|
406
|
-
function ge(e) {
|
|
407
|
-
return {
|
|
408
|
-
employeeId: e._id,
|
|
409
|
-
name: e.name,
|
|
410
|
-
employmentType: "FULLTIME",
|
|
411
|
-
workingHour: 0,
|
|
412
|
-
wage: { type: "HOURLY", amount: 0 },
|
|
413
|
-
primaryPosition: null,
|
|
414
|
-
secondaryPositions: [],
|
|
415
|
-
availability: []
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
function ze(e = []) {
|
|
419
|
-
const t = u.value;
|
|
420
|
-
if (!t) return [];
|
|
421
|
-
const a = new Map(t.employees.map((s) => [s.employeeId, s])), r = C.value.map(
|
|
422
|
-
(s) => a.get(s._id) ?? ge(s)
|
|
423
|
-
), o = pe(r), n = /* @__PURE__ */ new Map();
|
|
424
|
-
for (const s of t.assignments) {
|
|
425
|
-
const c = `${s.employeeId}|${s.date}`, y = n.get(c);
|
|
426
|
-
y ? y.push(s) : n.set(c, [s]);
|
|
427
|
-
}
|
|
428
|
-
return r.map((s) => {
|
|
429
|
-
var M, $;
|
|
430
|
-
const c = fe(s.employeeId), y = ((M = s.primaryPosition) == null ? void 0 : M.positionName) || re, l = [
|
|
431
|
-
($ = s.primaryPosition) == null ? void 0 : $.positionName,
|
|
432
|
-
...s.secondaryPositions.map((O) => O.positionName)
|
|
433
|
-
].filter((O) => !!O), v = e.map((O) => {
|
|
434
|
-
const d = (n.get(`${s.employeeId}|${P(O)}`) ?? []).filter((h) => h.startTime && h.endTime).map((h) => he(h, y)).sort((h, Z) => h.start.localeCompare(Z.start));
|
|
435
|
-
return d.length ? d.length === 1 ? d[0] : d : null;
|
|
436
|
-
}), k = Array.from(
|
|
437
|
-
{ length: 7 },
|
|
438
|
-
(O, w) => s.availability.some((d) => N(d.dayOfWeek) === w)
|
|
439
|
-
), Q = Array.from({ length: 7 }, (O, w) => {
|
|
440
|
-
const d = s.availability.find((h) => N(h.dayOfWeek) === w);
|
|
441
|
-
return { from: (d == null ? void 0 : d.start) ?? "", to: (d == null ? void 0 : d.end) ?? "" };
|
|
442
|
-
});
|
|
443
|
-
return {
|
|
444
|
-
id: c,
|
|
445
|
-
name: s.name,
|
|
446
|
-
role: y,
|
|
447
|
-
initials: de(s.name),
|
|
448
|
-
color: G[(c - z - 1) % G.length],
|
|
449
|
-
// Gross hours actually rostered this week — the figure the cost rail multiplies by
|
|
450
|
-
// the rate. Contracted hours are a separate question, answered by RULES.contract.
|
|
451
|
-
// Rounded to one decimal — `hoursBetween` divides by 60, so an unrounded sum reads
|
|
452
|
-
// as a long, meaningless float (e.g. 31.983333333333334) everywhere this is shown
|
|
453
|
-
// verbatim, matching the rounding `employeeLoadOf`'s own hours figure already uses.
|
|
454
|
-
weekHours: Math.round(
|
|
455
|
-
v.reduce(
|
|
456
|
-
(O, w) => O + (Array.isArray(w) ? w : w && "start" in w ? [w] : []).reduce(
|
|
457
|
-
(d, h) => d + ce(h.start, h.end),
|
|
458
|
-
0
|
|
459
|
-
),
|
|
460
|
-
0
|
|
461
|
-
) * 10
|
|
462
|
-
) / 10,
|
|
463
|
-
pct: ve(s, o),
|
|
464
|
-
contractHours: s.workingHour || void 0,
|
|
465
|
-
rate: ye(s, o),
|
|
466
|
-
positions: l,
|
|
467
|
-
shifts: v,
|
|
468
|
-
// Remarks live in their own collection in the older scheduling design and are not
|
|
469
|
-
// part of this board's payload yet.
|
|
470
|
-
remarks: [],
|
|
471
|
-
section: V,
|
|
472
|
-
payBasis: s.wage.type === "HOURLY" ? "hourly" : "monthly",
|
|
473
|
-
payAmount: s.wage.amount,
|
|
474
|
-
availDays: k,
|
|
475
|
-
availHours: Q
|
|
476
|
-
};
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
function Je() {
|
|
480
|
-
return [];
|
|
481
|
-
}
|
|
482
|
-
function Xe() {
|
|
483
|
-
var r, o;
|
|
484
|
-
const e = u.value, t = {}, a = {};
|
|
485
|
-
for (const n of (e == null ? void 0 : e.demands) ?? []) {
|
|
486
|
-
const s = n.date ? t[r = n.date] ?? (t[r] = []) : n.dayOfWeek !== null ? a[o = N(n.dayOfWeek)] ?? (a[o] = []) : null;
|
|
487
|
-
if (!s) continue;
|
|
488
|
-
let c = s.find((y) => y.from === n.startTime && y.to === n.endTime);
|
|
489
|
-
c || (c = { from: n.startTime, to: n.endTime, n: 0, roles: [] }, s.push(c)), c.n += n.headcount, n.position && c.roles.push({ position: n.position.positionName, n: n.headcount });
|
|
490
|
-
}
|
|
491
|
-
return { byDate: t, byWeekday: a };
|
|
492
|
-
}
|
|
493
|
-
function Qe() {
|
|
494
|
-
const e = te(), { restaurants: t, readRestaurants: a } = ne(), r = I(!1), o = U(
|
|
495
|
-
() => [...t.value].map((l) => ({ value: l._id, label: l.profile.name })).sort((l, v) => l.label.localeCompare(v.label))
|
|
496
|
-
), n = U(() => {
|
|
497
|
-
var l;
|
|
498
|
-
return ((l = e.currentRestaurant.value) == null ? void 0 : l._id) ?? "";
|
|
499
|
-
});
|
|
500
|
-
async function s(l, v) {
|
|
501
|
-
return Y(l) ? (await Promise.all([x(l), se(v)]), !0) : !1;
|
|
502
|
-
}
|
|
503
|
-
const c = (l) => !!l && o.value.some((v) => v.value === l);
|
|
504
|
-
async function y() {
|
|
505
|
-
var v;
|
|
506
|
-
await a(), b.splice(0, b.length, ...o.value.map((k) => k.label));
|
|
507
|
-
const l = c(i.value) ? i.value : c(n.value) ? n.value : ((v = o.value[0]) == null ? void 0 : v.value) ?? "";
|
|
508
|
-
return l && (Y(l), await x(l)), r.value = !0, l;
|
|
509
|
-
}
|
|
510
|
-
return { options: o, ready: r, outletId: i, resolve: y, switchTo: s };
|
|
511
|
-
}
|
|
512
|
-
export {
|
|
513
|
-
$e as A,
|
|
514
|
-
oe as B,
|
|
515
|
-
xe as C,
|
|
516
|
-
B as D,
|
|
517
|
-
je as E,
|
|
518
|
-
Xe as F,
|
|
519
|
-
Ce as G,
|
|
520
|
-
J as H,
|
|
521
|
-
Ne as I,
|
|
522
|
-
Pe as J,
|
|
523
|
-
Ie as K,
|
|
524
|
-
b as L,
|
|
525
|
-
le as O,
|
|
526
|
-
ue as P,
|
|
527
|
-
Ye as R,
|
|
528
|
-
We as S,
|
|
529
|
-
V as U,
|
|
530
|
-
Me as W,
|
|
531
|
-
ze as a,
|
|
532
|
-
E as b,
|
|
533
|
-
Je as c,
|
|
534
|
-
L as d,
|
|
535
|
-
u as e,
|
|
536
|
-
Fe as f,
|
|
537
|
-
Ve as g,
|
|
538
|
-
ke as h,
|
|
539
|
-
He as i,
|
|
540
|
-
Te as j,
|
|
541
|
-
Ge as k,
|
|
542
|
-
Ke as l,
|
|
543
|
-
Se as m,
|
|
544
|
-
Le as n,
|
|
545
|
-
i as o,
|
|
546
|
-
Be as p,
|
|
547
|
-
fe as q,
|
|
548
|
-
be as r,
|
|
549
|
-
De as s,
|
|
550
|
-
Re as t,
|
|
551
|
-
_e as u,
|
|
552
|
-
ie as v,
|
|
553
|
-
Ue as w,
|
|
554
|
-
Qe as x,
|
|
555
|
-
se as y,
|
|
556
|
-
R as z
|
|
557
|
-
};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { ref as t, watch as O, computed as d } from "vue";
|
|
2
|
-
import { H as g, a as k, I as L, J as R, K as T } from "./useScheduleOutlet-CmIG5dwQ.js";
|
|
3
|
-
function m() {
|
|
4
|
-
return g.map((l) => ({ id: l.id, name: l.name }));
|
|
5
|
-
}
|
|
6
|
-
function x() {
|
|
7
|
-
const l = t(m());
|
|
8
|
-
O(
|
|
9
|
-
() => g.map((e) => `${e.id}:${e.name}`).join(" "),
|
|
10
|
-
() => {
|
|
11
|
-
l.value = m();
|
|
12
|
-
}
|
|
13
|
-
);
|
|
14
|
-
const h = d(() => k()), s = t(!1), r = t(""), c = t(null), v = t(""), i = t(null), u = t(!1), a = t(null);
|
|
15
|
-
function p(e) {
|
|
16
|
-
return h.value.filter((n) => n.role === e).length;
|
|
17
|
-
}
|
|
18
|
-
function f(e, n) {
|
|
19
|
-
return l.value.some(
|
|
20
|
-
(o) => o.id !== n && o.name.toLowerCase() === e.toLowerCase()
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
function y() {
|
|
24
|
-
s.value = !0, r.value = "", c.value = null, i.value = null, a.value = null;
|
|
25
|
-
}
|
|
26
|
-
function E() {
|
|
27
|
-
s.value = !1, r.value = "";
|
|
28
|
-
}
|
|
29
|
-
async function w() {
|
|
30
|
-
const e = r.value.trim().slice(0, 40);
|
|
31
|
-
if (!(!e || f(e))) {
|
|
32
|
-
u.value = !0, a.value = null;
|
|
33
|
-
try {
|
|
34
|
-
await T({ name: e }), s.value = !1, r.value = "";
|
|
35
|
-
} catch (n) {
|
|
36
|
-
a.value = n instanceof Error ? n.message : "Could not add this position";
|
|
37
|
-
} finally {
|
|
38
|
-
u.value = !1;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function C(e) {
|
|
43
|
-
const n = l.value.find((o) => o.id === e);
|
|
44
|
-
n && (c.value = e, v.value = n.name, s.value = !1, i.value = null, a.value = null);
|
|
45
|
-
}
|
|
46
|
-
function P() {
|
|
47
|
-
c.value = null, v.value = "";
|
|
48
|
-
}
|
|
49
|
-
async function D(e) {
|
|
50
|
-
const n = v.value.trim().slice(0, 40);
|
|
51
|
-
if (!(!n || f(n, e))) {
|
|
52
|
-
u.value = !0, a.value = null;
|
|
53
|
-
try {
|
|
54
|
-
await R(e, { name: n }), c.value = null, v.value = "";
|
|
55
|
-
} catch (o) {
|
|
56
|
-
a.value = o instanceof Error ? o.message : "Could not rename this position";
|
|
57
|
-
} finally {
|
|
58
|
-
u.value = !1;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function I(e) {
|
|
63
|
-
i.value = e;
|
|
64
|
-
}
|
|
65
|
-
function A() {
|
|
66
|
-
i.value = null;
|
|
67
|
-
}
|
|
68
|
-
async function S(e) {
|
|
69
|
-
u.value = !0, a.value = null;
|
|
70
|
-
try {
|
|
71
|
-
await L(e), i.value = null;
|
|
72
|
-
} catch (n) {
|
|
73
|
-
a.value = n instanceof Error ? n.message : "Could not delete this position";
|
|
74
|
-
} finally {
|
|
75
|
-
u.value = !1;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
const N = d(() => l.value.length);
|
|
79
|
-
return {
|
|
80
|
-
positions: l,
|
|
81
|
-
count: N,
|
|
82
|
-
isAdding: s,
|
|
83
|
-
newName: r,
|
|
84
|
-
editingId: c,
|
|
85
|
-
editingName: v,
|
|
86
|
-
pendingDeleteId: i,
|
|
87
|
-
saving: u,
|
|
88
|
-
error: a,
|
|
89
|
-
usageCountFor: p,
|
|
90
|
-
startAdd: y,
|
|
91
|
-
cancelAdd: E,
|
|
92
|
-
confirmAdd: w,
|
|
93
|
-
startEdit: C,
|
|
94
|
-
cancelEdit: P,
|
|
95
|
-
saveEdit: D,
|
|
96
|
-
askDelete: I,
|
|
97
|
-
cancelDelete: A,
|
|
98
|
-
confirmDelete: S
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
export {
|
|
102
|
-
x as u
|
|
103
|
-
};
|