@feedmepos/mf-hrm-portal 2.0.19 → 2.0.20-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 (66) hide show
  1. package/dist/AuditLogList-ChxAzO74.js +1037 -0
  2. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
  3. package/dist/EmployeeList-Cs-Mn6UA.js +843 -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-BPM7QyFL.js → Main-B9_TyRDo.js} +2009 -2005
  7. package/dist/Main-CdHW4UkN.js +90 -0
  8. package/dist/Main-DcvmP7s-.js +574 -0
  9. package/dist/PermissionSetList-VFVS0g0v.js +347 -0
  10. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Dr3R9JjS.js +3444 -0
  11. package/dist/RoleList-BZ6RZvm2.js +556 -0
  12. package/dist/TeamMemberList-C-zhFauD.js +1115 -0
  13. package/dist/{TimesheetList-CdWXksIf.js → TimesheetList-CZex54an.js} +129 -115
  14. package/dist/{app-D6OxaCEx.js → app-CLL3p27X.js} +699 -653
  15. package/dist/app.js +1 -1
  16. package/dist/{dayjs.min-C0I-OiL6.js → dayjs.min-CDt1i9vl.js} +1 -1
  17. package/dist/employee-BpRvjWNh.js +200 -0
  18. package/dist/{iteration-CcZFMm5X.js → iteration-BVjUzYL5.js} +9314 -9272
  19. package/dist/{lodash-CW7MBjcM.js → lodash-CrwgACp2.js} +1 -1
  20. package/dist/{rule-6Lg9M_3I.js → rule-BlQ5YZ9Z.js} +274 -275
  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 +2 -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-CaSIm-Rv.js → timesheet-jFs4GTAL.js} +2 -2
  42. package/dist/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/useAppStore-DMAL8VFY.js +169 -0
  44. package/dist/useDebounce-CWb5QR9G.js +28 -0
  45. package/dist/useDiscardConfirm-DPhEV6v0.js +157 -0
  46. package/dist/{useLoading-cnpr1-pP.js → useLoading-AFTjRLyO.js} +1 -1
  47. package/dist/{useReportPermissions-CNr0AdOf.js → useReportPermissions-hODG0Xx3.js} +3 -3
  48. package/package.json +1 -1
  49. package/dist/AuditLogList-Bw3sRBhW.js +0 -980
  50. package/dist/EmployeeList-C4tVWPJE.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-BC20s7cs.js +0 -560
  54. package/dist/Main-eN8MDWpv.js +0 -85
  55. package/dist/PermissionSetList-CPSRrCsu.js +0 -341
  56. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CXt721Zo.js +0 -3480
  57. package/dist/RoleList-tRu19xyl.js +0 -530
  58. package/dist/TeamMemberList-CvitYIKw.js +0 -1114
  59. package/dist/TeamMemberList.vue_vue_type_style_index_0_scoped_473cbd86_lang-BDjrD45a.js +0 -34
  60. package/dist/employee-yT17VCCS.js +0 -204
  61. package/dist/src/api/account/index.d.ts +0 -4
  62. package/dist/src/composables/useSupportedCountries.d.ts +0 -5
  63. package/dist/useAppStore-CONZvtGc.js +0 -171
  64. package/dist/useDebounce-B8ZPVS5C.js +0 -15
  65. package/dist/useDiscardConfirm-BHni0LNu.js +0 -28
  66. 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-D6OxaCEx.js";
1
+ import { f as e, i as r, r as o } from "./app-CLL3p27X.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-D6OxaCEx.js";
1
+ import { g as Q, c as K } from "./app-CLL3p27X.js";
2
2
  var E = { exports: {} };
3
3
  (function(V, X) {
4
4
  (function(W, k) {
@@ -0,0 +1,200 @@
1
+ import { d as g } from "./dayjs.min-CDt1i9vl.js";
2
+ import { defineStore as $, storeToRefs as T } from "pinia";
3
+ import { ref as m } from "vue";
4
+ import { b as l, g as f, u as w, s as E } from "./iteration-BVjUzYL5.js";
5
+ import { i as v } from "./utils-BZkjJbju.js";
6
+ import { u as _ } from "./useAppStore-DMAL8VFY.js";
7
+ const o = {
8
+ async readEmployees() {
9
+ return f(await l().get("/pos-users"));
10
+ },
11
+ async readEmployeesPage(e) {
12
+ var t, p;
13
+ return f(
14
+ await l().get("/pos-users/paged", {
15
+ params: {
16
+ limit: e.limit,
17
+ offset: e.offset,
18
+ search: e.search,
19
+ restaurantIds: (t = e.restaurantIds) != null && t.length ? e.restaurantIds : void 0,
20
+ roleIds: (p = e.roleIds) != null && p.length ? e.roleIds : void 0
21
+ }
22
+ })
23
+ );
24
+ },
25
+ async createEmployee(e) {
26
+ await l().post("/pos-users", e);
27
+ },
28
+ async createMasterEmployee(e) {
29
+ await l().post("/pos-users/master-user", e);
30
+ },
31
+ async migrateToMasterEmployee(e, t) {
32
+ await l().put(`/pos-users/migrate/${e}`, t);
33
+ },
34
+ async updateEmployee(e, t) {
35
+ await l().put(`/pos-users/${e}`, t);
36
+ },
37
+ async updateMasterEmployee(e, t) {
38
+ await l().put(`/pos-users/master-user/${e}`, t);
39
+ },
40
+ async deleteEmployee(e) {
41
+ await l().put(`/pos-users/${e._id}`, {
42
+ user: e,
43
+ roles: [],
44
+ previousRoles: e.restaurants.map((t) => ({
45
+ restaurantId: t.restaurantId,
46
+ roleId: t.roleId
47
+ }))
48
+ });
49
+ },
50
+ async deleteMasterEmployee(e) {
51
+ await l().put(`/pos-users/master-user/${e._id}`, {
52
+ user: e,
53
+ roles: [],
54
+ previousRoles: e.restaurants.map((t) => ({
55
+ restaurantId: t.restaurantId,
56
+ roleId: t.roleId
57
+ }))
58
+ });
59
+ },
60
+ async generateEmployeePasscode() {
61
+ return `${f(
62
+ await l().get("/pos-users/generate-passcode")
63
+ )}`;
64
+ },
65
+ async syncUsersMeta() {
66
+ await l().post("/pos-users/create-users-meta");
67
+ }
68
+ };
69
+ async function h(e) {
70
+ const t = _().roles.value, { restaurants: p } = w(), u = new Map(
71
+ p.value.map((a) => [a._id, a.profile.name])
72
+ ), c = new Map(t.map((a) => [a._id, a.name])), r = /* @__PURE__ */ new Map();
73
+ for (const a of e) {
74
+ const n = {
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: g(v(a._id)).format("DD/MM/YYYY"),
85
+ restaurants: [n]
86
+ });
87
+ continue;
88
+ }
89
+ d.restaurants.some((y) => y.restaurantId === a.restaurantId) || (d.restaurants = E([...d.restaurants, n], {
90
+ selector: "restaurantName"
91
+ }));
92
+ }
93
+ return E([...r.values()], { selector: "name" });
94
+ }
95
+ function M(e) {
96
+ const { restaurants: t } = w(), p = _().roles.value, u = new Map(
97
+ t.value.map((a) => [a._id, a])
98
+ ), c = new Map(p.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: g(v(e._id)).format("DD/MM/YYYY"),
109
+ restaurants: E(
110
+ e.restaurantRole.map((a) => {
111
+ const n = u.get(a.restaurantId);
112
+ return {
113
+ restaurantId: a.restaurantId,
114
+ restaurantName: (n == null ? void 0 : n.profile.name) || "",
115
+ restaurantCode: (n == null ? void 0 : n.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 = $("employee", () => {
125
+ const e = w(), t = m([]), p = m([]), u = m(0), c = m(!1);
126
+ async function r() {
127
+ try {
128
+ c.value = !0, await e.readRestaurants();
129
+ const s = await o.readEmployees();
130
+ t.value = await h(s);
131
+ } finally {
132
+ c.value = !1;
133
+ }
134
+ }
135
+ async function a(s) {
136
+ try {
137
+ c.value = !0, await e.readRestaurants();
138
+ const i = await o.readEmployeesPage(s);
139
+ p.value = i.items.map(M), u.value = i.total;
140
+ } finally {
141
+ c.value = !1;
142
+ }
143
+ }
144
+ async function n(s, i) {
145
+ await e.readRestaurants();
146
+ const I = i ?? (await o.readEmployeesPage({ ...s, limit: 1, offset: 0 })).total;
147
+ return I === 0 ? [] : (await o.readEmployeesPage({ ...s, limit: I, offset: 0 })).items.map(M);
148
+ }
149
+ async function d(s) {
150
+ await o.createEmployee(s);
151
+ }
152
+ async function y(s, i) {
153
+ await o.updateEmployee(s, i);
154
+ }
155
+ async function P(s) {
156
+ await o.deleteEmployee(s);
157
+ }
158
+ async function Y(s) {
159
+ await o.deleteMasterEmployee(s);
160
+ }
161
+ async function N(s) {
162
+ await o.createMasterEmployee(s);
163
+ }
164
+ async function S(s, i) {
165
+ await o.updateMasterEmployee(s, i);
166
+ }
167
+ async function D(s, i) {
168
+ await o.migrateToMasterEmployee(s, i);
169
+ }
170
+ async function U() {
171
+ await o.syncUsersMeta();
172
+ }
173
+ return {
174
+ employees: t,
175
+ listEmployees: p,
176
+ totalEmployees: u,
177
+ isLoading: c,
178
+ readEmployees: r,
179
+ readEmployeesPage: a,
180
+ readAllEmployeesPage: n,
181
+ createEmployee: d,
182
+ updateEmployee: y,
183
+ deleteEmployee: P,
184
+ createMasterEmployee: N,
185
+ updateMasterEmployee: S,
186
+ deleteMasterEmployee: Y,
187
+ migrateToMasterUser: D,
188
+ syncUsersMeta: U
189
+ };
190
+ }), k = () => {
191
+ const e = R();
192
+ return {
193
+ ...e,
194
+ ...T(e)
195
+ };
196
+ };
197
+ export {
198
+ o as E,
199
+ k as u
200
+ };