@feedmepos/mf-hrm-portal 2.0.15-dev → 2.0.15-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 (36) hide show
  1. package/dist/{AuditLogList-DBIsI4YF.js → AuditLogList-eyzJecZc.js} +4 -4
  2. package/dist/EmployeeList-QibdsTN-.js +736 -0
  3. package/dist/{Main-BAZAQTWi.js → Main-B_QCpWOx.js} +4 -4
  4. package/dist/{Main-D7yzD5SW.js → Main-Bjfm9a6M.js} +5 -5
  5. package/dist/{Main-B3YiMuFq.js → Main-DX1aet8y.js} +1298 -1294
  6. package/dist/{PermissionSetList-DBT9LtfT.js → PermissionSetList-fE9Zfrl6.js} +30 -30
  7. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BfqnjeTK.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-JpCfRxA9.js} +500 -500
  8. package/dist/RoleList-ByXZemFz.js +528 -0
  9. package/dist/{TeamMemberList-BCv5Vixx.js → TeamMemberList-D-_icv19.js} +327 -324
  10. package/dist/{TimesheetList-DpMBgVtY.js → TimesheetList-DVvz6id4.js} +7 -7
  11. package/dist/{app-pvHHFjbx.js → app-DJG3HGqG.js} +220 -261
  12. package/dist/app.js +2 -2
  13. package/dist/{dayjs.min-BK_bM9xY.js → dayjs.min-CN6o-ax9.js} +1 -1
  14. package/dist/{employee-DhkixwiI.js → employee-CU-G-rAZ.js} +71 -74
  15. package/dist/{index-DK4fVbTF.js → index-ynxje0mm.js} +1 -1
  16. package/dist/{iteration-Bk3cnP07.js → iteration-C6Km_Rno.js} +1 -1
  17. package/dist/{lodash-TrOlqj07.js → lodash-DZvG4gEx.js} +1 -1
  18. package/dist/rule-X41LxaES.js +991 -0
  19. package/dist/src/helpers/rule.d.ts +1 -1
  20. package/dist/src/stores/employee.d.ts +124 -19
  21. package/dist/src/types/employee.d.ts +3 -0
  22. package/dist/src/views/hr/employee/EmployeeList.vue.d.ts +4 -0
  23. package/dist/style.css +1 -1
  24. package/dist/{timesheet-DSQeCVfL.js → timesheet-DUtxTIA4.js} +9 -9
  25. package/dist/tsconfig.app.tsbuildinfo +1 -1
  26. package/dist/useAppStore-CrUYEAtX.js +171 -0
  27. package/dist/useDiscardConfirm-BHni0LNu.js +28 -0
  28. package/dist/{useLoading-fEAOlgoV.js → useLoading-hGUqfW4U.js} +1 -1
  29. package/dist/{useReportPermissions-CkOk_2tl.js → useReportPermissions-BgTdISQy.js} +3 -3
  30. package/dist/utils-BZkjJbju.js +17 -0
  31. package/package.json +1 -1
  32. package/dist/EmployeeList-BOSxLZbY.js +0 -702
  33. package/dist/RoleList-DeE5tN-5.js +0 -519
  34. package/dist/index-Bckj5jnu.js +0 -998
  35. package/dist/useAppStore-DwfwjZpc.js +0 -168
  36. package/dist/useRestaurantMap-e9fQJiLC.js +0 -39
package/dist/app.js CHANGED
@@ -1,6 +1,6 @@
1
- import { f as a, e as r, r as o } from "./app-pvHHFjbx.js";
1
+ import { d as e, i as r, r as o } from "./app-DJG3HGqG.js";
2
2
  export {
3
- a as FmApp,
3
+ e as FmApp,
4
4
  r as i18nMessages,
5
5
  o as routes
6
6
  };
@@ -1,4 +1,4 @@
1
- import { g as Q, c as K } from "./app-pvHHFjbx.js";
1
+ import { g as Q, c as K } from "./app-DJG3HGqG.js";
2
2
  var E = { exports: {} };
3
3
  (function(V, X) {
4
4
  (function(W, k) {
@@ -1,45 +1,45 @@
1
- import { d as M } from "./dayjs.min-BK_bM9xY.js";
2
- import { defineStore as S, storeToRefs as $ } from "pinia";
3
- import { ref as u } from "vue";
1
+ import { d as M } from "./dayjs.min-CN6o-ax9.js";
2
+ import { defineStore as S, storeToRefs as U } from "pinia";
3
+ import { ref as m } from "vue";
4
4
  import { useCoreStore as w } from "@feedmepos/mf-common";
5
- import { b as l, g as f, s as E } from "./iteration-Bk3cnP07.js";
6
- import { t as b, i as v } from "./index-Bckj5jnu.js";
7
- import { u as _ } from "./useAppStore-DwfwjZpc.js";
5
+ import { b as p, g as f, s as E } from "./iteration-C6Km_Rno.js";
6
+ import { i as v } from "./utils-BZkjJbju.js";
7
+ import { u as _ } from "./useAppStore-CrUYEAtX.js";
8
8
  const n = {
9
9
  async readEmployees() {
10
- return f(await l().get("/pos-users"));
10
+ return f(await p().get("/pos-users"));
11
11
  },
12
12
  async readEmployeesPage(e) {
13
- var t, p;
13
+ var t, i;
14
14
  return f(
15
- await l().get("/pos-users/paged", {
15
+ await p().get("/pos-users/paged", {
16
16
  params: {
17
17
  limit: e.limit,
18
18
  offset: e.offset,
19
19
  search: e.search,
20
20
  restaurantIds: (t = e.restaurantIds) != null && t.length ? e.restaurantIds : void 0,
21
- roleIds: (p = e.roleIds) != null && p.length ? e.roleIds : void 0
21
+ roleIds: (i = e.roleIds) != null && i.length ? e.roleIds : void 0
22
22
  }
23
23
  })
24
24
  );
25
25
  },
26
26
  async createEmployee(e) {
27
- await l().post("/pos-users", e);
27
+ await p().post("/pos-users", e);
28
28
  },
29
29
  async createMasterEmployee(e) {
30
- await l().post("/pos-users/master-user", e);
30
+ await p().post("/pos-users/master-user", e);
31
31
  },
32
32
  async migrateToMasterEmployee(e, t) {
33
- await l().put(`/pos-users/migrate/${e}`, t);
33
+ await p().put(`/pos-users/migrate/${e}`, t);
34
34
  },
35
35
  async updateEmployee(e, t) {
36
- await l().put(`/pos-users/${e}`, t);
36
+ await p().put(`/pos-users/${e}`, t);
37
37
  },
38
38
  async updateMasterEmployee(e, t) {
39
- await l().put(`/pos-users/master-user/${e}`, t);
39
+ await p().put(`/pos-users/master-user/${e}`, t);
40
40
  },
41
41
  async deleteEmployee(e) {
42
- await l().put(`/pos-users/${e._id}`, {
42
+ await p().put(`/pos-users/${e._id}`, {
43
43
  user: e,
44
44
  roles: [],
45
45
  previousRoles: e.restaurants.map((t) => ({
@@ -49,7 +49,7 @@ const n = {
49
49
  });
50
50
  },
51
51
  async deleteMasterEmployee(e) {
52
- await l().put(`/pos-users/master-user/${e._id}`, {
52
+ await p().put(`/pos-users/master-user/${e._id}`, {
53
53
  user: e,
54
54
  roles: [],
55
55
  previousRoles: e.restaurants.map((t) => ({
@@ -60,148 +60,145 @@ const n = {
60
60
  },
61
61
  async generateEmployeePasscode() {
62
62
  return `${f(
63
- await l().get("/pos-users/generate-passcode")
63
+ await p().get("/pos-users/generate-passcode")
64
64
  )}`;
65
65
  },
66
66
  async syncUsersMeta() {
67
- await l().post("/pos-users/create-users-meta");
67
+ await p().post("/pos-users/create-users-meta");
68
68
  }
69
69
  };
70
- async function A(e) {
71
- const t = _().roles.value, { restaurants: p } = w(), c = new Map(
72
- p.value.map((a) => [a._id, a.profile.name])
73
- ), i = new Map(t.map((a) => [a._id, a.name])), r = /* @__PURE__ */ new Map();
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
74
  for (const a of e) {
75
- const d = {
75
+ const l = {
76
76
  restaurantId: a.restaurantId,
77
77
  restaurantName: c.get(a.restaurantId) || "",
78
78
  roleId: a.role,
79
- roleName: i.get(a.role) || ""
80
- }, m = r.get(a._id);
81
- if (!m) {
79
+ roleName: d.get(a.role) || ""
80
+ }, u = r.get(a._id);
81
+ if (!u) {
82
82
  r.set(a._id, {
83
83
  ...a,
84
+ isRestricted: !1,
84
85
  since: M(v(a._id)).format("DD/MM/YYYY"),
85
- restaurants: [d]
86
+ restaurants: [l]
86
87
  });
87
88
  continue;
88
89
  }
89
- m.restaurants.some((y) => y.restaurantId === a.restaurantId) || (m.restaurants = E([...m.restaurants, d], {
90
+ u.restaurants.some((y) => y.restaurantId === a.restaurantId) || (u.restaurants = E([...u.restaurants, l], {
90
91
  selector: "restaurantName"
91
92
  }));
92
93
  }
93
94
  return E([...r.values()], { selector: "name" });
94
95
  }
95
96
  function I(e) {
96
- const { restaurants: t } = w(), p = _().roles.value, c = new Map(
97
- t.value.map((a) => [a._id, a.profile.name])
98
- ), i = new Map(p.map((a) => [a._id, a.name])), r = e.restaurantRole[0];
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];
99
100
  return {
100
101
  _id: e._id,
101
102
  name: e.name,
102
103
  code: e.code,
103
104
  passcode: e.passcode,
104
105
  isMasterUser: e.isMasterUser,
106
+ isRestricted: e.isRestricted,
105
107
  restaurantId: (r == null ? void 0 : r.restaurantId) || "",
106
108
  role: (r == null ? void 0 : r.roleId) || "",
107
109
  since: M(v(e._id)).format("DD/MM/YYYY"),
108
110
  restaurants: E(
109
- e.restaurantRole.map((a) => ({
110
- restaurantId: a.restaurantId,
111
- restaurantName: c.get(a.restaurantId) || "",
112
- roleId: a.roleId,
113
- roleName: i.get(a.roleId) || ""
114
- })),
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
+ }),
115
121
  { selector: "restaurantName" }
116
122
  )
117
123
  };
118
124
  }
119
- const x = S("employee", () => {
120
- const e = u([]), t = u([]), p = u(0), c = u(!1), i = u([]);
121
- async function r() {
125
+ const T = S("employee", () => {
126
+ const e = m([]), t = m([]), i = m(0), c = m(!1);
127
+ async function d() {
122
128
  try {
123
129
  c.value = !0;
124
130
  const s = await n.readEmployees();
125
- e.value = await A(s);
131
+ e.value = await $(s);
126
132
  } catch (s) {
127
133
  console.log("Error reading employees:", s);
128
134
  } finally {
129
135
  c.value = !1;
130
136
  }
131
137
  }
132
- async function a(s) {
138
+ async function r(s) {
133
139
  try {
134
140
  c.value = !0;
135
141
  const o = await n.readEmployeesPage(s);
136
- t.value = o.items.map(I), p.value = o.total;
142
+ t.value = o.items.map(I), i.value = o.total;
137
143
  } catch (o) {
138
144
  console.log("Error reading employee page:", o);
139
145
  } finally {
140
146
  c.value = !1;
141
147
  }
142
148
  }
143
- async function d(s, o) {
149
+ async function a(s, o) {
144
150
  const g = o ?? (await n.readEmployeesPage({ ...s, limit: 1, offset: 0 })).total;
145
151
  return g === 0 ? [] : (await n.readEmployeesPage({ ...s, limit: g, offset: 0 })).items.map(I);
146
152
  }
147
- async function m(s) {
153
+ async function l(s) {
148
154
  await n.createEmployee(s);
149
155
  }
150
- async function y(s, o) {
156
+ async function u(s, o) {
151
157
  await n.updateEmployee(s, o);
152
158
  }
153
- async function P(s) {
159
+ async function y(s) {
154
160
  await n.deleteEmployee(s);
155
161
  }
156
- async function N(s) {
162
+ async function P(s) {
157
163
  await n.deleteMasterEmployee(s);
158
164
  }
159
- async function U(s) {
165
+ async function Y(s) {
160
166
  await n.createMasterEmployee(s);
161
167
  }
162
- async function Y(s, o) {
168
+ async function N(s, o) {
163
169
  await n.updateMasterEmployee(s, o);
164
170
  }
165
171
  async function h(s, o) {
166
172
  await n.migrateToMasterEmployee(s, o);
167
173
  }
168
- async function T() {
169
- try {
170
- i.value = await b.readTeamMemberPosUserIds();
171
- } catch (s) {
172
- console.log("Error reading team member pos user ids:", s);
173
- }
174
- }
175
174
  async function D() {
176
175
  await n.syncUsersMeta();
177
176
  }
178
177
  return {
179
178
  employees: e,
180
179
  listEmployees: t,
181
- totalEmployees: p,
182
- restrictEmployeeIds: i,
180
+ totalEmployees: i,
183
181
  isLoading: c,
184
- readEmployees: r,
185
- readEmployeesPage: a,
186
- readAllEmployeesPage: d,
187
- createEmployee: m,
188
- updateEmployee: y,
189
- deleteEmployee: P,
190
- createMasterEmployee: U,
191
- updateMasterEmployee: Y,
192
- deleteMasterEmployee: N,
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,
193
191
  migrateToMasterUser: h,
194
- readTeamMemberPosUserIds: T,
195
192
  syncUsersMeta: D
196
193
  };
197
- }), H = () => {
198
- const e = x();
194
+ }), z = () => {
195
+ const e = T();
199
196
  return {
200
197
  ...e,
201
- ...$(e)
198
+ ...U(e)
202
199
  };
203
200
  };
204
201
  export {
205
202
  n as E,
206
- H as u
203
+ z as u
207
204
  };
@@ -2,7 +2,7 @@ var oe = Object.defineProperty;
2
2
  var se = (_, h, y) => h in _ ? oe(_, h, { enumerable: !0, configurable: !0, writable: !0, value: y }) : _[h] = y;
3
3
  var ot = (_, h, y) => se(_, typeof h != "symbol" ? h + "" : h, y);
4
4
  import { readonly as Nt, ref as Rt } from "vue";
5
- import { c as st } from "./app-pvHHFjbx.js";
5
+ import { c as st } from "./app-DJG3HGqG.js";
6
6
  var Pt = { exports: {} };
7
7
  (function(_, h) {
8
8
  (function(y, p) {
@@ -1,4 +1,4 @@
1
- import { c as U } from "./app-pvHHFjbx.js";
1
+ import { c as U } from "./app-DJG3HGqG.js";
2
2
  import { useCoreStore as To, baseClientInstance as jr, FeedMeAuth as Zs } from "@feedmepos/mf-common";
3
3
  var Ys = {}, _n = {}, _ = {}, zo = {}, $i = {}, eo = {}, ui = {};
4
4
  (function(e) {
@@ -1,4 +1,4 @@
1
- import { c as jt } from "./app-pvHHFjbx.js";
1
+ import { c as jt } from "./app-DJG3HGqG.js";
2
2
  var Jr = { exports: {} };
3
3
  /**
4
4
  * @license