@feedmepos/mf-hrm-portal 2.3.2-dev.9 → 2.3.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 (114) hide show
  1. package/dist/{ApprovalCodeList-gb0bre9J.js → ApprovalCodeList-C9r8CGNH.js} +15 -14
  2. package/dist/{AuditLogList-9cwS6bL7.js → AuditLogList-Cu-KcQKa.js} +152 -147
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BQ-uIsTN.js +438 -0
  4. package/dist/EmployeeList-BaFqZnFM.js +776 -0
  5. package/dist/FormItem.vue_vue_type_script_setup_true_lang-Be1OU1_r.js +45 -0
  6. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  7. package/dist/{GrantUserList-yU2NqFVO.js → GrantUserList-Bjhx60M7.js} +16 -15
  8. package/dist/Main-CJQpjOgY.js +96 -0
  9. package/dist/{Main-4KwMqF3h.js → Main-DHiTgiDR.js} +5 -5
  10. package/dist/{Main-BS_Lk_eB.js → Main-LpfQqR_u.js} +999 -1005
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
  12. package/dist/{PermissionSetList-D7SS1iAr.js → PermissionSetList-C0OZ_dvE.js} +80 -80
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-T7dkd5Uv.js +4167 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-EwU7gHP7.js +35 -0
  15. package/dist/RoleList-DpyW5XLs.js +740 -0
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang--dsZOhnv.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CqP-Dn1X.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-Pq6ufiDu.js → ScheduleGeneralPage-BNHi5jGf.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-DKFJLsTW.js → ScheduleModal.vue_vue_type_script_setup_true_lang-B609MZoP.js} +186 -187
  19. package/dist/{SchedulePage-8EAOfiJx.js → SchedulePage-CrP5_m3p.js} +13 -13
  20. package/dist/{SchedulePositionPage-CGXeUnju.js → SchedulePositionPage-ei_NKAUw.js} +3 -3
  21. package/dist/{SelectFilter-C-UEVLla.js → SelectFilter-CEYQ-ViE.js} +1 -1
  22. package/dist/TeamMemberList-rPiKKu2b.js +1154 -0
  23. package/dist/TimesheetList-B1L4WkNh.js +402 -0
  24. package/dist/TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-By6YR-k2.js +58 -0
  25. package/dist/{app-BohKQtlz.js → app-BzlH-2cN.js} +4015 -7796
  26. package/dist/app.js +3 -3
  27. package/dist/{approval-code-Bfvxsg8h.js → approval-code-CWq2ce3u.js} +1 -1
  28. package/dist/{dayjs.min-C0MqTPg1.js → dayjs.min-D6T4JzVv.js} +21 -21
  29. package/dist/employee-Bw7kRokg.js +209 -0
  30. package/dist/{grant-user-LZ3b6siI.js → grant-user-q_mkj3Vh.js} +1 -1
  31. package/dist/{index-DDDG-LHm.js → iteration-Dz0e08VH.js} +726 -698
  32. package/dist/{lodash-BRqMda7F.js → lodash-DGG_-VgI.js} +1 -1
  33. package/dist/restaurant-DJBQY9N5.js +2688 -0
  34. package/dist/role-CiRbkZSm.js +92 -0
  35. package/dist/rule-DMgkHpva.js +783 -0
  36. package/dist/src/api/employee/index.d.ts +2 -1
  37. package/dist/src/api/timesheet/index.d.ts +1 -1
  38. package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
  39. package/dist/src/helpers/permission-set.d.ts +102 -1
  40. package/dist/src/helpers/rule.d.ts +2 -2
  41. package/dist/src/helpers/string.d.ts +1 -10
  42. package/dist/src/router/shared.d.ts +1 -3
  43. package/dist/src/stores/employee.d.ts +7 -1
  44. package/dist/src/stores/restaurant.d.ts +8 -68
  45. package/dist/src/stores/team.d.ts +0 -30
  46. package/dist/src/stores/timesheet.d.ts +51 -66
  47. package/dist/src/types/team.d.ts +1 -17
  48. package/dist/src/types/timesheet.d.ts +0 -3
  49. package/dist/src/views/audit-log/constants.d.ts +1 -1
  50. package/dist/src/views/audit-log/locales/index.d.ts +16 -12
  51. package/dist/src/views/hr/locales/index.d.ts +0 -20
  52. package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
  53. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  54. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  55. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  56. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  57. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
  58. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
  59. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
  60. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
  61. package/dist/src/views/team/locales/index.d.ts +0 -716
  62. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
  63. package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
  64. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
  65. package/dist/string-VNuQNweN.js +15 -0
  66. package/dist/style.css +1 -1
  67. package/dist/tsconfig.app.tsbuildinfo +1 -1
  68. package/dist/{useAppStore-DV13z6oc.js → useAppStore-TRX-PQD4.js} +1 -1
  69. package/dist/{useLoading-Fcnnfywt.js → useLoading-W3YSF8OB.js} +1 -1
  70. package/dist/{useReportPermissions-BcyVoKVq.js → useReportPermissions-CCkCAaGO.js} +13 -13
  71. package/package.json +3 -3
  72. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-DR-c15gr.js +0 -459
  73. package/dist/EmployeeList-DjyoW1we.js +0 -896
  74. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BBWlADve.js +0 -90
  75. package/dist/Main-BuG7SPnC.js +0 -101
  76. package/dist/MyPosProfile-CuDzRaRS.js +0 -360
  77. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
  78. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-u1UlV2Aw.js +0 -4208
  79. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CYkv2x_y.js +0 -1831
  80. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-hiMgwiya.js +0 -547
  81. package/dist/RoleList-B3P-LQYV.js +0 -265
  82. package/dist/TeamMemberList-Bd1O44Ur.js +0 -2087
  83. package/dist/TimesheetList-CSCmigCM.js +0 -437
  84. package/dist/employee-DWxT78W2.js +0 -172
  85. package/dist/iteration-CcXrOMQe.js +0 -30
  86. package/dist/member-grant-a3AGCWfT.js +0 -54
  87. package/dist/restaurant-pL7vHt-H.js +0 -52
  88. package/dist/role--EKCVqho.js +0 -98
  89. package/dist/rule-Db3gFVHx.js +0 -843
  90. package/dist/src/api/my-pos-profile/index.d.ts +0 -3
  91. package/dist/src/api/sso-provider/index.d.ts +0 -5
  92. package/dist/src/api/staff-invite/index.d.ts +0 -16
  93. package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
  94. package/dist/src/composables/useMenuAccess.d.ts +0 -56
  95. package/dist/src/composables/useSsoProviders.d.ts +0 -19
  96. package/dist/src/composables/useStaffInviteProviders.d.ts +0 -8
  97. package/dist/src/helpers/member-grant.d.ts +0 -36
  98. package/dist/src/helpers/my-pos-profile.d.ts +0 -37
  99. package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
  100. package/dist/src/helpers/staff-invite.d.ts +0 -54
  101. package/dist/src/router/menu-access-guard.d.ts +0 -17
  102. package/dist/src/types/my-pos-profile.d.ts +0 -24
  103. package/dist/src/types/sso-provider.d.ts +0 -10
  104. package/dist/src/types/staff-invite.d.ts +0 -100
  105. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +0 -2
  106. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
  107. package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -236
  108. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
  109. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
  110. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +0 -11
  111. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
  112. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
  113. package/dist/string-DZQ1uNjn.js +0 -22
  114. package/dist/timesheet-NYW1P4rf.js +0 -76
package/dist/app.js CHANGED
@@ -1,6 +1,6 @@
1
- import { E as e, D as o, F as p } from "./app-BohKQtlz.js";
1
+ import { j as e, i as r, r as o } from "./app-BzlH-2cN.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-BohKQtlz.js";
3
+ import { g as p, b as s } from "./restaurant-DJBQY9N5.js";
4
4
  const n = {
5
5
  async getApprovalCodes() {
6
6
  return p(await s("approval-codes").get(""));
@@ -1,10 +1,10 @@
1
- import { x as Q, w as K } from "./app-BohKQtlz.js";
1
+ import { g as Q, f as K } from "./app-BzlH-2cN.js";
2
2
  var E = { exports: {} };
3
3
  (function(V, X) {
4
- (function(W, x) {
5
- V.exports = x();
4
+ (function(W, k) {
5
+ V.exports = k();
6
6
  })(K, function() {
7
- var W = 1e3, x = 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) {
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,23 +23,23 @@ 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
- } }, k = "en", D = {};
27
- D[k] = G;
26
+ } }, x = "en", g = {};
27
+ g[x] = G;
28
28
  var Z = "$isDayjsObject", F = function(s) {
29
29
  return s instanceof C || !(!s || !s[Z]);
30
30
  }, j = function s(n, t, r) {
31
31
  var e;
32
- if (!n) return k;
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
- return !r && e && (k = e), e || !r && k;
42
+ return !r && e && (x = e), e || !r && x;
43
43
  }, f = function(s, n) {
44
44
  if (F(s)) return s.clone();
45
45
  var t = typeof n == "object" ? n : {};
@@ -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 _:
@@ -139,14 +139,14 @@ var E = { exports: {} };
139
139
  if (u === v) return this.set(v, this.$y + t);
140
140
  if (u === M) return o(1);
141
141
  if (u === T) return o(7);
142
- var c = (e = {}, e[w] = x, e[O] = N, e[S] = W, e)[u] || 1, h = this.$d.getTime() + t * c;
142
+ var c = (e = {}, e[w] = k, e[O] = N, e[S] = W, e)[u] || 1, h = this.$d.getTime() + t * c;
143
143
  return a.w(h, this);
144
144
  }, n.subtract = function(t, r) {
145
145
  return this.add(-1 * t, r);
146
146
  }, n.format = function(t) {
147
147
  var r = this, e = this.$locale();
148
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, g = function($, y, H, L) {
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");
@@ -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":
@@ -212,7 +212,7 @@ var E = { exports: {} };
212
212
  }, n.utcOffset = function() {
213
213
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
214
214
  }, n.diff = function(t, r, e) {
215
- var i, u = this, o = a.p(r), c = f(t), h = (c.utcOffset() - this.utcOffset()) * x, d = this - c, l = function() {
215
+ var i, u = this, o = a.p(r), c = f(t), h = (c.utcOffset() - this.utcOffset()) * k, d = this - c, l = function() {
216
216
  return a.m(u, c);
217
217
  };
218
218
  switch (o) {
@@ -235,7 +235,7 @@ var E = { exports: {} };
235
235
  i = d / N;
236
236
  break;
237
237
  case w:
238
- i = d / x;
238
+ i = d / k;
239
239
  break;
240
240
  case S:
241
241
  i = d / W;
@@ -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);
@@ -272,7 +272,7 @@ var E = { exports: {} };
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[k], 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-D6T4JzVv.js";
2
+ import { defineStore as $, storeToRefs as h } from "pinia";
3
+ import { ref as y } from "vue";
4
+ import { s as E } from "./iteration-Dz0e08VH.js";
5
+ import { b as l, g as m, u as I } from "./restaurant-DJBQY9N5.js";
6
+ import { i as v } from "./utils-BZkjJbju.js";
7
+ import { u as P } from "./role-CiRbkZSm.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-BohKQtlz.js";
3
+ import { g as s, a as v, b as o } from "./restaurant-DJBQY9N5.js";
4
4
  const c = {
5
5
  async getGrantUsers() {
6
6
  return s(await o("grant").get(""));