@feedmepos/mf-hrm-portal 2.0.17 → 2.0.18-dev.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 (60) hide show
  1. package/dist/AuditLogList-D4E8pss5.js +1037 -0
  2. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
  3. package/dist/EmployeeList-BfJO89pN.js +827 -0
  4. package/dist/FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js +45 -0
  5. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  6. package/dist/{Main-CCTDT_TG.js → Main-BbOMNP31.js} +758 -761
  7. package/dist/Main-XmxzThcC.js +86 -0
  8. package/dist/{Main-C7Q3OELU.js → Main-dqgR1UXY.js} +181 -175
  9. package/dist/PermissionSetList-DO0PRS6Z.js +347 -0
  10. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DL4_xvBZ.js +3443 -0
  11. package/dist/RoleList-DB3NfUYF.js +545 -0
  12. package/dist/TeamMemberList-4hEx6L5r.js +1090 -0
  13. package/dist/{TimesheetList-DhKfguOb.js → TimesheetList-D29EFj1Q.js} +132 -126
  14. package/dist/{app--3WguZOC.js → app-SadE2J6-.js} +759 -711
  15. package/dist/app.js +1 -1
  16. package/dist/{dayjs.min-RrLy0N6G.js → dayjs.min-DKCxxK08.js} +1 -1
  17. package/dist/employee-3KJs872J.js +204 -0
  18. package/dist/{iteration-BQA73VxD.js → iteration-QZxp7XeE.js} +9258 -9213
  19. package/dist/{lodash-B1ouSWpG.js → lodash-DrksHyHu.js} +1 -1
  20. package/dist/{rule-BL-miuus.js → rule-CSsgDC6F.js} +263 -265
  21. package/dist/src/api/audit-log/index.d.ts +9 -0
  22. package/dist/src/api/restaurant/index.d.ts +5 -0
  23. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  24. package/dist/src/components/CollapsibleWrapper.vue.d.ts +2 -0
  25. package/dist/src/components/Skeleton.vue.d.ts +7 -0
  26. package/dist/src/composables/useBasePermission.d.ts +1 -0
  27. package/dist/src/composables/useRestaurantMap.d.ts +2 -329
  28. package/dist/src/stores/restaurant.d.ts +181 -0
  29. package/dist/src/stores/role.d.ts +7 -7
  30. package/dist/src/stores/team.d.ts +6 -6
  31. package/dist/src/types/restaurant.d.ts +11 -0
  32. package/dist/src/types/team.d.ts +1 -1
  33. package/dist/src/views/hr/locales/index.d.ts +16 -0
  34. package/dist/src/views/team/components/BasePermission.vue.d.ts +3 -7
  35. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +2 -2
  36. package/dist/src/views/team/locales/index.d.ts +32 -0
  37. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +5 -3
  38. package/dist/style.css +1 -1
  39. package/dist/{timesheet-BbtAYZ1B.js → timesheet-sBe_HCZh.js} +2 -2
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/useAppStore-BDADkWuX.js +171 -0
  42. package/dist/useDebounce-CWb5QR9G.js +28 -0
  43. package/dist/useDiscardConfirm-DPhEV6v0.js +157 -0
  44. package/dist/{useLoading-D7PklYeR.js → useLoading-PTqnaz_W.js} +1 -1
  45. package/dist/{useReportPermissions-CNcISy8f.js → useReportPermissions-C3Uzu7vB.js} +3 -3
  46. package/package.json +1 -1
  47. package/dist/AuditLogList-DwCmJovS.js +0 -980
  48. package/dist/EmployeeList-8166DlII.js +0 -736
  49. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +0 -71
  50. package/dist/HorizontalSplitter-o860F4xM.js +0 -12
  51. package/dist/Main-C4LaqZaa.js +0 -85
  52. package/dist/PermissionSetList-trnHwNFR.js +0 -341
  53. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bc5nE9NF.js +0 -3480
  54. package/dist/RoleList-DJtbEUSC.js +0 -530
  55. package/dist/TeamMemberList-C6qx-yJi.js +0 -1108
  56. package/dist/employee-DSAStcBv.js +0 -204
  57. package/dist/useAppStore-BHWapSDk.js +0 -171
  58. package/dist/useDebounce-B8ZPVS5C.js +0 -15
  59. package/dist/useDiscardConfirm-BHni0LNu.js +0 -28
  60. package/dist/useSearch-B6WK1LBB.js +0 -15
package/dist/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as e, h as r, r as o } from "./app--3WguZOC.js";
1
+ import { j as e, h as r, r as o } from "./app-SadE2J6-.js";
2
2
  export {
3
3
  e as FmApp,
4
4
  r as i18nMessages,
@@ -1,4 +1,4 @@
1
- import { g as Q, c as K } from "./app--3WguZOC.js";
1
+ import { g as Q, c as K } from "./app-SadE2J6-.js";
2
2
  var E = { exports: {} };
3
3
  (function(V, X) {
4
4
  (function(W, k) {
@@ -0,0 +1,204 @@
1
+ import { d as M } from "./dayjs.min-DKCxxK08.js";
2
+ import { defineStore as U, storeToRefs as $ } from "pinia";
3
+ import { ref as m } from "vue";
4
+ import { b as p, g as f, u as g, s as E } from "./iteration-QZxp7XeE.js";
5
+ import { i as v } from "./utils-BZkjJbju.js";
6
+ import { u as _ } from "./useAppStore-BDADkWuX.js";
7
+ const n = {
8
+ async readEmployees() {
9
+ return f(await p().get("/pos-users"));
10
+ },
11
+ async readEmployeesPage(e) {
12
+ var s, i;
13
+ return f(
14
+ await p().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: (i = e.roleIds) != null && i.length ? e.roleIds : void 0
21
+ }
22
+ })
23
+ );
24
+ },
25
+ async createEmployee(e) {
26
+ await p().post("/pos-users", e);
27
+ },
28
+ async createMasterEmployee(e) {
29
+ await p().post("/pos-users/master-user", e);
30
+ },
31
+ async migrateToMasterEmployee(e, s) {
32
+ await p().put(`/pos-users/migrate/${e}`, s);
33
+ },
34
+ async updateEmployee(e, s) {
35
+ await p().put(`/pos-users/${e}`, s);
36
+ },
37
+ async updateMasterEmployee(e, s) {
38
+ await p().put(`/pos-users/master-user/${e}`, s);
39
+ },
40
+ async deleteEmployee(e) {
41
+ await p().put(`/pos-users/${e._id}`, {
42
+ user: e,
43
+ roles: [],
44
+ previousRoles: e.restaurants.map((s) => ({
45
+ restaurantId: s.restaurantId,
46
+ roleId: s.roleId
47
+ }))
48
+ });
49
+ },
50
+ async deleteMasterEmployee(e) {
51
+ await p().put(`/pos-users/master-user/${e._id}`, {
52
+ user: e,
53
+ roles: [],
54
+ previousRoles: e.restaurants.map((s) => ({
55
+ restaurantId: s.restaurantId,
56
+ roleId: s.roleId
57
+ }))
58
+ });
59
+ },
60
+ async generateEmployeePasscode() {
61
+ return `${f(
62
+ await p().get("/pos-users/generate-passcode")
63
+ )}`;
64
+ },
65
+ async syncUsersMeta() {
66
+ await p().post("/pos-users/create-users-meta");
67
+ }
68
+ };
69
+ async function T(e) {
70
+ const s = _().roles.value, { restaurants: i } = g(), u = new Map(
71
+ i.value.map((a) => [a._id, a.profile.name])
72
+ ), c = new Map(s.map((a) => [a._id, a.name])), r = /* @__PURE__ */ new Map();
73
+ for (const a of e) {
74
+ const l = {
75
+ restaurantId: a.restaurantId,
76
+ restaurantName: u.get(a.restaurantId) || "",
77
+ roleId: a.role,
78
+ roleName: c.get(a.role) || ""
79
+ }, d = r.get(a._id);
80
+ if (!d) {
81
+ r.set(a._id, {
82
+ ...a,
83
+ isRestricted: !1,
84
+ since: M(v(a._id)).format("DD/MM/YYYY"),
85
+ restaurants: [l]
86
+ });
87
+ continue;
88
+ }
89
+ d.restaurants.some((y) => y.restaurantId === a.restaurantId) || (d.restaurants = E([...d.restaurants, l], {
90
+ selector: "restaurantName"
91
+ }));
92
+ }
93
+ return E([...r.values()], { selector: "name" });
94
+ }
95
+ function I(e) {
96
+ const { restaurants: s } = g(), i = _().roles.value, u = new Map(
97
+ s.value.map((a) => [a._id, a])
98
+ ), c = new Map(i.map((a) => [a._id, a.name])), r = e.restaurantRole[0];
99
+ return {
100
+ _id: e._id,
101
+ name: e.name,
102
+ code: e.code,
103
+ passcode: e.passcode,
104
+ isMasterUser: e.isMasterUser,
105
+ isRestricted: e.isRestricted,
106
+ restaurantId: (r == null ? void 0 : r.restaurantId) || "",
107
+ role: (r == null ? void 0 : r.roleId) || "",
108
+ since: M(v(e._id)).format("DD/MM/YYYY"),
109
+ restaurants: E(
110
+ e.restaurantRole.map((a) => {
111
+ const l = u.get(a.restaurantId);
112
+ return {
113
+ restaurantId: a.restaurantId,
114
+ restaurantName: (l == null ? void 0 : l.profile.name) || "",
115
+ restaurantCode: (l == null ? void 0 : l.profile.code) ?? void 0,
116
+ roleId: a.roleId,
117
+ roleName: c.get(a.roleId) || ""
118
+ };
119
+ }),
120
+ { selector: "restaurantName" }
121
+ )
122
+ };
123
+ }
124
+ const R = U("employee", () => {
125
+ const e = g(), s = m([]), i = m([]), u = m(0), c = m(!1);
126
+ async function r() {
127
+ try {
128
+ c.value = !0, await e.readRestaurants();
129
+ const t = await n.readEmployees();
130
+ s.value = await T(t);
131
+ } catch (t) {
132
+ console.log("Error reading employees:", t);
133
+ } finally {
134
+ c.value = !1;
135
+ }
136
+ }
137
+ async function a(t) {
138
+ try {
139
+ c.value = !0, await e.readRestaurants();
140
+ const o = await n.readEmployeesPage(t);
141
+ i.value = o.items.map(I), u.value = o.total;
142
+ } catch (o) {
143
+ console.log("Error reading employee page:", o);
144
+ } finally {
145
+ c.value = !1;
146
+ }
147
+ }
148
+ async function l(t, o) {
149
+ await e.readRestaurants();
150
+ const w = o ?? (await n.readEmployeesPage({ ...t, limit: 1, offset: 0 })).total;
151
+ return w === 0 ? [] : (await n.readEmployeesPage({ ...t, limit: w, offset: 0 })).items.map(I);
152
+ }
153
+ async function d(t) {
154
+ await n.createEmployee(t);
155
+ }
156
+ async function y(t, o) {
157
+ await n.updateEmployee(t, o);
158
+ }
159
+ async function P(t) {
160
+ await n.deleteEmployee(t);
161
+ }
162
+ async function Y(t) {
163
+ await n.deleteMasterEmployee(t);
164
+ }
165
+ async function N(t) {
166
+ await n.createMasterEmployee(t);
167
+ }
168
+ async function S(t, o) {
169
+ await n.updateMasterEmployee(t, o);
170
+ }
171
+ async function h(t, o) {
172
+ await n.migrateToMasterEmployee(t, o);
173
+ }
174
+ async function D() {
175
+ await n.syncUsersMeta();
176
+ }
177
+ return {
178
+ employees: s,
179
+ listEmployees: i,
180
+ totalEmployees: u,
181
+ isLoading: c,
182
+ readEmployees: r,
183
+ readEmployeesPage: a,
184
+ readAllEmployeesPage: l,
185
+ createEmployee: d,
186
+ updateEmployee: y,
187
+ deleteEmployee: P,
188
+ createMasterEmployee: N,
189
+ updateMasterEmployee: S,
190
+ deleteMasterEmployee: Y,
191
+ migrateToMasterUser: h,
192
+ syncUsersMeta: D
193
+ };
194
+ }), k = () => {
195
+ const e = R();
196
+ return {
197
+ ...e,
198
+ ...$(e)
199
+ };
200
+ };
201
+ export {
202
+ n as E,
203
+ k as u
204
+ };