@feedmepos/mf-hrm-portal 2.0.18-dev → 2.0.18-dev.3

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 (66) hide show
  1. package/dist/AuditLogList-CPG5uNyJ.js +980 -0
  2. package/dist/EmployeeList-CyF7_ax8.js +736 -0
  3. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +71 -0
  4. package/dist/HorizontalSplitter-o860F4xM.js +12 -0
  5. package/dist/{Main-CvW6Vu8N.js → Main-BwMCrfKS.js} +761 -758
  6. package/dist/Main-S5kR_LNV.js +85 -0
  7. package/dist/{Main-CleutFvF.js → Main-y2ea2vuC.js} +176 -183
  8. package/dist/PermissionSetList-C5oGIsQP.js +341 -0
  9. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-VaY4Fg_h.js +3480 -0
  10. package/dist/RoleList-C95uKJ8O.js +530 -0
  11. package/dist/TeamMemberList-CEqYCWn6.js +1114 -0
  12. package/dist/TeamMemberList.vue_vue_type_style_index_0_scoped_473cbd86_lang-DJ-znUI3.js +34 -0
  13. package/dist/{TimesheetList-WqqoKPbg.js → TimesheetList-DXtxCeNh.js} +126 -132
  14. package/dist/{app-R5EioPr4.js → app-BwtXEFgW.js} +711 -759
  15. package/dist/app.js +1 -1
  16. package/dist/{dayjs.min-CN15Ft3o.js → dayjs.min-uVMAR_wK.js} +1 -1
  17. package/dist/employee-ImeXt_Q7.js +204 -0
  18. package/dist/{iteration-UBGGRoxQ.js → iteration-BjJgU8cS.js} +4688 -4732
  19. package/dist/{lodash-CC6qHVUo.js → lodash-CSw3Ei7_.js} +1 -1
  20. package/dist/{rule-B519XbW6.js → rule-B6wBPpcM.js} +265 -263
  21. package/dist/src/api/account/index.d.ts +4 -0
  22. package/dist/src/api/audit-log/index.d.ts +0 -9
  23. package/dist/src/api/index.d.ts +1 -0
  24. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  25. package/dist/src/components/CollapsibleWrapper.vue.d.ts +0 -2
  26. package/dist/src/composables/useBasePermission.d.ts +0 -1
  27. package/dist/src/composables/useRestaurantMap.d.ts +329 -2
  28. package/dist/src/composables/useSupportedCountries.d.ts +5 -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 +0 -11
  32. package/dist/src/types/team.d.ts +1 -1
  33. package/dist/src/views/hr/locales/index.d.ts +0 -16
  34. package/dist/src/views/team/components/BasePermission.vue.d.ts +7 -3
  35. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +2 -2
  36. package/dist/src/views/team/locales/index.d.ts +0 -32
  37. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -5
  38. package/dist/style.css +1 -1
  39. package/dist/{timesheet-BylrXRfd.js → timesheet-D1f9XDxj.js} +2 -2
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/useAppStore-D7jswOfq.js +171 -0
  42. package/dist/useDebounce-B8ZPVS5C.js +15 -0
  43. package/dist/useDiscardConfirm-BHni0LNu.js +28 -0
  44. package/dist/{useLoading-rbrVwWuj.js → useLoading-kFlAIf6Y.js} +1 -1
  45. package/dist/{useReportPermissions-BOEZU86S.js → useReportPermissions-ClWD1GSr.js} +3 -3
  46. package/dist/useSearch-B6WK1LBB.js +15 -0
  47. package/package.json +1 -1
  48. package/dist/AuditLogList-CaoW9uYd.js +0 -1011
  49. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +0 -58
  50. package/dist/EmployeeList-DcMvF9U5.js +0 -839
  51. package/dist/FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js +0 -34
  52. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
  53. package/dist/Main-D7k57uq5.js +0 -87
  54. package/dist/PermissionSetList-CM7kbWkO.js +0 -347
  55. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Ces9YwYB.js +0 -3443
  56. package/dist/RoleList-DR3eVJ9f.js +0 -545
  57. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +0 -16
  58. package/dist/TeamMemberList-CZZv4Pu5.js +0 -1038
  59. package/dist/employee-DwQlWLkL.js +0 -204
  60. package/dist/src/api/restaurant/index.d.ts +0 -5
  61. package/dist/src/components/Skeleton.vue.d.ts +0 -7
  62. package/dist/src/stores/restaurant.d.ts +0 -181
  63. package/dist/team-BGLhgx5P.js +0 -33
  64. package/dist/useAppStore-Akl8AoVN.js +0 -171
  65. package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
  66. package/dist/useSearch-BAPEUu1R.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-R5EioPr4.js";
1
+ import { j as e, h as r, r as o } from "./app-BwtXEFgW.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-R5EioPr4.js";
1
+ import { g as Q, c as K } from "./app-BwtXEFgW.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-uVMAR_wK.js";
2
+ import { defineStore as S, storeToRefs as U } from "pinia";
3
+ import { ref as m } from "vue";
4
+ import { useCoreStore as w } from "@feedmepos/mf-common";
5
+ import { b as p, g as f, s as E } from "./iteration-BjJgU8cS.js";
6
+ import { i as v } from "./utils-BZkjJbju.js";
7
+ import { u as _ } from "./useAppStore-D7jswOfq.js";
8
+ const n = {
9
+ async readEmployees() {
10
+ return f(await p().get("/pos-users"));
11
+ },
12
+ async readEmployeesPage(e) {
13
+ var t, i;
14
+ return f(
15
+ await p().get("/pos-users/paged", {
16
+ params: {
17
+ limit: e.limit,
18
+ offset: e.offset,
19
+ search: e.search,
20
+ restaurantIds: (t = e.restaurantIds) != null && t.length ? e.restaurantIds : void 0,
21
+ roleIds: (i = e.roleIds) != null && i.length ? e.roleIds : void 0
22
+ }
23
+ })
24
+ );
25
+ },
26
+ async createEmployee(e) {
27
+ await p().post("/pos-users", e);
28
+ },
29
+ async createMasterEmployee(e) {
30
+ await p().post("/pos-users/master-user", e);
31
+ },
32
+ async migrateToMasterEmployee(e, t) {
33
+ await p().put(`/pos-users/migrate/${e}`, t);
34
+ },
35
+ async updateEmployee(e, t) {
36
+ await p().put(`/pos-users/${e}`, t);
37
+ },
38
+ async updateMasterEmployee(e, t) {
39
+ await p().put(`/pos-users/master-user/${e}`, t);
40
+ },
41
+ async deleteEmployee(e) {
42
+ await p().put(`/pos-users/${e._id}`, {
43
+ user: e,
44
+ roles: [],
45
+ previousRoles: e.restaurants.map((t) => ({
46
+ restaurantId: t.restaurantId,
47
+ roleId: t.roleId
48
+ }))
49
+ });
50
+ },
51
+ async deleteMasterEmployee(e) {
52
+ await p().put(`/pos-users/master-user/${e._id}`, {
53
+ user: e,
54
+ roles: [],
55
+ previousRoles: e.restaurants.map((t) => ({
56
+ restaurantId: t.restaurantId,
57
+ roleId: t.roleId
58
+ }))
59
+ });
60
+ },
61
+ async generateEmployeePasscode() {
62
+ return `${f(
63
+ await p().get("/pos-users/generate-passcode")
64
+ )}`;
65
+ },
66
+ async syncUsersMeta() {
67
+ await p().post("/pos-users/create-users-meta");
68
+ }
69
+ };
70
+ async function $(e) {
71
+ const t = _().roles.value, { restaurants: i } = w(), c = new Map(
72
+ i.value.map((a) => [a._id, a.profile.name])
73
+ ), d = new Map(t.map((a) => [a._id, a.name])), r = /* @__PURE__ */ new Map();
74
+ for (const a of e) {
75
+ const l = {
76
+ restaurantId: a.restaurantId,
77
+ restaurantName: c.get(a.restaurantId) || "",
78
+ roleId: a.role,
79
+ roleName: d.get(a.role) || ""
80
+ }, u = r.get(a._id);
81
+ if (!u) {
82
+ r.set(a._id, {
83
+ ...a,
84
+ isRestricted: !1,
85
+ since: M(v(a._id)).format("DD/MM/YYYY"),
86
+ restaurants: [l]
87
+ });
88
+ continue;
89
+ }
90
+ u.restaurants.some((y) => y.restaurantId === a.restaurantId) || (u.restaurants = E([...u.restaurants, l], {
91
+ selector: "restaurantName"
92
+ }));
93
+ }
94
+ return E([...r.values()], { selector: "name" });
95
+ }
96
+ function I(e) {
97
+ const { restaurants: t } = w(), i = _().roles.value, c = new Map(
98
+ t.value.map((a) => [a._id, a])
99
+ ), d = new Map(i.map((a) => [a._id, a.name])), r = e.restaurantRole[0];
100
+ return {
101
+ _id: e._id,
102
+ name: e.name,
103
+ code: e.code,
104
+ passcode: e.passcode,
105
+ isMasterUser: e.isMasterUser,
106
+ isRestricted: e.isRestricted,
107
+ restaurantId: (r == null ? void 0 : r.restaurantId) || "",
108
+ role: (r == null ? void 0 : r.roleId) || "",
109
+ since: M(v(e._id)).format("DD/MM/YYYY"),
110
+ restaurants: E(
111
+ e.restaurantRole.map((a) => {
112
+ const l = c.get(a.restaurantId);
113
+ return {
114
+ restaurantId: a.restaurantId,
115
+ restaurantName: (l == null ? void 0 : l.profile.name) || "",
116
+ restaurantCode: (l == null ? void 0 : l.profile.code) ?? void 0,
117
+ roleId: a.roleId,
118
+ roleName: d.get(a.roleId) || ""
119
+ };
120
+ }),
121
+ { selector: "restaurantName" }
122
+ )
123
+ };
124
+ }
125
+ const T = S("employee", () => {
126
+ const e = m([]), t = m([]), i = m(0), c = m(!1);
127
+ async function d() {
128
+ try {
129
+ c.value = !0;
130
+ const s = await n.readEmployees();
131
+ e.value = await $(s);
132
+ } catch (s) {
133
+ console.log("Error reading employees:", s);
134
+ } finally {
135
+ c.value = !1;
136
+ }
137
+ }
138
+ async function r(s) {
139
+ try {
140
+ c.value = !0;
141
+ const o = await n.readEmployeesPage(s);
142
+ t.value = o.items.map(I), i.value = o.total;
143
+ } catch (o) {
144
+ console.log("Error reading employee page:", o);
145
+ } finally {
146
+ c.value = !1;
147
+ }
148
+ }
149
+ async function a(s, o) {
150
+ const g = o ?? (await n.readEmployeesPage({ ...s, limit: 1, offset: 0 })).total;
151
+ return g === 0 ? [] : (await n.readEmployeesPage({ ...s, limit: g, offset: 0 })).items.map(I);
152
+ }
153
+ async function l(s) {
154
+ await n.createEmployee(s);
155
+ }
156
+ async function u(s, o) {
157
+ await n.updateEmployee(s, o);
158
+ }
159
+ async function y(s) {
160
+ await n.deleteEmployee(s);
161
+ }
162
+ async function P(s) {
163
+ await n.deleteMasterEmployee(s);
164
+ }
165
+ async function Y(s) {
166
+ await n.createMasterEmployee(s);
167
+ }
168
+ async function N(s, o) {
169
+ await n.updateMasterEmployee(s, o);
170
+ }
171
+ async function h(s, o) {
172
+ await n.migrateToMasterEmployee(s, o);
173
+ }
174
+ async function D() {
175
+ await n.syncUsersMeta();
176
+ }
177
+ return {
178
+ employees: e,
179
+ listEmployees: t,
180
+ totalEmployees: i,
181
+ isLoading: c,
182
+ readEmployees: d,
183
+ readEmployeesPage: r,
184
+ readAllEmployeesPage: a,
185
+ createEmployee: l,
186
+ updateEmployee: u,
187
+ deleteEmployee: y,
188
+ createMasterEmployee: Y,
189
+ updateMasterEmployee: N,
190
+ deleteMasterEmployee: P,
191
+ migrateToMasterUser: h,
192
+ syncUsersMeta: D
193
+ };
194
+ }), z = () => {
195
+ const e = T();
196
+ return {
197
+ ...e,
198
+ ...U(e)
199
+ };
200
+ };
201
+ export {
202
+ n as E,
203
+ z as u
204
+ };