@feedmepos/mf-hrm-portal 2.4.2-dev.2 → 2.4.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 (112) hide show
  1. package/dist/{ApprovalCodeList-b8usXKo8.js → ApprovalCodeList-DGLPcQcv.js} +15 -14
  2. package/dist/{AuditLogList-DqbgzFAs.js → AuditLogList-ahJwTF7N.js} +12 -12
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-IPkyxwIF.js +438 -0
  4. package/dist/EmployeeList-B18mlY4V.js +776 -0
  5. package/dist/FormItem.vue_vue_type_script_setup_true_lang-Dvo9AiKf.js +45 -0
  6. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  7. package/dist/{GrantUserList-B-p8Qghu.js → GrantUserList-C8BbP99C.js} +16 -15
  8. package/dist/{Main-D_EXStcl.js → Main-BA29_N_p.js} +2280 -2274
  9. package/dist/{Main-x6An4Vlq.js → Main-BN3b_yie.js} +5 -5
  10. package/dist/Main-Clux_qKN.js +96 -0
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
  12. package/dist/{PermissionSetList-D4Vdbk10.js → PermissionSetList-BSOJ8ftd.js} +108 -107
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Hz_rFmbH.js +4181 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-BwuBk683.js +35 -0
  15. package/dist/RoleList-EnfxydGa.js +740 -0
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-DiWJzXvb.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-yIdd8r7y.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-O7ohVH-K.js → ScheduleGeneralPage-CFUqm5-r.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-DOkdX3vt.js → ScheduleModal.vue_vue_type_script_setup_true_lang-BmPrGRG2.js} +186 -187
  19. package/dist/{SchedulePage-WT_Ttars.js → SchedulePage-DEFQwipO.js} +16 -16
  20. package/dist/{SchedulePositionPage-13qwxMn2.js → SchedulePositionPage-CM5NS5-F.js} +3 -3
  21. package/dist/{SelectFilter-DbE6YV-6.js → SelectFilter-DgjR5o5E.js} +1 -1
  22. package/dist/TeamMemberList-BKvhHLNG.js +1150 -0
  23. package/dist/TimesheetList-EQRMimP7.js +402 -0
  24. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_ffd7f807_lang-_tXql6vR.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-BumkwWvb.js} +7 -7
  25. package/dist/{app-D-6Rxcbg.js → app-Bkc0pF3P.js} +3929 -7722
  26. package/dist/app.js +3 -3
  27. package/dist/{approval-code-Ba9JpPf4.js → approval-code-BKMu1GDn.js} +1 -1
  28. package/dist/{dayjs.min-dCnie4oC.js → dayjs.min-CkI2q2aC.js} +24 -24
  29. package/dist/employee-BfkxCdPL.js +209 -0
  30. package/dist/{grant-user-Dpla60s_.js → grant-user-ClN_vTOv.js} +1 -1
  31. package/dist/{index-D8G0ElDc.js → iteration-CsNIceUp.js} +558 -573
  32. package/dist/{lodash-CucBZWOa.js → lodash-BgraJgCc.js} +1 -1
  33. package/dist/restaurant-CRNgiIa4.js +2685 -0
  34. package/dist/role-CZYSdVn2.js +91 -0
  35. package/dist/rule-_4roLZrG.js +780 -0
  36. package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
  37. package/dist/src/helpers/iteration.d.ts +2 -9
  38. package/dist/src/helpers/permission-set.d.ts +102 -1
  39. package/dist/src/helpers/rule.d.ts +2 -2
  40. package/dist/src/helpers/string.d.ts +1 -10
  41. package/dist/src/router/shared.d.ts +1 -3
  42. package/dist/src/stores/restaurant.d.ts +7 -7
  43. package/dist/src/stores/team.d.ts +0 -30
  44. package/dist/src/types/team.d.ts +1 -17
  45. package/dist/src/views/audit-log/locales/index.d.ts +0 -12
  46. package/dist/src/views/hr/locales/index.d.ts +0 -20
  47. package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
  48. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  49. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  50. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  51. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  52. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
  53. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
  54. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
  55. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
  56. package/dist/src/views/team/locales/index.d.ts +0 -716
  57. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
  58. package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
  59. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
  60. package/dist/string-VNuQNweN.js +15 -0
  61. package/dist/style.css +1 -1
  62. package/dist/tsconfig.app.tsbuildinfo +1 -1
  63. package/dist/{useAppStore-C_LStOtj.js → useAppStore-DYmF1kgk.js} +1 -1
  64. package/dist/{useLoading-CJ-DUrnR.js → useLoading-C2UKuAxD.js} +1 -1
  65. package/dist/{useReportPermissions-C7TLMKuR.js → useReportPermissions-BiaXRc0p.js} +22 -22
  66. package/package.json +1 -1
  67. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-WeFI9muF.js +0 -459
  68. package/dist/EmployeeList-NM0guUbU.js +0 -896
  69. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BCNKeDZY.js +0 -90
  70. package/dist/Main-BrhCJsik.js +0 -101
  71. package/dist/MyPosProfile-CG1PZ5p4.js +0 -360
  72. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
  73. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CFyGZpKr.js +0 -4212
  74. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CTxqUf16.js +0 -1797
  75. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-DUhqZaQv.js +0 -547
  76. package/dist/RoleList-DFcy90mE.js +0 -274
  77. package/dist/TeamMemberList-CWfXQcO3.js +0 -2082
  78. package/dist/TimesheetList-Bp2hRf7V.js +0 -408
  79. package/dist/employee-B5qCkaCi.js +0 -237
  80. package/dist/member-grant-CZILo1nC.js +0 -54
  81. package/dist/restaurant-CD6RZ8XG.js +0 -49
  82. package/dist/role-54DbS-Cy.js +0 -91
  83. package/dist/rule-DzTp1Kjh.js +0 -845
  84. package/dist/src/api/my-pos-profile/index.d.ts +0 -3
  85. package/dist/src/api/sso-provider/index.d.ts +0 -5
  86. package/dist/src/api/staff-invite/index.d.ts +0 -16
  87. package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
  88. package/dist/src/composables/useMenuAccess.d.ts +0 -56
  89. package/dist/src/composables/useSsoProviders.d.ts +0 -19
  90. package/dist/src/composables/useStaffInviteProviders.d.ts +0 -8
  91. package/dist/src/helpers/employee-merge.d.ts +0 -33
  92. package/dist/src/helpers/member-grant.d.ts +0 -36
  93. package/dist/src/helpers/my-pos-profile.d.ts +0 -37
  94. package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
  95. package/dist/src/helpers/restaurant-lookup.d.ts +0 -19
  96. package/dist/src/helpers/role-merge.d.ts +0 -11
  97. package/dist/src/helpers/staff-invite.d.ts +0 -54
  98. package/dist/src/router/menu-access-guard.d.ts +0 -17
  99. package/dist/src/types/my-pos-profile.d.ts +0 -24
  100. package/dist/src/types/sso-provider.d.ts +0 -10
  101. package/dist/src/types/staff-invite.d.ts +0 -100
  102. package/dist/src/views/hr/timesheet/timesheet-view.d.ts +0 -29
  103. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +0 -2
  104. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
  105. package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -236
  106. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
  107. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
  108. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +0 -11
  109. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
  110. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
  111. package/dist/string-DZQ1uNjn.js +0 -22
  112. package/dist/useSsoProviders-DhmUc7LW.js +0 -41
package/dist/app.js CHANGED
@@ -1,6 +1,6 @@
1
- import { K as e, J as o, L as p } from "./app-D-6Rxcbg.js";
1
+ import { j as e, i as r, r as o } from "./app-Bkc0pF3P.js";
2
2
  export {
3
3
  e as FmApp,
4
- o as i18nMessages,
5
- p as routes
4
+ r as i18nMessages,
5
+ o as routes
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { defineStore as A } from "pinia";
2
2
  import { ref as l } from "vue";
3
- import { g as p, b as s } from "./app-D-6Rxcbg.js";
3
+ import { g as p, b as s } from "./restaurant-CRNgiIa4.js";
4
4
  const n = {
5
5
  async getApprovalCodes() {
6
6
  return p(await s("approval-codes").get(""));
@@ -1,10 +1,10 @@
1
- import { B as Q, z as K } from "./app-D-6Rxcbg.js";
1
+ import { g as Q, f as K } from "./app-Bkc0pF3P.js";
2
2
  var E = { exports: {} };
3
3
  (function(V, X) {
4
4
  (function(W, k) {
5
5
  V.exports = k();
6
6
  })(K, function() {
7
- var W = 1e3, k = 6e4, N = 36e5, A = "millisecond", S = "second", w = "minute", O = "hour", M = "day", T = "week", m = "month", U = "quarter", v = "year", _ = "date", z = "Invalid Date", B = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, q = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, G = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(s) {
7
+ var W = 1e3, k = 6e4, N = 36e5, A = "millisecond", S = "second", w = "minute", O = "hour", M = "day", T = "week", m = "month", U = "quarter", v = "year", _ = "date", J = "Invalid Date", q = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, B = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, G = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(s) {
8
8
  var n = ["th", "st", "nd", "rd"], t = s % 100;
9
9
  return "[" + s + (n[(t - 20) % 10] || n[t] || n[0]) + "]";
10
10
  } }, I = function(s, n, t) {
@@ -23,21 +23,21 @@ var E = { exports: {} };
23
23
  return { M: m, y: v, w: T, d: M, D: _, h: O, m: w, s: S, ms: A, Q: U }[s] || String(s || "").toLowerCase().replace(/s$/, "");
24
24
  }, u: function(s) {
25
25
  return s === void 0;
26
- } }, x = "en", D = {};
27
- D[x] = G;
28
- var J = "$isDayjsObject", F = function(s) {
29
- return s instanceof C || !(!s || !s[J]);
26
+ } }, x = "en", g = {};
27
+ g[x] = G;
28
+ var Z = "$isDayjsObject", F = function(s) {
29
+ return s instanceof C || !(!s || !s[Z]);
30
30
  }, j = function s(n, t, r) {
31
31
  var e;
32
32
  if (!n) return x;
33
33
  if (typeof n == "string") {
34
34
  var i = n.toLowerCase();
35
- D[i] && (e = i), t && (D[i] = t, e = i);
35
+ g[i] && (e = i), t && (g[i] = t, e = i);
36
36
  var u = n.split("-");
37
37
  if (!e && u.length > 1) return s(u[0]);
38
38
  } else {
39
39
  var o = n.name;
40
- D[o] = n, e = o;
40
+ g[o] = n, e = o;
41
41
  }
42
42
  return !r && e && (x = e), e || !r && x;
43
43
  }, f = function(s, n) {
@@ -50,7 +50,7 @@ var E = { exports: {} };
50
50
  };
51
51
  var C = function() {
52
52
  function s(t) {
53
- this.$L = j(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[J] = !0;
53
+ this.$L = j(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[Z] = !0;
54
54
  }
55
55
  var n = s.prototype;
56
56
  return n.parse = function(t) {
@@ -60,7 +60,7 @@ var E = { exports: {} };
60
60
  if (a.u(e)) return /* @__PURE__ */ new Date();
61
61
  if (e instanceof Date) return new Date(e);
62
62
  if (typeof e == "string" && !/Z$/i.test(e)) {
63
- var u = e.match(B);
63
+ var u = e.match(q);
64
64
  if (u) {
65
65
  var o = u[2] - 1 || 0, c = (u[7] || "0").substring(0, 3);
66
66
  return i ? new Date(Date.UTC(u[1], o, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, c)) : new Date(u[1], o, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, c);
@@ -74,7 +74,7 @@ var E = { exports: {} };
74
74
  }, n.$utils = function() {
75
75
  return a;
76
76
  }, n.isValid = function() {
77
- return this.$d.toString() !== z;
77
+ return this.$d.toString() !== J;
78
78
  }, n.isSame = function(t, r) {
79
79
  var e = f(t);
80
80
  return this.startOf(r) <= e && e <= this.endOf(r);
@@ -101,7 +101,7 @@ var E = { exports: {} };
101
101
  case m:
102
102
  return i ? o(1, d) : o(0, d + 1);
103
103
  case T:
104
- var g = this.$locale().weekStart || 0, Y = (h < g ? h + 7 : h) - g;
104
+ var D = this.$locale().weekStart || 0, Y = (h < D ? h + 7 : h) - D;
105
105
  return o(i ? l - Y : l + (6 - Y), d);
106
106
  case M:
107
107
  case _:
@@ -145,8 +145,8 @@ var E = { exports: {} };
145
145
  return this.add(-1 * t, r);
146
146
  }, n.format = function(t) {
147
147
  var r = this, e = this.$locale();
148
- if (!this.isValid()) return e.invalidDate || z;
149
- var i = t || "YYYY-MM-DDTHH:mm:ssZ", u = a.z(this), o = this.$H, c = this.$m, h = this.$M, d = e.weekdays, l = e.months, b = e.meridiem, g = function($, y, H, L) {
148
+ if (!this.isValid()) return e.invalidDate || J;
149
+ var i = t || "YYYY-MM-DDTHH:mm:ssZ", u = a.z(this), o = this.$H, c = this.$m, h = this.$M, d = e.weekdays, l = e.months, b = e.meridiem, D = function($, y, H, L) {
150
150
  return $ && ($[y] || $(r, i)) || H[y].slice(0, L);
151
151
  }, Y = function($) {
152
152
  return a.s(o % 12 || 12, $, "0");
@@ -154,7 +154,7 @@ var E = { exports: {} };
154
154
  var L = $ < 12 ? "AM" : "PM";
155
155
  return H ? L.toLowerCase() : L;
156
156
  };
157
- return i.replace(q, function($, y) {
157
+ return i.replace(B, function($, y) {
158
158
  return y || function(H) {
159
159
  switch (H) {
160
160
  case "YY":
@@ -166,9 +166,9 @@ var E = { exports: {} };
166
166
  case "MM":
167
167
  return a.s(h + 1, 2, "0");
168
168
  case "MMM":
169
- return g(e.monthsShort, h, l, 3);
169
+ return D(e.monthsShort, h, l, 3);
170
170
  case "MMMM":
171
- return g(l, h);
171
+ return D(l, h);
172
172
  case "D":
173
173
  return r.$D;
174
174
  case "DD":
@@ -176,9 +176,9 @@ var E = { exports: {} };
176
176
  case "d":
177
177
  return String(r.$W);
178
178
  case "dd":
179
- return g(e.weekdaysMin, r.$W, d, 2);
179
+ return D(e.weekdaysMin, r.$W, d, 2);
180
180
  case "ddd":
181
- return g(e.weekdaysShort, r.$W, d, 3);
181
+ return D(e.weekdaysShort, r.$W, d, 3);
182
182
  case "dddd":
183
183
  return d[r.$W];
184
184
  case "H":
@@ -247,7 +247,7 @@ var E = { exports: {} };
247
247
  }, n.daysInMonth = function() {
248
248
  return this.endOf(m).$D;
249
249
  }, n.$locale = function() {
250
- return D[this.$L];
250
+ return g[this.$L];
251
251
  }, n.locale = function(t, r) {
252
252
  if (!t) return this.$L;
253
253
  var e = this.clone(), i = j(t, r, !0);
@@ -263,16 +263,16 @@ var E = { exports: {} };
263
263
  }, n.toString = function() {
264
264
  return this.$d.toUTCString();
265
265
  }, s;
266
- }(), Z = C.prototype;
267
- return f.prototype = Z, [["$ms", A], ["$s", S], ["$m", w], ["$H", O], ["$W", M], ["$M", m], ["$y", v], ["$D", _]].forEach(function(s) {
268
- Z[s[1]] = function(n) {
266
+ }(), z = C.prototype;
267
+ return f.prototype = z, [["$ms", A], ["$s", S], ["$m", w], ["$H", O], ["$W", M], ["$M", m], ["$y", v], ["$D", _]].forEach(function(s) {
268
+ z[s[1]] = function(n) {
269
269
  return this.$g(n, s[0], s[1]);
270
270
  };
271
271
  }), f.extend = function(s, n) {
272
272
  return s.$i || (s(n, C, f), s.$i = !0), f;
273
273
  }, f.locale = j, f.isDayjs = F, f.unix = function(s) {
274
274
  return f(1e3 * s);
275
- }, f.en = D[x], f.Ls = D, f.p = {}, f;
275
+ }, f.en = g[x], f.Ls = g, f.p = {}, f;
276
276
  });
277
277
  })(E);
278
278
  var R = E.exports;
@@ -0,0 +1,209 @@
1
+ import { d as g } from "./dayjs.min-CkI2q2aC.js";
2
+ import { defineStore as $, storeToRefs as h } from "pinia";
3
+ import { ref as y } from "vue";
4
+ import { s as E } from "./iteration-CsNIceUp.js";
5
+ import { b as l, g as m, u as I } from "./restaurant-CRNgiIa4.js";
6
+ import { i as v } from "./utils-BZkjJbju.js";
7
+ import { u as P } from "./role-CZYSdVn2.js";
8
+ const o = {
9
+ async readEmployees() {
10
+ return m(await l().get("/pos-users"));
11
+ },
12
+ async readEmployeesPage(e) {
13
+ var s, i;
14
+ return m(
15
+ await l().get("/pos-users/paged", {
16
+ params: {
17
+ limit: e.limit,
18
+ offset: e.offset,
19
+ search: e.search,
20
+ restaurantIds: (s = e.restaurantIds) != null && s.length ? e.restaurantIds : void 0,
21
+ roleIds: (i = e.roleIds) != null && i.length ? e.roleIds : void 0,
22
+ includeEmptyPasscode: e.includeEmptyPasscode || void 0
23
+ }
24
+ })
25
+ );
26
+ },
27
+ async createEmployee(e) {
28
+ return m(
29
+ await l().post("/pos-users", e)
30
+ ).employeeId;
31
+ },
32
+ async createMasterEmployee(e) {
33
+ return m(
34
+ await l().post("/pos-users/master-user", e)
35
+ ).employeeId;
36
+ },
37
+ async migrateToMasterEmployee(e, s) {
38
+ await l().put(`/pos-users/migrate/${e}`, s);
39
+ },
40
+ async updateEmployee(e, s) {
41
+ await l().put(`/pos-users/${e}`, s);
42
+ },
43
+ async updateMasterEmployee(e, s) {
44
+ await l().put(`/pos-users/master-user/${e}`, s);
45
+ },
46
+ async deleteEmployee(e) {
47
+ await l().put(`/pos-users/${e._id}`, {
48
+ user: e,
49
+ roles: [],
50
+ previousRoles: e.restaurants.map((s) => ({
51
+ restaurantId: s.restaurantId,
52
+ roleId: s.roleId
53
+ }))
54
+ });
55
+ },
56
+ async deleteMasterEmployee(e) {
57
+ await l().put(`/pos-users/master-user/${e._id}`, {
58
+ user: e,
59
+ roles: [],
60
+ previousRoles: e.restaurants.map((s) => ({
61
+ restaurantId: s.restaurantId,
62
+ roleId: s.roleId
63
+ }))
64
+ });
65
+ },
66
+ async generateEmployeePasscode(e) {
67
+ return `${m(
68
+ await l().post("/pos-users/generate-passcode", {
69
+ restaurantIds: e.restaurantIds,
70
+ excludePosUserId: e.excludePosUserId
71
+ })
72
+ )}`;
73
+ },
74
+ async syncUsersMeta() {
75
+ await l().post("/pos-users/create-users-meta");
76
+ }
77
+ };
78
+ async function x(e) {
79
+ const s = P().roles.value, { restaurants: i } = I(), c = new Map(
80
+ i.value.map((a) => [a._id, a.profile.name])
81
+ ), u = new Map(s.map((a) => [a._id, a.name])), r = /* @__PURE__ */ new Map();
82
+ for (const a of e) {
83
+ const n = {
84
+ restaurantId: a.restaurantId,
85
+ restaurantName: c.get(a.restaurantId) || "",
86
+ roleId: a.role,
87
+ roleName: u.get(a.role) || ""
88
+ }, d = r.get(a._id);
89
+ if (!d) {
90
+ r.set(a._id, {
91
+ ...a,
92
+ isRestricted: !1,
93
+ since: g(v(a._id)).format("DD/MM/YYYY"),
94
+ restaurants: [n]
95
+ });
96
+ continue;
97
+ }
98
+ d.restaurants.some((f) => f.restaurantId === a.restaurantId) || (d.restaurants = E([...d.restaurants, n], {
99
+ selector: "restaurantName"
100
+ }));
101
+ }
102
+ return E([...r.values()], { selector: "name" });
103
+ }
104
+ function M(e) {
105
+ const { restaurants: s } = I(), i = P().roles.value, c = new Map(
106
+ s.value.map((a) => [a._id, a])
107
+ ), u = new Map(i.map((a) => [a._id, a.name])), r = e.restaurantRole[0];
108
+ return {
109
+ _id: e._id,
110
+ name: e.name,
111
+ code: e.code,
112
+ passcode: e.passcode,
113
+ isMasterUser: e.isMasterUser,
114
+ isRestricted: e.isRestricted,
115
+ restaurantId: (r == null ? void 0 : r.restaurantId) || "",
116
+ role: (r == null ? void 0 : r.roleId) || "",
117
+ since: g(v(e._id)).format("DD/MM/YYYY"),
118
+ restaurants: E(
119
+ e.restaurantRole.map((a) => {
120
+ const n = c.get(a.restaurantId);
121
+ return {
122
+ restaurantId: a.restaurantId,
123
+ restaurantName: (n == null ? void 0 : n.profile.name) || "",
124
+ restaurantCode: (n == null ? void 0 : n.profile.code) ?? void 0,
125
+ roleId: a.roleId,
126
+ roleName: u.get(a.roleId) || ""
127
+ };
128
+ }),
129
+ { selector: "restaurantName" }
130
+ )
131
+ };
132
+ }
133
+ const T = $("hrm-employee", () => {
134
+ const e = I(), s = y([]), i = y([]), c = y(0), u = y(!1);
135
+ async function r() {
136
+ try {
137
+ u.value = !0, await e.readRestaurants();
138
+ const t = await o.readEmployees();
139
+ s.value = await x(t);
140
+ } finally {
141
+ u.value = !1;
142
+ }
143
+ }
144
+ async function a(t) {
145
+ try {
146
+ u.value = !0, await e.readRestaurants();
147
+ const p = await o.readEmployeesPage(t);
148
+ i.value = p.items.map(M), c.value = p.total;
149
+ } finally {
150
+ u.value = !1;
151
+ }
152
+ }
153
+ async function n(t, p) {
154
+ await e.readRestaurants();
155
+ const w = p ?? (await o.readEmployeesPage({ ...t, limit: 1, offset: 0 })).total;
156
+ return w === 0 ? [] : (await o.readEmployeesPage({ ...t, limit: w, offset: 0 })).items.map(M);
157
+ }
158
+ async function d(t) {
159
+ return o.createEmployee(t);
160
+ }
161
+ async function f(t, p) {
162
+ await o.updateEmployee(t, p);
163
+ }
164
+ async function _(t) {
165
+ await o.deleteEmployee(t);
166
+ }
167
+ async function U(t) {
168
+ await o.deleteMasterEmployee(t);
169
+ }
170
+ async function Y(t) {
171
+ return o.createMasterEmployee(t);
172
+ }
173
+ async function N(t, p) {
174
+ await o.updateMasterEmployee(t, p);
175
+ }
176
+ async function S(t, p) {
177
+ await o.migrateToMasterEmployee(t, p);
178
+ }
179
+ async function D() {
180
+ await o.syncUsersMeta();
181
+ }
182
+ return {
183
+ employees: s,
184
+ listEmployees: i,
185
+ totalEmployees: c,
186
+ isLoading: u,
187
+ readEmployees: r,
188
+ readEmployeesPage: a,
189
+ readAllEmployeesPage: n,
190
+ createEmployee: d,
191
+ updateEmployee: f,
192
+ deleteEmployee: _,
193
+ createMasterEmployee: Y,
194
+ updateMasterEmployee: N,
195
+ deleteMasterEmployee: U,
196
+ migrateToMasterUser: S,
197
+ syncUsersMeta: D
198
+ };
199
+ }), z = () => {
200
+ const e = T();
201
+ return {
202
+ ...e,
203
+ ...h(e)
204
+ };
205
+ };
206
+ export {
207
+ o as E,
208
+ z as u
209
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineStore as f } from "pinia";
2
2
  import { ref as u } from "vue";
3
- import { g as s, e as v, b as o } from "./app-D-6Rxcbg.js";
3
+ import { g as s, a as v, b as o } from "./restaurant-CRNgiIa4.js";
4
4
  const c = {
5
5
  async getGrantUsers() {
6
6
  return s(await o("grant").get(""));