@feedmepos/mf-hrm-portal 2.1.1-dev.2 → 2.1.1-dev.4

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 (50) hide show
  1. package/dist/ApprovalCodeList-B0PLZwav.js +758 -0
  2. package/dist/{AuditLogList-DHiqs9G0.js → AuditLogList-CRXwPImZ.js} +5 -5
  3. package/dist/{ConditionFormHost.vue_vue_type_script_setup_true_lang-CWqNWNdD.js → ConditionFormHost.vue_vue_type_script_setup_true_lang-zJwkM_Xb.js} +2 -2
  4. package/dist/{EmployeeList-CUd3VH5h.js → EmployeeList-DN2pnXcS.js} +7 -7
  5. package/dist/GrantUserList-DoyxknJZ.js +464 -0
  6. package/dist/{Main-DgemO-iy.js → Main-B5BKGpLg.js} +13 -11
  7. package/dist/Main-BGONIxo8.js +122 -0
  8. package/dist/{Main-B_L5flWT.js → Main-DQj4xtkB.js} +10 -8
  9. package/dist/{PermissionSetList-BaC4lKV5.js → PermissionSetList-4uIU9FvN.js} +13 -12
  10. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-D0luaKDb.js +4122 -0
  11. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_79737e32_lang-DbPzVpnG.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DVVSBIx2.js} +1 -1
  12. package/dist/{RoleList-CThb6VEd.js → RoleList-Bj5Y5jd_.js} +12 -11
  13. package/dist/TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js +37 -0
  14. package/dist/TeamMemberList-Byjlca2Y.js +1216 -0
  15. package/dist/{TimesheetList-C_IMtsTH.js → TimesheetList-DwIcsOM-.js} +47 -46
  16. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-DGwteHIL.js → TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-B9qlQ6KG.js} +14 -13
  17. package/dist/{app-BW91YDke.js → app-BZwE2coe.js} +2512 -2035
  18. package/dist/app.js +1 -1
  19. package/dist/approval-code-Q4666xp5.js +58 -0
  20. package/dist/{dayjs.min-DwQTpnVK.js → dayjs.min-BXBPls4m.js} +1 -1
  21. package/dist/{employee-yM0kdY70.js → employee-CJTbs1f7.js} +27 -26
  22. package/dist/grant-user-CQZaTzVt.js +67 -0
  23. package/dist/{TableEmptyState.vue_vue_type_script_setup_true_lang-Ci_MVqGK.js → index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js} +19 -50
  24. package/dist/iteration-BCbIbdHR.js +7682 -0
  25. package/dist/{lodash-DLReQyP0.js → lodash-CUIS1iIz.js} +1 -1
  26. package/dist/restaurant-YOVMuuFY.js +1876 -0
  27. package/dist/role-CzXchcSS.js +82 -0
  28. package/dist/{rule-BJ-o-PKi.js → rule-BO6xj2Xa.js} +37 -36
  29. package/dist/src/api/approval-code/index.d.ts +7 -0
  30. package/dist/src/router/shared.d.ts +3 -1
  31. package/dist/src/stores/approval-code.d.ts +140 -0
  32. package/dist/src/types/approval-code.d.ts +114 -0
  33. package/dist/src/views/approval-code/ApprovalCodeList.vue.d.ts +26 -0
  34. package/dist/src/views/approval-code/components/ApprovalCodeCreatedDialog.vue.d.ts +9 -0
  35. package/dist/src/views/approval-code/components/ApprovalCodeForm.vue.d.ts +22 -0
  36. package/dist/src/views/approval-code/locales/index.d.ts +360 -0
  37. package/dist/src/views/pos-access/locales/index.d.ts +48 -0
  38. package/dist/src/views/team/locales/index.d.ts +8 -0
  39. package/dist/style.css +1 -1
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/useAppStore-DNTlIeMv.js +93 -0
  42. package/dist/{useLoading-B89K5XKO.js → useLoading-BH02lYns.js} +1 -1
  43. package/dist/{useReportPermissions-Bjfhr6FD.js → useReportPermissions-Q-xLwz5N.js} +3 -3
  44. package/package.json +1 -1
  45. package/dist/Main-DUbLeLlK.js +0 -577
  46. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DddOxcG_.js +0 -4121
  47. package/dist/TeamMemberList-CAw4jr1b.js +0 -1186
  48. package/dist/iteration-Dj50K6I7.js +0 -9556
  49. package/dist/useAppStore-CHkGWiai.js +0 -169
  50. /package/dist/src/views/{grant → pos-access}/Main.vue.d.ts +0 -0
package/dist/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as e, i as r, r as o } from "./app-BW91YDke.js";
1
+ import { j as e, i as r, r as o } from "./app-BZwE2coe.js";
2
2
  export {
3
3
  e as FmApp,
4
4
  r as i18nMessages,
@@ -0,0 +1,58 @@
1
+ import { defineStore as C } from "pinia";
2
+ import { ref as l } from "vue";
3
+ import { g as p, b as s } from "./restaurant-YOVMuuFY.js";
4
+ const n = {
5
+ async getApprovalCodes() {
6
+ return p(await s("approval-codes").get(""));
7
+ },
8
+ async createApprovalCodes(r) {
9
+ return p(await s("approval-codes").post("", r));
10
+ },
11
+ async revokeApprovalCode(r, a) {
12
+ return p(
13
+ await s("approval-codes").patch(`/revoke/${r}`, null, {
14
+ params: { restaurantId: a }
15
+ })
16
+ );
17
+ }
18
+ }, A = C("approvalCode", () => {
19
+ const r = l([]), a = l(!1);
20
+ async function d() {
21
+ a.value = !0;
22
+ try {
23
+ r.value = (await n.getApprovalCodes()).sort(
24
+ (o, e) => o.createdAt < e.createdAt ? 1 : -1
25
+ );
26
+ } catch (o) {
27
+ throw console.error("Error reading approval codes:", o), o;
28
+ } finally {
29
+ a.value = !1;
30
+ }
31
+ }
32
+ async function v(o) {
33
+ try {
34
+ const e = await n.createApprovalCodes(o);
35
+ return r.value = [...e, ...r.value], e;
36
+ } catch (e) {
37
+ throw console.error("Error creating approval codes:", e), e;
38
+ }
39
+ }
40
+ async function i(o, e) {
41
+ try {
42
+ const t = await n.revokeApprovalCode(o, e), c = r.value.findIndex((u) => u._id === o);
43
+ c !== -1 && (r.value[c] = t);
44
+ } catch (t) {
45
+ throw console.error("Error revoking approval code:", t), t;
46
+ }
47
+ }
48
+ return {
49
+ approvalCodes: r,
50
+ isLoading: a,
51
+ readApprovalCodes: d,
52
+ createApprovalCodes: v,
53
+ revokeApprovalCode: i
54
+ };
55
+ }), g = A;
56
+ export {
57
+ g as u
58
+ };
@@ -1,4 +1,4 @@
1
- import { g as Q, c as K } from "./app-BW91YDke.js";
1
+ import { g as Q, c as K } from "./app-BZwE2coe.js";
2
2
  var E = { exports: {} };
3
3
  (function(V, X) {
4
4
  (function(W, k) {
@@ -1,17 +1,18 @@
1
- import { d as g } from "./dayjs.min-DwQTpnVK.js";
1
+ import { d as g } from "./dayjs.min-BXBPls4m.js";
2
2
  import { defineStore as $, storeToRefs as T } from "pinia";
3
3
  import { ref as m } from "vue";
4
- import { b as l, g as f, u as w, s as E } from "./iteration-Dj50K6I7.js";
4
+ import { s as E } from "./iteration-BCbIbdHR.js";
5
+ import { b as i, g as f, u as w } from "./restaurant-YOVMuuFY.js";
5
6
  import { i as v } from "./utils-BZkjJbju.js";
6
- import { u as _ } from "./useAppStore-CHkGWiai.js";
7
+ import { u as _ } from "./role-CzXchcSS.js";
7
8
  const o = {
8
9
  async readEmployees() {
9
- return f(await l().get("/pos-users"));
10
+ return f(await i().get("/pos-users"));
10
11
  },
11
12
  async readEmployeesPage(e) {
12
13
  var t, p;
13
14
  return f(
14
- await l().get("/pos-users/paged", {
15
+ await i().get("/pos-users/paged", {
15
16
  params: {
16
17
  limit: e.limit,
17
18
  offset: e.offset,
@@ -23,22 +24,22 @@ const o = {
23
24
  );
24
25
  },
25
26
  async createEmployee(e) {
26
- await l().post("/pos-users", e);
27
+ await i().post("/pos-users", e);
27
28
  },
28
29
  async createMasterEmployee(e) {
29
- await l().post("/pos-users/master-user", e);
30
+ await i().post("/pos-users/master-user", e);
30
31
  },
31
32
  async migrateToMasterEmployee(e, t) {
32
- await l().put(`/pos-users/migrate/${e}`, t);
33
+ await i().put(`/pos-users/migrate/${e}`, t);
33
34
  },
34
35
  async updateEmployee(e, t) {
35
- await l().put(`/pos-users/${e}`, t);
36
+ await i().put(`/pos-users/${e}`, t);
36
37
  },
37
38
  async updateMasterEmployee(e, t) {
38
- await l().put(`/pos-users/master-user/${e}`, t);
39
+ await i().put(`/pos-users/master-user/${e}`, t);
39
40
  },
40
41
  async deleteEmployee(e) {
41
- await l().put(`/pos-users/${e._id}`, {
42
+ await i().put(`/pos-users/${e._id}`, {
42
43
  user: e,
43
44
  roles: [],
44
45
  previousRoles: e.restaurants.map((t) => ({
@@ -48,7 +49,7 @@ const o = {
48
49
  });
49
50
  },
50
51
  async deleteMasterEmployee(e) {
51
- await l().put(`/pos-users/master-user/${e._id}`, {
52
+ await i().put(`/pos-users/master-user/${e._id}`, {
52
53
  user: e,
53
54
  roles: [],
54
55
  previousRoles: e.restaurants.map((t) => ({
@@ -59,11 +60,11 @@ const o = {
59
60
  },
60
61
  async generateEmployeePasscode() {
61
62
  return `${f(
62
- await l().get("/pos-users/generate-passcode")
63
+ await i().get("/pos-users/generate-passcode")
63
64
  )}`;
64
65
  },
65
66
  async syncUsersMeta() {
66
- await l().post("/pos-users/create-users-meta");
67
+ await i().post("/pos-users/create-users-meta");
67
68
  }
68
69
  };
69
70
  async function h(e) {
@@ -135,22 +136,22 @@ const R = $("employee", () => {
135
136
  async function a(s) {
136
137
  try {
137
138
  c.value = !0, await e.readRestaurants();
138
- const i = await o.readEmployeesPage(s);
139
- p.value = i.items.map(M), u.value = i.total;
139
+ const l = await o.readEmployeesPage(s);
140
+ p.value = l.items.map(M), u.value = l.total;
140
141
  } finally {
141
142
  c.value = !1;
142
143
  }
143
144
  }
144
- async function n(s, i) {
145
+ async function n(s, l) {
145
146
  await e.readRestaurants();
146
- const I = i ?? (await o.readEmployeesPage({ ...s, limit: 1, offset: 0 })).total;
147
+ const I = l ?? (await o.readEmployeesPage({ ...s, limit: 1, offset: 0 })).total;
147
148
  return I === 0 ? [] : (await o.readEmployeesPage({ ...s, limit: I, offset: 0 })).items.map(M);
148
149
  }
149
150
  async function d(s) {
150
151
  await o.createEmployee(s);
151
152
  }
152
- async function y(s, i) {
153
- await o.updateEmployee(s, i);
153
+ async function y(s, l) {
154
+ await o.updateEmployee(s, l);
154
155
  }
155
156
  async function P(s) {
156
157
  await o.deleteEmployee(s);
@@ -161,11 +162,11 @@ const R = $("employee", () => {
161
162
  async function N(s) {
162
163
  await o.createMasterEmployee(s);
163
164
  }
164
- async function S(s, i) {
165
- await o.updateMasterEmployee(s, i);
165
+ async function S(s, l) {
166
+ await o.updateMasterEmployee(s, l);
166
167
  }
167
- async function D(s, i) {
168
- await o.migrateToMasterEmployee(s, i);
168
+ async function D(s, l) {
169
+ await o.migrateToMasterEmployee(s, l);
169
170
  }
170
171
  async function U() {
171
172
  await o.syncUsersMeta();
@@ -187,7 +188,7 @@ const R = $("employee", () => {
187
188
  migrateToMasterUser: D,
188
189
  syncUsersMeta: U
189
190
  };
190
- }), k = () => {
191
+ }), z = () => {
191
192
  const e = R();
192
193
  return {
193
194
  ...e,
@@ -196,5 +197,5 @@ const R = $("employee", () => {
196
197
  };
197
198
  export {
198
199
  o as E,
199
- k as u
200
+ z as u
200
201
  };
@@ -0,0 +1,67 @@
1
+ import { defineStore as f } from "pinia";
2
+ import { ref as u } from "vue";
3
+ import { g as s, a as v, b as o } from "./restaurant-YOVMuuFY.js";
4
+ const c = {
5
+ async getGrantUsers() {
6
+ return s(await o("grant").get(""));
7
+ },
8
+ async createGrantUser(r) {
9
+ return s(await o("grant").post("", r));
10
+ },
11
+ async revokeGrantUser(r, a) {
12
+ return s(
13
+ await o("grant").patch(`/revoke/${r}`, null, {
14
+ params: { restaurantId: a }
15
+ })
16
+ );
17
+ },
18
+ // Test grant validation
19
+ async validatePasscode(r, a) {
20
+ return s(
21
+ await v().post("", {
22
+ passcode: r,
23
+ restaurantId: a
24
+ })
25
+ );
26
+ }
27
+ }, w = f("grantUser", () => {
28
+ const r = u([]), a = u(!1);
29
+ async function l() {
30
+ a.value = !0;
31
+ try {
32
+ r.value = (await c.getGrantUsers()).sort(
33
+ (e, t) => e.createdAt < t.createdAt ? 1 : -1
34
+ );
35
+ } catch (e) {
36
+ throw console.error("Error reading grant users:", e), e;
37
+ } finally {
38
+ a.value = !1;
39
+ }
40
+ }
41
+ async function g(e) {
42
+ try {
43
+ const t = await c.createGrantUser(e);
44
+ return r.value = [t, ...r.value], t;
45
+ } catch (t) {
46
+ throw console.error("Error creating grant user:", t), t;
47
+ }
48
+ }
49
+ async function U(e, t) {
50
+ try {
51
+ const n = await c.revokeGrantUser(e, t), i = r.value.findIndex((d) => d._id === e);
52
+ i !== -1 && (r.value[i] = n);
53
+ } catch (n) {
54
+ throw console.error("Error revoking grant user:", n), n;
55
+ }
56
+ }
57
+ return {
58
+ grantUsers: r,
59
+ isLoading: a,
60
+ readGrantUsers: l,
61
+ createGrantUser: g,
62
+ revokeGrantUser: U
63
+ };
64
+ }), h = w;
65
+ export {
66
+ h as u
67
+ };