@feedmepos/mf-hrm-portal 2.3.2-dev.17 → 2.3.2-dev.19

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 (116) hide show
  1. package/dist/{ApprovalCodeList-Bo8IbNxV.js → ApprovalCodeList-CiZcp75s.js} +14 -15
  2. package/dist/{AuditLogList-C7CjPILA.js → AuditLogList-AVdhUk22.js} +823 -833
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CGsOJ4bA.js +459 -0
  4. package/dist/EmployeeList-DmB3wCwv.js +896 -0
  5. package/dist/FormSection.vue_vue_type_script_setup_true_lang-Qsc3hk6l.js +90 -0
  6. package/dist/{GrantUserList-CXWGr3Wo.js → GrantUserList-CUWnDKaH.js} +15 -16
  7. package/dist/Main-CbJjQFFR.js +101 -0
  8. package/dist/{Main-bru10M5U.js → Main-D7CAtkiV.js} +2274 -2280
  9. package/dist/{Main-DeuWov9n.js → Main-DT4TJPRM.js} +5 -5
  10. package/dist/MyPosProfile-EWK8IPlZ.js +360 -0
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +126 -0
  12. package/dist/{PermissionSetList--xt0piQz.js → PermissionSetList-D2HDsSFi.js} +136 -137
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BUSup81G.js +4212 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-B1sb_3ow.js +1797 -0
  15. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-D-Gve4l8.js +547 -0
  16. package/dist/RoleList-DRFTQcwP.js +274 -0
  17. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Cqo5kHcF.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-b96QQsiZ.js} +1 -1
  18. package/dist/{ScheduleGeneralPage-DxhgBLix.js → ScheduleGeneralPage-DO6ZO_7t.js} +2 -2
  19. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-DGPwmNQb.js → ScheduleModal.vue_vue_type_script_setup_true_lang-BG0-qg1-.js} +187 -186
  20. package/dist/{SchedulePage-oBdEvGWN.js → SchedulePage-m9fYfgEO.js} +20 -20
  21. package/dist/{SchedulePositionPage-BZps-kKs.js → SchedulePositionPage-B9M8bgu1.js} +3 -3
  22. package/dist/{SelectFilter-Bs_LCk3L.js → SelectFilter-qanI8DEh.js} +1 -1
  23. package/dist/TeamMemberList-D7PIM3xv.js +2082 -0
  24. package/dist/TimesheetList-C_XQe3jl.js +408 -0
  25. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-Dv66Af5C.js → TimesheetList.vue_vue_type_style_index_0_scoped_ffd7f807_lang-D6qTouaS.js} +7 -7
  26. package/dist/{app-B8xnhtVI.js → app-BuJGxfu4.js} +7973 -4103
  27. package/dist/app.js +3 -3
  28. package/dist/{approval-code-B0jU1bvk.js → approval-code-HPeWQne5.js} +1 -1
  29. package/dist/{dayjs.min-CdpSCqn1.js → dayjs.min-CLUgksBW.js} +34 -34
  30. package/dist/employee-DrsTtOKq.js +237 -0
  31. package/dist/{grant-user-C3C6glCk.js → grant-user-J6TSUXHn.js} +1 -1
  32. package/dist/{iteration-BM0iyDBd.js → index-Dl7XhjSB.js} +573 -558
  33. package/dist/{lodash-KK9U7NAy.js → lodash-CMqarlaS.js} +1 -1
  34. package/dist/member-grant-BeNgG3hd.js +54 -0
  35. package/dist/restaurant-9Y8x8pCL.js +49 -0
  36. package/dist/role-COuuwMES.js +91 -0
  37. package/dist/rule-50_hBJQJ.js +845 -0
  38. package/dist/src/api/my-pos-profile/index.d.ts +3 -0
  39. package/dist/src/api/sso-provider/index.d.ts +5 -0
  40. package/dist/src/api/staff-invite/index.d.ts +16 -0
  41. package/dist/src/components/CollapsibleWrapper.vue.d.ts +11 -3
  42. package/dist/src/components/form/SegmentedTabs.vue.d.ts +23 -0
  43. package/dist/src/composables/useMenuAccess.d.ts +56 -0
  44. package/dist/src/composables/useSsoProviders.d.ts +19 -0
  45. package/dist/src/composables/useStaffInviteProviders.d.ts +8 -0
  46. package/dist/src/composables/useTenant.d.ts +11 -0
  47. package/dist/src/helpers/employee-merge.d.ts +33 -0
  48. package/dist/src/helpers/iteration.d.ts +9 -2
  49. package/dist/src/helpers/member-grant.d.ts +36 -0
  50. package/dist/src/helpers/my-pos-profile.d.ts +37 -0
  51. package/dist/src/helpers/permission-set.d.ts +1 -102
  52. package/dist/src/helpers/pos-assignment-rows.d.ts +28 -0
  53. package/dist/src/helpers/restaurant-lookup.d.ts +19 -0
  54. package/dist/src/helpers/role-merge.d.ts +11 -0
  55. package/dist/src/helpers/rule.d.ts +2 -2
  56. package/dist/src/helpers/staff-invite.d.ts +54 -0
  57. package/dist/src/helpers/string.d.ts +10 -1
  58. package/dist/src/router/courtGuard.d.ts +4 -0
  59. package/dist/src/router/menu-access-guard.d.ts +17 -0
  60. package/dist/src/router/shared.d.ts +3 -1
  61. package/dist/src/stores/restaurant.d.ts +7 -7
  62. package/dist/src/stores/team.d.ts +31 -1
  63. package/dist/src/types/my-pos-profile.d.ts +24 -0
  64. package/dist/src/types/sso-provider.d.ts +10 -0
  65. package/dist/src/types/staff-invite.d.ts +100 -0
  66. package/dist/src/types/team.d.ts +17 -1
  67. package/dist/src/views/audit-log/locales/index.d.ts +12 -0
  68. package/dist/src/views/audit-log/useTraceIdDeepLink.d.ts +1 -1
  69. package/dist/src/views/hr/locales/index.d.ts +20 -0
  70. package/dist/src/views/hr/role/RoleForm.vue.d.ts +29 -2
  71. package/dist/src/views/hr/timesheet/timesheet-view.d.ts +29 -0
  72. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +2 -0
  73. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +4 -0
  74. package/dist/src/views/my-pos-profile/locales/index.d.ts +236 -0
  75. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  76. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  77. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  78. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  79. package/dist/src/views/team/components/BasePermission.vue.d.ts +11 -0
  80. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +11 -0
  81. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +51 -0
  82. package/dist/src/views/team/{member/MemberInfo.vue.d.ts → components/MemberStatusBadge.vue.d.ts} +2 -2
  83. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +21 -0
  84. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +44 -0
  85. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +11 -0
  86. package/dist/src/views/team/locales/index.d.ts +716 -0
  87. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +48 -3
  88. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +11 -0
  89. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +35 -0
  90. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +19 -0
  91. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +1 -0
  92. package/dist/string-DZQ1uNjn.js +22 -0
  93. package/dist/style.css +1 -1
  94. package/dist/tsconfig.app.tsbuildinfo +1 -1
  95. package/dist/{useAppStore-C1lk2Q2j.js → useAppStore-BCvZUxKY.js} +1 -1
  96. package/dist/{useLoading-CXdGsnHm.js → useLoading-BOt2Is3p.js} +1 -1
  97. package/dist/useReportPermissions-BVTpovDL.js +80 -0
  98. package/dist/useSsoProviders-Bec-WHC7.js +41 -0
  99. package/package.json +2 -2
  100. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-C-4BaMN-.js +0 -438
  101. package/dist/EmployeeList-BOP-gaTp.js +0 -776
  102. package/dist/FormItem.vue_vue_type_script_setup_true_lang-BEOR-8QD.js +0 -45
  103. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
  104. package/dist/Main-BrP1frfO.js +0 -96
  105. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +0 -243
  106. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-D5nvRsW3.js +0 -4167
  107. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DiNDrCy0.js +0 -35
  108. package/dist/RoleList-BEE-8EQK.js +0 -740
  109. package/dist/TeamMemberList-DCgNcs4P.js +0 -1154
  110. package/dist/TimesheetList-BW6iCigo.js +0 -402
  111. package/dist/employee-DlFGiUgI.js +0 -209
  112. package/dist/restaurant-C7o2Yk6j.js +0 -2688
  113. package/dist/role-DYCorsOh.js +0 -92
  114. package/dist/rule-BhGHZqKO.js +0 -783
  115. package/dist/string-VNuQNweN.js +0 -15
  116. package/dist/useReportPermissions-D_I4rFVo.js +0 -82
package/dist/app.js CHANGED
@@ -1,6 +1,6 @@
1
- import { l as e, j as r, r as o } from "./app-B8xnhtVI.js";
1
+ import { K as e, J as o, L as p } from "./app-BuJGxfu4.js";
2
2
  export {
3
3
  e as FmApp,
4
- r as i18nMessages,
5
- o as routes
4
+ o as i18nMessages,
5
+ p 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 "./restaurant-C7o2Yk6j.js";
3
+ import { g as p, b as s } from "./app-BuJGxfu4.js";
4
4
  const n = {
5
5
  async getApprovalCodes() {
6
6
  return p(await s("approval-codes").get(""));
@@ -1,10 +1,10 @@
1
- import { h as Q, g as K } from "./app-B8xnhtVI.js";
1
+ import { z as Q, y as K } from "./app-BuJGxfu4.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", 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", y = "year", _ = "date", z = "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) {
@@ -20,24 +20,24 @@ var E = { exports: {} };
20
20
  }, a: function(s) {
21
21
  return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
22
22
  }, p: function(s) {
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$/, "");
23
+ return { M: m, y, 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", g = {};
27
- g[x] = G;
28
- var Z = "$isDayjsObject", F = function(s) {
29
- return s instanceof C || !(!s || !s[Z]);
26
+ } }, x = "en", D = {};
27
+ D[x] = G;
28
+ var J = "$isDayjsObject", F = function(s) {
29
+ return s instanceof C || !(!s || !s[J]);
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
- g[i] && (e = i), t && (g[i] = t, e = i);
35
+ D[i] && (e = i), t && (D[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
- g[o] = n, e = o;
40
+ D[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[Z] = !0;
53
+ this.$L = j(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[J] = !0;
54
54
  }
55
55
  var n = s.prototype;
56
56
  return n.parse = function(t) {
@@ -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() !== J;
77
+ return this.$d.toString() !== z;
78
78
  }, n.isSame = function(t, r) {
79
79
  var e = f(t);
80
80
  return this.startOf(r) <= e && e <= this.endOf(r);
@@ -90,18 +90,18 @@ var E = { exports: {} };
90
90
  return this.$d.getTime();
91
91
  }, n.startOf = function(t, r) {
92
92
  var e = this, i = !!a.u(r) || r, u = a.p(t), o = function(p, $) {
93
- var y = a.w(e.$u ? Date.UTC(e.$y, $, p) : new Date(e.$y, $, p), e);
94
- return i ? y : y.endOf(M);
93
+ var v = a.w(e.$u ? Date.UTC(e.$y, $, p) : new Date(e.$y, $, p), e);
94
+ return i ? v : v.endOf(M);
95
95
  }, c = function(p, $) {
96
96
  return a.w(e.toDate()[p].apply(e.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice($)), e);
97
97
  }, h = this.$W, d = this.$M, l = this.$D, b = "set" + (this.$u ? "UTC" : "");
98
98
  switch (u) {
99
- case v:
99
+ case y:
100
100
  return i ? o(1, 0) : o(31, 11);
101
101
  case m:
102
102
  return i ? o(1, d) : o(0, d + 1);
103
103
  case T:
104
- var D = this.$locale().weekStart || 0, Y = (h < D ? h + 7 : h) - D;
104
+ var g = this.$locale().weekStart || 0, Y = (h < g ? h + 7 : h) - g;
105
105
  return o(i ? l - Y : l + (6 - Y), d);
106
106
  case M:
107
107
  case _:
@@ -118,8 +118,8 @@ var E = { exports: {} };
118
118
  }, n.endOf = function(t) {
119
119
  return this.startOf(t, !1);
120
120
  }, n.$set = function(t, r) {
121
- var e, i = a.p(t), u = "set" + (this.$u ? "UTC" : ""), o = (e = {}, e[M] = u + "Date", e[_] = u + "Date", e[m] = u + "Month", e[v] = u + "FullYear", e[O] = u + "Hours", e[w] = u + "Minutes", e[S] = u + "Seconds", e[A] = u + "Milliseconds", e)[i], c = i === M ? this.$D + (r - this.$W) : r;
122
- if (i === m || i === v) {
121
+ var e, i = a.p(t), u = "set" + (this.$u ? "UTC" : ""), o = (e = {}, e[M] = u + "Date", e[_] = u + "Date", e[m] = u + "Month", e[y] = u + "FullYear", e[O] = u + "Hours", e[w] = u + "Minutes", e[S] = u + "Seconds", e[A] = u + "Milliseconds", e)[i], c = i === M ? this.$D + (r - this.$W) : r;
122
+ if (i === m || i === y) {
123
123
  var h = this.clone().set(_, 1);
124
124
  h.$d[o](c), h.init(), this.$d = h.set(_, Math.min(this.$D, h.daysInMonth())).$d;
125
125
  } else o && this.$d[o](c);
@@ -136,7 +136,7 @@ var E = { exports: {} };
136
136
  return a.w(l.date(l.date() + Math.round(d * t)), i);
137
137
  };
138
138
  if (u === m) return this.set(m, this.$M + t);
139
- if (u === v) return this.set(v, this.$y + t);
139
+ if (u === y) return this.set(y, this.$y + t);
140
140
  if (u === M) return o(1);
141
141
  if (u === T) return o(7);
142
142
  var c = (e = {}, e[w] = k, e[O] = N, e[S] = W, e)[u] || 1, h = this.$d.getTime() + t * c;
@@ -145,17 +145,17 @@ 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 || 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
- return $ && ($[y] || $(r, i)) || H[y].slice(0, L);
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($, v, H, L) {
150
+ return $ && ($[v] || $(r, i)) || H[v].slice(0, L);
151
151
  }, Y = function($) {
152
152
  return a.s(o % 12 || 12, $, "0");
153
- }, p = b || function($, y, H) {
153
+ }, p = b || function($, v, H) {
154
154
  var L = $ < 12 ? "AM" : "PM";
155
155
  return H ? L.toLowerCase() : L;
156
156
  };
157
- return i.replace(B, function($, y) {
158
- return y || function(H) {
157
+ return i.replace(B, function($, v) {
158
+ return v || function(H) {
159
159
  switch (H) {
160
160
  case "YY":
161
161
  return String(r.$y).slice(-2);
@@ -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 D(e.monthsShort, h, l, 3);
169
+ return g(e.monthsShort, h, l, 3);
170
170
  case "MMMM":
171
- return D(l, h);
171
+ return g(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 D(e.weekdaysMin, r.$W, d, 2);
179
+ return g(e.weekdaysMin, r.$W, d, 2);
180
180
  case "ddd":
181
- return D(e.weekdaysShort, r.$W, d, 3);
181
+ return g(e.weekdaysShort, r.$W, d, 3);
182
182
  case "dddd":
183
183
  return d[r.$W];
184
184
  case "H":
@@ -216,7 +216,7 @@ var E = { exports: {} };
216
216
  return a.m(u, c);
217
217
  };
218
218
  switch (o) {
219
- case v:
219
+ case y:
220
220
  i = l() / 12;
221
221
  break;
222
222
  case m:
@@ -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 g[this.$L];
250
+ return D[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", y], ["$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 = g[x], f.Ls = g, f.p = {}, f;
275
+ }, f.en = D[x], f.Ls = D, f.p = {}, f;
276
276
  });
277
277
  })(E);
278
278
  var R = E.exports;
@@ -0,0 +1,237 @@
1
+ import { defineStore as U, storeToRefs as $ } from "pinia";
2
+ import { toRaw as y, ref as I } from "vue";
3
+ import { a as T, s as E } from "./index-Dl7XhjSB.js";
4
+ import { b as p, g as m } from "./app-BuJGxfu4.js";
5
+ import { d as D } from "./dayjs.min-CLUgksBW.js";
6
+ import { i as Y } from "./utils-BZkjJbju.js";
7
+ import { u as M } from "./role-COuuwMES.js";
8
+ import { u as b } from "./restaurant-9Y8x8pCL.js";
9
+ function g(e) {
10
+ return D(Y(e)).format("DD/MM/YYYY");
11
+ }
12
+ function j(e, s, l) {
13
+ const c = new Map(y(s).map((t) => [t._id, t.profile.name])), a = new Map(y(l).map((t) => [t._id, t.name])), r = /* @__PURE__ */ new Map();
14
+ for (const t of e) {
15
+ const f = {
16
+ restaurantId: t.restaurantId,
17
+ restaurantName: c.get(t.restaurantId) || "",
18
+ roleId: t.role,
19
+ roleName: a.get(t.role) || ""
20
+ }, i = r.get(t._id);
21
+ i ? i.outletIds.has(t.restaurantId) || (i.outletIds.add(t.restaurantId), i.employee.restaurants.push(f)) : r.set(t._id, {
22
+ employee: {
23
+ ...t,
24
+ isRestricted: !1,
25
+ since: g(t._id),
26
+ restaurants: [f]
27
+ },
28
+ outletIds: /* @__PURE__ */ new Set([t.restaurantId])
29
+ });
30
+ }
31
+ const n = [];
32
+ for (const { employee: t } of r.values())
33
+ t.restaurants = E(t.restaurants, { selector: "restaurantName" }), n.push(t);
34
+ return E(n, { selector: "name" });
35
+ }
36
+ function A(e, s) {
37
+ const l = new Map(y(e).map((a) => [a._id, a])), c = new Map(y(s).map((a) => [a._id, a.name]));
38
+ return (a) => {
39
+ const r = a.restaurantRole[0];
40
+ return {
41
+ _id: a._id,
42
+ name: a.name,
43
+ code: a.code,
44
+ passcode: a.passcode,
45
+ isMasterUser: a.isMasterUser,
46
+ isRestricted: a.isRestricted,
47
+ restaurantId: (r == null ? void 0 : r.restaurantId) || "",
48
+ role: (r == null ? void 0 : r.roleId) || "",
49
+ since: g(a._id),
50
+ restaurants: E(
51
+ a.restaurantRole.map((n) => {
52
+ const t = l.get(n.restaurantId);
53
+ return {
54
+ restaurantId: n.restaurantId,
55
+ restaurantName: (t == null ? void 0 : t.profile.name) || "",
56
+ restaurantCode: (t == null ? void 0 : t.profile.code) ?? void 0,
57
+ roleId: n.roleId,
58
+ roleName: c.get(n.roleId) || ""
59
+ };
60
+ }),
61
+ { selector: "restaurantName" }
62
+ )
63
+ };
64
+ };
65
+ }
66
+ function J(e, s, l) {
67
+ const { nameById: c } = T(s), a = /* @__PURE__ */ new Map();
68
+ for (const r of y(l))
69
+ a.has(r._id) || a.set(r._id, r.name);
70
+ return e.flatMap(
71
+ (r) => r.restaurants.map((n, t) => ({
72
+ code: t === 0 ? Reflect.get(r, "code") : "",
73
+ name: t === 0 ? r.name : "",
74
+ passcode: t === 0 ? r.passcode : "",
75
+ since: t === 0 ? r.since : "",
76
+ restaurant: c.get(n.restaurantId) || "",
77
+ role: a.get(n.roleId) || ""
78
+ }))
79
+ );
80
+ }
81
+ const u = {
82
+ async readEmployees() {
83
+ return m(await p().get("/pos-users"));
84
+ },
85
+ async readEmployeesPage(e) {
86
+ var s, l;
87
+ return m(
88
+ await p().get("/pos-users/paged", {
89
+ params: {
90
+ limit: e.limit,
91
+ offset: e.offset,
92
+ search: e.search,
93
+ restaurantIds: (s = e.restaurantIds) != null && s.length ? e.restaurantIds : void 0,
94
+ roleIds: (l = e.roleIds) != null && l.length ? e.roleIds : void 0,
95
+ includeEmptyPasscode: e.includeEmptyPasscode || void 0
96
+ }
97
+ })
98
+ );
99
+ },
100
+ async createEmployee(e) {
101
+ return m(
102
+ await p().post("/pos-users", e)
103
+ ).employeeId;
104
+ },
105
+ async createMasterEmployee(e) {
106
+ return m(
107
+ await p().post("/pos-users/master-user", e)
108
+ ).employeeId;
109
+ },
110
+ async migrateToMasterEmployee(e, s) {
111
+ await p().put(`/pos-users/migrate/${e}`, s);
112
+ },
113
+ async updateEmployee(e, s) {
114
+ await p().put(`/pos-users/${e}`, s);
115
+ },
116
+ async updateMasterEmployee(e, s) {
117
+ await p().put(`/pos-users/master-user/${e}`, s);
118
+ },
119
+ async deleteEmployee(e) {
120
+ await p().put(`/pos-users/${e._id}`, {
121
+ user: e,
122
+ roles: [],
123
+ previousRoles: e.restaurants.map((s) => ({
124
+ restaurantId: s.restaurantId,
125
+ roleId: s.roleId
126
+ }))
127
+ });
128
+ },
129
+ async deleteMasterEmployee(e) {
130
+ await p().put(`/pos-users/master-user/${e._id}`, {
131
+ user: e,
132
+ roles: [],
133
+ previousRoles: e.restaurants.map((s) => ({
134
+ restaurantId: s.restaurantId,
135
+ roleId: s.roleId
136
+ }))
137
+ });
138
+ },
139
+ async generateEmployeePasscode(e) {
140
+ return `${m(
141
+ await p().post("/pos-users/generate-passcode", {
142
+ restaurantIds: e.restaurantIds,
143
+ excludePosUserId: e.excludePosUserId
144
+ })
145
+ )}`;
146
+ },
147
+ async syncUsersMeta() {
148
+ await p().post("/pos-users/create-users-meta");
149
+ }
150
+ }, x = U("hrm-employee", () => {
151
+ const e = b(), s = I([]), l = I([]), c = I(0), a = I(!1);
152
+ function r() {
153
+ return A(
154
+ e.restaurants.value,
155
+ M().roles.value
156
+ );
157
+ }
158
+ async function n() {
159
+ try {
160
+ a.value = !0, await e.readRestaurants();
161
+ const o = await u.readEmployees();
162
+ s.value = j(
163
+ o,
164
+ e.restaurants.value,
165
+ M().roles.value
166
+ );
167
+ } finally {
168
+ a.value = !1;
169
+ }
170
+ }
171
+ async function t(o) {
172
+ try {
173
+ a.value = !0, await e.readRestaurants();
174
+ const d = await u.readEmployeesPage(o);
175
+ l.value = d.items.map(r()), c.value = d.total;
176
+ } finally {
177
+ a.value = !1;
178
+ }
179
+ }
180
+ async function f(o, d) {
181
+ await e.readRestaurants();
182
+ const w = d ?? (await u.readEmployeesPage({ ...o, limit: 1, offset: 0 })).total;
183
+ return w === 0 ? [] : (await u.readEmployeesPage({ ...o, limit: w, offset: 0 })).items.map(r());
184
+ }
185
+ async function i(o) {
186
+ return u.createEmployee(o);
187
+ }
188
+ async function v(o, d) {
189
+ await u.updateEmployee(o, d);
190
+ }
191
+ async function _(o) {
192
+ await u.deleteEmployee(o);
193
+ }
194
+ async function P(o) {
195
+ await u.deleteMasterEmployee(o);
196
+ }
197
+ async function h(o) {
198
+ return u.createMasterEmployee(o);
199
+ }
200
+ async function S(o, d) {
201
+ await u.updateMasterEmployee(o, d);
202
+ }
203
+ async function N(o, d) {
204
+ await u.migrateToMasterEmployee(o, d);
205
+ }
206
+ async function R() {
207
+ await u.syncUsersMeta();
208
+ }
209
+ return {
210
+ employees: s,
211
+ listEmployees: l,
212
+ totalEmployees: c,
213
+ isLoading: a,
214
+ readEmployees: n,
215
+ readEmployeesPage: t,
216
+ readAllEmployeesPage: f,
217
+ createEmployee: i,
218
+ updateEmployee: v,
219
+ deleteEmployee: _,
220
+ createMasterEmployee: h,
221
+ updateMasterEmployee: S,
222
+ deleteMasterEmployee: P,
223
+ migrateToMasterUser: N,
224
+ syncUsersMeta: R
225
+ };
226
+ }), K = () => {
227
+ const e = x();
228
+ return {
229
+ ...e,
230
+ ...$(e)
231
+ };
232
+ };
233
+ export {
234
+ u as E,
235
+ J as t,
236
+ K as u
237
+ };
@@ -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, a as v, b as o } from "./restaurant-C7o2Yk6j.js";
3
+ import { g as s, e as v, b as o } from "./app-BuJGxfu4.js";
4
4
  const c = {
5
5
  async getGrantUsers() {
6
6
  return s(await o("grant").get(""));