@feedmepos/mf-hrm-portal 0.0.1-alpha.1 → 0.0.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 (104) hide show
  1. package/package.json +1 -1
  2. package/dist/App.vue.d.ts +0 -2
  3. package/dist/EmployeeList-BU6n0y6w.js +0 -604
  4. package/dist/Entry.vue.d.ts +0 -2
  5. package/dist/PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js +0 -37
  6. package/dist/RoleList-kE8O8wyy.js +0 -492
  7. package/dist/TeamMemberList-BBl8auxB.js +0 -1447
  8. package/dist/TimesheetList-QmuwWz31.js +0 -395
  9. package/dist/api/employee/index.d.ts +0 -15
  10. package/dist/api/index.d.ts +0 -3
  11. package/dist/api/inventory/index.d.ts +0 -5
  12. package/dist/api/role/index.d.ts +0 -9
  13. package/dist/api/team/index.d.ts +0 -10
  14. package/dist/api/timesheet/index.d.ts +0 -6
  15. package/dist/api/user/index.d.ts +0 -6
  16. package/dist/app-DWSjl6MP.js +0 -1170
  17. package/dist/app-DXlbstZu.js +0 -2282
  18. package/dist/app.d.ts +0 -3
  19. package/dist/app.js +0 -6
  20. package/dist/components/AppForm.vue.d.ts +0 -45
  21. package/dist/components/CheckboxInput.vue.d.ts +0 -155
  22. package/dist/components/Navigator.vue.d.ts +0 -6
  23. package/dist/components/Splash.vue.d.ts +0 -2
  24. package/dist/composables/message.d.ts +0 -4
  25. package/dist/composables/restaurant.d.ts +0 -329
  26. package/dist/employee-C-ICOGva.js +0 -449
  27. package/dist/favicon.ico +0 -0
  28. package/dist/helpers/component.d.ts +0 -12
  29. package/dist/helpers/iteration.d.ts +0 -10
  30. package/dist/helpers/rule.d.ts +0 -28
  31. package/dist/helpers/utils.d.ts +0 -3
  32. package/dist/index-COaCoGwy.js +0 -57
  33. package/dist/loading-31nfQqf0.js +0 -140
  34. package/dist/lodash-P5mhhlxp.js +0 -3676
  35. package/dist/main-DlJuqlgg.js +0 -15636
  36. package/dist/main.d.ts +0 -1
  37. package/dist/restaurant-D5BNPLKh.js +0 -107
  38. package/dist/router/index.d.ts +0 -2
  39. package/dist/router/shared.d.ts +0 -10
  40. package/dist/rule-DjIknogy.js +0 -8229
  41. package/dist/search-Dh3HG-_h.js +0 -258
  42. package/dist/shared/api/index.d.ts +0 -3
  43. package/dist/shared/api/public.d.ts +0 -5
  44. package/dist/shared/components/button/ResponsiveFabButton.vue.d.ts +0 -3
  45. package/dist/shared/components/form/SelectFilter.vue.d.ts +0 -86
  46. package/dist/shared/components/layout/FormColumn.vue.d.ts +0 -12
  47. package/dist/shared/components/layout/FormItem.vue.d.ts +0 -17
  48. package/dist/shared/components/layout/FormSection.vue.d.ts +0 -18
  49. package/dist/shared/components/layout/FullWrapper.vue.d.ts +0 -9
  50. package/dist/shared/components/layout/HorizontalSplitter.vue.d.ts +0 -2
  51. package/dist/shared/components/layout/LottieAnimation.vue.d.ts +0 -39
  52. package/dist/shared/components/layout/PageLayout.vue.d.ts +0 -20
  53. package/dist/shared/components/loading/AppLoading.vue.d.ts +0 -20
  54. package/dist/shared/components/loading/PageLoading.vue.d.ts +0 -2
  55. package/dist/shared/components/loading/index.d.ts +0 -1
  56. package/dist/shared/components/menu/BottomSheetMenu.vue.d.ts +0 -13
  57. package/dist/shared/components/menu/BottomSheetMenuItem.vue.d.ts +0 -15
  58. package/dist/shared/components/menu/ResponsiveContextMenu.vue.d.ts +0 -13
  59. package/dist/shared/components/table/EmptyDataTemplate/Icon.vue.d.ts +0 -2
  60. package/dist/shared/components/table/EmptyDataTemplate/index.d.ts +0 -1
  61. package/dist/shared/components/table/EmptyDataTemplate/index.vue.d.ts +0 -18
  62. package/dist/shared/composable/dateRange.d.ts +0 -18
  63. package/dist/shared/composable/discardConfirm.d.ts +0 -1
  64. package/dist/shared/composable/elementPosition.d.ts +0 -17
  65. package/dist/shared/composable/filterSelector.d.ts +0 -12
  66. package/dist/shared/composable/loading.d.ts +0 -29
  67. package/dist/shared/composable/search.d.ts +0 -5
  68. package/dist/shared/composable/sheet.d.ts +0 -17
  69. package/dist/shared/helpers/createComponent.d.ts +0 -7
  70. package/dist/shared/helpers/iteration.d.ts +0 -11
  71. package/dist/shared/helpers/object.d.ts +0 -6
  72. package/dist/shared/helpers/string.d.ts +0 -12
  73. package/dist/shared/permission/posPermission.d.ts +0 -6
  74. package/dist/shared/stores/app.d.ts +0 -217
  75. package/dist/stores/employee.d.ts +0 -590
  76. package/dist/stores/role.d.ts +0 -214
  77. package/dist/stores/timesheet.d.ts +0 -253
  78. package/dist/style.css +0 -1
  79. package/dist/timesheet-Jwqi_LdM.js +0 -56
  80. package/dist/tsconfig.app.tsbuildinfo +0 -1
  81. package/dist/types/employee.d.ts +0 -30
  82. package/dist/types/permission.d.ts +0 -2
  83. package/dist/types/restaurant.d.ts +0 -18
  84. package/dist/types/role.d.ts +0 -37
  85. package/dist/types/team.d.ts +0 -49
  86. package/dist/types/timesheet.d.ts +0 -16
  87. package/dist/views/hr/locales/index.d.ts +0 -602
  88. package/dist/views/hr/views/employee/Employee.vue.d.ts +0 -2
  89. package/dist/views/hr/views/employee/EmployeeList.vue.d.ts +0 -38
  90. package/dist/views/hr/views/employee/components/EmployeeForm.vue.d.ts +0 -27
  91. package/dist/views/hr/views/main.vue.d.ts +0 -2
  92. package/dist/views/hr/views/role/RoleForm.vue.d.ts +0 -17
  93. package/dist/views/hr/views/role/RoleList.vue.d.ts +0 -5
  94. package/dist/views/hr/views/timesheet/TimesheetList.vue.d.ts +0 -2
  95. package/dist/views/team/locales/index.d.ts +0 -348
  96. package/dist/views/team/views/team/TeamMemberList.vue.d.ts +0 -2
  97. package/dist/views/team/views/team/components/AddMemberForm.vue.d.ts +0 -37
  98. package/dist/views/team/views/team/components/MemberInfo.vue.d.ts +0 -6
  99. package/dist/views/team/views/team/components/PortalPermissionEditor.vue.d.ts +0 -46
  100. package/dist/views/team/views/team/components/PortalUserSearcher.vue.d.ts +0 -40
  101. package/dist/views/team/views/team/components/TeamMemberBasePermission.vue.d.ts +0 -36
  102. package/dist/views/team/views/team/components/TeamMemberConditionPermission.vue.d.ts +0 -50
  103. package/dist/views/team/views/team/components/TeamMemberMasterUser.vue.d.ts +0 -710
  104. package/dist/views/team/views/team/components/TeamMemberRolePermission.vue.d.ts +0 -46
@@ -1,449 +0,0 @@
1
- import { p as se, m as ne, b as O, g as Y, u as ae, o as oe, s as Q } from "./rule-DjIknogy.js";
2
- import { defineStore as ie, storeToRefs as ue } from "pinia";
3
- import { ref as q } from "vue";
4
- import { useCoreStore as ce } from "@feedmepos/mf-common";
5
- import { t as le } from "./index-COaCoGwy.js";
6
- var K = { exports: {} };
7
- (function(u, v) {
8
- (function(I, T) {
9
- u.exports = T();
10
- })(ne, function() {
11
- var I = 1e3, T = 6e4, _ = 36e5, x = "millisecond", b = "second", D = "minute", M = "hour", E = "day", w = "week", p = "month", U = "quarter", i = "year", c = "date", $ = "Invalid Date", X = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, ee = /\[([^\]]+)]|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, te = { 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(n) {
12
- var r = ["th", "st", "nd", "rd"], e = n % 100;
13
- return "[" + n + (r[(e - 20) % 10] || r[e] || r[0]) + "]";
14
- } }, V = function(n, r, e) {
15
- var s = String(n);
16
- return !s || s.length >= r ? n : "" + Array(r + 1 - s.length).join(e) + n;
17
- }, re = { s: V, z: function(n) {
18
- var r = -n.utcOffset(), e = Math.abs(r), s = Math.floor(e / 60), t = e % 60;
19
- return (r <= 0 ? "+" : "-") + V(s, 2, "0") + ":" + V(t, 2, "0");
20
- }, m: function n(r, e) {
21
- if (r.date() < e.date()) return -n(e, r);
22
- var s = 12 * (e.year() - r.year()) + (e.month() - r.month()), t = r.clone().add(s, p), a = e - t < 0, o = r.clone().add(s + (a ? -1 : 1), p);
23
- return +(-(s + (e - t) / (a ? t - o : o - t)) || 0);
24
- }, a: function(n) {
25
- return n < 0 ? Math.ceil(n) || 0 : Math.floor(n);
26
- }, p: function(n) {
27
- return { M: p, y: i, w, d: E, D: c, h: M, m: D, s: b, ms: x, Q: U }[n] || String(n || "").toLowerCase().replace(/s$/, "");
28
- }, u: function(n) {
29
- return n === void 0;
30
- } }, N = "en", L = {};
31
- L[N] = te;
32
- var B = "$isDayjsObject", R = function(n) {
33
- return n instanceof Z || !(!n || !n[B]);
34
- }, J = function n(r, e, s) {
35
- var t;
36
- if (!r) return N;
37
- if (typeof r == "string") {
38
- var a = r.toLowerCase();
39
- L[a] && (t = a), e && (L[a] = e, t = a);
40
- var o = r.split("-");
41
- if (!t && o.length > 1) return n(o[0]);
42
- } else {
43
- var f = r.name;
44
- L[f] = r, t = f;
45
- }
46
- return !s && t && (N = t), t || !s && N;
47
- }, m = function(n, r) {
48
- if (R(n)) return n.clone();
49
- var e = typeof r == "object" ? r : {};
50
- return e.date = n, e.args = arguments, new Z(e);
51
- }, l = re;
52
- l.l = J, l.i = R, l.w = function(n, r) {
53
- return m(n, { locale: r.$L, utc: r.$u, x: r.$x, $offset: r.$offset });
54
- };
55
- var Z = function() {
56
- function n(e) {
57
- this.$L = J(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[B] = !0;
58
- }
59
- var r = n.prototype;
60
- return r.parse = function(e) {
61
- this.$d = function(s) {
62
- var t = s.date, a = s.utc;
63
- if (t === null) return /* @__PURE__ */ new Date(NaN);
64
- if (l.u(t)) return /* @__PURE__ */ new Date();
65
- if (t instanceof Date) return new Date(t);
66
- if (typeof t == "string" && !/Z$/i.test(t)) {
67
- var o = t.match(X);
68
- if (o) {
69
- var f = o[2] - 1 || 0, d = (o[7] || "0").substring(0, 3);
70
- return a ? new Date(Date.UTC(o[1], f, o[3] || 1, o[4] || 0, o[5] || 0, o[6] || 0, d)) : new Date(o[1], f, o[3] || 1, o[4] || 0, o[5] || 0, o[6] || 0, d);
71
- }
72
- }
73
- return new Date(t);
74
- }(e), this.init();
75
- }, r.init = function() {
76
- var e = this.$d;
77
- this.$y = e.getFullYear(), this.$M = e.getMonth(), this.$D = e.getDate(), this.$W = e.getDay(), this.$H = e.getHours(), this.$m = e.getMinutes(), this.$s = e.getSeconds(), this.$ms = e.getMilliseconds();
78
- }, r.$utils = function() {
79
- return l;
80
- }, r.isValid = function() {
81
- return this.$d.toString() !== $;
82
- }, r.isSame = function(e, s) {
83
- var t = m(e);
84
- return this.startOf(s) <= t && t <= this.endOf(s);
85
- }, r.isAfter = function(e, s) {
86
- return m(e) < this.startOf(s);
87
- }, r.isBefore = function(e, s) {
88
- return this.endOf(s) < m(e);
89
- }, r.$g = function(e, s, t) {
90
- return l.u(e) ? this[s] : this.set(t, e);
91
- }, r.unix = function() {
92
- return Math.floor(this.valueOf() / 1e3);
93
- }, r.valueOf = function() {
94
- return this.$d.getTime();
95
- }, r.startOf = function(e, s) {
96
- var t = this, a = !!l.u(s) || s, o = l.p(e), f = function(A, g) {
97
- var H = l.w(t.$u ? Date.UTC(t.$y, g, A) : new Date(t.$y, g, A), t);
98
- return a ? H : H.endOf(E);
99
- }, d = function(A, g) {
100
- return l.w(t.toDate()[A].apply(t.toDate("s"), (a ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(g)), t);
101
- }, h = this.$W, y = this.$M, S = this.$D, W = "set" + (this.$u ? "UTC" : "");
102
- switch (o) {
103
- case i:
104
- return a ? f(1, 0) : f(31, 11);
105
- case p:
106
- return a ? f(1, y) : f(0, y + 1);
107
- case w:
108
- var j = this.$locale().weekStart || 0, F = (h < j ? h + 7 : h) - j;
109
- return f(a ? S - F : S + (6 - F), y);
110
- case E:
111
- case c:
112
- return d(W + "Hours", 0);
113
- case M:
114
- return d(W + "Minutes", 1);
115
- case D:
116
- return d(W + "Seconds", 2);
117
- case b:
118
- return d(W + "Milliseconds", 3);
119
- default:
120
- return this.clone();
121
- }
122
- }, r.endOf = function(e) {
123
- return this.startOf(e, !1);
124
- }, r.$set = function(e, s) {
125
- var t, a = l.p(e), o = "set" + (this.$u ? "UTC" : ""), f = (t = {}, t[E] = o + "Date", t[c] = o + "Date", t[p] = o + "Month", t[i] = o + "FullYear", t[M] = o + "Hours", t[D] = o + "Minutes", t[b] = o + "Seconds", t[x] = o + "Milliseconds", t)[a], d = a === E ? this.$D + (s - this.$W) : s;
126
- if (a === p || a === i) {
127
- var h = this.clone().set(c, 1);
128
- h.$d[f](d), h.init(), this.$d = h.set(c, Math.min(this.$D, h.daysInMonth())).$d;
129
- } else f && this.$d[f](d);
130
- return this.init(), this;
131
- }, r.set = function(e, s) {
132
- return this.clone().$set(e, s);
133
- }, r.get = function(e) {
134
- return this[l.p(e)]();
135
- }, r.add = function(e, s) {
136
- var t, a = this;
137
- e = Number(e);
138
- var o = l.p(s), f = function(y) {
139
- var S = m(a);
140
- return l.w(S.date(S.date() + Math.round(y * e)), a);
141
- };
142
- if (o === p) return this.set(p, this.$M + e);
143
- if (o === i) return this.set(i, this.$y + e);
144
- if (o === E) return f(1);
145
- if (o === w) return f(7);
146
- var d = (t = {}, t[D] = T, t[M] = _, t[b] = I, t)[o] || 1, h = this.$d.getTime() + e * d;
147
- return l.w(h, this);
148
- }, r.subtract = function(e, s) {
149
- return this.add(-1 * e, s);
150
- }, r.format = function(e) {
151
- var s = this, t = this.$locale();
152
- if (!this.isValid()) return t.invalidDate || $;
153
- var a = e || "YYYY-MM-DDTHH:mm:ssZ", o = l.z(this), f = this.$H, d = this.$m, h = this.$M, y = t.weekdays, S = t.months, W = t.meridiem, j = function(g, H, P, z) {
154
- return g && (g[H] || g(s, a)) || P[H].slice(0, z);
155
- }, F = function(g) {
156
- return l.s(f % 12 || 12, g, "0");
157
- }, A = W || function(g, H, P) {
158
- var z = g < 12 ? "AM" : "PM";
159
- return P ? z.toLowerCase() : z;
160
- };
161
- return a.replace(ee, function(g, H) {
162
- return H || function(P) {
163
- switch (P) {
164
- case "YY":
165
- return String(s.$y).slice(-2);
166
- case "YYYY":
167
- return l.s(s.$y, 4, "0");
168
- case "M":
169
- return h + 1;
170
- case "MM":
171
- return l.s(h + 1, 2, "0");
172
- case "MMM":
173
- return j(t.monthsShort, h, S, 3);
174
- case "MMMM":
175
- return j(S, h);
176
- case "D":
177
- return s.$D;
178
- case "DD":
179
- return l.s(s.$D, 2, "0");
180
- case "d":
181
- return String(s.$W);
182
- case "dd":
183
- return j(t.weekdaysMin, s.$W, y, 2);
184
- case "ddd":
185
- return j(t.weekdaysShort, s.$W, y, 3);
186
- case "dddd":
187
- return y[s.$W];
188
- case "H":
189
- return String(f);
190
- case "HH":
191
- return l.s(f, 2, "0");
192
- case "h":
193
- return F(1);
194
- case "hh":
195
- return F(2);
196
- case "a":
197
- return A(f, d, !0);
198
- case "A":
199
- return A(f, d, !1);
200
- case "m":
201
- return String(d);
202
- case "mm":
203
- return l.s(d, 2, "0");
204
- case "s":
205
- return String(s.$s);
206
- case "ss":
207
- return l.s(s.$s, 2, "0");
208
- case "SSS":
209
- return l.s(s.$ms, 3, "0");
210
- case "Z":
211
- return o;
212
- }
213
- return null;
214
- }(g) || o.replace(":", "");
215
- });
216
- }, r.utcOffset = function() {
217
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
218
- }, r.diff = function(e, s, t) {
219
- var a, o = this, f = l.p(s), d = m(e), h = (d.utcOffset() - this.utcOffset()) * T, y = this - d, S = function() {
220
- return l.m(o, d);
221
- };
222
- switch (f) {
223
- case i:
224
- a = S() / 12;
225
- break;
226
- case p:
227
- a = S();
228
- break;
229
- case U:
230
- a = S() / 3;
231
- break;
232
- case w:
233
- a = (y - h) / 6048e5;
234
- break;
235
- case E:
236
- a = (y - h) / 864e5;
237
- break;
238
- case M:
239
- a = y / _;
240
- break;
241
- case D:
242
- a = y / T;
243
- break;
244
- case b:
245
- a = y / I;
246
- break;
247
- default:
248
- a = y;
249
- }
250
- return t ? a : l.a(a);
251
- }, r.daysInMonth = function() {
252
- return this.endOf(p).$D;
253
- }, r.$locale = function() {
254
- return L[this.$L];
255
- }, r.locale = function(e, s) {
256
- if (!e) return this.$L;
257
- var t = this.clone(), a = J(e, s, !0);
258
- return a && (t.$L = a), t;
259
- }, r.clone = function() {
260
- return l.w(this.$d, this);
261
- }, r.toDate = function() {
262
- return new Date(this.valueOf());
263
- }, r.toJSON = function() {
264
- return this.isValid() ? this.toISOString() : null;
265
- }, r.toISOString = function() {
266
- return this.$d.toISOString();
267
- }, r.toString = function() {
268
- return this.$d.toUTCString();
269
- }, n;
270
- }(), G = Z.prototype;
271
- return m.prototype = G, [["$ms", x], ["$s", b], ["$m", D], ["$H", M], ["$W", E], ["$M", p], ["$y", i], ["$D", c]].forEach(function(n) {
272
- G[n[1]] = function(r) {
273
- return this.$g(r, n[0], n[1]);
274
- };
275
- }), m.extend = function(n, r) {
276
- return n.$i || (n(r, Z, m), n.$i = !0), m;
277
- }, m.locale = J, m.isDayjs = R, m.unix = function(n) {
278
- return m(1e3 * n);
279
- }, m.en = L[N], m.Ls = L, m.p = {}, m;
280
- });
281
- })(K);
282
- var fe = K.exports;
283
- const de = /* @__PURE__ */ se(fe), k = {
284
- async readEmployees() {
285
- return Y(await O().get("/pos-users"));
286
- },
287
- async createEmployee(u) {
288
- return Y(await O().post("/pos-users", u));
289
- },
290
- async createMasterEmployee(u) {
291
- return Y(await O().post("/pos-users/master-user", u));
292
- },
293
- async migrateToMasterEmployee(u, v) {
294
- return Y(await O().put(`/pos-users/migrate/${u}`, v));
295
- },
296
- async updateEmployee(u, v) {
297
- return Y(await O().put(`/pos-users/${u}`, v));
298
- },
299
- async updateMasterEmployee(u, v) {
300
- return Y(await O().put(`/pos-users/master-user/${u}`, v));
301
- },
302
- async deleteEmployee(u) {
303
- return Y(
304
- await O().put(`/pos-users/${u._id}`, {
305
- user: u,
306
- roles: []
307
- })
308
- );
309
- },
310
- async deleteMasterEmployee(u) {
311
- return Y(
312
- await O().put(`/pos-users/master-user/${u._id}`, {
313
- user: u,
314
- roles: []
315
- })
316
- );
317
- },
318
- async generateEmployeePasscode() {
319
- return `${Y(await O().get("/pos-users/generate-passcode"))}`;
320
- },
321
- async syncUsersMeta() {
322
- await O().post("/pos-users/create-users-meta");
323
- }
324
- };
325
- async function C(u) {
326
- const v = ae().roles.value, { restaurants: I } = ce(), T = u.reduce((_, x) => {
327
- var U;
328
- const { _id: b, restaurantId: D } = x, M = _.findIndex((i) => i._id === b), E = ((U = I.value.find((i) => i._id === D)) == null ? void 0 : U.profile.name) || "", w = v.find((i) => i._id === x.role), p = {
329
- restaurantId: D,
330
- restaurantName: E,
331
- roleId: (w == null ? void 0 : w._id) || "",
332
- roleName: (w == null ? void 0 : w.name) || ""
333
- };
334
- return M < 0 ? _.push({
335
- ...x,
336
- since: de(oe(b)).format("DD/MM/YYYY"),
337
- restaurants: [p]
338
- }) : _[M].restaurants.some((i) => i.restaurantId === D) || (_[M].restaurants = Q([..._[M].restaurants, p], {
339
- selector: "restaurantName"
340
- })), _;
341
- }, []);
342
- return Q(T, { selector: "name" });
343
- }
344
- const me = ie("employee", () => {
345
- const u = q([]), v = q(!1), I = q([]);
346
- async function T() {
347
- try {
348
- v.value = !0;
349
- const i = await k.readEmployees();
350
- u.value = await C(i);
351
- } catch (i) {
352
- console.log("Error reading employees:", i);
353
- } finally {
354
- v.value = !1;
355
- }
356
- }
357
- async function _(i) {
358
- try {
359
- const c = await k.createEmployee(i);
360
- u.value = await C(c);
361
- } catch (c) {
362
- console.log("Error creating employee:", c);
363
- }
364
- }
365
- async function x(i, c) {
366
- try {
367
- const $ = await k.updateEmployee(i, c);
368
- u.value = await C($);
369
- } catch ($) {
370
- console.log("Error updating employee:", $);
371
- }
372
- }
373
- async function b(i) {
374
- try {
375
- const c = await k.deleteEmployee(i);
376
- u.value = await C(c);
377
- } catch (c) {
378
- console.log("Error deleting employee:", c);
379
- }
380
- }
381
- async function D(i) {
382
- try {
383
- const c = await k.deleteMasterEmployee(i);
384
- u.value = await C(c);
385
- } catch (c) {
386
- console.log("Error deleting master employee:", c);
387
- }
388
- }
389
- async function M(i) {
390
- try {
391
- const c = await k.createMasterEmployee(i);
392
- u.value = await C(c);
393
- } catch (c) {
394
- console.log("Error creating master employee:", c);
395
- }
396
- }
397
- async function E(i, c) {
398
- try {
399
- const $ = await k.updateMasterEmployee(i, c);
400
- u.value = await C($);
401
- } catch ($) {
402
- console.log("Error updating master employee:", $);
403
- }
404
- }
405
- async function w(i, c) {
406
- try {
407
- const $ = await k.migrateToMasterEmployee(i, c);
408
- u.value = await C($);
409
- } catch ($) {
410
- console.log("Error migrating to master employee:", $);
411
- }
412
- }
413
- async function p() {
414
- try {
415
- I.value = await le.readTeamMemberPosUserIds();
416
- } catch (i) {
417
- console.log("Error reading team member pos user ids:", i);
418
- }
419
- }
420
- async function U() {
421
- await k.syncUsersMeta();
422
- }
423
- return {
424
- employees: u,
425
- restrictEmployeeIds: I,
426
- isLoading: v,
427
- readEmployees: T,
428
- createEmployee: _,
429
- updateEmployee: x,
430
- deleteEmployee: b,
431
- createMasterEmployee: M,
432
- updateMasterEmployee: E,
433
- deleteMasterEmployee: D,
434
- migrateToMasterUser: w,
435
- readTeamMemberPosUserIds: p,
436
- syncUsersMeta: U
437
- };
438
- }), Me = () => {
439
- const u = me();
440
- return {
441
- ...u,
442
- ...ue(u)
443
- };
444
- };
445
- export {
446
- de as D,
447
- k as E,
448
- Me as u
449
- };
package/dist/favicon.ico DELETED
Binary file
@@ -1,12 +0,0 @@
1
- export type MenuActionProps = {
2
- label: string;
3
- color: string;
4
- };
5
- export declare enum MenuActionEnum {
6
- Update = "Update",
7
- Remove = "Remove"
8
- }
9
- export declare const DefaultMenuActions: Record<MenuActionEnum, MenuActionProps>;
10
- export declare function createContextMenuComponents(actions: MenuActionProps[], onClick: (action: string) => void): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
11
- [key: string]: any;
12
- }>;
@@ -1,10 +0,0 @@
1
- export declare function clone<T>(value: T, exceptKey?: string[]): T;
2
- type Selector<T> = keyof T | ((item: T) => string);
3
- export declare function sort<T>(arr: T[], option?: {
4
- selector?: Selector<T>;
5
- descending?: boolean;
6
- } | undefined): T[];
7
- export declare function group<T>(arr: T[], by: Selector<T>): {
8
- [key: string]: T[];
9
- };
10
- export {};
@@ -1,28 +0,0 @@
1
- import type { RawRule } from '@casl/ability';
2
- import { F_RULE_SUBJECT, type FdoPermissionRule } from '@feedmepos/core/entity';
3
- import type { Rule } from '../types/role';
4
- export declare function filterPermissions(permissions: FdoPermissionRule[], subject: F_RULE_SUBJECT): string;
5
- export declare function ruleExtension(rule: FdoPermissionRule): {
6
- conditions: any;
7
- isDiscountOperation: boolean;
8
- isOrderOperation: boolean;
9
- isReportPermission: boolean;
10
- formatted: string;
11
- label: string;
12
- value: string;
13
- reason?: string | null | undefined;
14
- fields?: string[] | null | undefined;
15
- inverted?: boolean | null | undefined;
16
- subject: string;
17
- actions: ("delete" | "update" | "create" | "read" | "manage")[];
18
- };
19
- export declare function getMaxDiscount(rules: FdoPermissionRule[]): number;
20
- export declare function getManagableRestaurantIds(rules: RawRule[]): string[] | null;
21
- export declare function hasAdminRule(rules: FdoPermissionRule[]): boolean;
22
- export declare function usableRoleIds(rules: RawRule[]): string[] | null;
23
- export declare function fromValue(values: string[], maxDiscountPercentage: number): {
24
- subject: string;
25
- actions: ("delete" | "update" | "create" | "read" | "manage")[];
26
- conditions: object;
27
- }[];
28
- export declare function toRule(v: string): Rule;
@@ -1,3 +0,0 @@
1
- export declare function idToDate(id: string): string | null;
2
- export declare function formatDuration(totalMinutes: number): string;
3
- export declare function sentenceCase(s: string): string;
@@ -1,57 +0,0 @@
1
- import { fullPermission as l, useCoreStore as c, Permission as d } from "@feedmepos/mf-common";
2
- import { g as r, b as t, a as f, s as b } from "./rule-DjIknogy.js";
3
- const g = Object.freeze(Object.values(l));
4
- function i(e) {
5
- const u = c().restaurants, p = f(e.permissions) || u.value.map((s) => s._id);
6
- return {
7
- doc: e,
8
- id: e.id,
9
- name: e.name || "-",
10
- phoneNumber: e.phoneNumber,
11
- email: e.email,
12
- restaurants: b(
13
- p.map(
14
- (s) => {
15
- var m;
16
- return ((m = u.value.find((a) => a._id === s)) == null ? void 0 : m.profile.name) ?? "";
17
- }
18
- )
19
- ),
20
- managableRestaurantIds: p,
21
- permissions: b(
22
- e.permissions.reduce((s, m) => {
23
- const a = g.find((o) => o.subject === m.subject);
24
- if (a) {
25
- const o = a.subject === d.Subject.Business.stock ? "Warehouse management" : a.label;
26
- s.push(o);
27
- }
28
- return s;
29
- }, [])
30
- )
31
- };
32
- }
33
- const j = {
34
- async readTeamMembers() {
35
- return r(await t().get("/portal-users")).map(i);
36
- },
37
- async createTeamMember(e) {
38
- return i(
39
- r(await t().post("/portal-users", e))
40
- );
41
- },
42
- async updateTeamMember(e, n) {
43
- return i(
44
- r(await t().put(`/portal-users/${e}`, n))
45
- );
46
- },
47
- async deleteTeamMember(e) {
48
- return r(await t().delete(`/portal-users/${e}`));
49
- },
50
- async readTeamMemberPosUserIds() {
51
- return r(await t().get("/portal-users")).map((n) => n.posUserId);
52
- }
53
- };
54
- export {
55
- g as p,
56
- j as t
57
- };