@feedmepos/mf-hrm-portal 2.4.2-dev.2 → 2.4.2

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.
Files changed (112) hide show
  1. package/dist/{ApprovalCodeList-b8usXKo8.js → ApprovalCodeList-DGLPcQcv.js} +15 -14
  2. package/dist/{AuditLogList-DqbgzFAs.js → AuditLogList-ahJwTF7N.js} +12 -12
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-IPkyxwIF.js +438 -0
  4. package/dist/EmployeeList-B18mlY4V.js +776 -0
  5. package/dist/FormItem.vue_vue_type_script_setup_true_lang-Dvo9AiKf.js +45 -0
  6. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  7. package/dist/{GrantUserList-B-p8Qghu.js → GrantUserList-C8BbP99C.js} +16 -15
  8. package/dist/{Main-D_EXStcl.js → Main-BA29_N_p.js} +2280 -2274
  9. package/dist/{Main-x6An4Vlq.js → Main-BN3b_yie.js} +5 -5
  10. package/dist/Main-Clux_qKN.js +96 -0
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
  12. package/dist/{PermissionSetList-D4Vdbk10.js → PermissionSetList-BSOJ8ftd.js} +108 -107
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Hz_rFmbH.js +4181 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-BwuBk683.js +35 -0
  15. package/dist/RoleList-EnfxydGa.js +740 -0
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-DiWJzXvb.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-yIdd8r7y.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-O7ohVH-K.js → ScheduleGeneralPage-CFUqm5-r.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-DOkdX3vt.js → ScheduleModal.vue_vue_type_script_setup_true_lang-BmPrGRG2.js} +186 -187
  19. package/dist/{SchedulePage-WT_Ttars.js → SchedulePage-DEFQwipO.js} +16 -16
  20. package/dist/{SchedulePositionPage-13qwxMn2.js → SchedulePositionPage-CM5NS5-F.js} +3 -3
  21. package/dist/{SelectFilter-DbE6YV-6.js → SelectFilter-DgjR5o5E.js} +1 -1
  22. package/dist/TeamMemberList-BKvhHLNG.js +1150 -0
  23. package/dist/TimesheetList-EQRMimP7.js +402 -0
  24. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_ffd7f807_lang-_tXql6vR.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-BumkwWvb.js} +7 -7
  25. package/dist/{app-D-6Rxcbg.js → app-Bkc0pF3P.js} +3929 -7722
  26. package/dist/app.js +3 -3
  27. package/dist/{approval-code-Ba9JpPf4.js → approval-code-BKMu1GDn.js} +1 -1
  28. package/dist/{dayjs.min-dCnie4oC.js → dayjs.min-CkI2q2aC.js} +24 -24
  29. package/dist/employee-BfkxCdPL.js +209 -0
  30. package/dist/{grant-user-Dpla60s_.js → grant-user-ClN_vTOv.js} +1 -1
  31. package/dist/{index-D8G0ElDc.js → iteration-CsNIceUp.js} +558 -573
  32. package/dist/{lodash-CucBZWOa.js → lodash-BgraJgCc.js} +1 -1
  33. package/dist/restaurant-CRNgiIa4.js +2685 -0
  34. package/dist/role-CZYSdVn2.js +91 -0
  35. package/dist/rule-_4roLZrG.js +780 -0
  36. package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
  37. package/dist/src/helpers/iteration.d.ts +2 -9
  38. package/dist/src/helpers/permission-set.d.ts +102 -1
  39. package/dist/src/helpers/rule.d.ts +2 -2
  40. package/dist/src/helpers/string.d.ts +1 -10
  41. package/dist/src/router/shared.d.ts +1 -3
  42. package/dist/src/stores/restaurant.d.ts +7 -7
  43. package/dist/src/stores/team.d.ts +0 -30
  44. package/dist/src/types/team.d.ts +1 -17
  45. package/dist/src/views/audit-log/locales/index.d.ts +0 -12
  46. package/dist/src/views/hr/locales/index.d.ts +0 -20
  47. package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
  48. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  49. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  50. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  51. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  52. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
  53. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
  54. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
  55. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
  56. package/dist/src/views/team/locales/index.d.ts +0 -716
  57. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
  58. package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
  59. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
  60. package/dist/string-VNuQNweN.js +15 -0
  61. package/dist/style.css +1 -1
  62. package/dist/tsconfig.app.tsbuildinfo +1 -1
  63. package/dist/{useAppStore-C_LStOtj.js → useAppStore-DYmF1kgk.js} +1 -1
  64. package/dist/{useLoading-CJ-DUrnR.js → useLoading-C2UKuAxD.js} +1 -1
  65. package/dist/{useReportPermissions-C7TLMKuR.js → useReportPermissions-BiaXRc0p.js} +22 -22
  66. package/package.json +1 -1
  67. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-WeFI9muF.js +0 -459
  68. package/dist/EmployeeList-NM0guUbU.js +0 -896
  69. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BCNKeDZY.js +0 -90
  70. package/dist/Main-BrhCJsik.js +0 -101
  71. package/dist/MyPosProfile-CG1PZ5p4.js +0 -360
  72. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
  73. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CFyGZpKr.js +0 -4212
  74. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CTxqUf16.js +0 -1797
  75. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-DUhqZaQv.js +0 -547
  76. package/dist/RoleList-DFcy90mE.js +0 -274
  77. package/dist/TeamMemberList-CWfXQcO3.js +0 -2082
  78. package/dist/TimesheetList-Bp2hRf7V.js +0 -408
  79. package/dist/employee-B5qCkaCi.js +0 -237
  80. package/dist/member-grant-CZILo1nC.js +0 -54
  81. package/dist/restaurant-CD6RZ8XG.js +0 -49
  82. package/dist/role-54DbS-Cy.js +0 -91
  83. package/dist/rule-DzTp1Kjh.js +0 -845
  84. package/dist/src/api/my-pos-profile/index.d.ts +0 -3
  85. package/dist/src/api/sso-provider/index.d.ts +0 -5
  86. package/dist/src/api/staff-invite/index.d.ts +0 -16
  87. package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
  88. package/dist/src/composables/useMenuAccess.d.ts +0 -56
  89. package/dist/src/composables/useSsoProviders.d.ts +0 -19
  90. package/dist/src/composables/useStaffInviteProviders.d.ts +0 -8
  91. package/dist/src/helpers/employee-merge.d.ts +0 -33
  92. package/dist/src/helpers/member-grant.d.ts +0 -36
  93. package/dist/src/helpers/my-pos-profile.d.ts +0 -37
  94. package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
  95. package/dist/src/helpers/restaurant-lookup.d.ts +0 -19
  96. package/dist/src/helpers/role-merge.d.ts +0 -11
  97. package/dist/src/helpers/staff-invite.d.ts +0 -54
  98. package/dist/src/router/menu-access-guard.d.ts +0 -17
  99. package/dist/src/types/my-pos-profile.d.ts +0 -24
  100. package/dist/src/types/sso-provider.d.ts +0 -10
  101. package/dist/src/types/staff-invite.d.ts +0 -100
  102. package/dist/src/views/hr/timesheet/timesheet-view.d.ts +0 -29
  103. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +0 -2
  104. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
  105. package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -236
  106. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
  107. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
  108. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +0 -11
  109. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
  110. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
  111. package/dist/string-DZQ1uNjn.js +0 -22
  112. package/dist/useSsoProviders-DhmUc7LW.js +0 -41
@@ -1,408 +0,0 @@
1
- import { ref as f, computed as _, toRaw as E, defineComponent as ve, onMounted as he, watch as ee, resolveComponent as p, createElementBlock as N, openBlock as I, Fragment as te, createVNode as s, createElementVNode as i, unref as n, withCtx as D, createCommentVNode as ge, toDisplayString as R, createTextVNode as ye, isRef as we, renderList as be, createBlock as ae, nextTick as _e } from "vue";
2
- import { d as b } from "./dayjs.min-dCnie4oC.js";
3
- import { useI18n as xe } from "@feedmepos/mf-common";
4
- import { useSnackbar as De, components as Se } from "@feedmepos/ui-library";
5
- import { S as Ve } from "./SelectFilter-DbE6YV-6.js";
6
- import { _ as ke, a as Ce } from "./app-D-6Rxcbg.js";
7
- import { _ as Fe } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
8
- import { u as Ye } from "./useLoading-CJ-DUrnR.js";
9
- import { n as Me } from "./string-DZQ1uNjn.js";
10
- import { u as Te } from "./employee-B5qCkaCi.js";
11
- import { u as Le } from "./restaurant-CD6RZ8XG.js";
12
- import { u as Ie } from "./TimesheetList.vue_vue_type_style_index_0_scoped_ffd7f807_lang-_tXql6vR.js";
13
- import { g as Re, s as $e } from "./index-D8G0ElDc.js";
14
- import { f as Be } from "./utils-BZkjJbju.js";
15
- function Ee(v, a) {
16
- return ["years", "months"].find((g) => {
17
- const h = v.startOf(g), r = v.endOf(g);
18
- return v.isSame(h, "day") && a.isSame(r, "day");
19
- }) || "days";
20
- }
21
- function Oe() {
22
- const v = {
23
- startDate: b().format("YYYY-MM-DD"),
24
- endDate: b().format("YYYY-MM-DD")
25
- }, a = f(v), u = _(() => {
26
- if (!a.value) return "No dates selected.";
27
- const r = a.value.startDate ?? "Start", d = a.value.endDate ?? "End";
28
- return `${r} - ${d}`;
29
- }), g = _(() => ({
30
- startDate: new Date(a.value.startDate),
31
- endDate: new Date(a.value.endDate)
32
- }));
33
- function h(r) {
34
- const d = b(a.value.startDate), l = b(a.value.endDate), c = Ee(d, l), y = c === "days" ? l.diff(d, "days") + 1 : 1, S = r === "subtract" ? (V) => V.subtract(y, c) : (V) => V.add(y, c);
35
- a.value = {
36
- startDate: S(d).startOf(c).format("YYYY-MM-DD"),
37
- endDate: S(l).endOf(c).format("YYYY-MM-DD")
38
- };
39
- }
40
- return { dateRange: a, parsedDateRange: g, dateRangeLabel: u, setRange: h };
41
- }
42
- function P(v) {
43
- const a = /* @__PURE__ */ new Map();
44
- for (const u of v)
45
- a.has(u._id) || a.set(u._id, u);
46
- return a;
47
- }
48
- function Ae(v, a, u, g) {
49
- const h = P(E(a)), r = P(E(u)), d = g ? new Set(g) : null;
50
- return E(v).filter((l) => !d || d.has(l.restaurantId)).map((l) => {
51
- var y;
52
- const c = r.get(l.user.id);
53
- return {
54
- ...l,
55
- restaurantCode: (y = h.get(l.restaurantId)) == null ? void 0 : y.profile.code,
56
- user: { ...l.user, code: c ? c.code : "" }
57
- };
58
- });
59
- }
60
- function Ke(v, a) {
61
- const u = P(E(a)), g = Object.entries(Re([...v], (h) => h.user.name)).map(([h, r]) => {
62
- const d = r[0], l = u.get(d.user.id);
63
- return {
64
- key: h,
65
- user: d.user.name,
66
- code: l ? l.code : d.user.code || "",
67
- timesheets: r,
68
- total: Be(r.reduce((c, y) => c + y.totalMin, 0))
69
- };
70
- });
71
- return $e(g, { selector: "user" });
72
- }
73
- const Ue = {
74
- class: "my-16 flex w-[350px] flex-col gap-40"
75
- }, ze = {
76
- class: "flex gap-16"
77
- }, Ne = {
78
- class: "flex flex-col gap-4"
79
- }, Pe = {
80
- class: "fm-typo-body-md-400 text-fm-color-typo-secondary"
81
- }, je = {
82
- class: "fm-typo-body-md-700 text-fm-color-typo-primary"
83
- }, He = {
84
- class: "flex flex-col gap-8"
85
- }, Ge = {
86
- class: "fm-typo-body-xl-700"
87
- }, qe = {
88
- class: "flex flex-col gap-24"
89
- }, Je = {
90
- class: "flex flex-col gap-8"
91
- }, Qe = {
92
- class: "fm-typo-body-xl-700"
93
- }, We = {
94
- class: "flex flex-col gap-24"
95
- }, Xe = {
96
- key: 0,
97
- class: "fm-typo-body-sm-400 text-fm-color-typo-error mt-1 flex items-center gap-4"
98
- }, Ze = {
99
- class: "flex items-center justify-start gap-8"
100
- }, et = {
101
- class: "space-y-8"
102
- }, tt = {
103
- class: "flex items-start gap-8 flex-wrap xs:px-16"
104
- }, at = {
105
- class: "flex items-center gap-8"
106
- }, ot = {
107
- class: "flex h-full flex-col overflow-auto"
108
- }, st = /* @__PURE__ */ ve({
109
- __name: "TimesheetList",
110
- setup(v) {
111
- const {
112
- t: a
113
- } = xe(), u = De(), g = Ye(u), h = [{
114
- label: a("hr.timesheet.listView"),
115
- value: "listView"
116
- }, {
117
- label: a("hr.timesheet.userView"),
118
- value: "userView"
119
- }], r = f("listView"), d = _(() => {
120
- var t;
121
- return (t = h.find((e) => e.value === r.value)) == null ? void 0 : t.label;
122
- }), l = f(""), c = Ie(), y = Te(), S = Le(), V = _(() => y.employees.value), j = _(() => Ae(c.timesheets.value, S.restaurants.value, V.value, U.value)), O = _(() => j.value.filter((t) => {
123
- var e, m;
124
- return t.user.name.toLowerCase().includes(l.value.toLowerCase()) || t.restaurantName.toLowerCase().includes(l.value.toLowerCase()) || ((e = t.restaurantCode) == null ? void 0 : e.toLowerCase().includes(l.value.toLowerCase())) || ((m = t.user.code) == null ? void 0 : m.toLowerCase().includes(l.value.toLowerCase()));
125
- })), H = _(() => Ke(j.value, V.value)), A = _(() => H.value.filter((t) => {
126
- var e;
127
- return t.user.toLowerCase().includes(l.value.toLowerCase()) || ((e = t.code) == null ? void 0 : e.toLowerCase().includes(l.value.toLowerCase()));
128
- })), k = f(!1), K = async () => {
129
- const {
130
- startDate: t,
131
- endDate: e
132
- } = C.value;
133
- k.value = !0;
134
- try {
135
- await c.readTimesheet(new Date(t), new Date(e)), await _e(), z.value = Object.fromEntries(Object.entries(new Array(H.value.length).fill(!0)));
136
- } catch (m) {
137
- u.open({
138
- title: m instanceof Error ? m.message : `${m}`,
139
- type: "error"
140
- });
141
- } finally {
142
- k.value = !1;
143
- }
144
- };
145
- he(async () => {
146
- try {
147
- await S.readRestaurants(), y.employees.value.length === 0 && await y.readEmployees();
148
- } catch (t) {
149
- console.error("Failed to load timesheet dependencies:", t), u.open({
150
- message: t instanceof Error ? t.message : String(t),
151
- type: "error"
152
- });
153
- }
154
- K();
155
- });
156
- const U = f(), oe = _(() => S.restaurants.value.filter((t) => t.managable).map((t) => ({
157
- label: `${t.profile.code ? `${t.profile.code} - ` : ""}${t.profile.name}`,
158
- value: t._id
159
- }))), {
160
- dateRange: C,
161
- dateRangeLabel: se,
162
- setRange: G
163
- } = Oe();
164
- ee(C, async () => {
165
- K();
166
- });
167
- const le = [{
168
- accessorKey: "user.code",
169
- size: 100,
170
- header: () => a("hr.employee.columns.code"),
171
- cell: (t) => t.row.original.user.code || "--",
172
- enableSorting: !0
173
- }, {
174
- accessorKey: "user",
175
- header: () => a("hr.timesheet.columns.name"),
176
- cell: (t) => t.row.original.user.name,
177
- enableSorting: !1
178
- }, {
179
- accessorKey: "restaurantName",
180
- header: () => a("hr.timesheet.columns.restaurant"),
181
- cell: (t) => {
182
- const e = t.row.original.restaurantCode, m = t.row.original.restaurantName;
183
- return `${e ? e + " - " : ""}${m}`;
184
- },
185
- enableSorting: !0
186
- }, {
187
- accessorKey: "start",
188
- header: () => a("hr.timesheet.columns.start"),
189
- cell: (t) => t.row.original.start || "--",
190
- enableSorting: !0
191
- }, {
192
- accessorKey: "end",
193
- header: () => a("hr.timesheet.columns.end"),
194
- cell: (t) => t.row.original.end || "--",
195
- enableSorting: !0
196
- }, {
197
- name: "duration",
198
- accessorKey: "duration",
199
- header: () => a("hr.timesheet.columns.duration"),
200
- cell: (t) => t.row.original.duration || "--",
201
- enableSorting: !0
202
- }], z = f({}), ne = [{
203
- accessorKey: "code",
204
- size: 100,
205
- header: () => a("hr.employee.columns.code"),
206
- cell: (t) => t.row.original.code,
207
- enableSorting: !1
208
- }, {
209
- accessorKey: "user",
210
- header: () => a("hr.timesheet.columns.name"),
211
- cell: (t) => {
212
- const e = t.row.original;
213
- if (typeof e.user == "string") {
214
- const m = t.row.getIsExpanded();
215
- return s("div", {
216
- class: "flex items-center gap-8"
217
- }, [s("div", {
218
- onClick: (x) => {
219
- x.stopPropagation(), t.row.getToggleExpandedHandler()(x);
220
- }
221
- }, [s(Se.FmButton, {
222
- variant: "tertiary",
223
- icon: m ? "keyboard_arrow_up" : "keyboard_arrow_down"
224
- }, null)]), e.user]);
225
- }
226
- },
227
- enableSorting: !1
228
- }, {
229
- accessorKey: "start",
230
- header: () => a("hr.timesheet.columns.start"),
231
- cell: (t) => {
232
- const e = t.row.original;
233
- return (e == null ? void 0 : e.start) || "--";
234
- },
235
- enableSorting: !1
236
- }, {
237
- accessorKey: "end",
238
- header: () => a("hr.timesheet.columns.end"),
239
- cell: (t) => {
240
- const e = t.row.original;
241
- return (e == null ? void 0 : e.end) || "--";
242
- },
243
- enableSorting: !1
244
- }, {
245
- name: "duration",
246
- accessorKey: "duration",
247
- header: () => a("hr.timesheet.columns.hourMinute"),
248
- cell: (t) => {
249
- const e = t.row.original;
250
- return e.total ? `Total: ${e.total}` : e.duration;
251
- },
252
- enableSorting: !1
253
- }], F = f(!1);
254
- function q(t) {
255
- w.value = t, Y.value = b(w.value.startedAt).format("YYYY-MM-DD"), T.value = b(w.value.endedAt || w.value.startedAt).format("YYYY-MM-DD"), M.value = b(w.value.startedAt).format("HH:mm"), L.value = b(w.value.endedAt || w.value.startedAt).format("HH:mm"), F.value = !0;
256
- }
257
- const Y = f(), M = f(), T = f(), L = f(), w = f(), $ = f("");
258
- async function re() {
259
- const t = J(Y.value, M.value), e = J(T.value, L.value);
260
- if (b(t).isAfter(e)) {
261
- $.value = a("hr.timesheet.checkOutMustBeforeCheckIn");
262
- return;
263
- }
264
- g.minor(async () => {
265
- await c.updateTimesheet(w.value, t, e);
266
- }, {
267
- successMessage: a("hr.timesheet.update.successMessage")
268
- }), K(), F.value = !1;
269
- }
270
- const J = (t, e) => b(t).set("h", parseInt(e.split(":")[0])).set("m", parseInt(e.split(":")[1])).toISOString();
271
- return ee([Y, T, M, L], ([t, e, m, x]) => {
272
- (t || e || m || x) && ($.value = "");
273
- }), (t, e) => {
274
- const m = p("FmAvatar"), x = p("FmDatePicker"), Q = p("FmTimePicker"), ie = p("FmIcon"), B = p("FmButton"), ue = p("FmSideSheet"), W = p("FmChip"), de = p("FmDateRangePicker"), ce = p("FmMenuItem"), me = p("FmMenu"), pe = p("FmSpacer"), fe = p("FmSearch"), X = p("FmTable");
275
- return I(), N(te, null, [s(ue, {
276
- modelValue: F.value,
277
- "onUpdate:modelValue": e[5] || (e[5] = (o) => F.value = o),
278
- "dismiss-away": "",
279
- header: n(a)("hr.timesheet.update.title")
280
- }, {
281
- "side-sheet-footer": D(() => [i("div", Ze, [s(B, {
282
- label: n(a)("common.update"),
283
- size: "md",
284
- variant: "primary",
285
- onClick: re
286
- }, null, 8, ["label"]), s(B, {
287
- label: n(a)("common.cancel"),
288
- size: "md",
289
- variant: "secondary",
290
- onClick: e[4] || (e[4] = (o) => F.value = !1)
291
- }, null, 8, ["label"])])]),
292
- default: D(() => [i("div", Ue, [i("div", ze, [s(m, {
293
- name: w.value.user.name,
294
- initials: n(Me)(w.value.user.name),
295
- size: "lg"
296
- }, null, 8, ["name", "initials"]), i("div", Ne, [i("div", Pe, R(n(a)("hr.timesheet.employeeName")), 1), i("div", je, R(w.value.user.name), 1)])]), i("div", He, [i("div", Ge, R(n(a)("hr.timesheet.update.checkIn")), 1), i("div", qe, [s(x, {
297
- modelValue: Y.value,
298
- "onUpdate:modelValue": e[0] || (e[0] = (o) => Y.value = o),
299
- disabled: !1,
300
- label: n(a)("hr.timesheet.update.date")
301
- }, null, 8, ["modelValue", "label"]), s(Q, {
302
- modelValue: M.value,
303
- "onUpdate:modelValue": e[1] || (e[1] = (o) => M.value = o),
304
- label: n(a)("hr.timesheet.update.time")
305
- }, null, 8, ["modelValue", "label"])])]), i("div", Je, [i("div", Qe, R(n(a)("hr.timesheet.update.checkOut")), 1), i("div", We, [s(x, {
306
- modelValue: T.value,
307
- "onUpdate:modelValue": e[2] || (e[2] = (o) => T.value = o),
308
- disabled: !1,
309
- label: n(a)("hr.timesheet.update.date")
310
- }, null, 8, ["modelValue", "label"]), s(Q, {
311
- modelValue: L.value,
312
- "onUpdate:modelValue": e[3] || (e[3] = (o) => L.value = o),
313
- label: n(a)("hr.timesheet.update.time")
314
- }, null, 8, ["modelValue", "label"])])]), $.value ? (I(), N("div", Xe, [s(ie, {
315
- color: "#FF3B30",
316
- name: "error",
317
- size: "sm"
318
- }), ye(" " + R($.value), 1)])) : ge("", !0)])]),
319
- _: 1
320
- }, 8, ["modelValue", "header"]), i("div", et, [i("div", tt, [s(Ve, {
321
- modelValue: U.value,
322
- "onUpdate:modelValue": e[6] || (e[6] = (o) => U.value = o),
323
- multiple: "",
324
- items: oe.value,
325
- variant: "dark",
326
- "selected-prefix": n(a)("hr.role.columns.restaurants"),
327
- placeholder: n(a)("hr.role.columns.restaurants"),
328
- class: "!w-auto pt-[3px]"
329
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i("div", at, [s(de, {
330
- modelValue: n(C),
331
- "onUpdate:modelValue": e[7] || (e[7] = (o) => we(C) ? C.value = o : null),
332
- "show-predefined-range": ""
333
- }, {
334
- "trigger-button": D(() => [s(W, {
335
- label: n(se)
336
- }, null, 8, ["label"])]),
337
- _: 1
338
- }, 8, ["modelValue"]), s(B, {
339
- icon: "chevron_left",
340
- variant: "tertiary",
341
- onClick: e[8] || (e[8] = (o) => n(G)("subtract"))
342
- }), s(B, {
343
- icon: "chevron_right",
344
- variant: "tertiary",
345
- onClick: e[9] || (e[9] = (o) => n(G)("add"))
346
- })]), s(me, {
347
- class: "pt-[3px]"
348
- }, {
349
- "menu-button": D(() => [s(W, {
350
- label: d.value,
351
- "right-icon": "keyboard_arrow_down"
352
- }, null, 8, ["label"])]),
353
- default: D(() => [(I(), N(te, null, be(h, (o) => s(ce, {
354
- key: o.value,
355
- label: o.label,
356
- onClick: (Z) => r.value = o.value
357
- }, null, 8, ["label", "onClick"])), 64))]),
358
- _: 1
359
- }), s(pe), s(fe, {
360
- modelValue: l.value,
361
- "onUpdate:modelValue": e[10] || (e[10] = (o) => l.value = o),
362
- class: "w-[320px]",
363
- placeholder: n(a)("hr.timesheet.search.placeholder")
364
- }, null, 8, ["modelValue", "placeholder"])]), s(ke, {
365
- class: "w-full xs:px-16"
366
- }, {
367
- default: D(() => [i("div", ot, [s(Fe, {
368
- "is-loading": k.value,
369
- "is-empty": r.value === "listView" ? O.value.length === 0 : A.value.length === 0,
370
- "collapse-at": !1,
371
- title: n(a)("hr.timesheet.noData.title"),
372
- subtitle: ""
373
- }, {
374
- default: D(() => [r.value === "listView" ? (I(), ae(X, {
375
- key: 0,
376
- class: "min-w-[640px]",
377
- "column-defs": le,
378
- "row-data": O.value,
379
- "page-size": O.value.length,
380
- loading: k.value,
381
- "pin-header-row": "",
382
- "hide-footer": "",
383
- "shrink-at": !1,
384
- onRowClick: e[11] || (e[11] = (o) => q(o.original))
385
- }, null, 8, ["row-data", "page-size", "loading"])) : (I(), ae(X, {
386
- key: 1,
387
- class: "min-w-[640px] timesheet-user-view",
388
- "column-defs": ne,
389
- "row-data": A.value,
390
- "page-size": A.value.reduce((o, Z) => o + 1 + Z.timesheets.length, 0),
391
- loading: k.value,
392
- "pin-header-row": "",
393
- "shrink-at": !1,
394
- "expanded-state": z.value,
395
- "get-sub-row": (o) => o.timesheets,
396
- "onUpdate:expandedState": e[12] || (e[12] = (o) => z.value = o),
397
- onRowClick: e[13] || (e[13] = (o) => q(o.original))
398
- }, null, 8, ["row-data", "page-size", "loading", "expanded-state", "get-sub-row"]))]),
399
- _: 1
400
- }, 8, ["is-loading", "is-empty", "title"])])]),
401
- _: 1
402
- })])], 64);
403
- };
404
- }
405
- }), wt = /* @__PURE__ */ Ce(st, [["__scopeId", "data-v-ffd7f807"]]);
406
- export {
407
- wt as default
408
- };
@@ -1,237 +0,0 @@
1
- import { defineStore as U, storeToRefs as $ } from "pinia";
2
- import { toRaw as y, ref as I } from "vue";
3
- import { a as T, s as E } from "./index-D8G0ElDc.js";
4
- import { b as p, g as m } from "./app-D-6Rxcbg.js";
5
- import { d as D } from "./dayjs.min-dCnie4oC.js";
6
- import { i as Y } from "./utils-BZkjJbju.js";
7
- import { u as M } from "./role-54DbS-Cy.js";
8
- import { u as b } from "./restaurant-CD6RZ8XG.js";
9
- function g(e) {
10
- return D(Y(e)).format("DD/MM/YYYY");
11
- }
12
- function j(e, s, l) {
13
- const c = new Map(y(s).map((t) => [t._id, t.profile.name])), a = new Map(y(l).map((t) => [t._id, t.name])), r = /* @__PURE__ */ new Map();
14
- for (const t of e) {
15
- const f = {
16
- restaurantId: t.restaurantId,
17
- restaurantName: c.get(t.restaurantId) || "",
18
- roleId: t.role,
19
- roleName: a.get(t.role) || ""
20
- }, i = r.get(t._id);
21
- i ? i.outletIds.has(t.restaurantId) || (i.outletIds.add(t.restaurantId), i.employee.restaurants.push(f)) : r.set(t._id, {
22
- employee: {
23
- ...t,
24
- isRestricted: !1,
25
- since: g(t._id),
26
- restaurants: [f]
27
- },
28
- outletIds: /* @__PURE__ */ new Set([t.restaurantId])
29
- });
30
- }
31
- const n = [];
32
- for (const { employee: t } of r.values())
33
- t.restaurants = E(t.restaurants, { selector: "restaurantName" }), n.push(t);
34
- return E(n, { selector: "name" });
35
- }
36
- function A(e, s) {
37
- const l = new Map(y(e).map((a) => [a._id, a])), c = new Map(y(s).map((a) => [a._id, a.name]));
38
- return (a) => {
39
- const r = a.restaurantRole[0];
40
- return {
41
- _id: a._id,
42
- name: a.name,
43
- code: a.code,
44
- passcode: a.passcode,
45
- isMasterUser: a.isMasterUser,
46
- isRestricted: a.isRestricted,
47
- restaurantId: (r == null ? void 0 : r.restaurantId) || "",
48
- role: (r == null ? void 0 : r.roleId) || "",
49
- since: g(a._id),
50
- restaurants: E(
51
- a.restaurantRole.map((n) => {
52
- const t = l.get(n.restaurantId);
53
- return {
54
- restaurantId: n.restaurantId,
55
- restaurantName: (t == null ? void 0 : t.profile.name) || "",
56
- restaurantCode: (t == null ? void 0 : t.profile.code) ?? void 0,
57
- roleId: n.roleId,
58
- roleName: c.get(n.roleId) || ""
59
- };
60
- }),
61
- { selector: "restaurantName" }
62
- )
63
- };
64
- };
65
- }
66
- function J(e, s, l) {
67
- const { nameById: c } = T(s), a = /* @__PURE__ */ new Map();
68
- for (const r of y(l))
69
- a.has(r._id) || a.set(r._id, r.name);
70
- return e.flatMap(
71
- (r) => r.restaurants.map((n, t) => ({
72
- code: t === 0 ? Reflect.get(r, "code") : "",
73
- name: t === 0 ? r.name : "",
74
- passcode: t === 0 ? r.passcode : "",
75
- since: t === 0 ? r.since : "",
76
- restaurant: c.get(n.restaurantId) || "",
77
- role: a.get(n.roleId) || ""
78
- }))
79
- );
80
- }
81
- const u = {
82
- async readEmployees() {
83
- return m(await p().get("/pos-users"));
84
- },
85
- async readEmployeesPage(e) {
86
- var s, l;
87
- return m(
88
- await p().get("/pos-users/paged", {
89
- params: {
90
- limit: e.limit,
91
- offset: e.offset,
92
- search: e.search,
93
- restaurantIds: (s = e.restaurantIds) != null && s.length ? e.restaurantIds : void 0,
94
- roleIds: (l = e.roleIds) != null && l.length ? e.roleIds : void 0,
95
- includeEmptyPasscode: e.includeEmptyPasscode || void 0
96
- }
97
- })
98
- );
99
- },
100
- async createEmployee(e) {
101
- return m(
102
- await p().post("/pos-users", e)
103
- ).employeeId;
104
- },
105
- async createMasterEmployee(e) {
106
- return m(
107
- await p().post("/pos-users/master-user", e)
108
- ).employeeId;
109
- },
110
- async migrateToMasterEmployee(e, s) {
111
- await p().put(`/pos-users/migrate/${e}`, s);
112
- },
113
- async updateEmployee(e, s) {
114
- await p().put(`/pos-users/${e}`, s);
115
- },
116
- async updateMasterEmployee(e, s) {
117
- await p().put(`/pos-users/master-user/${e}`, s);
118
- },
119
- async deleteEmployee(e) {
120
- await p().put(`/pos-users/${e._id}`, {
121
- user: e,
122
- roles: [],
123
- previousRoles: e.restaurants.map((s) => ({
124
- restaurantId: s.restaurantId,
125
- roleId: s.roleId
126
- }))
127
- });
128
- },
129
- async deleteMasterEmployee(e) {
130
- await p().put(`/pos-users/master-user/${e._id}`, {
131
- user: e,
132
- roles: [],
133
- previousRoles: e.restaurants.map((s) => ({
134
- restaurantId: s.restaurantId,
135
- roleId: s.roleId
136
- }))
137
- });
138
- },
139
- async generateEmployeePasscode(e) {
140
- return `${m(
141
- await p().post("/pos-users/generate-passcode", {
142
- restaurantIds: e.restaurantIds,
143
- excludePosUserId: e.excludePosUserId
144
- })
145
- )}`;
146
- },
147
- async syncUsersMeta() {
148
- await p().post("/pos-users/create-users-meta");
149
- }
150
- }, x = U("hrm-employee", () => {
151
- const e = b(), s = I([]), l = I([]), c = I(0), a = I(!1);
152
- function r() {
153
- return A(
154
- e.restaurants.value,
155
- M().roles.value
156
- );
157
- }
158
- async function n() {
159
- try {
160
- a.value = !0, await e.readRestaurants();
161
- const o = await u.readEmployees();
162
- s.value = j(
163
- o,
164
- e.restaurants.value,
165
- M().roles.value
166
- );
167
- } finally {
168
- a.value = !1;
169
- }
170
- }
171
- async function t(o) {
172
- try {
173
- a.value = !0, await e.readRestaurants();
174
- const d = await u.readEmployeesPage(o);
175
- l.value = d.items.map(r()), c.value = d.total;
176
- } finally {
177
- a.value = !1;
178
- }
179
- }
180
- async function f(o, d) {
181
- await e.readRestaurants();
182
- const w = d ?? (await u.readEmployeesPage({ ...o, limit: 1, offset: 0 })).total;
183
- return w === 0 ? [] : (await u.readEmployeesPage({ ...o, limit: w, offset: 0 })).items.map(r());
184
- }
185
- async function i(o) {
186
- return u.createEmployee(o);
187
- }
188
- async function v(o, d) {
189
- await u.updateEmployee(o, d);
190
- }
191
- async function _(o) {
192
- await u.deleteEmployee(o);
193
- }
194
- async function P(o) {
195
- await u.deleteMasterEmployee(o);
196
- }
197
- async function h(o) {
198
- return u.createMasterEmployee(o);
199
- }
200
- async function S(o, d) {
201
- await u.updateMasterEmployee(o, d);
202
- }
203
- async function N(o, d) {
204
- await u.migrateToMasterEmployee(o, d);
205
- }
206
- async function R() {
207
- await u.syncUsersMeta();
208
- }
209
- return {
210
- employees: s,
211
- listEmployees: l,
212
- totalEmployees: c,
213
- isLoading: a,
214
- readEmployees: n,
215
- readEmployeesPage: t,
216
- readAllEmployeesPage: f,
217
- createEmployee: i,
218
- updateEmployee: v,
219
- deleteEmployee: _,
220
- createMasterEmployee: h,
221
- updateMasterEmployee: S,
222
- deleteMasterEmployee: P,
223
- migrateToMasterUser: N,
224
- syncUsersMeta: R
225
- };
226
- }), K = () => {
227
- const e = x();
228
- return {
229
- ...e,
230
- ...$(e)
231
- };
232
- };
233
- export {
234
- u as E,
235
- J as t,
236
- K as u
237
- };
@@ -1,54 +0,0 @@
1
- import { k as n } from "./app-D-6Rxcbg.js";
2
- import { z as u } from "./rule-DzTp1Kjh.js";
3
- const a = [
4
- n.Subject.Business.restaurant,
5
- n.Subject.Business.role,
6
- n.Subject.Restaurant.restaurant,
7
- n.Subject.Business.inventory_stock
8
- ], c = (s) => a.includes(s.subject);
9
- function l(s, t) {
10
- return t.length > 0 || s.some((o) => !o.inverted && !c(o));
11
- }
12
- function d(s) {
13
- return s.filter(c);
14
- }
15
- const b = {
16
- customPermissions: [],
17
- permissions: [],
18
- permissionSetIds: [],
19
- posUser: void 0
20
- };
21
- function S(s) {
22
- const { customPermissions: t, permissions: o } = u({
23
- userPermissions: s.userPermissions,
24
- inheritedPermissions: s.inheritedPermissions,
25
- reportSubjects: s.reportSubjects,
26
- defaultReportSubjects: s.defaultReportSubjects
27
- }), { posUser: e, savedPosUser: r } = s;
28
- return {
29
- customPermissions: t,
30
- permissions: o,
31
- permissionSetIds: s.permissionSetIds,
32
- posUser: e ? {
33
- ...e,
34
- name: e.name || (r == null ? void 0 : r.name) || s.fallbackName,
35
- code: e.code || (r == null ? void 0 : r.code) || "",
36
- passcode: e.passcode,
37
- roles: e.roles.filter((i) => !!i.roleId)
38
- } : e === null ? null : void 0
39
- };
40
- }
41
- function f(s, t) {
42
- const { posUser: o, ...e } = s;
43
- if (!o || !t || o.passcode !== t.passcode) return { ...e, posUser: o };
44
- const { passcode: r, ...i } = o;
45
- return { ...e, posUser: i };
46
- }
47
- export {
48
- b as E,
49
- a as W,
50
- S as b,
51
- l as h,
52
- f as t,
53
- d as w
54
- };