@feedmepos/mf-hrm-portal 1.1.2-dev → 1.1.4-dev.1

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 (88) hide show
  1. package/dist/{EmployeeList-CKHgrdAO.js → EmployeeList-D3a7ngdE.js} +16 -18
  2. package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js → PageLayout.vue_vue_type_script_setup_true_lang-DuwNwJDM.js} +2 -2
  3. package/dist/{RoleList-Bef-7IhW.js → RoleList-CsxyMZW0.js} +53 -57
  4. package/dist/TeamMemberList-ZkrdrTlL.js +1508 -0
  5. package/dist/{TimesheetList-DVIk0Tis.js → TimesheetList-BwiUzcJ-.js} +41 -42
  6. package/dist/api/team/index.d.ts +1 -5
  7. package/dist/app-CrML_LtM.js +1202 -0
  8. package/dist/app.js +4 -4
  9. package/dist/components/AppForm.vue.d.ts +2 -3
  10. package/dist/components/CheckboxInput.vue.d.ts +4 -10
  11. package/dist/components/CollapsibleWrapper.vue.d.ts +2 -3
  12. package/dist/components/form/SelectFilter.vue.d.ts +2 -3
  13. package/dist/components/layout/FormColumn.vue.d.ts +3 -6
  14. package/dist/components/layout/FormItem.vue.d.ts +1 -2
  15. package/dist/components/layout/FormSection.vue.d.ts +1 -2
  16. package/dist/components/layout/FullWrapper.vue.d.ts +3 -6
  17. package/dist/components/layout/PageLayout.vue.d.ts +1 -2
  18. package/dist/components/menu/BottomSheetMenu.vue.d.ts +1 -2
  19. package/dist/components/menu/BottomSheetMenuItem.vue.d.ts +3 -6
  20. package/dist/components/table/EmptyDataTemplate/index.vue.d.ts +3 -6
  21. package/dist/composables/useAppStore.d.ts +6 -6
  22. package/dist/composables/useDateRange.d.ts +1 -1
  23. package/dist/composables/useRestaurantMap.d.ts +8 -4
  24. package/dist/composables/useSheet.d.ts +1 -1
  25. package/dist/employee-DSGaYrd4.js +449 -0
  26. package/dist/{index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js → empty-placeholder-ey8LJtN1.js} +2 -43
  27. package/dist/helpers/rule.d.ts +3 -4
  28. package/dist/index-CIaav54n.js +57 -0
  29. package/dist/{lodash-DpoPPi_j.js → lodash-dGfuW9fw.js} +343 -326
  30. package/dist/{Main-YQ5f-v03.js → main-CUI7RdvY.js} +1531 -1501
  31. package/dist/router/shared.d.ts +1 -4
  32. package/dist/{index-CicR1-Jp.js → rule-BLgeh_ly.js} +2672 -2721
  33. package/dist/stores/employee.d.ts +4 -4
  34. package/dist/stores/role.d.ts +4 -4
  35. package/dist/stores/timesheet.d.ts +19 -19
  36. package/dist/{timesheet-BRQvljNj.js → timesheet-BFrZzS2q.js} +14 -14
  37. package/dist/tsconfig.app.tsbuildinfo +1 -1
  38. package/dist/types/permission.d.ts +4 -1
  39. package/dist/types/team.d.ts +3 -13
  40. package/dist/useAppStore-DViQe2C8.js +93 -0
  41. package/dist/useLoading-DAoKseT-.js +141 -0
  42. package/dist/{useRestaurantMap-D5BNPLKh.js → useRestaurantMap-CpS9-OSq.js} +7 -7
  43. package/dist/{SelectFilter-NbXrJ4iH.js → useSearch-C25VELOk.js} +101 -90
  44. package/dist/views/hr/employee/{EmployeeForm.vue.d.ts → components/EmployeeForm.vue.d.ts} +7 -10
  45. package/dist/views/team/{member → components}/AddMemberForm.vue.d.ts +0 -1
  46. package/dist/views/team/components/PortalPermissionEditor.vue.d.ts +28 -68
  47. package/dist/views/team/components/TeamMemberBasePermission.vue.d.ts +36 -0
  48. package/dist/views/team/components/{ConditionPermission.vue.d.ts → TeamMemberConditionPermission.vue.d.ts} +1 -14
  49. package/dist/views/team/components/TeamMemberMasterUser.vue.d.ts +718 -0
  50. package/dist/views/team/components/{PosRolePermission.vue.d.ts → TeamMemberRolePermission.vue.d.ts} +1 -14
  51. package/dist/views/team/locales/index.d.ts +4 -176
  52. package/package.json +8 -13
  53. package/dist/AuditLogList-CjrocQS2.js +0 -316
  54. package/dist/Main-HzplGv-e.js +0 -85
  55. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-xQ4fjIxa.js +0 -3050
  56. package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +0 -38
  57. package/dist/RolePermissionList-BzwpQFeO.js +0 -285
  58. package/dist/TeamMemberList-D2Xey_w9.js +0 -949
  59. package/dist/api/audit-log/index.d.ts +0 -10
  60. package/dist/api/permission-assignment/index.d.ts +0 -10
  61. package/dist/api/permission-set/index.d.ts +0 -8
  62. package/dist/app-DUs516v0.js +0 -2592
  63. package/dist/dayjs.min-DVb8OkTL.js +0 -282
  64. package/dist/employee-jH7EJnhi.js +0 -172
  65. package/dist/helpers/permission-set.d.ts +0 -32
  66. package/dist/helpers/portal-user.d.ts +0 -8
  67. package/dist/stores/permission-assignment.d.ts +0 -277
  68. package/dist/stores/permission-set.d.ts +0 -250
  69. package/dist/stores/team.d.ts +0 -288
  70. package/dist/team-CiZSNUQW.js +0 -26
  71. package/dist/types/audit-log.d.ts +0 -19
  72. package/dist/types/permission-assignment.d.ts +0 -20
  73. package/dist/types/permission-set.d.ts +0 -20
  74. package/dist/useAppStore-RzLLN5d9.js +0 -180
  75. package/dist/useLoading-1OqFn86y.js +0 -99
  76. package/dist/useSearch-B6WK1LBB.js +0 -15
  77. package/dist/views/audit-log/locales/index.d.ts +0 -211
  78. package/dist/views/team/Main.vue.d.ts +0 -2
  79. package/dist/views/team/components/BasePermission.vue.d.ts +0 -64
  80. package/dist/views/team/components/InheritPermissionTooltip.vue.d.ts +0 -14
  81. package/dist/views/team/components/PermissionWithTooltip.vue.d.ts +0 -14
  82. package/dist/views/team/member/TeamMemberList.vue.d.ts +0 -4
  83. package/dist/views/team/member/TeamMemberMasterUser.vue.d.ts +0 -55
  84. package/dist/views/team/role/RolePermissionForm.vue.d.ts +0 -19
  85. package/dist/views/team/role/RolePermissionList.vue.d.ts +0 -5
  86. /package/dist/views/{audit-log/AuditLogList.vue.d.ts → hr/main.vue.d.ts} +0 -0
  87. /package/dist/views/{hr/Main.vue.d.ts → team/TeamMemberList.vue.d.ts} +0 -0
  88. /package/dist/views/team/{member → components}/MemberInfo.vue.d.ts +0 -0
@@ -1,282 +0,0 @@
1
- import { g as Q, c as K } from "./app-DUs516v0.js";
2
- var E = { exports: {} };
3
- (function(V, X) {
4
- (function(W, k) {
5
- V.exports = k();
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) {
8
- var n = ["th", "st", "nd", "rd"], t = s % 100;
9
- return "[" + s + (n[(t - 20) % 10] || n[t] || n[0]) + "]";
10
- } }, I = function(s, n, t) {
11
- var r = String(s);
12
- return !r || r.length >= n ? s : "" + Array(n + 1 - r.length).join(t) + s;
13
- }, P = { s: I, z: function(s) {
14
- var n = -s.utcOffset(), t = Math.abs(n), r = Math.floor(t / 60), e = t % 60;
15
- return (n <= 0 ? "+" : "-") + I(r, 2, "0") + ":" + I(e, 2, "0");
16
- }, m: function s(n, t) {
17
- if (n.date() < t.date()) return -s(t, n);
18
- var r = 12 * (t.year() - n.year()) + (t.month() - n.month()), e = n.clone().add(r, m), i = t - e < 0, u = n.clone().add(r + (i ? -1 : 1), m);
19
- return +(-(r + (t - e) / (i ? e - u : u - e)) || 0);
20
- }, a: function(s) {
21
- return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
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$/, "");
24
- }, u: function(s) {
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]);
30
- }, j = function s(n, t, r) {
31
- var e;
32
- if (!n) return x;
33
- if (typeof n == "string") {
34
- var i = n.toLowerCase();
35
- g[i] && (e = i), t && (g[i] = t, e = i);
36
- var u = n.split("-");
37
- if (!e && u.length > 1) return s(u[0]);
38
- } else {
39
- var o = n.name;
40
- g[o] = n, e = o;
41
- }
42
- return !r && e && (x = e), e || !r && x;
43
- }, f = function(s, n) {
44
- if (F(s)) return s.clone();
45
- var t = typeof n == "object" ? n : {};
46
- return t.date = s, t.args = arguments, new C(t);
47
- }, a = P;
48
- a.l = j, a.i = F, a.w = function(s, n) {
49
- return f(s, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset });
50
- };
51
- var C = function() {
52
- function s(t) {
53
- this.$L = j(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[Z] = !0;
54
- }
55
- var n = s.prototype;
56
- return n.parse = function(t) {
57
- this.$d = function(r) {
58
- var e = r.date, i = r.utc;
59
- if (e === null) return /* @__PURE__ */ new Date(NaN);
60
- if (a.u(e)) return /* @__PURE__ */ new Date();
61
- if (e instanceof Date) return new Date(e);
62
- if (typeof e == "string" && !/Z$/i.test(e)) {
63
- var u = e.match(q);
64
- if (u) {
65
- var o = u[2] - 1 || 0, c = (u[7] || "0").substring(0, 3);
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);
67
- }
68
- }
69
- return new Date(e);
70
- }(t), this.init();
71
- }, n.init = function() {
72
- var t = this.$d;
73
- this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
74
- }, n.$utils = function() {
75
- return a;
76
- }, n.isValid = function() {
77
- return this.$d.toString() !== J;
78
- }, n.isSame = function(t, r) {
79
- var e = f(t);
80
- return this.startOf(r) <= e && e <= this.endOf(r);
81
- }, n.isAfter = function(t, r) {
82
- return f(t) < this.startOf(r);
83
- }, n.isBefore = function(t, r) {
84
- return this.endOf(r) < f(t);
85
- }, n.$g = function(t, r, e) {
86
- return a.u(t) ? this[r] : this.set(e, t);
87
- }, n.unix = function() {
88
- return Math.floor(this.valueOf() / 1e3);
89
- }, n.valueOf = function() {
90
- return this.$d.getTime();
91
- }, n.startOf = function(t, r) {
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);
95
- }, c = function(p, $) {
96
- return a.w(e.toDate()[p].apply(e.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice($)), e);
97
- }, h = this.$W, d = this.$M, l = this.$D, b = "set" + (this.$u ? "UTC" : "");
98
- switch (u) {
99
- case v:
100
- return i ? o(1, 0) : o(31, 11);
101
- case m:
102
- return i ? o(1, d) : o(0, d + 1);
103
- case T:
104
- var D = this.$locale().weekStart || 0, Y = (h < D ? h + 7 : h) - D;
105
- return o(i ? l - Y : l + (6 - Y), d);
106
- case M:
107
- case _:
108
- return c(b + "Hours", 0);
109
- case O:
110
- return c(b + "Minutes", 1);
111
- case w:
112
- return c(b + "Seconds", 2);
113
- case S:
114
- return c(b + "Milliseconds", 3);
115
- default:
116
- return this.clone();
117
- }
118
- }, n.endOf = function(t) {
119
- return this.startOf(t, !1);
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) {
123
- var h = this.clone().set(_, 1);
124
- h.$d[o](c), h.init(), this.$d = h.set(_, Math.min(this.$D, h.daysInMonth())).$d;
125
- } else o && this.$d[o](c);
126
- return this.init(), this;
127
- }, n.set = function(t, r) {
128
- return this.clone().$set(t, r);
129
- }, n.get = function(t) {
130
- return this[a.p(t)]();
131
- }, n.add = function(t, r) {
132
- var e, i = this;
133
- t = Number(t);
134
- var u = a.p(r), o = function(d) {
135
- var l = f(i);
136
- return a.w(l.date(l.date() + Math.round(d * t)), i);
137
- };
138
- if (u === m) return this.set(m, this.$M + t);
139
- if (u === v) return this.set(v, this.$y + t);
140
- if (u === M) return o(1);
141
- if (u === T) return o(7);
142
- var c = (e = {}, e[w] = k, e[O] = N, e[S] = W, e)[u] || 1, h = this.$d.getTime() + t * c;
143
- return a.w(h, this);
144
- }, n.subtract = function(t, r) {
145
- return this.add(-1 * t, r);
146
- }, n.format = function(t) {
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);
151
- }, Y = function($) {
152
- return a.s(o % 12 || 12, $, "0");
153
- }, p = b || function($, y, H) {
154
- var L = $ < 12 ? "AM" : "PM";
155
- return H ? L.toLowerCase() : L;
156
- };
157
- return i.replace(B, function($, y) {
158
- return y || function(H) {
159
- switch (H) {
160
- case "YY":
161
- return String(r.$y).slice(-2);
162
- case "YYYY":
163
- return a.s(r.$y, 4, "0");
164
- case "M":
165
- return h + 1;
166
- case "MM":
167
- return a.s(h + 1, 2, "0");
168
- case "MMM":
169
- return D(e.monthsShort, h, l, 3);
170
- case "MMMM":
171
- return D(l, h);
172
- case "D":
173
- return r.$D;
174
- case "DD":
175
- return a.s(r.$D, 2, "0");
176
- case "d":
177
- return String(r.$W);
178
- case "dd":
179
- return D(e.weekdaysMin, r.$W, d, 2);
180
- case "ddd":
181
- return D(e.weekdaysShort, r.$W, d, 3);
182
- case "dddd":
183
- return d[r.$W];
184
- case "H":
185
- return String(o);
186
- case "HH":
187
- return a.s(o, 2, "0");
188
- case "h":
189
- return Y(1);
190
- case "hh":
191
- return Y(2);
192
- case "a":
193
- return p(o, c, !0);
194
- case "A":
195
- return p(o, c, !1);
196
- case "m":
197
- return String(c);
198
- case "mm":
199
- return a.s(c, 2, "0");
200
- case "s":
201
- return String(r.$s);
202
- case "ss":
203
- return a.s(r.$s, 2, "0");
204
- case "SSS":
205
- return a.s(r.$ms, 3, "0");
206
- case "Z":
207
- return u;
208
- }
209
- return null;
210
- }($) || u.replace(":", "");
211
- });
212
- }, n.utcOffset = function() {
213
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
214
- }, n.diff = function(t, r, e) {
215
- var i, u = this, o = a.p(r), c = f(t), h = (c.utcOffset() - this.utcOffset()) * k, d = this - c, l = function() {
216
- return a.m(u, c);
217
- };
218
- switch (o) {
219
- case v:
220
- i = l() / 12;
221
- break;
222
- case m:
223
- i = l();
224
- break;
225
- case U:
226
- i = l() / 3;
227
- break;
228
- case T:
229
- i = (d - h) / 6048e5;
230
- break;
231
- case M:
232
- i = (d - h) / 864e5;
233
- break;
234
- case O:
235
- i = d / N;
236
- break;
237
- case w:
238
- i = d / k;
239
- break;
240
- case S:
241
- i = d / W;
242
- break;
243
- default:
244
- i = d;
245
- }
246
- return e ? i : a.a(i);
247
- }, n.daysInMonth = function() {
248
- return this.endOf(m).$D;
249
- }, n.$locale = function() {
250
- return g[this.$L];
251
- }, n.locale = function(t, r) {
252
- if (!t) return this.$L;
253
- var e = this.clone(), i = j(t, r, !0);
254
- return i && (e.$L = i), e;
255
- }, n.clone = function() {
256
- return a.w(this.$d, this);
257
- }, n.toDate = function() {
258
- return new Date(this.valueOf());
259
- }, n.toJSON = function() {
260
- return this.isValid() ? this.toISOString() : null;
261
- }, n.toISOString = function() {
262
- return this.$d.toISOString();
263
- }, n.toString = function() {
264
- return this.$d.toUTCString();
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) {
269
- return this.$g(n, s[0], s[1]);
270
- };
271
- }), f.extend = function(s, n) {
272
- return s.$i || (s(n, C, f), s.$i = !0), f;
273
- }, f.locale = j, f.isDayjs = F, f.unix = function(s) {
274
- return f(1e3 * s);
275
- }, f.en = g[x], f.Ls = g, f.p = {}, f;
276
- });
277
- })(E);
278
- var R = E.exports;
279
- const et = /* @__PURE__ */ Q(R);
280
- export {
281
- et as d
282
- };
@@ -1,172 +0,0 @@
1
- import { d as v } from "./dayjs.min-DVb8OkTL.js";
2
- import { defineStore as T, storeToRefs as _ } from "pinia";
3
- import { ref as h } from "vue";
4
- import { useCoreStore as U } from "@feedmepos/mf-common";
5
- import { b as o, g as n, t as $, k as b, s as I } from "./index-CicR1-Jp.js";
6
- import { u as S } from "./useAppStore-RzLLN5d9.js";
7
- const c = {
8
- async readEmployees() {
9
- return n(await o().get("/pos-users"));
10
- },
11
- async createEmployee(e) {
12
- return n(await o().post("/pos-users", e));
13
- },
14
- async createMasterEmployee(e) {
15
- return n(await o().post("/pos-users/master-user", e));
16
- },
17
- async migrateToMasterEmployee(e, s) {
18
- return n(await o().put(`/pos-users/migrate/${e}`, s));
19
- },
20
- async updateEmployee(e, s) {
21
- return n(await o().put(`/pos-users/${e}`, s));
22
- },
23
- async updateMasterEmployee(e, s) {
24
- return n(await o().put(`/pos-users/master-user/${e}`, s));
25
- },
26
- async deleteEmployee(e) {
27
- return n(
28
- await o().put(`/pos-users/${e._id}`, {
29
- user: e,
30
- roles: []
31
- })
32
- );
33
- },
34
- async deleteMasterEmployee(e) {
35
- return n(
36
- await o().put(`/pos-users/master-user/${e._id}`, {
37
- user: e,
38
- roles: []
39
- })
40
- );
41
- },
42
- async generateEmployeePasscode() {
43
- return `${n(await o().get("/pos-users/generate-passcode"))}`;
44
- },
45
- async syncUsersMeta() {
46
- await o().post("/pos-users/create-users-meta");
47
- }
48
- };
49
- async function i(e) {
50
- const s = S().roles.value, { restaurants: d } = U(), w = e.reduce((l, m) => {
51
- var f;
52
- const { _id: E, restaurantId: y } = m, p = l.findIndex((r) => r._id === E), M = ((f = d.value.find((r) => r._id === y)) == null ? void 0 : f.profile.name) || "", u = s.find((r) => r._id === m.role), g = {
53
- restaurantId: y,
54
- restaurantName: M,
55
- roleId: (u == null ? void 0 : u._id) || "",
56
- roleName: (u == null ? void 0 : u.name) || ""
57
- };
58
- return p < 0 ? l.push({
59
- ...m,
60
- since: v(b(E)).format("DD/MM/YYYY"),
61
- restaurants: [g]
62
- }) : l[p].restaurants.some((r) => r.restaurantId === y) || (l[p].restaurants = I([...l[p].restaurants, g], {
63
- selector: "restaurantName"
64
- })), l;
65
- }, []);
66
- return I(w, { selector: "name" });
67
- }
68
- const x = T("employee", () => {
69
- const e = h([]), s = h(!1), d = h([]);
70
- async function w() {
71
- try {
72
- s.value = !0;
73
- const r = await c.readEmployees();
74
- e.value = await i(r);
75
- } catch (r) {
76
- console.log("Error reading employees:", r);
77
- } finally {
78
- s.value = !1;
79
- }
80
- }
81
- async function l(r) {
82
- try {
83
- const t = await c.createEmployee(r);
84
- e.value = await i(t);
85
- } catch (t) {
86
- console.log("Error creating employee:", t);
87
- }
88
- }
89
- async function m(r, t) {
90
- try {
91
- const a = await c.updateEmployee(r, t);
92
- e.value = await i(a);
93
- } catch (a) {
94
- console.log("Error updating employee:", a);
95
- }
96
- }
97
- async function E(r) {
98
- try {
99
- const t = await c.deleteEmployee(r);
100
- e.value = await i(t);
101
- } catch (t) {
102
- console.log("Error deleting employee:", t);
103
- }
104
- }
105
- async function y(r) {
106
- try {
107
- const t = await c.deleteMasterEmployee(r);
108
- e.value = await i(t);
109
- } catch (t) {
110
- console.log("Error deleting master employee:", t);
111
- }
112
- }
113
- async function p(r) {
114
- try {
115
- const t = await c.createMasterEmployee(r);
116
- e.value = await i(t);
117
- } catch (t) {
118
- console.log("Error creating master employee:", t);
119
- }
120
- }
121
- async function M(r, t) {
122
- try {
123
- const a = await c.updateMasterEmployee(r, t);
124
- e.value = await i(a);
125
- } catch (a) {
126
- console.log("Error updating master employee:", a);
127
- }
128
- }
129
- async function u(r, t) {
130
- try {
131
- const a = await c.migrateToMasterEmployee(r, t);
132
- e.value = await i(a);
133
- } catch (a) {
134
- console.log("Error migrating to master employee:", a);
135
- }
136
- }
137
- async function g() {
138
- try {
139
- d.value = await $.readTeamMemberPosUserIds();
140
- } catch (r) {
141
- console.log("Error reading team member pos user ids:", r);
142
- }
143
- }
144
- async function f() {
145
- await c.syncUsersMeta();
146
- }
147
- return {
148
- employees: e,
149
- restrictEmployeeIds: d,
150
- isLoading: s,
151
- readEmployees: w,
152
- createEmployee: l,
153
- updateEmployee: m,
154
- deleteEmployee: E,
155
- createMasterEmployee: p,
156
- updateMasterEmployee: M,
157
- deleteMasterEmployee: y,
158
- migrateToMasterUser: u,
159
- readTeamMemberPosUserIds: g,
160
- syncUsersMeta: f
161
- };
162
- }), R = () => {
163
- const e = x();
164
- return {
165
- ...e,
166
- ..._(e)
167
- };
168
- };
169
- export {
170
- c as E,
171
- R as u
172
- };
@@ -1,32 +0,0 @@
1
- import type { InheritedPermission, IFdtoPermissionSet } from '@/types/permission-set';
2
- import type { FdoPermissionRule } from '@feedmepos/core/entity';
3
- /**
4
- * Transform permission sets by grouping role names by collection IDs for a specific field
5
- * @param permissionSets - Array of permission sets with their permissions
6
- * @param field - The field name to extract collection IDs from (e.g., 'restaurantId', 'warehouseId')
7
- * @param resource - The collection of resource (e.g., list of restaurants, warehouses)
8
- * @returns Array of objects containing collection ID and associated role names
9
- */
10
- export declare function transformByCollection(permissionSets: IFdtoPermissionSet[], field: string, resourceIds: string[]): InheritedPermission[];
11
- /**
12
- * Combine base permissions (permissions set) with user permissions
13
- * @param basePermissions - Base permissions
14
- * @param overridePermissions - User permissions
15
- * @returns Combined permissions
16
- * Return combined result with below criteria:
17
- * - If base has it and user doesn't, return base permission with { inverted: true }
18
- * - If user has it and base doesn't, return user permission
19
- * - If base and user has it, nothing return
20
- * For permission with conditions (collection: warehouses, roles, restaurants)
21
- * - If base conditions different from user conditions, return rule with { inverted: true } and conditions on collection ids to be denied
22
- * - If base has conditions and user doesn't, return base with { inverted: true } without conditions, essentially denied all access
23
- * - If user has conditions and base doesn't, return user's rule (user added)
24
- */
25
- export declare function getOverridePermissions(basePermissions: FdoPermissionRule[], overridePermissions: FdoPermissionRule[]): FdoPermissionRule[];
26
- /**
27
- * Combine base permissions with override permissions to get effective permissions
28
- * @param basePermissions - Base permissions from permission sets
29
- * @param overridePermissions - Override permissions from permission user
30
- * @returns - Combined effective permissions
31
- */
32
- export declare function getEffectivePermissions(basePermissions: FdoPermissionRule[], overridePermissions: FdoPermissionRule[]): FdoPermissionRule[];
@@ -1,8 +0,0 @@
1
- import type { FTeamMember, IFdtoPortalUser } from '@/types/team';
2
- /**
3
- * Combine portal user data with permission assignment and return as team member data
4
- * @param doc
5
- * @param options
6
- * @returns
7
- */
8
- export declare function portalUserToTeamMember(doc: IFdtoPortalUser): FTeamMember;