@feedmepos/mf-hrm-portal 2.3.1 → 2.3.2-dev.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/{ApprovalCodeList-CcvVEriB.js → ApprovalCodeList-RKU5B8SO.js} +14 -15
  2. package/dist/{AuditLogList-C61-SnWG.js → AuditLogList-DuDCMjGR.js} +796 -720
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-pL2zRc67.js +459 -0
  4. package/dist/EmployeeList-nrYsS5uz.js +896 -0
  5. package/dist/FormSection.vue_vue_type_script_setup_true_lang-7S2w36aY.js +90 -0
  6. package/dist/{GrantUserList-1ErIV7b7.js → GrantUserList-BSjeC4MC.js} +15 -16
  7. package/dist/{Main-R0qyd8Ea.js → Main-CpuHaXU6.js} +5 -5
  8. package/dist/Main-DbdoVLCE.js +101 -0
  9. package/dist/{Main-CD8OS1rM.js → Main-DtmCBbTR.js} +1005 -999
  10. package/dist/MyPosProfile-CsTCfGNT.js +360 -0
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +126 -0
  12. package/dist/{PermissionSetList-ig3oxdhh.js → PermissionSetList-B1c-uGZO.js} +80 -80
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Toq6qrLx.js +4208 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-D6Z9z_Yt.js +1831 -0
  15. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-TWTVo_9Y.js +547 -0
  16. package/dist/RoleList-CwaGNsFy.js +265 -0
  17. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Dg7S6nFO.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-C2ekVXdR.js} +1 -1
  18. package/dist/{ScheduleGeneralPage-QYijA95u.js → ScheduleGeneralPage-BVtXmxtp.js} +2 -2
  19. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-Bnyqna_E.js → ScheduleModal.vue_vue_type_script_setup_true_lang-DdsQ8v-5.js} +187 -186
  20. package/dist/{SchedulePage-BrBZmuMj.js → SchedulePage-3qksmT2I.js} +193 -205
  21. package/dist/{SchedulePositionPage-NCvNg8v5.js → SchedulePositionPage-DAU20KPZ.js} +3 -3
  22. package/dist/{SelectFilter-r-QOCO99.js → SelectFilter-BpzBwBmQ.js} +2 -3
  23. package/dist/TeamMemberList-Bdpm40i3.js +2087 -0
  24. package/dist/TimesheetList-CL_eJp2h.js +437 -0
  25. package/dist/{app-DKHtjxyC.js → app-DEZT4wdV.js} +7789 -3967
  26. package/dist/app.js +3 -3
  27. package/dist/{approval-code-BIpLingm.js → approval-code-BZTz5OXK.js} +4 -4
  28. package/dist/{dayjs.min-CNNMpacl.js → dayjs.min-B55I-uhI.js} +21 -21
  29. package/dist/employee-C6z5i6O4.js +172 -0
  30. package/dist/{grant-user-uZmvD_bw.js → grant-user-B2rYztyf.js} +2 -2
  31. package/dist/{iteration-DkcNkScw.js → index-Bfdseotz.js} +698 -726
  32. package/dist/iteration-CcXrOMQe.js +30 -0
  33. package/dist/{lodash-g-62RoFP.js → lodash-B8bqa6a9.js} +1 -1
  34. package/dist/member-grant-BIpKkuu8.js +54 -0
  35. package/dist/restaurant-ejyX2jEG.js +52 -0
  36. package/dist/role-C_t3DDlG.js +98 -0
  37. package/dist/rule-Ccopk8R_.js +843 -0
  38. package/dist/src/api/audit-log/index.d.ts +2 -0
  39. package/dist/src/api/employee/index.d.ts +1 -2
  40. package/dist/src/api/my-pos-profile/index.d.ts +3 -0
  41. package/dist/src/api/sso-provider/index.d.ts +5 -0
  42. package/dist/src/api/staff-invite/index.d.ts +16 -0
  43. package/dist/src/api/timesheet/index.d.ts +1 -1
  44. package/dist/src/components/CollapsibleWrapper.vue.d.ts +11 -3
  45. package/dist/src/components/form/SegmentedTabs.vue.d.ts +23 -0
  46. package/dist/src/composables/useMenuAccess.d.ts +56 -0
  47. package/dist/src/composables/useSsoProviders.d.ts +19 -0
  48. package/dist/src/composables/useStaffInviteProviders.d.ts +8 -0
  49. package/dist/src/helpers/member-grant.d.ts +36 -0
  50. package/dist/src/helpers/my-pos-profile.d.ts +37 -0
  51. package/dist/src/helpers/permission-set.d.ts +1 -102
  52. package/dist/src/helpers/pos-assignment-rows.d.ts +28 -0
  53. package/dist/src/helpers/rule.d.ts +2 -2
  54. package/dist/src/helpers/staff-invite.d.ts +54 -0
  55. package/dist/src/helpers/string.d.ts +10 -1
  56. package/dist/src/router/menu-access-guard.d.ts +17 -0
  57. package/dist/src/router/shared.d.ts +3 -1
  58. package/dist/src/stores/approval-code.d.ts +1 -1
  59. package/dist/src/stores/employee.d.ts +3 -9
  60. package/dist/src/stores/grant-user.d.ts +1 -1
  61. package/dist/src/stores/permission-assignment.d.ts +2 -2
  62. package/dist/src/stores/permission-set.d.ts +2 -2
  63. package/dist/src/stores/restaurant.d.ts +70 -10
  64. package/dist/src/stores/role.d.ts +2 -2
  65. package/dist/src/stores/team.d.ts +31 -1
  66. package/dist/src/stores/timesheet.d.ts +68 -53
  67. package/dist/src/types/my-pos-profile.d.ts +24 -0
  68. package/dist/src/types/sso-provider.d.ts +10 -0
  69. package/dist/src/types/staff-invite.d.ts +100 -0
  70. package/dist/src/types/team.d.ts +17 -1
  71. package/dist/src/types/timesheet.d.ts +3 -0
  72. package/dist/src/views/audit-log/locales/index.d.ts +40 -0
  73. package/dist/src/views/audit-log/useTraceIdDeepLink.d.ts +19 -0
  74. package/dist/src/views/hr/locales/index.d.ts +24 -4
  75. package/dist/src/views/hr/role/RoleForm.vue.d.ts +29 -2
  76. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +2 -0
  77. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +4 -0
  78. package/dist/src/views/my-pos-profile/locales/index.d.ts +236 -0
  79. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  80. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  81. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  82. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  83. package/dist/src/views/team/components/BasePermission.vue.d.ts +11 -0
  84. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +11 -0
  85. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +51 -0
  86. package/dist/src/views/team/{member/MemberInfo.vue.d.ts → components/MemberStatusBadge.vue.d.ts} +2 -2
  87. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +21 -0
  88. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +44 -0
  89. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +11 -0
  90. package/dist/src/views/team/locales/index.d.ts +716 -0
  91. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +48 -3
  92. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +11 -0
  93. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +35 -0
  94. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +19 -0
  95. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +1 -0
  96. package/dist/string-DZQ1uNjn.js +22 -0
  97. package/dist/style.css +1 -1
  98. package/dist/timesheet-CZHcebqS.js +76 -0
  99. package/dist/tsconfig.app.tsbuildinfo +1 -1
  100. package/dist/{useAppStore-Bp0PwbAN.js → useAppStore-DfqsbhT2.js} +1 -1
  101. package/dist/{useLoading-sgL8DRUz.js → useLoading-CQnX5WjI.js} +1 -1
  102. package/dist/useMessage-_ywT_N9X.js +17 -0
  103. package/dist/{useReportPermissions-CcIHwTRI.js → useReportPermissions-kTjftFk7.js} +13 -13
  104. package/package.json +4 -4
  105. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BZ-ZDviW.js +0 -438
  106. package/dist/EmployeeList-Cucr2mxn.js +0 -776
  107. package/dist/FormItem.vue_vue_type_script_setup_true_lang-4XV2qPxn.js +0 -45
  108. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
  109. package/dist/Main-B-F_cdM_.js +0 -96
  110. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +0 -243
  111. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-ClG4YhnF.js +0 -4167
  112. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DaAx79pC.js +0 -35
  113. package/dist/RoleList-BqR_Vf8H.js +0 -740
  114. package/dist/TeamMemberList-B6ZnfKV0.js +0 -1154
  115. package/dist/TimesheetList-BvsUk6kd.js +0 -402
  116. package/dist/TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-D3--3EhR.js +0 -58
  117. package/dist/employee-H2J0xRqJ.js +0 -209
  118. package/dist/restaurant-CHpkjUPy.js +0 -1880
  119. package/dist/role-CkxDtfst.js +0 -92
  120. package/dist/rule-BWvSqhBk.js +0 -783
  121. package/dist/string-VNuQNweN.js +0 -15
@@ -1,402 +0,0 @@
1
- import { ref as d, computed as g, defineComponent as pe, onMounted as fe, watch as Z, resolveComponent as u, createElementBlock as P, openBlock as E, Fragment as ee, createVNode as l, createElementVNode as i, unref as n, withCtx as b, createCommentVNode as ve, toDisplayString as O, createTextVNode as he, isRef as ge, renderList as we, createBlock as te, nextTick as ye } from "vue";
2
- import { d as v } from "./dayjs.min-CNNMpacl.js";
3
- import { useI18n as _e } from "@feedmepos/mf-common";
4
- import { useSnackbar as be, components as xe } from "@feedmepos/ui-library";
5
- import { S as De } from "./SelectFilter-r-QOCO99.js";
6
- import { _ as Se, a as Ve } from "./app-DKHtjxyC.js";
7
- import { _ as ke } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
8
- import { u as Ce } from "./useLoading-sgL8DRUz.js";
9
- import { g as Fe, s as Ye } from "./iteration-DkcNkScw.js";
10
- import { f as Le } from "./utils-BZkjJbju.js";
11
- import { n as Me } from "./string-VNuQNweN.js";
12
- import { u as Te } from "./employee-H2J0xRqJ.js";
13
- import { u as Ie } from "./restaurant-CHpkjUPy.js";
14
- import { u as Re } from "./TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-D3--3EhR.js";
15
- function $e(x, a) {
16
- return ["years", "months"].find((S) => {
17
- const V = x.startOf(S), p = x.endOf(S);
18
- return x.isSame(V, "day") && a.isSame(p, "day");
19
- }) || "days";
20
- }
21
- function Ee() {
22
- const x = {
23
- startDate: v().format("YYYY-MM-DD"),
24
- endDate: v().format("YYYY-MM-DD")
25
- }, a = d(x), D = g(() => {
26
- if (!a.value) return "No dates selected.";
27
- const p = a.value.startDate ?? "Start", _ = a.value.endDate ?? "End";
28
- return `${p} - ${_}`;
29
- }), S = g(() => ({
30
- startDate: new Date(a.value.startDate),
31
- endDate: new Date(a.value.endDate)
32
- }));
33
- function V(p) {
34
- const _ = v(a.value.startDate), c = v(a.value.endDate), h = $e(_, c), k = h === "days" ? c.diff(_, "days") + 1 : 1, C = p === "subtract" ? (F) => F.subtract(k, h) : (F) => F.add(k, h);
35
- a.value = {
36
- startDate: C(_).startOf(h).format("YYYY-MM-DD"),
37
- endDate: C(c).endOf(h).format("YYYY-MM-DD")
38
- };
39
- }
40
- return { dateRange: a, parsedDateRange: S, dateRangeLabel: D, setRange: V };
41
- }
42
- const Oe = {
43
- class: "my-16 flex w-[350px] flex-col gap-40"
44
- }, Ae = {
45
- class: "flex gap-16"
46
- }, Ke = {
47
- class: "flex flex-col gap-4"
48
- }, ze = {
49
- class: "fm-typo-body-md-400 text-fm-color-typo-secondary"
50
- }, Ne = {
51
- class: "fm-typo-body-md-700 text-fm-color-typo-primary"
52
- }, Ue = {
53
- class: "flex flex-col gap-8"
54
- }, Be = {
55
- class: "fm-typo-body-xl-700"
56
- }, Pe = {
57
- class: "flex flex-col gap-24"
58
- }, je = {
59
- class: "flex flex-col gap-8"
60
- }, He = {
61
- class: "fm-typo-body-xl-700"
62
- }, Ge = {
63
- class: "flex flex-col gap-24"
64
- }, qe = {
65
- key: 0,
66
- class: "fm-typo-body-sm-400 text-fm-color-typo-error mt-1 flex items-center gap-4"
67
- }, Je = {
68
- class: "flex items-center justify-start gap-8"
69
- }, Qe = {
70
- class: "space-y-8"
71
- }, We = {
72
- class: "flex items-start gap-8 flex-wrap xs:px-16"
73
- }, Xe = {
74
- class: "flex items-center gap-8"
75
- }, Ze = {
76
- class: "flex h-full flex-col overflow-auto"
77
- }, et = /* @__PURE__ */ pe({
78
- __name: "TimesheetList",
79
- setup(x) {
80
- const {
81
- t: a
82
- } = _e(), D = be(), S = Ce(D), V = [{
83
- label: a("hr.timesheet.listView"),
84
- value: "listView"
85
- }, {
86
- label: a("hr.timesheet.userView"),
87
- value: "userView"
88
- }], p = d("listView"), _ = g(() => {
89
- var t;
90
- return (t = V.find((e) => e.value === p.value)) == null ? void 0 : t.label;
91
- }), c = d(""), h = Re(), k = Te(), C = Ie(), F = g(() => k.employees.value), j = g(() => h.timesheets.value.filter((s) => !A.value || A.value.includes(s.restaurantId)).map((s) => {
92
- var y;
93
- const r = (y = C.restaurants.value.find((f) => f._id === s.restaurantId)) == null ? void 0 : y.profile.code, w = F.value.find((f) => f._id === s.user.id);
94
- return {
95
- ...s,
96
- restaurantCode: r,
97
- user: {
98
- ...s.user,
99
- code: w ? w.code : ""
100
- }
101
- };
102
- })), z = g(() => j.value.filter((t) => {
103
- var e, s;
104
- 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())) || ((s = t.user.code) == null ? void 0 : s.toLowerCase().includes(c.value.toLowerCase()));
105
- })), H = g(() => {
106
- const t = Fe(j.value, (s) => s.user.name), e = Object.entries(t).map(([s, r]) => {
107
- const w = F.value.find((y) => y._id === r[0].user.id);
108
- return {
109
- key: s,
110
- user: r[0].user.name,
111
- code: w ? w.code : r[0].user.code || "",
112
- timesheets: r,
113
- total: Le(r.reduce((y, f) => y + f.totalMin, 0))
114
- };
115
- });
116
- return Ye(e, {
117
- selector: "user"
118
- });
119
- }), N = g(() => H.value.filter((t) => {
120
- var e;
121
- return t.user.toLowerCase().includes(c.value.toLowerCase()) || ((e = t.code) == null ? void 0 : e.toLowerCase().includes(c.value.toLowerCase()));
122
- })), Y = d(!1), U = async () => {
123
- const {
124
- startDate: t,
125
- endDate: e
126
- } = L.value;
127
- Y.value = !0;
128
- try {
129
- await h.readTimesheet(new Date(t), new Date(e)), await ye(), B.value = Object.fromEntries(Object.entries(new Array(H.value.length).fill(!0)));
130
- } catch (s) {
131
- D.open({
132
- title: s instanceof Error ? s.message : `${s}`,
133
- type: "error"
134
- });
135
- } finally {
136
- Y.value = !1;
137
- }
138
- };
139
- fe(async () => {
140
- try {
141
- await C.readRestaurants(), k.employees.value.length === 0 && await k.readEmployees();
142
- } catch (t) {
143
- console.error("Failed to load timesheet dependencies:", t), D.open({
144
- message: t instanceof Error ? t.message : String(t),
145
- type: "error"
146
- });
147
- }
148
- U();
149
- });
150
- const A = d(), ae = g(() => C.restaurants.value.filter((t) => t.managable).map((t) => ({
151
- label: `${t.profile.code ? `${t.profile.code} - ` : ""}${t.profile.name}`,
152
- value: t._id
153
- }))), {
154
- dateRange: L,
155
- dateRangeLabel: oe,
156
- setRange: G
157
- } = Ee();
158
- Z(L, async () => {
159
- U();
160
- });
161
- const se = [{
162
- accessorKey: "user.code",
163
- size: 100,
164
- header: () => a("hr.employee.columns.code"),
165
- cell: (t) => t.row.original.user.code || "--",
166
- enableSorting: !0
167
- }, {
168
- accessorKey: "user",
169
- header: () => a("hr.timesheet.columns.name"),
170
- cell: (t) => t.row.original.user.name,
171
- enableSorting: !1
172
- }, {
173
- accessorKey: "restaurantName",
174
- header: () => a("hr.timesheet.columns.restaurant"),
175
- cell: (t) => {
176
- const e = t.row.original.restaurantCode, s = t.row.original.restaurantName;
177
- return `${e ? e + " - " : ""}${s}`;
178
- },
179
- enableSorting: !0
180
- }, {
181
- accessorKey: "start",
182
- header: () => a("hr.timesheet.columns.start"),
183
- cell: (t) => t.row.original.start || "--",
184
- enableSorting: !0
185
- }, {
186
- accessorKey: "end",
187
- header: () => a("hr.timesheet.columns.end"),
188
- cell: (t) => t.row.original.end || "--",
189
- enableSorting: !0
190
- }, {
191
- name: "duration",
192
- accessorKey: "duration",
193
- header: () => a("hr.timesheet.columns.duration"),
194
- cell: (t) => t.row.original.duration || "--",
195
- enableSorting: !0
196
- }], B = d({}), le = [{
197
- accessorKey: "code",
198
- size: 100,
199
- header: () => a("hr.employee.columns.code"),
200
- cell: (t) => t.row.original.code,
201
- enableSorting: !1
202
- }, {
203
- accessorKey: "user",
204
- header: () => a("hr.timesheet.columns.name"),
205
- cell: (t) => {
206
- const e = t.row.original;
207
- if (typeof e.user == "string") {
208
- const s = t.row.getIsExpanded();
209
- return l("div", {
210
- class: "flex items-center gap-8"
211
- }, [l("div", {
212
- onClick: (r) => {
213
- r.stopPropagation(), t.row.getToggleExpandedHandler()(r);
214
- }
215
- }, [l(xe.FmButton, {
216
- variant: "tertiary",
217
- icon: s ? "keyboard_arrow_up" : "keyboard_arrow_down"
218
- }, null)]), e.user]);
219
- }
220
- },
221
- enableSorting: !1
222
- }, {
223
- accessorKey: "start",
224
- header: () => a("hr.timesheet.columns.start"),
225
- cell: (t) => {
226
- const e = t.row.original;
227
- return (e == null ? void 0 : e.start) || "--";
228
- },
229
- enableSorting: !1
230
- }, {
231
- accessorKey: "end",
232
- header: () => a("hr.timesheet.columns.end"),
233
- cell: (t) => {
234
- const e = t.row.original;
235
- return (e == null ? void 0 : e.end) || "--";
236
- },
237
- enableSorting: !1
238
- }, {
239
- name: "duration",
240
- accessorKey: "duration",
241
- header: () => a("hr.timesheet.columns.hourMinute"),
242
- cell: (t) => {
243
- const e = t.row.original;
244
- return e.total ? `Total: ${e.total}` : e.duration;
245
- },
246
- enableSorting: !1
247
- }], M = d(!1);
248
- function q(t) {
249
- m.value = t, T.value = v(m.value.startedAt).format("YYYY-MM-DD"), R.value = v(m.value.endedAt || m.value.startedAt).format("YYYY-MM-DD"), I.value = v(m.value.startedAt).format("HH:mm"), $.value = v(m.value.endedAt || m.value.startedAt).format("HH:mm"), M.value = !0;
250
- }
251
- const T = d(), I = d(), R = d(), $ = d(), m = d(), K = d("");
252
- async function ne() {
253
- const t = J(T.value, I.value), e = J(R.value, $.value);
254
- if (v(t).isAfter(e)) {
255
- K.value = a("hr.timesheet.checkOutMustBeforeCheckIn");
256
- return;
257
- }
258
- S.minor(async () => {
259
- await h.updateTimesheet(m.value, t, e);
260
- }, {
261
- successMessage: a("hr.timesheet.update.successMessage")
262
- }), U(), M.value = !1;
263
- }
264
- const J = (t, e) => v(t).set("h", parseInt(e.split(":")[0])).set("m", parseInt(e.split(":")[1])).toISOString();
265
- return Z([T, R, I, $], ([t, e, s, r]) => {
266
- (t || e || s || r) && (K.value = "");
267
- }), (t, e) => {
268
- const s = u("FmAvatar"), r = u("FmDatePicker"), w = u("FmTimePicker"), y = u("FmIcon"), f = u("FmButton"), re = u("FmSideSheet"), Q = u("FmChip"), ie = u("FmDateRangePicker"), ue = u("FmMenuItem"), de = u("FmMenu"), ce = u("FmSpacer"), me = u("FmSearch"), W = u("FmTable");
269
- return E(), P(ee, null, [l(re, {
270
- modelValue: M.value,
271
- "onUpdate:modelValue": e[5] || (e[5] = (o) => M.value = o),
272
- "dismiss-away": "",
273
- header: n(a)("hr.timesheet.update.title")
274
- }, {
275
- "side-sheet-footer": b(() => [i("div", Je, [l(f, {
276
- label: n(a)("common.update"),
277
- size: "md",
278
- variant: "primary",
279
- onClick: ne
280
- }, null, 8, ["label"]), l(f, {
281
- label: n(a)("common.cancel"),
282
- size: "md",
283
- variant: "secondary",
284
- onClick: e[4] || (e[4] = (o) => M.value = !1)
285
- }, null, 8, ["label"])])]),
286
- default: b(() => [i("div", Oe, [i("div", Ae, [l(s, {
287
- name: m.value.user.name,
288
- initials: n(Me)(m.value.user.name),
289
- size: "lg"
290
- }, null, 8, ["name", "initials"]), i("div", Ke, [i("div", ze, O(n(a)("hr.timesheet.employeeName")), 1), i("div", Ne, O(m.value.user.name), 1)])]), i("div", Ue, [i("div", Be, O(n(a)("hr.timesheet.update.checkIn")), 1), i("div", Pe, [l(r, {
291
- modelValue: T.value,
292
- "onUpdate:modelValue": e[0] || (e[0] = (o) => T.value = o),
293
- disabled: !1,
294
- label: n(a)("hr.timesheet.update.date")
295
- }, null, 8, ["modelValue", "label"]), l(w, {
296
- modelValue: I.value,
297
- "onUpdate:modelValue": e[1] || (e[1] = (o) => I.value = o),
298
- label: n(a)("hr.timesheet.update.time")
299
- }, null, 8, ["modelValue", "label"])])]), i("div", je, [i("div", He, O(n(a)("hr.timesheet.update.checkOut")), 1), i("div", Ge, [l(r, {
300
- modelValue: R.value,
301
- "onUpdate:modelValue": e[2] || (e[2] = (o) => R.value = o),
302
- disabled: !1,
303
- label: n(a)("hr.timesheet.update.date")
304
- }, null, 8, ["modelValue", "label"]), l(w, {
305
- modelValue: $.value,
306
- "onUpdate:modelValue": e[3] || (e[3] = (o) => $.value = o),
307
- label: n(a)("hr.timesheet.update.time")
308
- }, null, 8, ["modelValue", "label"])])]), K.value ? (E(), P("div", qe, [l(y, {
309
- color: "#FF3B30",
310
- name: "error",
311
- size: "sm"
312
- }), he(" " + O(K.value), 1)])) : ve("", !0)])]),
313
- _: 1
314
- }, 8, ["modelValue", "header"]), i("div", Qe, [i("div", We, [l(De, {
315
- modelValue: A.value,
316
- "onUpdate:modelValue": e[6] || (e[6] = (o) => A.value = o),
317
- multiple: "",
318
- items: ae.value,
319
- variant: "dark",
320
- "selected-prefix": n(a)("hr.role.columns.restaurants"),
321
- placeholder: n(a)("hr.role.columns.restaurants"),
322
- class: "!w-auto pt-[3px]"
323
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i("div", Xe, [l(ie, {
324
- modelValue: n(L),
325
- "onUpdate:modelValue": e[7] || (e[7] = (o) => ge(L) ? L.value = o : null),
326
- "show-predefined-range": ""
327
- }, {
328
- "trigger-button": b(() => [l(Q, {
329
- label: n(oe)
330
- }, null, 8, ["label"])]),
331
- _: 1
332
- }, 8, ["modelValue"]), l(f, {
333
- icon: "chevron_left",
334
- variant: "tertiary",
335
- onClick: e[8] || (e[8] = (o) => n(G)("subtract"))
336
- }), l(f, {
337
- icon: "chevron_right",
338
- variant: "tertiary",
339
- onClick: e[9] || (e[9] = (o) => n(G)("add"))
340
- })]), l(de, {
341
- class: "pt-[3px]"
342
- }, {
343
- "menu-button": b(() => [l(Q, {
344
- label: _.value,
345
- "right-icon": "keyboard_arrow_down"
346
- }, null, 8, ["label"])]),
347
- default: b(() => [(E(), P(ee, null, we(V, (o) => l(ue, {
348
- key: o.value,
349
- label: o.label,
350
- onClick: (X) => p.value = o.value
351
- }, null, 8, ["label", "onClick"])), 64))]),
352
- _: 1
353
- }), l(ce), l(me, {
354
- modelValue: c.value,
355
- "onUpdate:modelValue": e[10] || (e[10] = (o) => c.value = o),
356
- class: "w-[320px]",
357
- placeholder: n(a)("hr.timesheet.search.placeholder")
358
- }, null, 8, ["modelValue", "placeholder"])]), l(Se, {
359
- class: "w-full xs:px-16"
360
- }, {
361
- default: b(() => [i("div", Ze, [l(ke, {
362
- "is-loading": Y.value,
363
- "is-empty": p.value === "listView" ? z.value.length === 0 : N.value.length === 0,
364
- "collapse-at": !1,
365
- title: n(a)("hr.timesheet.noData.title"),
366
- subtitle: ""
367
- }, {
368
- default: b(() => [p.value === "listView" ? (E(), te(W, {
369
- key: 0,
370
- class: "min-w-[640px]",
371
- "column-defs": se,
372
- "row-data": z.value,
373
- "page-size": z.value.length,
374
- loading: Y.value,
375
- "pin-header-row": "",
376
- "hide-footer": "",
377
- "shrink-at": !1,
378
- onRowClick: e[11] || (e[11] = (o) => q(o.original))
379
- }, null, 8, ["row-data", "page-size", "loading"])) : (E(), te(W, {
380
- key: 1,
381
- class: "min-w-[640px] timesheet-user-view",
382
- "column-defs": le,
383
- "row-data": N.value,
384
- "page-size": N.value.reduce((o, X) => o + 1 + X.timesheets.length, 0),
385
- loading: Y.value,
386
- "pin-header-row": "",
387
- "shrink-at": !1,
388
- "expanded-state": B.value,
389
- "get-sub-row": (o) => o.timesheets,
390
- "onUpdate:expandedState": e[12] || (e[12] = (o) => B.value = o),
391
- onRowClick: e[13] || (e[13] = (o) => q(o.original))
392
- }, null, 8, ["row-data", "page-size", "loading", "expanded-state", "get-sub-row"]))]),
393
- _: 1
394
- }, 8, ["is-loading", "is-empty", "title"])])]),
395
- _: 1
396
- })])], 64);
397
- };
398
- }
399
- }), vt = /* @__PURE__ */ Ve(et, [["__scopeId", "data-v-63294af2"]]);
400
- export {
401
- vt as default
402
- };
@@ -1,58 +0,0 @@
1
- import { d as i } from "./dayjs.min-CNNMpacl.js";
2
- import { defineStore as p, storeToRefs as T } from "pinia";
3
- import { ref as l } from "vue";
4
- import { b as c, g as y } from "./restaurant-CHpkjUPy.js";
5
- import { s as S } from "./iteration-DkcNkScw.js";
6
- import { i as f, f as g } from "./utils-BZkjJbju.js";
7
- const u = {
8
- async readTimesheets(t, e) {
9
- return y(await c().get(`timesheet?start=${t}&end=${e}`));
10
- },
11
- async updateTimesheet(t, e) {
12
- await c().put(`timesheet/${t}`, e);
13
- }
14
- };
15
- function A(t) {
16
- const e = t.map((n) => {
17
- const { startedAt: s, endedAt: r } = n, a = i(f(s)), o = r ? i(f(r)) : null, m = (o == null ? void 0 : o.diff(a, "minute", !1)) || 0, h = o ? g(m) : "", d = "YYYY-MM-DD hh:mm a";
18
- return {
19
- ...n,
20
- start: a.format(d),
21
- end: o ? o.format(d) : "",
22
- totalMin: m,
23
- duration: h
24
- };
25
- });
26
- return S(e, { selector: "start" });
27
- }
28
- const D = p("timesheet", () => {
29
- const t = l([]);
30
- async function e(s, r) {
31
- const a = await u.readTimesheets(
32
- i(s).startOf("day").toISOString(),
33
- i(r).endOf("day").toISOString()
34
- );
35
- t.value = A(a);
36
- }
37
- async function n(s, r, a) {
38
- await u.updateTimesheet(s.restaurantId, {
39
- id: s._id,
40
- startAt: r,
41
- endAt: a
42
- });
43
- }
44
- return {
45
- timesheets: t,
46
- readTimesheet: e,
47
- updateTimesheet: n
48
- };
49
- }), b = () => {
50
- const t = D();
51
- return {
52
- ...t,
53
- ...T(t)
54
- };
55
- };
56
- export {
57
- b as u
58
- };
@@ -1,209 +0,0 @@
1
- import { d as g } from "./dayjs.min-CNNMpacl.js";
2
- import { defineStore as $, storeToRefs as x } from "pinia";
3
- import { ref as y } from "vue";
4
- import { s as E } from "./iteration-DkcNkScw.js";
5
- import { b as l, g as m, u as I } from "./restaurant-CHpkjUPy.js";
6
- import { i as v } from "./utils-BZkjJbju.js";
7
- import { u as P } from "./role-CkxDtfst.js";
8
- const o = {
9
- async readEmployees() {
10
- return m(await l().get("/pos-users"));
11
- },
12
- async readEmployeesPage(e) {
13
- var s, i;
14
- return m(
15
- await l().get("/pos-users/paged", {
16
- params: {
17
- limit: e.limit,
18
- offset: e.offset,
19
- search: e.search,
20
- restaurantIds: (s = e.restaurantIds) != null && s.length ? e.restaurantIds : void 0,
21
- roleIds: (i = e.roleIds) != null && i.length ? e.roleIds : void 0,
22
- includeEmptyPasscode: e.includeEmptyPasscode || void 0
23
- }
24
- })
25
- );
26
- },
27
- async createEmployee(e) {
28
- return m(
29
- await l().post("/pos-users", e)
30
- ).employeeId;
31
- },
32
- async createMasterEmployee(e) {
33
- return m(
34
- await l().post("/pos-users/master-user", e)
35
- ).employeeId;
36
- },
37
- async migrateToMasterEmployee(e, s) {
38
- await l().put(`/pos-users/migrate/${e}`, s);
39
- },
40
- async updateEmployee(e, s) {
41
- await l().put(`/pos-users/${e}`, s);
42
- },
43
- async updateMasterEmployee(e, s) {
44
- await l().put(`/pos-users/master-user/${e}`, s);
45
- },
46
- async deleteEmployee(e) {
47
- await l().put(`/pos-users/${e._id}`, {
48
- user: e,
49
- roles: [],
50
- previousRoles: e.restaurants.map((s) => ({
51
- restaurantId: s.restaurantId,
52
- roleId: s.roleId
53
- }))
54
- });
55
- },
56
- async deleteMasterEmployee(e) {
57
- await l().put(`/pos-users/master-user/${e._id}`, {
58
- user: e,
59
- roles: [],
60
- previousRoles: e.restaurants.map((s) => ({
61
- restaurantId: s.restaurantId,
62
- roleId: s.roleId
63
- }))
64
- });
65
- },
66
- async generateEmployeePasscode(e) {
67
- return `${m(
68
- await l().post("/pos-users/generate-passcode", {
69
- restaurantIds: e.restaurantIds,
70
- excludePosUserId: e.excludePosUserId
71
- })
72
- )}`;
73
- },
74
- async syncUsersMeta() {
75
- await l().post("/pos-users/create-users-meta");
76
- }
77
- };
78
- async function T(e) {
79
- const s = P().roles.value, { restaurants: i } = I(), c = new Map(
80
- i.value.map((a) => [a._id, a.profile.name])
81
- ), u = new Map(s.map((a) => [a._id, a.name])), r = /* @__PURE__ */ new Map();
82
- for (const a of e) {
83
- const n = {
84
- restaurantId: a.restaurantId,
85
- restaurantName: c.get(a.restaurantId) || "",
86
- roleId: a.role,
87
- roleName: u.get(a.role) || ""
88
- }, d = r.get(a._id);
89
- if (!d) {
90
- r.set(a._id, {
91
- ...a,
92
- isRestricted: !1,
93
- since: g(v(a._id)).format("DD/MM/YYYY"),
94
- restaurants: [n]
95
- });
96
- continue;
97
- }
98
- d.restaurants.some((f) => f.restaurantId === a.restaurantId) || (d.restaurants = E([...d.restaurants, n], {
99
- selector: "restaurantName"
100
- }));
101
- }
102
- return E([...r.values()], { selector: "name" });
103
- }
104
- function M(e) {
105
- const { restaurants: s } = I(), i = P().roles.value, c = new Map(
106
- s.value.map((a) => [a._id, a])
107
- ), u = new Map(i.map((a) => [a._id, a.name])), r = e.restaurantRole[0];
108
- return {
109
- _id: e._id,
110
- name: e.name,
111
- code: e.code,
112
- passcode: e.passcode,
113
- isMasterUser: e.isMasterUser,
114
- isRestricted: e.isRestricted,
115
- restaurantId: (r == null ? void 0 : r.restaurantId) || "",
116
- role: (r == null ? void 0 : r.roleId) || "",
117
- since: g(v(e._id)).format("DD/MM/YYYY"),
118
- restaurants: E(
119
- e.restaurantRole.map((a) => {
120
- const n = c.get(a.restaurantId);
121
- return {
122
- restaurantId: a.restaurantId,
123
- restaurantName: (n == null ? void 0 : n.profile.name) || "",
124
- restaurantCode: (n == null ? void 0 : n.profile.code) ?? void 0,
125
- roleId: a.roleId,
126
- roleName: u.get(a.roleId) || ""
127
- };
128
- }),
129
- { selector: "restaurantName" }
130
- )
131
- };
132
- }
133
- const h = $("employee", () => {
134
- const e = I(), s = y([]), i = y([]), c = y(0), u = y(!1);
135
- async function r() {
136
- try {
137
- u.value = !0, await e.readRestaurants();
138
- const t = await o.readEmployees();
139
- s.value = await T(t);
140
- } finally {
141
- u.value = !1;
142
- }
143
- }
144
- async function a(t) {
145
- try {
146
- u.value = !0, await e.readRestaurants();
147
- const p = await o.readEmployeesPage(t);
148
- i.value = p.items.map(M), c.value = p.total;
149
- } finally {
150
- u.value = !1;
151
- }
152
- }
153
- async function n(t, p) {
154
- await e.readRestaurants();
155
- const w = p ?? (await o.readEmployeesPage({ ...t, limit: 1, offset: 0 })).total;
156
- return w === 0 ? [] : (await o.readEmployeesPage({ ...t, limit: w, offset: 0 })).items.map(M);
157
- }
158
- async function d(t) {
159
- return o.createEmployee(t);
160
- }
161
- async function f(t, p) {
162
- await o.updateEmployee(t, p);
163
- }
164
- async function _(t) {
165
- await o.deleteEmployee(t);
166
- }
167
- async function U(t) {
168
- await o.deleteMasterEmployee(t);
169
- }
170
- async function Y(t) {
171
- return o.createMasterEmployee(t);
172
- }
173
- async function N(t, p) {
174
- await o.updateMasterEmployee(t, p);
175
- }
176
- async function S(t, p) {
177
- await o.migrateToMasterEmployee(t, p);
178
- }
179
- async function D() {
180
- await o.syncUsersMeta();
181
- }
182
- return {
183
- employees: s,
184
- listEmployees: i,
185
- totalEmployees: c,
186
- isLoading: u,
187
- readEmployees: r,
188
- readEmployeesPage: a,
189
- readAllEmployeesPage: n,
190
- createEmployee: d,
191
- updateEmployee: f,
192
- deleteEmployee: _,
193
- createMasterEmployee: Y,
194
- updateMasterEmployee: N,
195
- deleteMasterEmployee: U,
196
- migrateToMasterUser: S,
197
- syncUsersMeta: D
198
- };
199
- }), z = () => {
200
- const e = h();
201
- return {
202
- ...e,
203
- ...x(e)
204
- };
205
- };
206
- export {
207
- o as E,
208
- z as u
209
- };