@feedmepos/mf-hrm-portal 2.0.17-dev.5 → 2.0.18-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 (35) hide show
  1. package/dist/{AuditLogList-Dl3Nmf00.js → AuditLogList-CaoW9uYd.js} +5 -5
  2. package/dist/EmployeeList-DcMvF9U5.js +839 -0
  3. package/dist/Main-CleutFvF.js +567 -0
  4. package/dist/{Main-CQ3KwxDY.js → Main-CvW6Vu8N.js} +2055 -2055
  5. package/dist/{Main-w0XUUaBp.js → Main-D7k57uq5.js} +32 -32
  6. package/dist/{PermissionSetList-B8qNOWH6.js → PermissionSetList-CM7kbWkO.js} +6 -6
  7. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C9VUjAu_.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Ces9YwYB.js} +525 -525
  8. package/dist/{RoleList-DMFJsUZv.js → RoleList-DR3eVJ9f.js} +102 -102
  9. package/dist/TeamMemberList-CZZv4Pu5.js +1038 -0
  10. package/dist/{TimesheetList-Bwp9_xHe.js → TimesheetList-WqqoKPbg.js} +132 -126
  11. package/dist/{app-COJbSNM4.js → app-R5EioPr4.js} +4 -4
  12. package/dist/app.js +1 -1
  13. package/dist/{dayjs.min-CcBi6N-K.js → dayjs.min-CN15Ft3o.js} +1 -1
  14. package/dist/employee-DwQlWLkL.js +204 -0
  15. package/dist/{iteration-JOKbtlLf.js → iteration-UBGGRoxQ.js} +9258 -9213
  16. package/dist/{lodash-D5xlVzib.js → lodash-CC6qHVUo.js} +1 -1
  17. package/dist/{rule-3sXHiW0y.js → rule-B519XbW6.js} +273 -273
  18. package/dist/src/api/restaurant/index.d.ts +5 -0
  19. package/dist/src/composables/useRestaurantMap.d.ts +2 -329
  20. package/dist/src/stores/restaurant.d.ts +181 -0
  21. package/dist/src/stores/role.d.ts +7 -7
  22. package/dist/src/types/restaurant.d.ts +11 -0
  23. package/dist/style.css +1 -1
  24. package/dist/{team-CyNektSD.js → team-BGLhgx5P.js} +1 -1
  25. package/dist/{timesheet-DkD3AysG.js → timesheet-BylrXRfd.js} +2 -2
  26. package/dist/tsconfig.app.tsbuildinfo +1 -1
  27. package/dist/useAppStore-Akl8AoVN.js +171 -0
  28. package/dist/{useLoading-4TNmhm5N.js → useLoading-rbrVwWuj.js} +1 -1
  29. package/dist/{useReportPermissions-CWMFFb8E.js → useReportPermissions-BOEZU86S.js} +3 -3
  30. package/package.json +1 -1
  31. package/dist/EmployeeList-DBd_rVW2.js +0 -831
  32. package/dist/Main-pTgqNncY.js +0 -560
  33. package/dist/TeamMemberList-BLRTfKLz.js +0 -1031
  34. package/dist/employee-xiV0LfnL.js +0 -204
  35. package/dist/useAppStore-CvmsaYSG.js +0 -171
@@ -1,204 +0,0 @@
1
- import { d as M } from "./dayjs.min-CcBi6N-K.js";
2
- import { defineStore as S, storeToRefs as U } from "pinia";
3
- import { ref as m } from "vue";
4
- import { useCoreStore as w } from "@feedmepos/mf-common";
5
- import { b as p, g as f, s as E } from "./iteration-JOKbtlLf.js";
6
- import { i as v } from "./utils-BZkjJbju.js";
7
- import { u as _ } from "./useAppStore-CvmsaYSG.js";
8
- const n = {
9
- async readEmployees() {
10
- return f(await p().get("/pos-users"));
11
- },
12
- async readEmployeesPage(e) {
13
- var t, i;
14
- return f(
15
- await p().get("/pos-users/paged", {
16
- params: {
17
- limit: e.limit,
18
- offset: e.offset,
19
- search: e.search,
20
- restaurantIds: (t = e.restaurantIds) != null && t.length ? e.restaurantIds : void 0,
21
- roleIds: (i = e.roleIds) != null && i.length ? e.roleIds : void 0
22
- }
23
- })
24
- );
25
- },
26
- async createEmployee(e) {
27
- await p().post("/pos-users", e);
28
- },
29
- async createMasterEmployee(e) {
30
- await p().post("/pos-users/master-user", e);
31
- },
32
- async migrateToMasterEmployee(e, t) {
33
- await p().put(`/pos-users/migrate/${e}`, t);
34
- },
35
- async updateEmployee(e, t) {
36
- await p().put(`/pos-users/${e}`, t);
37
- },
38
- async updateMasterEmployee(e, t) {
39
- await p().put(`/pos-users/master-user/${e}`, t);
40
- },
41
- async deleteEmployee(e) {
42
- await p().put(`/pos-users/${e._id}`, {
43
- user: e,
44
- roles: [],
45
- previousRoles: e.restaurants.map((t) => ({
46
- restaurantId: t.restaurantId,
47
- roleId: t.roleId
48
- }))
49
- });
50
- },
51
- async deleteMasterEmployee(e) {
52
- await p().put(`/pos-users/master-user/${e._id}`, {
53
- user: e,
54
- roles: [],
55
- previousRoles: e.restaurants.map((t) => ({
56
- restaurantId: t.restaurantId,
57
- roleId: t.roleId
58
- }))
59
- });
60
- },
61
- async generateEmployeePasscode() {
62
- return `${f(
63
- await p().get("/pos-users/generate-passcode")
64
- )}`;
65
- },
66
- async syncUsersMeta() {
67
- await p().post("/pos-users/create-users-meta");
68
- }
69
- };
70
- async function $(e) {
71
- const t = _().roles.value, { restaurants: i } = w(), c = new Map(
72
- i.value.map((a) => [a._id, a.profile.name])
73
- ), d = new Map(t.map((a) => [a._id, a.name])), r = /* @__PURE__ */ new Map();
74
- for (const a of e) {
75
- const l = {
76
- restaurantId: a.restaurantId,
77
- restaurantName: c.get(a.restaurantId) || "",
78
- roleId: a.role,
79
- roleName: d.get(a.role) || ""
80
- }, u = r.get(a._id);
81
- if (!u) {
82
- r.set(a._id, {
83
- ...a,
84
- isRestricted: !1,
85
- since: M(v(a._id)).format("DD/MM/YYYY"),
86
- restaurants: [l]
87
- });
88
- continue;
89
- }
90
- u.restaurants.some((y) => y.restaurantId === a.restaurantId) || (u.restaurants = E([...u.restaurants, l], {
91
- selector: "restaurantName"
92
- }));
93
- }
94
- return E([...r.values()], { selector: "name" });
95
- }
96
- function I(e) {
97
- const { restaurants: t } = w(), i = _().roles.value, c = new Map(
98
- t.value.map((a) => [a._id, a])
99
- ), d = new Map(i.map((a) => [a._id, a.name])), r = e.restaurantRole[0];
100
- return {
101
- _id: e._id,
102
- name: e.name,
103
- code: e.code,
104
- passcode: e.passcode,
105
- isMasterUser: e.isMasterUser,
106
- isRestricted: e.isRestricted,
107
- restaurantId: (r == null ? void 0 : r.restaurantId) || "",
108
- role: (r == null ? void 0 : r.roleId) || "",
109
- since: M(v(e._id)).format("DD/MM/YYYY"),
110
- restaurants: E(
111
- e.restaurantRole.map((a) => {
112
- const l = c.get(a.restaurantId);
113
- return {
114
- restaurantId: a.restaurantId,
115
- restaurantName: (l == null ? void 0 : l.profile.name) || "",
116
- restaurantCode: (l == null ? void 0 : l.profile.code) ?? void 0,
117
- roleId: a.roleId,
118
- roleName: d.get(a.roleId) || ""
119
- };
120
- }),
121
- { selector: "restaurantName" }
122
- )
123
- };
124
- }
125
- const T = S("employee", () => {
126
- const e = m([]), t = m([]), i = m(0), c = m(!1);
127
- async function d() {
128
- try {
129
- c.value = !0;
130
- const s = await n.readEmployees();
131
- e.value = await $(s);
132
- } catch (s) {
133
- console.log("Error reading employees:", s);
134
- } finally {
135
- c.value = !1;
136
- }
137
- }
138
- async function r(s) {
139
- try {
140
- c.value = !0;
141
- const o = await n.readEmployeesPage(s);
142
- t.value = o.items.map(I), i.value = o.total;
143
- } catch (o) {
144
- console.log("Error reading employee page:", o);
145
- } finally {
146
- c.value = !1;
147
- }
148
- }
149
- async function a(s, o) {
150
- const g = o ?? (await n.readEmployeesPage({ ...s, limit: 1, offset: 0 })).total;
151
- return g === 0 ? [] : (await n.readEmployeesPage({ ...s, limit: g, offset: 0 })).items.map(I);
152
- }
153
- async function l(s) {
154
- await n.createEmployee(s);
155
- }
156
- async function u(s, o) {
157
- await n.updateEmployee(s, o);
158
- }
159
- async function y(s) {
160
- await n.deleteEmployee(s);
161
- }
162
- async function P(s) {
163
- await n.deleteMasterEmployee(s);
164
- }
165
- async function Y(s) {
166
- await n.createMasterEmployee(s);
167
- }
168
- async function N(s, o) {
169
- await n.updateMasterEmployee(s, o);
170
- }
171
- async function h(s, o) {
172
- await n.migrateToMasterEmployee(s, o);
173
- }
174
- async function D() {
175
- await n.syncUsersMeta();
176
- }
177
- return {
178
- employees: e,
179
- listEmployees: t,
180
- totalEmployees: i,
181
- isLoading: c,
182
- readEmployees: d,
183
- readEmployeesPage: r,
184
- readAllEmployeesPage: a,
185
- createEmployee: l,
186
- updateEmployee: u,
187
- deleteEmployee: y,
188
- createMasterEmployee: Y,
189
- updateMasterEmployee: N,
190
- deleteMasterEmployee: P,
191
- migrateToMasterUser: h,
192
- syncUsersMeta: D
193
- };
194
- }), z = () => {
195
- const e = T();
196
- return {
197
- ...e,
198
- ...U(e)
199
- };
200
- };
201
- export {
202
- n as E,
203
- z as u
204
- };
@@ -1,171 +0,0 @@
1
- import { defineStore as I, storeToRefs as Q } from "pinia";
2
- import { ref as w } from "vue";
3
- import { useCoreStore as x, baseClientInstance as S } from "@feedmepos/mf-common";
4
- import { g as l, b as g, s as h } from "./iteration-JOKbtlLf.js";
5
- const y = {
6
- async readRoles() {
7
- return l(await g().get("/pos-roles"));
8
- },
9
- async createRole(e) {
10
- return l(await g().post("/pos-roles", e));
11
- },
12
- async updateRole(e, t) {
13
- return l(await g().put(`/pos-roles/${e}`, t));
14
- },
15
- async deleteRole(e) {
16
- return l(
17
- await g().put(`/pos-roles/${e._id}`, {
18
- restaurantIds: [],
19
- role: e
20
- })
21
- );
22
- }
23
- };
24
- async function m(e) {
25
- const { restaurants: t } = x(), r = e.reduce((n, i) => {
26
- var p;
27
- const o = n.findIndex((s) => s._id === i._id), d = {
28
- id: i.restaurantId,
29
- name: ((p = t.value.find((s) => s._id === i.restaurantId)) == null ? void 0 : p.profile.name) || ""
30
- };
31
- return o < 0 ? n.push({
32
- ...i,
33
- restaurants: [d]
34
- }) : n[o].restaurants.some((s) => s.id === i.restaurantId) || (n[o].restaurants = h([...n[o].restaurants, d], { selector: "name" })), n;
35
- }, []);
36
- return h(r, { selector: "name" });
37
- }
38
- const U = I("role", () => {
39
- const { currentBusiness: e } = x(), t = w([]), r = w(!1), n = w(null);
40
- async function i() {
41
- var u;
42
- const s = ((u = e.value) == null ? void 0 : u._id) ?? null;
43
- if (n.value !== s)
44
- try {
45
- r.value = !0;
46
- const c = await y.readRoles();
47
- t.value = await m(c), n.value = s;
48
- } catch (c) {
49
- console.log("Error reading roles:", c);
50
- } finally {
51
- r.value = !1;
52
- }
53
- }
54
- async function o(s) {
55
- const u = await y.createRole(s);
56
- t.value = await m(u);
57
- }
58
- async function d(s, u) {
59
- const c = await y.updateRole(s, u);
60
- t.value = await m(c);
61
- }
62
- async function p(s) {
63
- const u = await y.deleteRole(s);
64
- t.value = await m(u);
65
- }
66
- return {
67
- roles: t,
68
- isLoading: r,
69
- readRoles: i,
70
- createRole: o,
71
- updateRole: d,
72
- deleteRole: p
73
- };
74
- }), $ = () => {
75
- const e = U();
76
- return {
77
- ...e,
78
- ...Q(e)
79
- };
80
- };
81
- var a = [];
82
- for (var R = 0; R < 256; ++R)
83
- a.push((R + 256).toString(16).slice(1));
84
- function D(e, t = 0) {
85
- return (a[e[t + 0]] + a[e[t + 1]] + a[e[t + 2]] + a[e[t + 3]] + "-" + a[e[t + 4]] + a[e[t + 5]] + "-" + a[e[t + 6]] + a[e[t + 7]] + "-" + a[e[t + 8]] + a[e[t + 9]] + "-" + a[e[t + 10]] + a[e[t + 11]] + a[e[t + 12]] + a[e[t + 13]] + a[e[t + 14]] + a[e[t + 15]]).toLowerCase();
86
- }
87
- var b, A = new Uint8Array(16);
88
- function _() {
89
- if (!b && (b = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !b))
90
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
91
- return b(A);
92
- }
93
- var L = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
94
- const v = {
95
- randomUUID: L
96
- };
97
- function C(e, t, r) {
98
- if (v.randomUUID && !e)
99
- return v.randomUUID();
100
- e = e || {};
101
- var n = e.random || (e.rng || _)();
102
- return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, D(n);
103
- }
104
- const f = {
105
- async read() {
106
- return l(await S("/").get("/public-setting"));
107
- },
108
- async update(e) {
109
- return l(await S("/").put("/public-setting", e));
110
- }
111
- };
112
- function V() {
113
- return {
114
- loadingQueue: [],
115
- publicSetting: {
116
- delivery: {
117
- feedMe: {
118
- areas: [],
119
- enable: !1,
120
- maxDistance: 0
121
- }
122
- },
123
- sms: {
124
- firebase: !1
125
- },
126
- assets: {
127
- groups: []
128
- },
129
- aiSettings: {
130
- remy: { enable: !1 }
131
- }
132
- }
133
- };
134
- }
135
- const j = I("portal-app-store", {
136
- state: () => V(),
137
- actions: {
138
- addLoadingQueues(e) {
139
- this.loadingQueue = [...this.loadingQueue, ...e];
140
- },
141
- clearLoadingQueue() {
142
- this.loadingQueue = [];
143
- },
144
- resolveQueues(e) {
145
- this.loadingQueue = this.loadingQueue.filter((t) => !e.includes(t.id));
146
- },
147
- async promise(e, t = !0) {
148
- const r = C();
149
- try {
150
- const n = [{ id: r, isGlobal: t }];
151
- return this.addLoadingQueues(n), await e();
152
- } finally {
153
- this.resolveQueues([r]);
154
- }
155
- },
156
- async getPublicSetting() {
157
- return this.publicSetting = await f.read(), this.publicSetting;
158
- },
159
- async updatePublicSetting(e) {
160
- return this.publicSetting = await f.update({
161
- ...this.publicSetting,
162
- ...e
163
- }), this.publicSetting;
164
- }
165
- }
166
- });
167
- export {
168
- j as a,
169
- $ as u,
170
- C as v
171
- };