@feedmepos/mf-hrm-portal 2.3.2-dev.3 → 2.3.2-dev.5

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 (99) hide show
  1. package/dist/{ApprovalCodeList-D3U4nvlF.js → ApprovalCodeList-NYJNwdDZ.js} +14 -15
  2. package/dist/{AuditLogList-qGCW7tf0.js → AuditLogList-Ghn4aBnn.js} +12 -12
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BxZ9t3MZ.js +459 -0
  4. package/dist/EmployeeList-jc8LTznV.js +896 -0
  5. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DLgm6oCz.js +90 -0
  6. package/dist/{GrantUserList-C71pal0N.js → GrantUserList-BtPTpypR.js} +15 -16
  7. package/dist/Main-BF8hlYeV.js +101 -0
  8. package/dist/{Main-CCdTWngg.js → Main-BizCV-_x.js} +11 -11
  9. package/dist/{Main-BWJPyEU1.js → Main-McMZU_cR.js} +5 -5
  10. package/dist/MyPosProfile-BjeCnBvL.js +290 -0
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +126 -0
  12. package/dist/{PermissionSetList-BS-oBunI.js → PermissionSetList-NWLoqFHC.js} +45 -46
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-UPcpeVD5.js +4243 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-nwpdr7T7.js +1831 -0
  15. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-eT-dPsOX.js +547 -0
  16. package/dist/RoleList-CIfN10zu.js +274 -0
  17. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-BXihM4sl.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CMTXC_UR.js} +1 -1
  18. package/dist/{ScheduleGeneralPage-DpNvWNGs.js → ScheduleGeneralPage-8vS1DUrk.js} +2 -2
  19. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-DIYLOF9N.js → ScheduleModal.vue_vue_type_script_setup_true_lang-Br4AcF1g.js} +187 -186
  20. package/dist/{SchedulePage-QW-cYvu2.js → SchedulePage-DqbE1PoV.js} +13 -13
  21. package/dist/{SchedulePositionPage-BtFfVo2N.js → SchedulePositionPage-DUnkT0Tp.js} +3 -3
  22. package/dist/{SelectFilter-BXeVKgHN.js → SelectFilter-voMj4_j1.js} +1 -1
  23. package/dist/TeamMemberList-DoEOWNDC.js +2086 -0
  24. package/dist/{TimesheetList-D-bESKe5.js → TimesheetList-BBv2SV96.js} +9 -9
  25. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-D0zAVqCa.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-h-bWBmpI.js} +3 -3
  26. package/dist/{app-D-MUq9Ab.js → app-CDCO87ji.js} +6389 -3455
  27. package/dist/app.js +3 -3
  28. package/dist/{approval-code-BXUiojPH.js → approval-code-CLE9s5dL.js} +1 -1
  29. package/dist/{dayjs.min-BZ1pM-6M.js → dayjs.min-BW6-XAUB.js} +21 -21
  30. package/dist/{employee-HQEU8fjb.js → employee-BaCU-FLC.js} +48 -47
  31. package/dist/{grant-user-CBJ3gEgW.js → grant-user-DMtilLJx.js} +1 -1
  32. package/dist/{iteration-ogxW2-Tv.js → iteration-CPLGGFBb.js} +1 -1
  33. package/dist/{lodash-Def4gaas.js → lodash-snXoiw60.js} +1 -1
  34. package/dist/member-grant-CJyOr-q0.js +55 -0
  35. package/dist/restaurant-BMlLIUqe.js +51 -0
  36. package/dist/{role-JDoDFVd9.js → role-DqcBOWHL.js} +5 -4
  37. package/dist/{rule-DPtqlnz-.js → rule-B5YNhGJ4.js} +105 -100
  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/helpers/member-grant.d.ts +36 -0
  47. package/dist/src/helpers/my-pos-profile.d.ts +37 -0
  48. package/dist/src/helpers/pos-assignment-rows.d.ts +28 -0
  49. package/dist/src/helpers/staff-invite.d.ts +54 -0
  50. package/dist/src/helpers/string.d.ts +10 -1
  51. package/dist/src/router/menu-access-guard.d.ts +17 -0
  52. package/dist/src/router/shared.d.ts +3 -1
  53. package/dist/src/stores/restaurant.d.ts +7 -7
  54. package/dist/src/stores/team.d.ts +30 -0
  55. package/dist/src/types/my-pos-profile.d.ts +24 -0
  56. package/dist/src/types/sso-provider.d.ts +10 -0
  57. package/dist/src/types/staff-invite.d.ts +100 -0
  58. package/dist/src/types/team.d.ts +17 -1
  59. package/dist/src/views/hr/locales/index.d.ts +20 -0
  60. package/dist/src/views/hr/role/RoleForm.vue.d.ts +29 -2
  61. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +2 -0
  62. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +4 -0
  63. package/dist/src/views/my-pos-profile/locales/index.d.ts +196 -0
  64. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  65. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  66. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  67. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  68. package/dist/src/views/team/components/BasePermission.vue.d.ts +11 -0
  69. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +11 -0
  70. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +51 -0
  71. package/dist/src/views/team/{member/MemberInfo.vue.d.ts → components/MemberStatusBadge.vue.d.ts} +2 -2
  72. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +21 -0
  73. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +44 -0
  74. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +11 -0
  75. package/dist/src/views/team/locales/index.d.ts +716 -0
  76. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +48 -3
  77. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +11 -0
  78. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +35 -0
  79. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +19 -0
  80. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +1 -0
  81. package/dist/string-DZQ1uNjn.js +22 -0
  82. package/dist/style.css +1 -1
  83. package/dist/tsconfig.app.tsbuildinfo +1 -1
  84. package/dist/{useAppStore-DZCdxlCd.js → useAppStore-pKAGQL6q.js} +1 -1
  85. package/dist/{useLoading-Nygx2zn8.js → useLoading-D67DIqfk.js} +1 -1
  86. package/dist/{useReportPermissions-CxV7Dz1B.js → useReportPermissions-CfgnE0NY.js} +5 -5
  87. package/package.json +1 -1
  88. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-B0VcRYUg.js +0 -438
  89. package/dist/EmployeeList-Bd73xDCX.js +0 -776
  90. package/dist/FormItem.vue_vue_type_script_setup_true_lang-cLEnrtC6.js +0 -45
  91. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
  92. package/dist/Main-DGf0bQvy.js +0 -96
  93. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +0 -243
  94. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CkOAT-oX.js +0 -4167
  95. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DQcgZ0nF.js +0 -35
  96. package/dist/RoleList-B_7UnVNb.js +0 -740
  97. package/dist/TeamMemberList-DoisBYnk.js +0 -1154
  98. package/dist/restaurant-D2mfKHaH.js +0 -1880
  99. package/dist/string-VNuQNweN.js +0 -15
@@ -1,10 +1,10 @@
1
- import { s as W, c as q, e as y } from "./iteration-ogxW2-Tv.js";
2
- import { h as O, c as V, d as _, v as F, n as h, O as ee, D as M } from "./app-D-MUq9Ab.js";
1
+ import { s as W, c as q, e as y } from "./iteration-CPLGGFBb.js";
2
+ import { g, b as v, y as O, n as z, m as _, z as F, v as x, C as S, O as ee, D as B } from "./app-CDCO87ji.js";
3
3
  import { s as se } from "./utils-BZkjJbju.js";
4
- import { g, b as v, q as x, u as te } from "./restaurant-D2mfKHaH.js";
5
- import { defineStore as z, storeToRefs as K } from "pinia";
6
- import { ref as S, computed as T } from "vue";
4
+ import { defineStore as V, storeToRefs as K } from "pinia";
5
+ import { ref as h, computed as J } from "vue";
7
6
  import { useCoreStore as X } from "@feedmepos/mf-common";
7
+ import { u as te } from "./restaurant-BMlLIUqe.js";
8
8
  const E = "/permission-sets", N = {
9
9
  async read() {
10
10
  return g(await v().get(E));
@@ -18,8 +18,8 @@ const E = "/permission-sets", N = {
18
18
  async delete(e) {
19
19
  return g(await v().delete(`${E}/${e}`));
20
20
  }
21
- }, ne = z("permissionSet", () => {
22
- const { currentBusiness: e } = X(), s = S([]), r = S(!1), n = S(null);
21
+ }, ne = V("permissionSet", () => {
22
+ const { currentBusiness: e } = X(), s = h([]), r = h(!1), n = h(null);
23
23
  async function i() {
24
24
  var l;
25
25
  const c = ((l = e.value) == null ? void 0 : l._id) ?? null;
@@ -38,7 +38,7 @@ const E = "/permission-sets", N = {
38
38
  }
39
39
  async function a(c, l) {
40
40
  const d = await N.update(c, l);
41
- s.value = u(s.value.map((f) => f.id === c ? d : f));
41
+ s.value = u(s.value.map((m) => m.id === c ? d : m));
42
42
  }
43
43
  async function o(c) {
44
44
  await N.delete(c), s.value = u(s.value.filter((l) => l.id !== c));
@@ -92,30 +92,30 @@ function Q(e) {
92
92
  return;
93
93
  }
94
94
  d.setNames.push(a.name);
95
- const f = D(d.conditions);
96
- if (!f || !c) {
95
+ const m = D(d.conditions);
96
+ if (!m || !c) {
97
97
  d.conditions = void 0;
98
98
  return;
99
99
  }
100
- for (const m in c)
101
- (o = f[m]) != null && o.$in && (u = c[m]) != null && u.$in ? f[m].$in = Array.from(
102
- /* @__PURE__ */ new Set([...f[m].$in, ...c[m].$in])
103
- ) : f[m] || (f[m] = c[m]);
104
- d.conditions = JSON.stringify(f);
100
+ for (const f in c)
101
+ (o = m[f]) != null && o.$in && (u = c[f]) != null && u.$in ? m[f].$in = Array.from(
102
+ /* @__PURE__ */ new Set([...m[f].$in, ...c[f].$in])
103
+ ) : m[f] || (m[f] = c[f]);
104
+ d.conditions = JSON.stringify(m);
105
105
  };
106
106
  for (const i of e)
107
107
  for (const t of i.permissions)
108
108
  n(t.inverted ? r : s, t, i);
109
109
  return [...Array.from(s.values()), ...Array.from(r.values())];
110
110
  }
111
- function B(e, s) {
111
+ function T(e, s) {
112
112
  return `${e}::${[...s].sort().join(",")}`;
113
113
  }
114
114
  function G(e, s) {
115
115
  const r = [...e], n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
116
116
  for (const o of e) {
117
117
  const u = O(o.subject);
118
- n.add(B(u, o.actions)), o.inverted && o.actions.includes("manage") && i.add(`set_${u}`), !o.inverted && o.actions.includes("manage") && t.add(u);
118
+ n.add(T(u, o.actions)), o.inverted && o.actions.includes("manage") && i.add(`set_${u}`), !o.inverted && o.actions.includes("manage") && t.add(u);
119
119
  }
120
120
  const a = [...e];
121
121
  for (; a.length > 0; ) {
@@ -125,12 +125,12 @@ function G(e, s) {
125
125
  const l = ie(o);
126
126
  o.source && !o.source.trace && (o.source = { ...o.source, trace: l });
127
127
  const d = [...l, `${c.name} (system)`];
128
- for (const f of c.permissions ?? []) {
129
- const m = O(f.subject), p = B(m, f.actions);
130
- n.has(p) || t.has(m) || (n.add(p), r.push({
131
- ...f,
128
+ for (const m of c.permissions ?? []) {
129
+ const f = O(m.subject), p = T(f, m.actions);
130
+ n.has(p) || t.has(f) || (n.add(p), r.push({
131
+ ...m,
132
132
  // FdoPermissionRule.fields is string[] | null; RawRule expects string[] | undefined
133
- fields: f.fields ?? void 0,
133
+ fields: m.fields ?? void 0,
134
134
  source: {
135
135
  type: "systemPermissionSet",
136
136
  permissionSetId: c.key,
@@ -139,9 +139,9 @@ function G(e, s) {
139
139
  }
140
140
  }));
141
141
  }
142
- for (const f of c.permissionSets ?? []) {
143
- const m = O(f), p = B(m, ["manage"]), b = {
144
- subject: m,
142
+ for (const m of c.permissionSets ?? []) {
143
+ const f = O(m), p = T(f, ["manage"]), b = {
144
+ subject: f,
145
145
  actions: ["manage"],
146
146
  source: {
147
147
  type: "systemPermissionSet",
@@ -226,28 +226,28 @@ function _e(e, s) {
226
226
  JSON.stringify(l) !== JSON.stringify(d) && t.push(c);
227
227
  continue;
228
228
  }
229
- const f = Object.keys(l)[0], m = l[f].$in.filter(
230
- (b) => !d[f].$in.includes(b)
229
+ const m = Object.keys(l)[0], f = l[m].$in.filter(
230
+ (b) => !d[m].$in.includes(b)
231
231
  );
232
- m.length > 0 && t.push(r(u, m)), d[f].$in.filter(
233
- (b) => !l[f].$in.includes(b)
232
+ f.length > 0 && t.push(r(u, f)), d[m].$in.filter(
233
+ (b) => !l[m].$in.includes(b)
234
234
  ).length > 0 && t.push(c);
235
235
  } else if (!u.conditions && c.conditions)
236
236
  t.push(c);
237
237
  else if (u.conditions && !c.conditions)
238
238
  j(JSON.parse(u.conditions)) || t.push(c);
239
239
  else if (!u.conditions && !c.conditions) {
240
- const l = new Set(u.actions), d = new Set(c.actions), f = c.actions.some((p) => !l.has(p)), m = u.actions.filter((p) => !d.has(p));
241
- if (f) {
240
+ const l = new Set(u.actions), d = new Set(c.actions), m = c.actions.some((p) => !l.has(p)), f = u.actions.filter((p) => !d.has(p));
241
+ if (m) {
242
242
  const p = c.actions.filter((b) => !l.has(b));
243
243
  t.push({
244
244
  ...c,
245
245
  actions: p
246
246
  });
247
247
  }
248
- m.length > 0 && t.push({
248
+ f.length > 0 && t.push({
249
249
  ...u,
250
- actions: m,
250
+ actions: f,
251
251
  inverted: !0
252
252
  });
253
253
  }
@@ -271,7 +271,7 @@ function _e(e, s) {
271
271
  function Ee(e) {
272
272
  const s = G(
273
273
  e,
274
- V
274
+ z
275
275
  ), r = new Set(
276
276
  s.filter((i) => {
277
277
  var t;
@@ -317,13 +317,13 @@ function Ue(e, s) {
317
317
  if (!l || !d || !le(d, o))
318
318
  return a.push(o), a;
319
319
  if (l.has("manage")) return a;
320
- const f = o.actions;
321
- if (f.includes("manage"))
320
+ const m = o.actions;
321
+ if (m.includes("manage"))
322
322
  return a.push(o), a;
323
- const m = new Set(f);
323
+ const f = new Set(m);
324
324
  for (const p of l)
325
- m.delete(p);
326
- return m.size === 0 || a.push({ ...o, actions: Array.from(m) }), a;
325
+ f.delete(p);
326
+ return f.size === 0 || a.push({ ...o, actions: Array.from(f) }), a;
327
327
  }, []);
328
328
  }
329
329
  function L(e, s) {
@@ -339,10 +339,10 @@ function L(e, s) {
339
339
  r.delete(t.subject);
340
340
  continue;
341
341
  }
342
- const l = Object.keys(c)[0], d = ((n = c[l]) == null ? void 0 : n.$in) ?? [], m = (((i = u[l]) == null ? void 0 : i.$in) ?? []).filter((p) => !d.includes(p));
343
- m.length > 0 ? r.set(t.subject, {
342
+ const l = Object.keys(c)[0], d = ((n = c[l]) == null ? void 0 : n.$in) ?? [], f = (((i = u[l]) == null ? void 0 : i.$in) ?? []).filter((p) => !d.includes(p));
343
+ f.length > 0 ? r.set(t.subject, {
344
344
  ...o,
345
- conditions: JSON.stringify({ [l]: { $in: m } })
345
+ conditions: JSON.stringify({ [l]: { $in: f } })
346
346
  }) : r.delete(t.subject);
347
347
  } else
348
348
  r.delete(t.subject);
@@ -407,8 +407,8 @@ const P = "/permission-assignments", I = {
407
407
  await v().post("/my-permissions/report-manage", { permissionKey: e, label: s })
408
408
  );
409
409
  }
410
- }, fe = z("permissionAssignment", () => {
411
- const e = S([]);
410
+ }, me = V("permissionAssignment", () => {
411
+ const e = h([]);
412
412
  async function s() {
413
413
  const o = await I.readAll();
414
414
  e.value = o;
@@ -439,8 +439,8 @@ const P = "/permission-assignments", I = {
439
439
  deletePermissionAssignment: t,
440
440
  getPermissionAssignmentByUserId: a
441
441
  };
442
- }), me = () => {
443
- const e = fe();
442
+ }), fe = () => {
443
+ const e = me();
444
444
  return {
445
445
  ...e,
446
446
  ...K(e)
@@ -449,16 +449,16 @@ const P = "/permission-assignments", I = {
449
449
  async fetchReportPermissions(e, s) {
450
450
  const r = s ? { lang: s } : {};
451
451
  return g(
452
- await x().get(`/report-query/hrm/${e}/reports`, { params: r })
452
+ await F().get(`/report-query/hrm/${e}/reports`, { params: r })
453
453
  );
454
454
  },
455
455
  async fetchReportPermissionsForPortal(e, s) {
456
456
  const r = s ? { isSupportPos: !1, lang: s } : { isSupportPos: !1 };
457
457
  return g(
458
- await x().get(`/report-query/hrm/${e}/reports`, { params: r })
458
+ await F().get(`/report-query/hrm/${e}/reports`, { params: r })
459
459
  );
460
460
  }
461
- }, U = S([]), C = S(!1), R = S(!1), $ = S(null), k = S(null), J = S(!1);
461
+ }, U = h([]), C = h(!1), R = h(!1), $ = h(null), k = h(null), M = h(!1);
462
462
  function ge() {
463
463
  const e = X();
464
464
  async function s() {
@@ -466,9 +466,9 @@ function ge() {
466
466
  const n = (t = e.currentBusiness.value) == null ? void 0 : t.id;
467
467
  if (!n) return;
468
468
  const i = localStorage.getItem("locale");
469
- if ($.value !== n && (U.value = [], C.value = !1, R.value = !1, $.value = n, J.value = !1), !(C.value && k.value === i)) {
469
+ if ($.value !== n && (U.value = [], C.value = !1, R.value = !1, $.value = n, M.value = !1), !(C.value && k.value === i)) {
470
470
  if (R.value) {
471
- J.value = !0;
471
+ M.value = !0;
472
472
  return;
473
473
  }
474
474
  R.value = !0;
@@ -480,39 +480,39 @@ function ge() {
480
480
  if ($.value !== n) return;
481
481
  console.warn("Failed to fetch custom report permissions:", a), U.value = [];
482
482
  } finally {
483
- $.value === n && (R.value = !1, J.value && (J.value = !1, await s()));
483
+ $.value === n && (R.value = !1, M.value && (M.value = !1, await s()));
484
484
  }
485
485
  }
486
486
  }
487
- const r = T(() => U.value.map(
487
+ const r = J(() => U.value.map(
488
488
  (n) => n.isDefault ? {
489
489
  label: n.name,
490
490
  subject: `business::report::reports::${n.permissionKey}`,
491
- actions: [h.manage, h.read, h.create],
492
- category: F.reports
491
+ actions: [S.manage, S.read, S.create],
492
+ category: x.reports
493
493
  } : {
494
494
  label: n.name,
495
495
  subject: `business::report::reports::${n.permissionKey}`,
496
496
  actions: [
497
- h.manage,
498
- h.read,
499
- h.create,
500
- h.update,
501
- h.delete
497
+ S.manage,
498
+ S.read,
499
+ S.create,
500
+ S.update,
501
+ S.delete
502
502
  ],
503
- category: F.customReports
503
+ category: x.customReports
504
504
  }
505
505
  ));
506
506
  return {
507
507
  fetchCustomReportPermissions: s,
508
508
  customReportPermissions: r,
509
- isLoading: T(() => R.value),
510
- isLoaded: T(() => C.value)
509
+ isLoading: J(() => R.value),
510
+ isLoaded: J(() => C.value)
511
511
  };
512
512
  }
513
513
  function A(e) {
514
- const s = re(), r = me(), n = te().restaurants, { customReportPermissions: i } = ge(), t = r.getPermissionAssignmentByUserId(e.id), a = H(
515
- (t == null ? void 0 : t.permissionSetIds) ?? [],
514
+ const s = re(), r = fe(), n = te().restaurants, { customReportPermissions: i } = ge(), t = r.getPermissionAssignmentByUserId(e.id), a = H(
515
+ (t == null ? void 0 : t.permissionSetIds) ?? e.permissionSetIds ?? [],
516
516
  s.permissionSets.value
517
517
  ), o = Q(a).map(
518
518
  ({ setNames: p, ...b }) => b
@@ -521,23 +521,26 @@ function A(e) {
521
521
  subject: O(p.subject)
522
522
  })), l = L(o, c), d = G(
523
523
  de(o, c),
524
- V
525
- ).filter((p) => !p.inverted), f = Y(d), m = f ?? n.value.map((p) => p._id);
524
+ z
525
+ ).filter((p) => !p.inverted), m = Y(d), f = m ?? n.value.map((p) => p._id);
526
526
  return {
527
527
  doc: e,
528
528
  id: e.id,
529
- name: e.name && e.name !== e.email && e.name !== e.phoneNumber ? e.name : "-",
529
+ // An invite's name is the admin's, or its sign-in key when it has none.
530
+ name: e.status === "invited" ? e.name || "-" : e.name && e.name !== e.email && e.name !== e.phoneNumber ? e.name : "-",
530
531
  phoneNumber: e.phoneNumber,
531
532
  email: e.email,
532
533
  restaurants: W(
533
- m.map((p) => {
534
+ f.map((p) => {
534
535
  var b;
535
536
  return ((b = n.value.find((Z) => Z._id === p)) == null ? void 0 : b.profile.name) ?? "";
536
537
  })
537
538
  ),
538
- managableRestaurantIds: f,
539
- permissionLabels: he(d, i.value),
540
- permissions: l
539
+ managableRestaurantIds: m,
540
+ permissionLabels: Se(d, i.value),
541
+ permissions: l,
542
+ status: e.status ?? "active",
543
+ loginMethod: e.loginMethod ?? "feedme"
541
544
  };
542
545
  }
543
546
  const ve = Object.freeze(
@@ -549,7 +552,7 @@ const ve = Object.freeze(
549
552
  ).map(A);
550
553
  },
551
554
  async readTeamMembersPage(e) {
552
- var r, n, i;
555
+ var r, n, i, t, a;
553
556
  const s = g(
554
557
  await v().get("/portal-users/paged", {
555
558
  params: {
@@ -558,7 +561,9 @@ const ve = Object.freeze(
558
561
  search: e.search,
559
562
  restaurantIds: (r = e.restaurantIds) != null && r.length ? e.restaurantIds : void 0,
560
563
  permissionSubjects: (n = e.permissionSubjects) != null && n.length ? e.permissionSubjects : void 0,
561
- permissionSetIds: (i = e.permissionSetIds) != null && i.length ? e.permissionSetIds : void 0
564
+ permissionSetIds: (i = e.permissionSetIds) != null && i.length ? e.permissionSetIds : void 0,
565
+ statuses: (t = e.statuses) != null && t.length ? e.statuses : void 0,
566
+ loginMethods: (a = e.loginMethods) != null && a.length ? e.loginMethods : void 0
562
567
  }
563
568
  })
564
569
  );
@@ -597,9 +602,9 @@ const ve = Object.freeze(
597
602
  )}`;
598
603
  }
599
604
  };
600
- function Je(e, s, r) {
605
+ function Me(e, s, r) {
601
606
  if (e.some((a) => a.subject === "all")) return "All";
602
- const n = (r ?? M).filter(
607
+ const n = (r ?? B).filter(
603
608
  (a) => a.subject === s
604
609
  ), i = new Set(n.map((a) => w(a).value)), t = e.filter((a) => a.subject === s).filter((a) => i.has(w(a).value));
605
610
  return t.length === n.length ? "All" : t.length === 0 ? "-" : `${t.length} permission allow`;
@@ -660,7 +665,7 @@ function w(e) {
660
665
  }
661
666
  };
662
667
  }
663
- function Te(e) {
668
+ function Je(e) {
664
669
  var n, i;
665
670
  const s = e.map((t) => w(t)).find((t) => t.isDiscountOperation);
666
671
  if (!s) return 100;
@@ -673,10 +678,10 @@ function Y(e) {
673
678
  );
674
679
  return s ? s.conditions ? JSON.parse(s.conditions).restaurantId.$in : null : [];
675
680
  }
676
- function Be(e, s) {
681
+ function Te(e, s) {
677
682
  return s.isOwner ? { restaurantIds: null, roleIds: null } : { restaurantIds: Y(e), roleIds: be(e) };
678
683
  }
679
- function Me(e) {
684
+ function Be(e) {
680
685
  return (e == null ? void 0 : e.some((s) => s.subject === "all")) ?? !1;
681
686
  }
682
687
  function be(e) {
@@ -691,7 +696,7 @@ function Le(e) {
691
696
  }
692
697
  function Fe(e, s, r) {
693
698
  return e.flatMap((n) => {
694
- const i = Se(n);
699
+ const i = he(n);
695
700
  if (!i) return [];
696
701
  const t = i.isReportPermission ? r == null ? void 0 : r.get(n) : void 0;
697
702
  return [
@@ -707,11 +712,11 @@ function Fe(e, s, r) {
707
712
  ];
708
713
  });
709
714
  }
710
- function Se(e) {
715
+ function he(e) {
711
716
  const s = e.indexOf(":"), r = s === -1 ? e : e.slice(0, s), n = s === -1 ? void 0 : e.slice(s + 1);
712
717
  if (s !== -1 && !n) return;
713
718
  let i;
714
- return n ? (i = M.find((t) => {
719
+ return n ? (i = B.find((t) => {
715
720
  if (t.subject !== r) return !1;
716
721
  const a = typeof t.conditions == "string" ? JSON.parse(t.conditions) : t.conditions;
717
722
  return [a == null ? void 0 : a.operation, a == null ? void 0 : a.name].includes(n);
@@ -722,7 +727,7 @@ function Se(e) {
722
727
  conditions: { name: n },
723
728
  inverted: !1,
724
729
  reason: ""
725
- })) : i = M.find((t) => t.subject === r), i ? w(i) : void 0;
730
+ })) : i = B.find((t) => t.subject === r), i ? w(i) : void 0;
726
731
  }
727
732
  function xe(e, s) {
728
733
  const r = { values: [], passthrough: [], dropped: [] };
@@ -737,7 +742,7 @@ function xe(e, s) {
737
742
  }
738
743
  return r;
739
744
  }
740
- function he(e, s = []) {
745
+ function Se(e, s = []) {
741
746
  return W(
742
747
  e.reduce((r, n) => {
743
748
  const i = ve.find(
@@ -754,29 +759,29 @@ function he(e, s = []) {
754
759
  export {
755
760
  G as N,
756
761
  Q as P,
757
- pe as R,
758
- Je as a,
759
- de as b,
762
+ oe as R,
763
+ ge as a,
764
+ Te as b,
760
765
  H as c,
761
- ge as d,
762
- Le as e,
763
- Fe as f,
764
- Te as g,
765
- Me as h,
766
- oe as i,
767
- Be as j,
768
- Ee as k,
769
- _e as l,
766
+ fe as d,
767
+ Fe as e,
768
+ Me as f,
769
+ de as g,
770
+ Be as h,
771
+ Je as i,
772
+ Le as j,
773
+ pe as k,
774
+ Ne as l,
770
775
  Ae as m,
771
- Ne as n,
772
- Ue as o,
776
+ Ue as n,
777
+ Ee as o,
773
778
  ve as p,
774
- me as q,
779
+ _e as q,
775
780
  w as r,
776
781
  xe as s,
777
782
  Ce as t,
778
783
  re as u,
779
- he as v,
784
+ Se as v,
780
785
  Oe as w,
781
786
  Y as x,
782
787
  be as y
@@ -0,0 +1,3 @@
1
+ import type { FdtoMyPosProfile, FdtoRegenerateMyPosPasscodeRes } from '@/types/my-pos-profile';
2
+ export declare const readMyPosProfile: () => Promise<FdtoMyPosProfile>;
3
+ export declare const regenerateMyPosPasscode: () => Promise<FdtoRegenerateMyPosPasscodeRes>;
@@ -0,0 +1,5 @@
1
+ import type { IFdtoSsoProvider } from '@/types/sso-provider';
2
+ declare const SsoProviderAPI: {
3
+ readProviders(): Promise<IFdtoSsoProvider[]>;
4
+ };
5
+ export default SsoProviderAPI;
@@ -0,0 +1,16 @@
1
+ import type { IFdtoCreateStaffInviteReq, IFdtoCreateStaffInviteRes, IFdtoResendStaffInviteRes, IFdtoStaffInvite, IFdtoStaffInviteLookup, IFdtoUpdateStaffInviteReq } from '@/types/staff-invite';
2
+ declare const StaffInviteAPI: {
3
+ readInvites(status?: IFdtoStaffInvite["status"]): Promise<IFdtoStaffInvite[]>;
4
+ lookup(key: {
5
+ mobile: string;
6
+ } | {
7
+ email: string;
8
+ }, provider?: string): Promise<IFdtoStaffInviteLookup | null>;
9
+ createInvite(req: IFdtoCreateStaffInviteReq): Promise<IFdtoCreateStaffInviteRes>;
10
+ updateInvite(id: string, req: IFdtoUpdateStaffInviteReq): Promise<IFdtoStaffInvite>;
11
+ revokeInvite(id: string): Promise<{
12
+ ok: true;
13
+ }>;
14
+ resendInvite(id: string): Promise<IFdtoResendStaffInviteRes>;
15
+ };
16
+ export default StaffInviteAPI;
@@ -2,17 +2,25 @@ interface Props {
2
2
  title?: string;
3
3
  subtitle?: string;
4
4
  initiallyCollapsed?: boolean;
5
+ /**
6
+ * 'trailing': toggle on the right, subtitle beside the title while collapsed.
7
+ * 'leading': chevron before the title, subtitle always under it (member sheet cards).
8
+ */
9
+ layout?: 'trailing' | 'leading';
5
10
  }
6
- declare var __VLS_1: {}, __VLS_7: {};
11
+ declare var __VLS_5: {}, __VLS_7: {}, __VLS_13: {};
7
12
  type __VLS_Slots = {} & {
8
- title?: (props: typeof __VLS_1) => any;
13
+ title?: (props: typeof __VLS_5) => any;
9
14
  } & {
10
- default?: (props: typeof __VLS_7) => any;
15
+ title?: (props: typeof __VLS_7) => any;
16
+ } & {
17
+ default?: (props: typeof __VLS_13) => any;
11
18
  };
12
19
  declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
13
20
  title: string;
14
21
  subtitle: string;
15
22
  initiallyCollapsed: boolean;
23
+ layout: "trailing" | "leading";
16
24
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
25
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
18
26
  export default _default;
@@ -0,0 +1,23 @@
1
+ declare const _default: <T extends string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
2
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
3
+ readonly "onUpdate:modelValue"?: ((value: T) => any) | undefined;
4
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & ({
5
+ items: {
6
+ label: string;
7
+ value: T;
8
+ }[];
9
+ disabled?: boolean;
10
+ } & {
11
+ modelValue: T;
12
+ }) & Partial<{}>> & import("vue").PublicProps;
13
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
14
+ attrs: any;
15
+ slots: {};
16
+ emit: (evt: "update:modelValue", value: T) => void;
17
+ }>) => import("vue").VNode & {
18
+ __ctx?: Awaited<typeof __VLS_setup>;
19
+ };
20
+ export default _default;
21
+ type __VLS_PrettifyLocal<T> = {
22
+ [K in keyof T]: T[K];
23
+ } & {};
@@ -0,0 +1,56 @@
1
+ import { type ComputedRef } from 'vue';
2
+ import { type LocationQuery, type RouteLocationMatched } from 'vue-router';
3
+ import { RouteName } from '@/router/shared';
4
+ /**
5
+ * One HRM side-menu entry. `to` is the route the item opens; its accessibility is the
6
+ * accessibility of that route, so the menu and the route guards can never disagree.
7
+ */
8
+ export interface MenuItemDef {
9
+ /** FmCollapsibleTabs value; kept identical to the values the Navigator always used. */
10
+ value: string;
11
+ labelKey: string;
12
+ to: RouteName;
13
+ /** Carry the current query (business query state) along when navigating. */
14
+ keepQuery: boolean;
15
+ /** Route names that highlight this item. */
16
+ activeRoutes: RouteName[];
17
+ }
18
+ export interface MenuAccessItem extends MenuItemDef {
19
+ accessible: boolean;
20
+ /** Access is not known yet (only My POS Profile, while its lookup runs). */
21
+ loading: boolean;
22
+ }
23
+ /**
24
+ * Menu order: existing items first, My POS Profile last. Built lazily because
25
+ * `@/router/shared` imports this module (through the route guard), so `RouteName` is not
26
+ * initialised yet while this module is first evaluated.
27
+ */
28
+ export declare function menuItemDefs(): MenuItemDef[];
29
+ type SessionUser = {
30
+ _role?: string;
31
+ permissions: unknown[];
32
+ } | null | undefined;
33
+ /**
34
+ * Same rule `withPermission` applies (hrm-permission `validateRoute` → `validate`): every
35
+ * matched record's `meta.validationManifest` must pass its role list and its CASL
36
+ * requirements, checked with the package's own `checkAccess`. `validateRoute` itself is not
37
+ * exported, so this walks the manifests and delegates the rule to `checkAccess`.
38
+ * No route here uses `customValidationFunction`; a manifest that has one is left to
39
+ * `withPermission` (treated as passing here).
40
+ */
41
+ export declare function passesRouteManifests(matched: readonly Pick<RouteLocationMatched, 'meta'>[], sessionUser: SessionUser): boolean;
42
+ /** Test hook: forget every cached lookup. */
43
+ export declare function resetMenuAccessCache(): void;
44
+ export declare function useMenuAccess(): {
45
+ items: ComputedRef<MenuAccessItem[]>;
46
+ visibleItems: ComputedRef<MenuAccessItem[]>;
47
+ firstAccessible: ComputedRef<MenuAccessItem | undefined>;
48
+ hasPosUser: ComputedRef<boolean | undefined>;
49
+ isLoading: ComputedRef<boolean>;
50
+ canOpenMatched: (matched: readonly RouteLocationMatched[]) => boolean | undefined;
51
+ locationFor: (item: MenuItemDef, query?: LocationQuery) => {
52
+ query?: LocationQuery | undefined;
53
+ name: RouteName;
54
+ };
55
+ };
56
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { IFdtoSsoProvider } from '@/types/sso-provider';
2
+ export declare function useSsoProviders(): {
3
+ providers: import("vue").Ref<{
4
+ slug: string;
5
+ label: string;
6
+ type: string;
7
+ enabled: boolean;
8
+ inviteMatch: import("../types/staff-invite").StaffInviteMatch | "none";
9
+ }[], IFdtoSsoProvider[] | {
10
+ slug: string;
11
+ label: string;
12
+ type: string;
13
+ enabled: boolean;
14
+ inviteMatch: import("../types/staff-invite").StaffInviteMatch | "none";
15
+ }[]>;
16
+ isLoaded: import("vue").ComputedRef<boolean>;
17
+ loadProviders: () => Promise<void>;
18
+ providerLabel: (slug: string) => string;
19
+ };
@@ -0,0 +1,8 @@
1
+ export declare function useStaffInviteProviders(): {
2
+ providers: import("vue").ComputedRef<import("../types/staff-invite").IFdtoStaffInviteProvider[]>;
3
+ isLoaded: import("vue").ComputedRef<boolean>;
4
+ hasProviders: import("vue").ComputedRef<boolean>;
5
+ canInvite: import("vue").ComputedRef<boolean>;
6
+ loadProviders: () => Promise<void>;
7
+ providerLabel: (slug: string) => string;
8
+ };
@@ -0,0 +1,36 @@
1
+ import type { FdoPermissionRule } from '@feedmepos/core/entity';
2
+ import type { IFdtoPermissionSet } from '@/types/permission-set';
3
+ import type { IFdtoCreatePortalUserReq, IFdtoPermissionPosUser, IFdtoUpdatePortalUserReq } from '@/types/team';
4
+ /** The grant half of a portal user request: roles, custom permissions and POS master user. */
5
+ export type MemberGrantPayload = Required<Pick<IFdtoCreatePortalUserReq, 'customPermissions' | 'permissions' | 'permissionSetIds'>> & Pick<IFdtoCreatePortalUserReq, 'posUser'>;
6
+ export interface MemberGrantState {
7
+ userPermissions: FdoPermissionRule[];
8
+ /** Permission sets collected from the selected roles. */
9
+ inheritedPermissions: IFdtoPermissionSet[];
10
+ permissionSetIds: string[];
11
+ posUser: IFdtoPermissionPosUser | null | undefined;
12
+ /** Report subjects still known; report rules outside it are stale. */
13
+ reportSubjects: Set<string>;
14
+ defaultReportSubjects: Set<string>;
15
+ /** Saved POS user, used when the form leaves name or code empty. */
16
+ savedPosUser?: IFdtoPermissionPosUser;
17
+ fallbackName: string;
18
+ }
19
+ /**
20
+ * Rules that scope where a member works (outlets, warehouses, usable POS roles) rather
21
+ * than which portal pages they open. "Where they work" edits these; "Portal access" the rest.
22
+ */
23
+ export declare const WORKPLACE_SUBJECTS: readonly string[];
24
+ /** Whether a grant opens any portal page: a role, or a granted rule beyond the workplace ones. */
25
+ export declare function hasPortalAccess(rules: FdoPermissionRule[], permissionSetIds: string[]): boolean;
26
+ /** Portal access off: keep only where they work, so they get My POS Profile and nothing else. */
27
+ export declare function withoutPortalAccess(rules: FdoPermissionRule[]): FdoPermissionRule[];
28
+ /** What an untouched grant section submits. */
29
+ export declare const EMPTY_MEMBER_GRANT: MemberGrantPayload;
30
+ export declare function buildMemberGrantPayload(state: MemberGrantState): MemberGrantPayload;
31
+ /**
32
+ * Member edit request: the passcode goes out only when the admin changed it. The form
33
+ * holds the passcode loaded when it opened; sending that back would overwrite a newer one
34
+ * the member set in My POS Profile (KDI-5225 review #2). Add member sends it as is.
35
+ */
36
+ export declare function toMemberUpdateReq(req: IFdtoCreatePortalUserReq, saved: IFdtoPermissionPosUser | undefined): IFdtoUpdatePortalUserReq;