@feedmepos/mf-hrm-portal 2.3.2-dev.8 → 2.3.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 (114) hide show
  1. package/dist/{ApprovalCodeList-DIYhVMGW.js → ApprovalCodeList-C9r8CGNH.js} +15 -14
  2. package/dist/{AuditLogList-DIc3Jgpr.js → AuditLogList-Cu-KcQKa.js} +152 -147
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BQ-uIsTN.js +438 -0
  4. package/dist/EmployeeList-BaFqZnFM.js +776 -0
  5. package/dist/FormItem.vue_vue_type_script_setup_true_lang-Be1OU1_r.js +45 -0
  6. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  7. package/dist/{GrantUserList-8zmzFk9z.js → GrantUserList-Bjhx60M7.js} +16 -15
  8. package/dist/Main-CJQpjOgY.js +96 -0
  9. package/dist/{Main-DYzFd_qa.js → Main-DHiTgiDR.js} +5 -5
  10. package/dist/{Main-gRu17-N6.js → Main-LpfQqR_u.js} +999 -1005
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
  12. package/dist/{PermissionSetList-CL42jQY4.js → PermissionSetList-C0OZ_dvE.js} +76 -76
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-T7dkd5Uv.js +4167 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-EwU7gHP7.js +35 -0
  15. package/dist/RoleList-DpyW5XLs.js +740 -0
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-B9NMhw9Z.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CqP-Dn1X.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-751cEUwS.js → ScheduleGeneralPage-BNHi5jGf.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-CBDNfiIM.js → ScheduleModal.vue_vue_type_script_setup_true_lang-B609MZoP.js} +186 -187
  19. package/dist/{SchedulePage-C-NcbGIl.js → SchedulePage-CrP5_m3p.js} +13 -13
  20. package/dist/{SchedulePositionPage-Ba0iiSRg.js → SchedulePositionPage-ei_NKAUw.js} +3 -3
  21. package/dist/{SelectFilter-Dpsq165k.js → SelectFilter-CEYQ-ViE.js} +1 -1
  22. package/dist/TeamMemberList-rPiKKu2b.js +1154 -0
  23. package/dist/TimesheetList-B1L4WkNh.js +402 -0
  24. package/dist/TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-By6YR-k2.js +58 -0
  25. package/dist/{app-DXkKrcRn.js → app-BzlH-2cN.js} +4015 -7756
  26. package/dist/app.js +3 -3
  27. package/dist/{approval-code-D2pGW-sI.js → approval-code-CWq2ce3u.js} +1 -1
  28. package/dist/{dayjs.min-BAz84JAQ.js → dayjs.min-D6T4JzVv.js} +21 -21
  29. package/dist/employee-Bw7kRokg.js +209 -0
  30. package/dist/{grant-user-B95RDjkR.js → grant-user-q_mkj3Vh.js} +1 -1
  31. package/dist/{index-TrBkLxJe.js → iteration-Dz0e08VH.js} +726 -698
  32. package/dist/{lodash-DXRsZpTB.js → lodash-DGG_-VgI.js} +1 -1
  33. package/dist/restaurant-DJBQY9N5.js +2688 -0
  34. package/dist/role-CiRbkZSm.js +92 -0
  35. package/dist/rule-DMgkHpva.js +783 -0
  36. package/dist/src/api/employee/index.d.ts +2 -1
  37. package/dist/src/api/timesheet/index.d.ts +1 -1
  38. package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
  39. package/dist/src/helpers/permission-set.d.ts +102 -1
  40. package/dist/src/helpers/rule.d.ts +2 -2
  41. package/dist/src/helpers/string.d.ts +1 -10
  42. package/dist/src/router/shared.d.ts +1 -3
  43. package/dist/src/stores/employee.d.ts +7 -1
  44. package/dist/src/stores/restaurant.d.ts +8 -68
  45. package/dist/src/stores/team.d.ts +0 -30
  46. package/dist/src/stores/timesheet.d.ts +51 -66
  47. package/dist/src/types/team.d.ts +1 -17
  48. package/dist/src/types/timesheet.d.ts +0 -3
  49. package/dist/src/views/audit-log/constants.d.ts +1 -1
  50. package/dist/src/views/audit-log/locales/index.d.ts +16 -12
  51. package/dist/src/views/hr/locales/index.d.ts +0 -20
  52. package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
  53. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  54. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  55. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  56. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  57. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
  58. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
  59. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
  60. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
  61. package/dist/src/views/team/locales/index.d.ts +0 -716
  62. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
  63. package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
  64. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
  65. package/dist/string-VNuQNweN.js +15 -0
  66. package/dist/style.css +1 -1
  67. package/dist/tsconfig.app.tsbuildinfo +1 -1
  68. package/dist/{useAppStore-7O0GMkXY.js → useAppStore-TRX-PQD4.js} +1 -1
  69. package/dist/{useLoading-BZXydjer.js → useLoading-W3YSF8OB.js} +1 -1
  70. package/dist/{useReportPermissions-Cn3ntCJ9.js → useReportPermissions-CCkCAaGO.js} +3 -3
  71. package/package.json +3 -3
  72. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-4YsF7lXu.js +0 -459
  73. package/dist/EmployeeList-iVg4pI9Y.js +0 -896
  74. package/dist/FormSection.vue_vue_type_script_setup_true_lang-C9AE0EHw.js +0 -90
  75. package/dist/Main-ClJox3pV.js +0 -101
  76. package/dist/MyPosProfile-ARRrolbz.js +0 -290
  77. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
  78. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DkA0XbZw.js +0 -4208
  79. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CA87qQ4b.js +0 -1831
  80. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-B3N3hTcU.js +0 -547
  81. package/dist/RoleList-F9ZORhgE.js +0 -265
  82. package/dist/TeamMemberList-DZ0aRbxg.js +0 -2087
  83. package/dist/TimesheetList-DO5T__dL.js +0 -437
  84. package/dist/employee-yYhuhc9L.js +0 -172
  85. package/dist/iteration-CcXrOMQe.js +0 -30
  86. package/dist/member-grant-ByAQ1Qja.js +0 -54
  87. package/dist/restaurant-COSpCpTQ.js +0 -52
  88. package/dist/role-ZmCd2yG4.js +0 -98
  89. package/dist/rule-Bty9eoI3.js +0 -843
  90. package/dist/src/api/my-pos-profile/index.d.ts +0 -3
  91. package/dist/src/api/sso-provider/index.d.ts +0 -5
  92. package/dist/src/api/staff-invite/index.d.ts +0 -16
  93. package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
  94. package/dist/src/composables/useMenuAccess.d.ts +0 -56
  95. package/dist/src/composables/useSsoProviders.d.ts +0 -19
  96. package/dist/src/composables/useStaffInviteProviders.d.ts +0 -8
  97. package/dist/src/helpers/member-grant.d.ts +0 -36
  98. package/dist/src/helpers/my-pos-profile.d.ts +0 -37
  99. package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
  100. package/dist/src/helpers/staff-invite.d.ts +0 -54
  101. package/dist/src/router/menu-access-guard.d.ts +0 -17
  102. package/dist/src/types/my-pos-profile.d.ts +0 -24
  103. package/dist/src/types/sso-provider.d.ts +0 -10
  104. package/dist/src/types/staff-invite.d.ts +0 -100
  105. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +0 -2
  106. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
  107. package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -196
  108. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
  109. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
  110. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +0 -11
  111. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
  112. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
  113. package/dist/string-DZQ1uNjn.js +0 -22
  114. package/dist/timesheet-CFD6XPiG.js +0 -76
@@ -1,437 +0,0 @@
1
- import { ref as m, computed as v, defineComponent as fe, onMounted as pe, watch as X, resolveComponent as d, createElementBlock as P, openBlock as L, Fragment as Z, createVNode as s, createElementVNode as i, unref as n, withCtx as w, createCommentVNode as ve, toDisplayString as T, createTextVNode as he, isRef as ge, renderList as De, createBlock as ee, nextTick as we } from "vue";
2
- import { d as l } from "./dayjs.min-BAz84JAQ.js";
3
- import { useI18n as Ye } from "@feedmepos/mf-common";
4
- import { useSnackbar as be, components as ye } from "@feedmepos/ui-library";
5
- import { S as _e } from "./SelectFilter-Dpsq165k.js";
6
- import { _ as Me } from "./app-DXkKrcRn.js";
7
- import { _ as xe } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
8
- import { u as ke } from "./useLoading-BZXydjer.js";
9
- import { g as Se, s as Ve } from "./iteration-CcXrOMQe.js";
10
- import { f as Ce } from "./utils-BZkjJbju.js";
11
- import { n as Fe } from "./string-DZQ1uNjn.js";
12
- import { u as Le } from "./restaurant-COSpCpTQ.js";
13
- import { u as Te } from "./timesheet-CFD6XPiG.js";
14
- function Oe(Y, a) {
15
- return ["years", "months"].find((y) => {
16
- const _ = Y.startOf(y), p = Y.endOf(y);
17
- return Y.isSame(_, "day") && a.isSame(p, "day");
18
- }) || "days";
19
- }
20
- function Re() {
21
- const Y = {
22
- startDate: l().format("YYYY-MM-DD"),
23
- endDate: l().format("YYYY-MM-DD")
24
- }, a = m(Y), b = v(() => {
25
- if (!a.value) return "No dates selected.";
26
- const p = a.value.startDate ?? "Start", g = a.value.endDate ?? "End";
27
- return `${p} - ${g}`;
28
- }), y = v(() => ({
29
- startDate: new Date(a.value.startDate),
30
- endDate: new Date(a.value.endDate)
31
- }));
32
- function _(p) {
33
- const g = l(a.value.startDate), c = l(a.value.endDate), h = Oe(g, c), M = h === "days" ? c.diff(g, "days") + 1 : 1, O = p === "subtract" ? (D) => D.subtract(M, h) : (D) => D.add(M, h);
34
- a.value = {
35
- startDate: O(g).startOf(h).format("YYYY-MM-DD"),
36
- endDate: O(c).endOf(h).format("YYYY-MM-DD")
37
- };
38
- }
39
- return { dateRange: a, parsedDateRange: y, dateRangeLabel: b, setRange: _ };
40
- }
41
- const Ie = {
42
- class: "my-16 flex w-[350px] flex-col gap-40"
43
- }, $e = {
44
- class: "flex gap-16"
45
- }, Ae = {
46
- class: "flex flex-col gap-4"
47
- }, Ee = {
48
- class: "fm-typo-body-md-400 text-fm-color-typo-secondary"
49
- }, Ke = {
50
- class: "fm-typo-body-md-700 text-fm-color-typo-primary"
51
- }, Ne = {
52
- class: "flex flex-col gap-8"
53
- }, Ue = {
54
- class: "fm-typo-body-xl-700"
55
- }, ze = {
56
- class: "flex flex-col gap-24"
57
- }, Be = {
58
- class: "flex flex-col gap-8"
59
- }, Pe = {
60
- class: "fm-typo-body-xl-700"
61
- }, je = {
62
- class: "flex flex-col gap-24"
63
- }, He = {
64
- key: 0,
65
- class: "fm-typo-body-sm-400 text-fm-color-typo-error mt-1 flex items-center gap-4"
66
- }, Ge = {
67
- class: "flex items-center justify-start gap-8"
68
- }, qe = {
69
- class: "space-y-8"
70
- }, Je = {
71
- class: "flex items-start gap-8 flex-wrap xs:px-16"
72
- }, Qe = {
73
- class: "flex items-center gap-8"
74
- }, We = {
75
- class: "flex h-full flex-col overflow-auto"
76
- }, ct = /* @__PURE__ */ fe({
77
- __name: "TimesheetList",
78
- setup(Y) {
79
- const {
80
- t: a
81
- } = Ye(), b = be(), y = ke(b), _ = [{
82
- label: a("hr.timesheet.listView"),
83
- value: "listView"
84
- }, {
85
- label: a("hr.timesheet.userView"),
86
- value: "userView"
87
- }], p = m("listView"), g = v(() => {
88
- var t;
89
- return (t = _.find((e) => e.value === p.value)) == null ? void 0 : t.label;
90
- }), c = m(""), h = Te(), M = Le(), O = v(() => new Map(M.restaurants.value.map((t) => [t._id, t.profile.code]))), D = v(() => h.timesheets.value.map((r) => {
91
- const u = O.value.get(r.restaurantId);
92
- return {
93
- ...r,
94
- restaurantCode: u
95
- };
96
- })), R = v(() => D.value.filter((t) => {
97
- var e, r;
98
- return t.user.name.toLowerCase().includes(c.value.toLowerCase()) || t.restaurantName.toLowerCase().includes(c.value.toLowerCase()) || ((e = t.restaurantCode) == null ? void 0 : e.toLowerCase().includes(c.value.toLowerCase())) || ((r = t.user.code) == null ? void 0 : r.toLowerCase().includes(c.value.toLowerCase()));
99
- })), j = v(() => {
100
- const t = Se(D.value, (r) => r.user.name), e = Object.entries(t).map(([r, u]) => ({
101
- key: r,
102
- user: u[0].user.name,
103
- code: u[0].user.code || "",
104
- timesheets: u,
105
- total: Ce(u.reduce((A, B) => A + B.totalMin, 0))
106
- }));
107
- return Ve(e, {
108
- selector: "user"
109
- });
110
- }), H = v(() => j.value.filter((t) => {
111
- var e;
112
- return t.user.toLowerCase().includes(c.value.toLowerCase()) || ((e = t.code) == null ? void 0 : e.toLowerCase().includes(c.value.toLowerCase()));
113
- })), K = m(!1), N = v(() => K.value && D.value.length === 0), U = async () => {
114
- const {
115
- startDate: t,
116
- endDate: e
117
- } = x.value;
118
- K.value = !0;
119
- try {
120
- await h.readTimesheet(new Date(t), new Date(e), I.value), await we(), z.value = Object.fromEntries(Object.entries(new Array(j.value.length).fill(!0)));
121
- } catch (r) {
122
- b.open({
123
- title: r instanceof Error ? r.message : `${r}`,
124
- type: "error"
125
- });
126
- } finally {
127
- K.value = !1;
128
- }
129
- };
130
- pe(async () => {
131
- try {
132
- await M.readRestaurants();
133
- } catch (t) {
134
- console.error("Failed to load timesheet dependencies:", t), b.open({
135
- message: t instanceof Error ? t.message : String(t),
136
- type: "error"
137
- });
138
- }
139
- U();
140
- });
141
- const I = m(), te = v(() => M.restaurants.value.filter((t) => t.managable).map((t) => ({
142
- label: `${t.profile.code ? `${t.profile.code} - ` : ""}${t.profile.name}`,
143
- value: t._id
144
- }))), {
145
- dateRange: x,
146
- dateRangeLabel: ae,
147
- setRange: G
148
- } = Re(), oe = [{
149
- label: "Today",
150
- value: {
151
- startDate: l().format("YYYY-MM-DD"),
152
- endDate: l().format("YYYY-MM-DD")
153
- }
154
- }, {
155
- label: "Yesterday",
156
- value: {
157
- startDate: l().subtract(1, "day").format("YYYY-MM-DD"),
158
- endDate: l().subtract(1, "day").format("YYYY-MM-DD")
159
- }
160
- }, {
161
- label: "This week",
162
- value: {
163
- startDate: l().startOf("week").format("YYYY-MM-DD"),
164
- endDate: l().endOf("week").format("YYYY-MM-DD")
165
- }
166
- }, {
167
- label: "Last week",
168
- value: {
169
- startDate: l().subtract(1, "week").startOf("week").format("YYYY-MM-DD"),
170
- endDate: l().subtract(1, "week").endOf("week").format("YYYY-MM-DD")
171
- }
172
- }, {
173
- label: "Last 7 days",
174
- value: {
175
- startDate: l().subtract(7, "day").format("YYYY-MM-DD"),
176
- endDate: l().subtract(1, "day").format("YYYY-MM-DD")
177
- }
178
- }, {
179
- label: "This month",
180
- value: {
181
- startDate: l().startOf("month").format("YYYY-MM-DD"),
182
- endDate: l().endOf("month").format("YYYY-MM-DD")
183
- }
184
- }, {
185
- label: "Last month",
186
- value: {
187
- startDate: l().subtract(1, "month").startOf("month").format("YYYY-MM-DD"),
188
- endDate: l().subtract(1, "month").endOf("month").format("YYYY-MM-DD")
189
- }
190
- }];
191
- X([x, I], async () => {
192
- U();
193
- });
194
- const se = [{
195
- accessorKey: "user.code",
196
- size: 100,
197
- header: () => a("hr.employee.columns.code"),
198
- cell: (t) => t.row.original.user.code || "--",
199
- enableSorting: !0
200
- }, {
201
- accessorKey: "user",
202
- header: () => a("hr.timesheet.columns.name"),
203
- cell: (t) => t.row.original.user.name,
204
- enableSorting: !1
205
- }, {
206
- accessorKey: "restaurantName",
207
- header: () => a("hr.timesheet.columns.restaurant"),
208
- cell: (t) => {
209
- const e = t.row.original.restaurantCode, r = t.row.original.restaurantName;
210
- return `${e ? e + " - " : ""}${r}`;
211
- },
212
- enableSorting: !0
213
- }, {
214
- accessorKey: "start",
215
- header: () => a("hr.timesheet.columns.start"),
216
- cell: (t) => t.row.original.start || "--",
217
- enableSorting: !0
218
- }, {
219
- accessorKey: "end",
220
- header: () => a("hr.timesheet.columns.end"),
221
- cell: (t) => t.row.original.end || "--",
222
- enableSorting: !0
223
- }, {
224
- name: "duration",
225
- accessorKey: "duration",
226
- header: () => a("hr.timesheet.columns.duration"),
227
- cell: (t) => t.row.original.duration || "--",
228
- enableSorting: !0
229
- }], z = m({}), le = [{
230
- accessorKey: "code",
231
- size: 100,
232
- header: () => a("hr.employee.columns.code"),
233
- cell: (t) => t.row.original.code,
234
- enableSorting: !1
235
- }, {
236
- accessorKey: "user",
237
- header: () => a("hr.timesheet.columns.name"),
238
- cell: (t) => {
239
- const e = t.row.original;
240
- if (typeof e.user == "string") {
241
- const r = t.row.getIsExpanded();
242
- return s("div", {
243
- class: "flex items-center gap-8"
244
- }, [s("div", {
245
- onClick: (u) => {
246
- u.stopPropagation(), t.row.getToggleExpandedHandler()(u);
247
- }
248
- }, [s(ye.FmButton, {
249
- variant: "tertiary",
250
- icon: r ? "keyboard_arrow_up" : "keyboard_arrow_down"
251
- }, null)]), e.user]);
252
- }
253
- },
254
- enableSorting: !1
255
- }, {
256
- accessorKey: "start",
257
- header: () => a("hr.timesheet.columns.start"),
258
- cell: (t) => {
259
- const e = t.row.original;
260
- return (e == null ? void 0 : e.start) || "--";
261
- },
262
- enableSorting: !1
263
- }, {
264
- accessorKey: "end",
265
- header: () => a("hr.timesheet.columns.end"),
266
- cell: (t) => {
267
- const e = t.row.original;
268
- return (e == null ? void 0 : e.end) || "--";
269
- },
270
- enableSorting: !1
271
- }, {
272
- name: "duration",
273
- accessorKey: "duration",
274
- header: () => a("hr.timesheet.columns.hourMinute"),
275
- cell: (t) => {
276
- const e = t.row.original;
277
- return e.total ? `Total: ${e.total}` : e.duration;
278
- },
279
- enableSorting: !1
280
- }], k = m(!1);
281
- function q(t) {
282
- f.value = t, S.value = l(f.value.startedAt).format("YYYY-MM-DD"), C.value = l(f.value.endedAt || f.value.startedAt).format("YYYY-MM-DD"), V.value = l(f.value.startedAt).format("HH:mm"), F.value = l(f.value.endedAt || f.value.startedAt).format("HH:mm"), k.value = !0;
283
- }
284
- const S = m(), V = m(), C = m(), F = m(), f = m(), $ = m("");
285
- async function re() {
286
- const t = J(S.value, V.value), e = J(C.value, F.value);
287
- if (l(t).isAfter(e)) {
288
- $.value = a("hr.timesheet.checkOutMustBeforeCheckIn");
289
- return;
290
- }
291
- y.minor(async () => {
292
- await h.updateTimesheet(f.value, t, e);
293
- }, {
294
- successMessage: a("hr.timesheet.update.successMessage")
295
- }), U(), k.value = !1;
296
- }
297
- const J = (t, e) => l(t).set("h", parseInt(e.split(":")[0])).set("m", parseInt(e.split(":")[1])).toISOString();
298
- return X([S, C, V, F], ([t, e, r, u]) => {
299
- (t || e || r || u) && ($.value = "");
300
- }), (t, e) => {
301
- const r = d("FmAvatar"), u = d("FmDatePicker"), A = d("FmTimePicker"), B = d("FmIcon"), E = d("FmButton"), ne = d("FmSideSheet"), Q = d("FmChip"), ie = d("FmDateRangePicker"), ue = d("FmMenuItem"), de = d("FmMenu"), me = d("FmSpacer"), ce = d("FmSearch"), W = d("FmTable");
302
- return L(), P(Z, null, [s(ne, {
303
- modelValue: k.value,
304
- "onUpdate:modelValue": e[5] || (e[5] = (o) => k.value = o),
305
- "dismiss-away": "",
306
- header: n(a)("hr.timesheet.update.title")
307
- }, {
308
- "side-sheet-footer": w(() => [i("div", Ge, [s(E, {
309
- label: n(a)("common.update"),
310
- size: "md",
311
- variant: "primary",
312
- onClick: re
313
- }, null, 8, ["label"]), s(E, {
314
- label: n(a)("common.cancel"),
315
- size: "md",
316
- variant: "secondary",
317
- onClick: e[4] || (e[4] = (o) => k.value = !1)
318
- }, null, 8, ["label"])])]),
319
- default: w(() => [i("div", Ie, [i("div", $e, [s(r, {
320
- name: f.value.user.name,
321
- initials: n(Fe)(f.value.user.name),
322
- size: "lg"
323
- }, null, 8, ["name", "initials"]), i("div", Ae, [i("div", Ee, T(n(a)("hr.timesheet.employeeName")), 1), i("div", Ke, T(f.value.user.name), 1)])]), i("div", Ne, [i("div", Ue, T(n(a)("hr.timesheet.update.checkIn")), 1), i("div", ze, [s(u, {
324
- modelValue: S.value,
325
- "onUpdate:modelValue": e[0] || (e[0] = (o) => S.value = o),
326
- disabled: !1,
327
- label: n(a)("hr.timesheet.update.date")
328
- }, null, 8, ["modelValue", "label"]), s(A, {
329
- modelValue: V.value,
330
- "onUpdate:modelValue": e[1] || (e[1] = (o) => V.value = o),
331
- label: n(a)("hr.timesheet.update.time")
332
- }, null, 8, ["modelValue", "label"])])]), i("div", Be, [i("div", Pe, T(n(a)("hr.timesheet.update.checkOut")), 1), i("div", je, [s(u, {
333
- modelValue: C.value,
334
- "onUpdate:modelValue": e[2] || (e[2] = (o) => C.value = o),
335
- disabled: !1,
336
- label: n(a)("hr.timesheet.update.date")
337
- }, null, 8, ["modelValue", "label"]), s(A, {
338
- modelValue: F.value,
339
- "onUpdate:modelValue": e[3] || (e[3] = (o) => F.value = o),
340
- label: n(a)("hr.timesheet.update.time")
341
- }, null, 8, ["modelValue", "label"])])]), $.value ? (L(), P("div", He, [s(B, {
342
- color: "#FF3B30",
343
- name: "error",
344
- size: "sm"
345
- }), he(" " + T($.value), 1)])) : ve("", !0)])]),
346
- _: 1
347
- }, 8, ["modelValue", "header"]), i("div", qe, [i("div", Je, [s(_e, {
348
- modelValue: I.value,
349
- "onUpdate:modelValue": e[6] || (e[6] = (o) => I.value = o),
350
- multiple: "",
351
- items: te.value,
352
- variant: "dark",
353
- "selected-prefix": n(a)("hr.role.columns.restaurants"),
354
- placeholder: n(a)("hr.role.columns.restaurants"),
355
- class: "!w-auto pt-[3px]"
356
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i("div", Qe, [s(ie, {
357
- modelValue: n(x),
358
- "onUpdate:modelValue": e[7] || (e[7] = (o) => ge(x) ? x.value = o : null),
359
- "show-predefined-range": "",
360
- "predefined-range": oe
361
- }, {
362
- "trigger-button": w(() => [s(Q, {
363
- label: n(ae)
364
- }, null, 8, ["label"])]),
365
- _: 1
366
- }, 8, ["modelValue"]), s(E, {
367
- icon: "chevron_left",
368
- variant: "tertiary",
369
- onClick: e[8] || (e[8] = (o) => n(G)("subtract"))
370
- }), s(E, {
371
- icon: "chevron_right",
372
- variant: "tertiary",
373
- onClick: e[9] || (e[9] = (o) => n(G)("add"))
374
- })]), s(de, {
375
- class: "pt-[3px]"
376
- }, {
377
- "menu-button": w(() => [s(Q, {
378
- label: g.value,
379
- "right-icon": "keyboard_arrow_down"
380
- }, null, 8, ["label"])]),
381
- default: w(() => [(L(), P(Z, null, De(_, (o) => s(ue, {
382
- key: o.value,
383
- label: o.label,
384
- onClick: (Xe) => p.value = o.value
385
- }, null, 8, ["label", "onClick"])), 64))]),
386
- _: 1
387
- }), s(me), s(ce, {
388
- modelValue: c.value,
389
- "onUpdate:modelValue": e[10] || (e[10] = (o) => c.value = o),
390
- class: "w-[320px]",
391
- placeholder: n(a)("hr.timesheet.search.placeholder")
392
- }, null, 8, ["modelValue", "placeholder"])]), s(Me, {
393
- class: "w-full xs:px-16"
394
- }, {
395
- default: w(() => [i("div", We, [s(xe, {
396
- "is-loading": N.value,
397
- "is-empty": p.value === "listView" ? R.value.length === 0 : H.value.length === 0,
398
- "collapse-at": !1,
399
- title: n(a)("hr.timesheet.noData.title"),
400
- subtitle: ""
401
- }, {
402
- default: w(() => [p.value === "listView" ? (L(), ee(W, {
403
- key: 0,
404
- class: "min-w-[640px]",
405
- "column-defs": se,
406
- "row-data": R.value,
407
- "page-size": R.value.length,
408
- loading: N.value,
409
- virtual: R.value.length > 0,
410
- "pin-header-row": "",
411
- "hide-footer": "",
412
- "shrink-at": !1,
413
- onRowClick: e[11] || (e[11] = (o) => q(o.original))
414
- }, null, 8, ["row-data", "page-size", "loading", "virtual"])) : (L(), ee(W, {
415
- key: 1,
416
- class: "min-w-[640px]",
417
- "column-defs": le,
418
- "row-data": H.value,
419
- "page-size": 100,
420
- loading: N.value,
421
- "pin-header-row": "",
422
- "shrink-at": !1,
423
- "expanded-state": z.value,
424
- "get-sub-row": (o) => o.timesheets,
425
- "onUpdate:expandedState": e[12] || (e[12] = (o) => z.value = o),
426
- onRowClick: e[13] || (e[13] = (o) => q(o.original))
427
- }, null, 8, ["row-data", "loading", "expanded-state", "get-sub-row"]))]),
428
- _: 1
429
- }, 8, ["is-loading", "is-empty", "title"])])]),
430
- _: 1
431
- })])], 64);
432
- };
433
- }
434
- });
435
- export {
436
- ct as default
437
- };
@@ -1,172 +0,0 @@
1
- import { d as S } from "./dayjs.min-BAz84JAQ.js";
2
- import { defineStore as _, storeToRefs as $ } from "pinia";
3
- import { ref as u } from "vue";
4
- import "./index-TrBkLxJe.js";
5
- import { b as n, g as m } from "./app-DXkKrcRn.js";
6
- import { s as h } from "./iteration-CcXrOMQe.js";
7
- import { i as T } from "./utils-BZkjJbju.js";
8
- import { u as x } from "./role-ZmCd2yG4.js";
9
- import { u as f } from "./restaurant-COSpCpTQ.js";
10
- const r = {
11
- async readEmployeesPage(e) {
12
- var s, l;
13
- return m(
14
- await n().get("/pos-users/paged", {
15
- params: {
16
- limit: e.limit,
17
- offset: e.offset,
18
- search: e.search,
19
- restaurantIds: (s = e.restaurantIds) != null && s.length ? e.restaurantIds : void 0,
20
- roleIds: (l = e.roleIds) != null && l.length ? e.roleIds : void 0,
21
- includeEmptyPasscode: e.includeEmptyPasscode || void 0
22
- }
23
- })
24
- );
25
- },
26
- async createEmployee(e) {
27
- return m(
28
- await n().post("/pos-users", e)
29
- ).employeeId;
30
- },
31
- async createMasterEmployee(e) {
32
- return m(
33
- await n().post("/pos-users/master-user", e)
34
- ).employeeId;
35
- },
36
- async migrateToMasterEmployee(e, s) {
37
- await n().put(`/pos-users/migrate/${e}`, s);
38
- },
39
- async updateEmployee(e, s) {
40
- await n().put(`/pos-users/${e}`, s);
41
- },
42
- async updateMasterEmployee(e, s) {
43
- await n().put(`/pos-users/master-user/${e}`, s);
44
- },
45
- async deleteEmployee(e) {
46
- await n().put(`/pos-users/${e._id}`, {
47
- user: e,
48
- roles: [],
49
- previousRoles: e.restaurants.map((s) => ({
50
- restaurantId: s.restaurantId,
51
- roleId: s.roleId
52
- }))
53
- });
54
- },
55
- async deleteMasterEmployee(e) {
56
- await n().put(`/pos-users/master-user/${e._id}`, {
57
- user: e,
58
- roles: [],
59
- previousRoles: e.restaurants.map((s) => ({
60
- restaurantId: s.restaurantId,
61
- roleId: s.roleId
62
- }))
63
- });
64
- },
65
- async generateEmployeePasscode(e) {
66
- return `${m(
67
- await n().post("/pos-users/generate-passcode", {
68
- restaurantIds: e.restaurantIds,
69
- excludePosUserId: e.excludePosUserId
70
- })
71
- )}`;
72
- },
73
- async syncUsersMeta() {
74
- await n().post("/pos-users/create-users-meta");
75
- }
76
- };
77
- function E(e) {
78
- const { restaurants: s } = f(), l = x().roles.value, c = new Map(
79
- s.value.map((a) => [a._id, a])
80
- ), d = new Map(l.map((a) => [a._id, a.name])), p = e.restaurantRole[0];
81
- return {
82
- _id: e._id,
83
- name: e.name,
84
- code: e.code,
85
- passcode: e.passcode,
86
- isMasterUser: e.isMasterUser,
87
- isRestricted: e.isRestricted,
88
- restaurantId: (p == null ? void 0 : p.restaurantId) || "",
89
- role: (p == null ? void 0 : p.roleId) || "",
90
- since: S(T(e._id)).format("DD/MM/YYYY"),
91
- restaurants: h(
92
- e.restaurantRole.map((a) => {
93
- const i = c.get(a.restaurantId);
94
- return {
95
- restaurantId: a.restaurantId,
96
- restaurantName: (i == null ? void 0 : i.profile.name) || "",
97
- restaurantCode: (i == null ? void 0 : i.profile.code) ?? void 0,
98
- roleId: a.roleId,
99
- roleName: d.get(a.roleId) || ""
100
- };
101
- }),
102
- { selector: "restaurantName" }
103
- )
104
- };
105
- }
106
- const D = _("hrm-employee", () => {
107
- const e = f(), s = u([]), l = u([]), c = u(0), d = u(!1);
108
- async function p(t) {
109
- try {
110
- d.value = !0, await e.readRestaurants();
111
- const o = await r.readEmployeesPage(t);
112
- l.value = o.items.map(E), c.value = o.total;
113
- } finally {
114
- d.value = !1;
115
- }
116
- }
117
- async function a(t, o) {
118
- await e.readRestaurants();
119
- const y = o ?? (await r.readEmployeesPage({ ...t, limit: 1, offset: 0 })).total;
120
- return y === 0 ? [] : (await r.readEmployeesPage({ ...t, limit: y, offset: 0 })).items.map(E);
121
- }
122
- async function i(t) {
123
- return r.createEmployee(t);
124
- }
125
- async function I(t, o) {
126
- await r.updateEmployee(t, o);
127
- }
128
- async function w(t) {
129
- await r.deleteEmployee(t);
130
- }
131
- async function M(t) {
132
- await r.deleteMasterEmployee(t);
133
- }
134
- async function g(t) {
135
- return r.createMasterEmployee(t);
136
- }
137
- async function v(t, o) {
138
- await r.updateMasterEmployee(t, o);
139
- }
140
- async function P(t, o) {
141
- await r.migrateToMasterEmployee(t, o);
142
- }
143
- async function U() {
144
- await r.syncUsersMeta();
145
- }
146
- return {
147
- employees: s,
148
- listEmployees: l,
149
- totalEmployees: c,
150
- isLoading: d,
151
- readEmployeesPage: p,
152
- readAllEmployeesPage: a,
153
- createEmployee: i,
154
- updateEmployee: I,
155
- deleteEmployee: w,
156
- createMasterEmployee: g,
157
- updateMasterEmployee: v,
158
- deleteMasterEmployee: M,
159
- migrateToMasterUser: P,
160
- syncUsersMeta: U
161
- };
162
- }), z = () => {
163
- const e = D();
164
- return {
165
- ...e,
166
- ...$(e)
167
- };
168
- };
169
- export {
170
- r as E,
171
- z as u
172
- };
@@ -1,30 +0,0 @@
1
- function d(e, r = []) {
2
- const c = JSON.parse(JSON.stringify(e));
3
- return r.length > 0 && r.forEach((s) => {
4
- c[s] !== void 0 && delete c[s];
5
- }), c;
6
- }
7
- function f(e, r) {
8
- return r === void 0 ? e : typeof r == "function" ? r(e) : `${e[r]}`;
9
- }
10
- function g(e, r) {
11
- return d(e).sort((s, u) => {
12
- let n = f(s, r == null ? void 0 : r.selector), t = f(u, r == null ? void 0 : r.selector);
13
- if (r != null && r.descending) {
14
- const [a, l] = [n, t];
15
- n = l, t = a;
16
- }
17
- return n.localeCompare(t, "en", { numeric: !0, sensitivity: "base" });
18
- });
19
- }
20
- function i(e, r) {
21
- return e.reduce((c, s) => {
22
- const u = f(s, r);
23
- return c[u] = [...c[u] || [], s], c;
24
- }, {});
25
- }
26
- export {
27
- d as c,
28
- i as g,
29
- g as s
30
- };
@@ -1,54 +0,0 @@
1
- import { m as n } from "./app-DXkKrcRn.js";
2
- import { U as u } from "./rule-Bty9eoI3.js";
3
- const m = [
4
- n.Subject.Business.restaurant,
5
- n.Subject.Business.role,
6
- n.Subject.Restaurant.restaurant,
7
- n.Subject.Business.inventory_stock
8
- ], c = (s) => m.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
- m as W,
50
- S as b,
51
- l as h,
52
- f as t,
53
- d as w
54
- };