@feedmepos/mf-hrm-portal 2.0.19-dev.1 → 2.0.20-dev.1

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 (65) hide show
  1. package/dist/AuditLogList-Bsj-qg8n.js +1037 -0
  2. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
  3. package/dist/EmployeeList-Cy2ayCko.js +824 -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-CsUo2UeJ.js → Main-BGc6kNaR.js} +758 -761
  7. package/dist/{Main-D_dew1Zy.js → Main-CSMAtoMj.js} +181 -175
  8. package/dist/Main-D7bV8EuC.js +86 -0
  9. package/dist/PermissionSetList-CuHhDqWl.js +347 -0
  10. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CdWgTjZw.js +3443 -0
  11. package/dist/RoleList-e0WUqt4Y.js +545 -0
  12. package/dist/TeamMemberList-CpPa1KyV.js +1097 -0
  13. package/dist/{TimesheetList-Bu47lfyS.js → TimesheetList-tFjvFHqH.js} +132 -126
  14. package/dist/{app-rZIFa5rc.js → app-CL7rUfL3.js} +552 -504
  15. package/dist/app.js +1 -1
  16. package/dist/{dayjs.min-BGndyuOo.js → dayjs.min-ChdFPuFV.js} +1 -1
  17. package/dist/employee-kKV7UnHU.js +204 -0
  18. package/dist/{iteration-BOjSUDXb.js → iteration-BbD0nOgO.js} +9253 -9209
  19. package/dist/{lodash-C3mSRK8f.js → lodash-CDf3aG6G.js} +1 -1
  20. package/dist/{rule-CPun0Q97.js → rule-BJ-y3Sp8.js} +263 -265
  21. package/dist/src/api/audit-log/index.d.ts +9 -0
  22. package/dist/src/api/index.d.ts +0 -1
  23. package/dist/src/api/restaurant/index.d.ts +5 -0
  24. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  25. package/dist/src/components/CollapsibleWrapper.vue.d.ts +2 -0
  26. package/dist/src/components/Skeleton.vue.d.ts +7 -0
  27. package/dist/src/composables/useBasePermission.d.ts +1 -0
  28. package/dist/src/composables/useRestaurantMap.d.ts +2 -329
  29. package/dist/src/stores/restaurant.d.ts +181 -0
  30. package/dist/src/stores/role.d.ts +7 -7
  31. package/dist/src/stores/team.d.ts +6 -6
  32. package/dist/src/types/restaurant.d.ts +11 -0
  33. package/dist/src/types/team.d.ts +1 -1
  34. package/dist/src/views/hr/locales/index.d.ts +16 -0
  35. package/dist/src/views/team/components/BasePermission.vue.d.ts +3 -7
  36. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +2 -2
  37. package/dist/src/views/team/locales/index.d.ts +32 -0
  38. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +5 -3
  39. package/dist/src/views/team/member/TeamMemberMasterUser.vue.d.ts +3 -3
  40. package/dist/style.css +1 -1
  41. package/dist/{timesheet-BKF3Ow4F.js → timesheet-BmV02Rkz.js} +2 -2
  42. package/dist/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/useAppStore-D8QAGZ02.js +171 -0
  44. package/dist/useDebounce-CWb5QR9G.js +28 -0
  45. package/dist/useDiscardConfirm-DPhEV6v0.js +157 -0
  46. package/dist/{useLoading-EAY7xVQ0.js → useLoading-KpcQw0p4.js} +1 -1
  47. package/dist/{useReportPermissions-C0Bay1Db.js → useReportPermissions-CmGJAz_N.js} +3 -3
  48. package/package.json +1 -1
  49. package/dist/AuditLogList-ayMV64G1.js +0 -980
  50. package/dist/EmployeeList-D_ZkY6oL.js +0 -736
  51. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +0 -71
  52. package/dist/HorizontalSplitter-o860F4xM.js +0 -12
  53. package/dist/Main-Dc9eZBpa.js +0 -85
  54. package/dist/PermissionSetList-CkRVYnaB.js +0 -341
  55. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DF26-RE9.js +0 -3480
  56. package/dist/RoleList-D6BdbJhj.js +0 -530
  57. package/dist/TeamMemberList-Cf82_HoM.js +0 -1114
  58. package/dist/TeamMemberList.vue_vue_type_style_index_0_scoped_473cbd86_lang--Ukpicpg.js +0 -34
  59. package/dist/employee-C9_9zcbo.js +0 -204
  60. package/dist/src/api/account/index.d.ts +0 -4
  61. package/dist/src/composables/useSupportedCountries.d.ts +0 -5
  62. package/dist/useAppStore-DBeAz_oF.js +0 -171
  63. package/dist/useDebounce-B8ZPVS5C.js +0 -15
  64. package/dist/useDiscardConfirm-BHni0LNu.js +0 -28
  65. package/dist/useSearch-B6WK1LBB.js +0 -15
package/dist/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import { f as e, i as r, r as o } from "./app-rZIFa5rc.js";
1
+ import { f as e, i as r, r as o } from "./app-CL7rUfL3.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-rZIFa5rc.js";
1
+ import { g as Q, c as K } from "./app-CL7rUfL3.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-ChdFPuFV.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-BbD0nOgO.js";
5
+ import { i as v } from "./utils-BZkjJbju.js";
6
+ import { u as _ } from "./useAppStore-D8QAGZ02.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
+ };