@feedmepos/mf-hrm-portal 2.3.2-dev.18 → 2.3.2-dev.19

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 (52) hide show
  1. package/dist/{ApprovalCodeList-Cv4-P7fX.js → ApprovalCodeList-CiZcp75s.js} +7 -7
  2. package/dist/{AuditLogList-KH-H5uzM.js → AuditLogList-AVdhUk22.js} +5 -5
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BQq5xW8d.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CGsOJ4bA.js} +2 -2
  4. package/dist/{EmployeeList-BCjOwL1V.js → EmployeeList-DmB3wCwv.js} +8 -8
  5. package/dist/{FormSection.vue_vue_type_script_setup_true_lang-D4e5iSQq.js → FormSection.vue_vue_type_script_setup_true_lang-Qsc3hk6l.js} +1 -1
  6. package/dist/{GrantUserList-CfvdU440.js → GrantUserList-CUWnDKaH.js} +8 -8
  7. package/dist/{Main-CVF5eDBd.js → Main-CbJjQFFR.js} +10 -10
  8. package/dist/{Main-DKKGpzdb.js → Main-D7CAtkiV.js} +1328 -1339
  9. package/dist/{Main-YrCgPqZU.js → Main-DT4TJPRM.js} +5 -5
  10. package/dist/{MyPosProfile-z84_PtAn.js → MyPosProfile-EWK8IPlZ.js} +1 -1
  11. package/dist/{PermissionSetList-9xD_n1VF.js → PermissionSetList-D2HDsSFi.js} +6 -6
  12. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-IX3av4mS.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BUSup81G.js} +551 -551
  13. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-sPatt5hV.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-B1sb_3ow.js} +2 -2
  14. package/dist/{RoleForm.vue_vue_type_script_setup_true_lang-CSsgsqvl.js → RoleForm.vue_vue_type_script_setup_true_lang-D-Gve4l8.js} +9 -9
  15. package/dist/{RoleList-oSqkcGgN.js → RoleList-DRFTQcwP.js} +7 -7
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-qJhZA2DN.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-b96QQsiZ.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-BxXDcGD4.js → ScheduleGeneralPage-DO6ZO_7t.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-Dcr2USSq.js → ScheduleModal.vue_vue_type_script_setup_true_lang-BG0-qg1-.js} +4 -4
  19. package/dist/{SchedulePage-C_M2ABMR.js → SchedulePage-m9fYfgEO.js} +9 -9
  20. package/dist/{SchedulePositionPage-XaIHUH4A.js → SchedulePositionPage-B9M8bgu1.js} +3 -3
  21. package/dist/{SelectFilter-BzqdpDfg.js → SelectFilter-qanI8DEh.js} +1 -1
  22. package/dist/{TeamMemberList--WEaatay.js → TeamMemberList-D7PIM3xv.js} +12 -12
  23. package/dist/TimesheetList-C_XQe3jl.js +408 -0
  24. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-GIIAlhti.js → TimesheetList.vue_vue_type_style_index_0_scoped_ffd7f807_lang-D6qTouaS.js} +7 -7
  25. package/dist/{app-DSUfooPD.js → app-BuJGxfu4.js} +10 -10
  26. package/dist/app.js +1 -1
  27. package/dist/{approval-code-BZYlghBT.js → approval-code-HPeWQne5.js} +1 -1
  28. package/dist/{dayjs.min-5UvwoDGv.js → dayjs.min-CLUgksBW.js} +1 -1
  29. package/dist/employee-DrsTtOKq.js +237 -0
  30. package/dist/{grant-user-CgvKn27g.js → grant-user-J6TSUXHn.js} +1 -1
  31. package/dist/{iteration-BFI7vEBg.js → index-Dl7XhjSB.js} +573 -558
  32. package/dist/{lodash-DJ0F99PK.js → lodash-CMqarlaS.js} +1 -1
  33. package/dist/{member-grant-BmthjLCk.js → member-grant-BeNgG3hd.js} +2 -2
  34. package/dist/{restaurant-CeR-XM1L.js → restaurant-9Y8x8pCL.js} +1 -1
  35. package/dist/role-COuuwMES.js +91 -0
  36. package/dist/rule-50_hBJQJ.js +845 -0
  37. package/dist/src/helpers/employee-merge.d.ts +33 -0
  38. package/dist/src/helpers/iteration.d.ts +9 -2
  39. package/dist/src/helpers/restaurant-lookup.d.ts +19 -0
  40. package/dist/src/helpers/role-merge.d.ts +11 -0
  41. package/dist/src/views/hr/timesheet/timesheet-view.d.ts +29 -0
  42. package/dist/style.css +1 -1
  43. package/dist/tsconfig.app.tsbuildinfo +1 -1
  44. package/dist/{useAppStore-KvMQH09O.js → useAppStore-BCvZUxKY.js} +1 -1
  45. package/dist/{useLoading-4s1zzjal.js → useLoading-BOt2Is3p.js} +1 -1
  46. package/dist/{useReportPermissions-BVxVU0SS.js → useReportPermissions-BVTpovDL.js} +3 -3
  47. package/dist/{useSsoProviders-CKRDQYcP.js → useSsoProviders-Bec-WHC7.js} +1 -1
  48. package/package.json +1 -1
  49. package/dist/TimesheetList-D6FG69-S.js +0 -402
  50. package/dist/employee-CT3TDtIM.js +0 -210
  51. package/dist/role-C2QeFrHr.js +0 -91
  52. package/dist/rule-CYsTf24V.js +0 -839
@@ -0,0 +1,237 @@
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-Dl7XhjSB.js";
4
+ import { b as p, g as m } from "./app-BuJGxfu4.js";
5
+ import { d as D } from "./dayjs.min-CLUgksBW.js";
6
+ import { i as Y } from "./utils-BZkjJbju.js";
7
+ import { u as M } from "./role-COuuwMES.js";
8
+ import { u as b } from "./restaurant-9Y8x8pCL.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,6 +1,6 @@
1
1
  import { defineStore as f } from "pinia";
2
2
  import { ref as u } from "vue";
3
- import { g as s, e as v, b as o } from "./app-DSUfooPD.js";
3
+ import { g as s, e as v, b as o } from "./app-BuJGxfu4.js";
4
4
  const c = {
5
5
  async getGrantUsers() {
6
6
  return s(await o("grant").get(""));