@feedmepos/mf-hrm-portal 1.1.1-dev → 1.1.3-dev

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 (32) hide show
  1. package/dist/AuditLogList-DNQh1rE9.js +316 -0
  2. package/dist/{EmployeeList-CMUbRS7j.js → EmployeeList-zU7fmC4c.js} +9 -8
  3. package/dist/{Main-BbZ-t-pu.js → Main-BqhrqOzx.js} +4 -4
  4. package/dist/{Main-un3v_g6p.js → Main-DGymQNz9.js} +9 -8
  5. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BvjXcknf.js +3050 -0
  6. package/dist/{RoleList-mlTepnhN.js → RoleList-jbZqer7A.js} +5 -5
  7. package/dist/{RolePermissionList-tR-Kmlu7.js → RolePermissionList-Dd8ks5i7.js} +3 -3
  8. package/dist/{useSearch-C6gRA62e.js → SelectFilter-NbXrJ4iH.js} +90 -101
  9. package/dist/{TeamMemberList-BkRQl6x8.js → TeamMemberList-uamoOFIV.js} +40 -39
  10. package/dist/{TimesheetList-i5yaAzhB.js → TimesheetList-hgT9DrHd.js} +21 -20
  11. package/dist/api/team/index.d.ts +4 -1
  12. package/dist/{app-4LaGLcWC.js → app-CcbYGJ22.js} +757 -464
  13. package/dist/app.js +4 -4
  14. package/dist/dayjs.min-CgN1oBQf.js +282 -0
  15. package/dist/employee-khk560IC.js +172 -0
  16. package/dist/{index-BsEM84j5.js → index-D5sdamN5.js} +1154 -1183
  17. package/dist/{lodash-DYaYvsmp.js → lodash-7Am6_Zd3.js} +1 -1
  18. package/dist/{team-eo_yQh1g.js → team-CFyc6tnm.js} +1 -1
  19. package/dist/{timesheet-CfPIK52Q.js → timesheet-DKhEeLe7.js} +12 -12
  20. package/dist/tsconfig.app.tsbuildinfo +1 -1
  21. package/dist/types/audit-log.d.ts +1 -0
  22. package/dist/types/permission.d.ts +1 -5
  23. package/dist/{useAppStore-D0F-tWJO.js → useAppStore-DOSLuH24.js} +1 -1
  24. package/dist/{useLoading-DpbOtToC.js → useLoading-BA-GSZ3R.js} +1 -1
  25. package/dist/useSearch-B6WK1LBB.js +15 -0
  26. package/dist/views/audit-log/locales/index.d.ts +211 -0
  27. package/dist/views/team/components/BasePermission.vue.d.ts +0 -12
  28. package/package.json +2 -2
  29. package/dist/AuditLogList-D62QRWN-.js +0 -232
  30. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CZKBfM_R.js +0 -3119
  31. package/dist/employee-BZTntAR0.js +0 -450
  32. /package/dist/views/{hr/audit-log → audit-log}/AuditLogList.vue.d.ts +0 -0
package/dist/app.js CHANGED
@@ -1,6 +1,6 @@
1
- import { a as e, i as r, r as o } from "./app-4LaGLcWC.js";
1
+ import { d as a, i as o, e as p } from "./app-CcbYGJ22.js";
2
2
  export {
3
- e as FmApp,
4
- r as i18nMessages,
5
- o as routes
3
+ a as FmApp,
4
+ o as i18nMessages,
5
+ p as routes
6
6
  };
@@ -0,0 +1,282 @@
1
+ import { g as Q, c as K } from "./app-CcbYGJ22.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
+ };
@@ -0,0 +1,172 @@
1
+ import { d as v } from "./dayjs.min-CgN1oBQf.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-D5sdamN5.js";
6
+ import { u as S } from "./useAppStore-DOSLuH24.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
+ };