@feedmepos/mf-hrm-portal 2.0.20-dev.1 → 2.0.20-dev.3
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.
- package/dist/{AuditLogList-Bsj-qg8n.js → AuditLogList-7E8iWQWx.js} +4 -4
- package/dist/EmployeeList-DyNW3cUo.js +851 -0
- package/dist/{Main-CSMAtoMj.js → Main-BLJyOcEv.js} +184 -176
- package/dist/{Main-BGc6kNaR.js → Main-BZjZxFHp.js} +2008 -2001
- package/dist/Main-C9lMH4EN.js +90 -0
- package/dist/PermissionSetList-BuCp14Os.js +355 -0
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CdWgTjZw.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BQSDnH-Z.js} +675 -661
- package/dist/RoleList-L8L1xmJ2.js +564 -0
- package/dist/TeamMemberList-DEN9rHqb.js +1124 -0
- package/dist/{TimesheetList-tFjvFHqH.js → TimesheetList-D88u0GFn.js} +61 -53
- package/dist/{app-CL7rUfL3.js → app-g_SrJtfC.js} +191 -193
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-ChdFPuFV.js → dayjs.min-BGHzwXCt.js} +1 -1
- package/dist/employee-Dep-q_aU.js +200 -0
- package/dist/{iteration-BbD0nOgO.js → iteration-Dc-Bz5bA.js} +173 -175
- package/dist/{lodash-CDf3aG6G.js → lodash-Cxw1GZ6L.js} +1 -1
- package/dist/{rule-BJ-y3Sp8.js → rule-ClRtpdqO.js} +27 -26
- package/dist/src/types/team.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/{timesheet-BmV02Rkz.js → timesheet-CZoSvFYT.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-D8QAGZ02.js → useAppStore-CTBRpqmO.js} +36 -38
- package/dist/{useLoading-KpcQw0p4.js → useLoading-XvrLj1VM.js} +1 -1
- package/dist/{useReportPermissions-CmGJAz_N.js → useReportPermissions-nivbQm9V.js} +3 -3
- package/package.json +1 -1
- package/dist/EmployeeList-Cy2ayCko.js +0 -824
- package/dist/Main-D7bV8EuC.js +0 -86
- package/dist/PermissionSetList-CuHhDqWl.js +0 -347
- package/dist/RoleList-e0WUqt4Y.js +0 -545
- package/dist/TeamMemberList-CpPa1KyV.js +0 -1097
- package/dist/employee-kKV7UnHU.js +0 -204
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { d as M } from "./dayjs.min-ChdFPuFV.js";
|
|
2
|
-
import { defineStore as U, storeToRefs as $ } from "pinia";
|
|
3
|
-
import { ref as m } from "vue";
|
|
4
|
-
import { b as p, g as f, u as g, s as E } from "./iteration-BbD0nOgO.js";
|
|
5
|
-
import { i as v } from "./utils-BZkjJbju.js";
|
|
6
|
-
import { u as _ } from "./useAppStore-D8QAGZ02.js";
|
|
7
|
-
const n = {
|
|
8
|
-
async readEmployees() {
|
|
9
|
-
return f(await p().get("/pos-users"));
|
|
10
|
-
},
|
|
11
|
-
async readEmployeesPage(e) {
|
|
12
|
-
var s, i;
|
|
13
|
-
return f(
|
|
14
|
-
await p().get("/pos-users/paged", {
|
|
15
|
-
params: {
|
|
16
|
-
limit: e.limit,
|
|
17
|
-
offset: e.offset,
|
|
18
|
-
search: e.search,
|
|
19
|
-
restaurantIds: (s = e.restaurantIds) != null && s.length ? e.restaurantIds : void 0,
|
|
20
|
-
roleIds: (i = e.roleIds) != null && i.length ? e.roleIds : void 0
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
);
|
|
24
|
-
},
|
|
25
|
-
async createEmployee(e) {
|
|
26
|
-
await p().post("/pos-users", e);
|
|
27
|
-
},
|
|
28
|
-
async createMasterEmployee(e) {
|
|
29
|
-
await p().post("/pos-users/master-user", e);
|
|
30
|
-
},
|
|
31
|
-
async migrateToMasterEmployee(e, s) {
|
|
32
|
-
await p().put(`/pos-users/migrate/${e}`, s);
|
|
33
|
-
},
|
|
34
|
-
async updateEmployee(e, s) {
|
|
35
|
-
await p().put(`/pos-users/${e}`, s);
|
|
36
|
-
},
|
|
37
|
-
async updateMasterEmployee(e, s) {
|
|
38
|
-
await p().put(`/pos-users/master-user/${e}`, s);
|
|
39
|
-
},
|
|
40
|
-
async deleteEmployee(e) {
|
|
41
|
-
await p().put(`/pos-users/${e._id}`, {
|
|
42
|
-
user: e,
|
|
43
|
-
roles: [],
|
|
44
|
-
previousRoles: e.restaurants.map((s) => ({
|
|
45
|
-
restaurantId: s.restaurantId,
|
|
46
|
-
roleId: s.roleId
|
|
47
|
-
}))
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
async deleteMasterEmployee(e) {
|
|
51
|
-
await p().put(`/pos-users/master-user/${e._id}`, {
|
|
52
|
-
user: e,
|
|
53
|
-
roles: [],
|
|
54
|
-
previousRoles: e.restaurants.map((s) => ({
|
|
55
|
-
restaurantId: s.restaurantId,
|
|
56
|
-
roleId: s.roleId
|
|
57
|
-
}))
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
async generateEmployeePasscode() {
|
|
61
|
-
return `${f(
|
|
62
|
-
await p().get("/pos-users/generate-passcode")
|
|
63
|
-
)}`;
|
|
64
|
-
},
|
|
65
|
-
async syncUsersMeta() {
|
|
66
|
-
await p().post("/pos-users/create-users-meta");
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
async function T(e) {
|
|
70
|
-
const s = _().roles.value, { restaurants: i } = g(), u = new Map(
|
|
71
|
-
i.value.map((a) => [a._id, a.profile.name])
|
|
72
|
-
), c = new Map(s.map((a) => [a._id, a.name])), r = /* @__PURE__ */ new Map();
|
|
73
|
-
for (const a of e) {
|
|
74
|
-
const l = {
|
|
75
|
-
restaurantId: a.restaurantId,
|
|
76
|
-
restaurantName: u.get(a.restaurantId) || "",
|
|
77
|
-
roleId: a.role,
|
|
78
|
-
roleName: c.get(a.role) || ""
|
|
79
|
-
}, d = r.get(a._id);
|
|
80
|
-
if (!d) {
|
|
81
|
-
r.set(a._id, {
|
|
82
|
-
...a,
|
|
83
|
-
isRestricted: !1,
|
|
84
|
-
since: M(v(a._id)).format("DD/MM/YYYY"),
|
|
85
|
-
restaurants: [l]
|
|
86
|
-
});
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
d.restaurants.some((y) => y.restaurantId === a.restaurantId) || (d.restaurants = E([...d.restaurants, l], {
|
|
90
|
-
selector: "restaurantName"
|
|
91
|
-
}));
|
|
92
|
-
}
|
|
93
|
-
return E([...r.values()], { selector: "name" });
|
|
94
|
-
}
|
|
95
|
-
function I(e) {
|
|
96
|
-
const { restaurants: s } = g(), i = _().roles.value, u = new Map(
|
|
97
|
-
s.value.map((a) => [a._id, a])
|
|
98
|
-
), c = new Map(i.map((a) => [a._id, a.name])), r = e.restaurantRole[0];
|
|
99
|
-
return {
|
|
100
|
-
_id: e._id,
|
|
101
|
-
name: e.name,
|
|
102
|
-
code: e.code,
|
|
103
|
-
passcode: e.passcode,
|
|
104
|
-
isMasterUser: e.isMasterUser,
|
|
105
|
-
isRestricted: e.isRestricted,
|
|
106
|
-
restaurantId: (r == null ? void 0 : r.restaurantId) || "",
|
|
107
|
-
role: (r == null ? void 0 : r.roleId) || "",
|
|
108
|
-
since: M(v(e._id)).format("DD/MM/YYYY"),
|
|
109
|
-
restaurants: E(
|
|
110
|
-
e.restaurantRole.map((a) => {
|
|
111
|
-
const l = u.get(a.restaurantId);
|
|
112
|
-
return {
|
|
113
|
-
restaurantId: a.restaurantId,
|
|
114
|
-
restaurantName: (l == null ? void 0 : l.profile.name) || "",
|
|
115
|
-
restaurantCode: (l == null ? void 0 : l.profile.code) ?? void 0,
|
|
116
|
-
roleId: a.roleId,
|
|
117
|
-
roleName: c.get(a.roleId) || ""
|
|
118
|
-
};
|
|
119
|
-
}),
|
|
120
|
-
{ selector: "restaurantName" }
|
|
121
|
-
)
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
const R = U("employee", () => {
|
|
125
|
-
const e = g(), s = m([]), i = m([]), u = m(0), c = m(!1);
|
|
126
|
-
async function r() {
|
|
127
|
-
try {
|
|
128
|
-
c.value = !0, await e.readRestaurants();
|
|
129
|
-
const t = await n.readEmployees();
|
|
130
|
-
s.value = await T(t);
|
|
131
|
-
} catch (t) {
|
|
132
|
-
console.log("Error reading employees:", t);
|
|
133
|
-
} finally {
|
|
134
|
-
c.value = !1;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
async function a(t) {
|
|
138
|
-
try {
|
|
139
|
-
c.value = !0, await e.readRestaurants();
|
|
140
|
-
const o = await n.readEmployeesPage(t);
|
|
141
|
-
i.value = o.items.map(I), u.value = o.total;
|
|
142
|
-
} catch (o) {
|
|
143
|
-
console.log("Error reading employee page:", o);
|
|
144
|
-
} finally {
|
|
145
|
-
c.value = !1;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
async function l(t, o) {
|
|
149
|
-
await e.readRestaurants();
|
|
150
|
-
const w = o ?? (await n.readEmployeesPage({ ...t, limit: 1, offset: 0 })).total;
|
|
151
|
-
return w === 0 ? [] : (await n.readEmployeesPage({ ...t, limit: w, offset: 0 })).items.map(I);
|
|
152
|
-
}
|
|
153
|
-
async function d(t) {
|
|
154
|
-
await n.createEmployee(t);
|
|
155
|
-
}
|
|
156
|
-
async function y(t, o) {
|
|
157
|
-
await n.updateEmployee(t, o);
|
|
158
|
-
}
|
|
159
|
-
async function P(t) {
|
|
160
|
-
await n.deleteEmployee(t);
|
|
161
|
-
}
|
|
162
|
-
async function Y(t) {
|
|
163
|
-
await n.deleteMasterEmployee(t);
|
|
164
|
-
}
|
|
165
|
-
async function N(t) {
|
|
166
|
-
await n.createMasterEmployee(t);
|
|
167
|
-
}
|
|
168
|
-
async function S(t, o) {
|
|
169
|
-
await n.updateMasterEmployee(t, o);
|
|
170
|
-
}
|
|
171
|
-
async function h(t, o) {
|
|
172
|
-
await n.migrateToMasterEmployee(t, o);
|
|
173
|
-
}
|
|
174
|
-
async function D() {
|
|
175
|
-
await n.syncUsersMeta();
|
|
176
|
-
}
|
|
177
|
-
return {
|
|
178
|
-
employees: s,
|
|
179
|
-
listEmployees: i,
|
|
180
|
-
totalEmployees: u,
|
|
181
|
-
isLoading: c,
|
|
182
|
-
readEmployees: r,
|
|
183
|
-
readEmployeesPage: a,
|
|
184
|
-
readAllEmployeesPage: l,
|
|
185
|
-
createEmployee: d,
|
|
186
|
-
updateEmployee: y,
|
|
187
|
-
deleteEmployee: P,
|
|
188
|
-
createMasterEmployee: N,
|
|
189
|
-
updateMasterEmployee: S,
|
|
190
|
-
deleteMasterEmployee: Y,
|
|
191
|
-
migrateToMasterUser: h,
|
|
192
|
-
syncUsersMeta: D
|
|
193
|
-
};
|
|
194
|
-
}), k = () => {
|
|
195
|
-
const e = R();
|
|
196
|
-
return {
|
|
197
|
-
...e,
|
|
198
|
-
...$(e)
|
|
199
|
-
};
|
|
200
|
-
};
|
|
201
|
-
export {
|
|
202
|
-
n as E,
|
|
203
|
-
k as u
|
|
204
|
-
};
|