@feedmepos/mf-hrm-portal 2.2.3 → 2.2.5-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.
- package/dist/{ApprovalCodeList-BnG3T_Lk.js → ApprovalCodeList-DgcWZ3SZ.js} +5 -5
- package/dist/{AuditLogList-CpK9-YkB.js → AuditLogList-vWKMMGvd.js} +235 -233
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CzKzq19d.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-DuhXogXK.js} +2 -2
- package/dist/EmployeeList-Cu4RxVQX.js +889 -0
- package/dist/{GrantUserList-BJoj3ZcO.js → GrantUserList-BAW0C1bA.js} +6 -6
- package/dist/{Main-FPpK9B70.js → Main-B7Nn8CLQ.js} +11 -11
- package/dist/{Main-5QLhf80L.js → Main-NzpdRNB3.js} +8 -8
- package/dist/{Main-BEUu3Hba.js → Main-Wr6cTqfM.js} +5 -5
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-BUI0Xsgc.js +85 -0
- package/dist/{PermissionSetList-DZGZ0Pm_.js → PermissionSetList-D6AFOleD.js} +7 -7
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BHEW1_dv.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bzq2_BMn.js} +1268 -1275
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-Z-DH7ouY.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-XHuHin8t.js} +1 -1
- package/dist/{RoleList-D5yToard.js → RoleList-BuqpmXn_.js} +9 -9
- package/dist/TeamMemberList-M6HA9BWu.js +1248 -0
- package/dist/{TimesheetList-DMo8KXoU.js → TimesheetList-B5FyVyCz.js} +92 -90
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-2KHu-f8U.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-C99Jr6Ax.js} +3 -3
- package/dist/{app-DlSD8S9A.js → app-8samJY5z.js} +214 -190
- package/dist/app.js +1 -1
- package/dist/{approval-code-BRClD2HN.js → approval-code-jIjkeVEb.js} +1 -1
- package/dist/{dayjs.min-DcI2auGP.js → dayjs.min-Ba4X_9nY.js} +1 -1
- package/dist/employee-BcFgm8Rt.js +204 -0
- package/dist/{grant-user-Dhi3ilC_.js → grant-user-SNiDV22U.js} +1 -1
- package/dist/{iteration-DSzPQ0fZ.js → iteration-Dhdew1jW.js} +1 -1
- package/dist/{lodash-Ce0IJ8Y3.js → lodash-CJ3mHku0.js} +1 -1
- package/dist/{restaurant-DiYb0pCm.js → restaurant-BTpBmfBV.js} +2 -2
- package/dist/{role-DkTkfUgR.js → role-BViYS7RK.js} +2 -2
- package/dist/{rule-B-REsmVM.js → rule-Dxt1ZSQS.js} +48 -40
- package/dist/src/api/employee/index.d.ts +5 -1
- package/dist/src/api/team/index.d.ts +3 -0
- package/dist/src/components/form/PasscodeGenerateButton.vue.d.ts +15 -0
- package/dist/src/components/form/PasscodePinField.vue.d.ts +18 -0
- package/dist/src/helpers/string.d.ts +2 -1
- package/dist/src/views/audit-log/locales/index.d.ts +4 -0
- package/dist/src/views/hr/locales/index.d.ts +8 -0
- package/dist/src/views/team/locales/index.d.ts +12 -0
- package/dist/src/views/team/member/AddMemberForm.vue.d.ts +1 -0
- package/dist/src/views/team/member/TeamMemberMasterUser.vue.d.ts +9 -0
- package/dist/string-VNuQNweN.js +15 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-BGhlB1_1.js → useAppStore-DCwd8GWN.js} +1 -1
- package/dist/{useLoading-CvgqVDbF.js → useLoading-CXzTpIVv.js} +1 -1
- package/dist/{useReportPermissions-VCzAQXKz.js → useReportPermissions-BiyAfGvZ.js} +3 -3
- package/package.json +1 -1
- package/dist/EmployeeList-CUsRanu7.js +0 -887
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +0 -16
- package/dist/TeamMemberList-C4-AHxO4.js +0 -1216
- package/dist/employee-C_cvCoHM.js +0 -201
package/dist/app.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineStore as C } from "pinia";
|
|
2
2
|
import { ref as l } from "vue";
|
|
3
|
-
import { g as p, b as s } from "./restaurant-
|
|
3
|
+
import { g as p, b as s } from "./restaurant-BTpBmfBV.js";
|
|
4
4
|
const n = {
|
|
5
5
|
async getApprovalCodes() {
|
|
6
6
|
return p(await s("approval-codes").get(""));
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { d as g } from "./dayjs.min-Ba4X_9nY.js";
|
|
2
|
+
import { defineStore as $, storeToRefs as x } from "pinia";
|
|
3
|
+
import { ref as m } from "vue";
|
|
4
|
+
import { s as E } from "./iteration-Dhdew1jW.js";
|
|
5
|
+
import { b as l, g as f, u as I } from "./restaurant-BTpBmfBV.js";
|
|
6
|
+
import { i as v } from "./utils-BZkjJbju.js";
|
|
7
|
+
import { u as _ } from "./role-BViYS7RK.js";
|
|
8
|
+
const o = {
|
|
9
|
+
async readEmployees() {
|
|
10
|
+
return f(await l().get("/pos-users"));
|
|
11
|
+
},
|
|
12
|
+
async readEmployeesPage(e) {
|
|
13
|
+
var s, p;
|
|
14
|
+
return f(
|
|
15
|
+
await l().get("/pos-users/paged", {
|
|
16
|
+
params: {
|
|
17
|
+
limit: e.limit,
|
|
18
|
+
offset: e.offset,
|
|
19
|
+
search: e.search,
|
|
20
|
+
restaurantIds: (s = e.restaurantIds) != null && s.length ? e.restaurantIds : void 0,
|
|
21
|
+
roleIds: (p = e.roleIds) != null && p.length ? e.roleIds : void 0
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
async createEmployee(e) {
|
|
27
|
+
await l().post("/pos-users", e);
|
|
28
|
+
},
|
|
29
|
+
async createMasterEmployee(e) {
|
|
30
|
+
await l().post("/pos-users/master-user", e);
|
|
31
|
+
},
|
|
32
|
+
async migrateToMasterEmployee(e, s) {
|
|
33
|
+
await l().put(`/pos-users/migrate/${e}`, s);
|
|
34
|
+
},
|
|
35
|
+
async updateEmployee(e, s) {
|
|
36
|
+
await l().put(`/pos-users/${e}`, s);
|
|
37
|
+
},
|
|
38
|
+
async updateMasterEmployee(e, s) {
|
|
39
|
+
await l().put(`/pos-users/master-user/${e}`, s);
|
|
40
|
+
},
|
|
41
|
+
async deleteEmployee(e) {
|
|
42
|
+
await l().put(`/pos-users/${e._id}`, {
|
|
43
|
+
user: e,
|
|
44
|
+
roles: [],
|
|
45
|
+
previousRoles: e.restaurants.map((s) => ({
|
|
46
|
+
restaurantId: s.restaurantId,
|
|
47
|
+
roleId: s.roleId
|
|
48
|
+
}))
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
async deleteMasterEmployee(e) {
|
|
52
|
+
await l().put(`/pos-users/master-user/${e._id}`, {
|
|
53
|
+
user: e,
|
|
54
|
+
roles: [],
|
|
55
|
+
previousRoles: e.restaurants.map((s) => ({
|
|
56
|
+
restaurantId: s.restaurantId,
|
|
57
|
+
roleId: s.roleId
|
|
58
|
+
}))
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
async generateEmployeePasscode(e) {
|
|
62
|
+
return `${f(
|
|
63
|
+
await l().post("/pos-users/generate-passcode", {
|
|
64
|
+
restaurantIds: e.restaurantIds,
|
|
65
|
+
excludePosUserId: e.excludePosUserId
|
|
66
|
+
})
|
|
67
|
+
)}`;
|
|
68
|
+
},
|
|
69
|
+
async syncUsersMeta() {
|
|
70
|
+
await l().post("/pos-users/create-users-meta");
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
async function T(e) {
|
|
74
|
+
const s = _().roles.value, { restaurants: p } = I(), c = new Map(
|
|
75
|
+
p.value.map((a) => [a._id, a.profile.name])
|
|
76
|
+
), u = new Map(s.map((a) => [a._id, a.name])), r = /* @__PURE__ */ new Map();
|
|
77
|
+
for (const a of e) {
|
|
78
|
+
const n = {
|
|
79
|
+
restaurantId: a.restaurantId,
|
|
80
|
+
restaurantName: c.get(a.restaurantId) || "",
|
|
81
|
+
roleId: a.role,
|
|
82
|
+
roleName: u.get(a.role) || ""
|
|
83
|
+
}, d = r.get(a._id);
|
|
84
|
+
if (!d) {
|
|
85
|
+
r.set(a._id, {
|
|
86
|
+
...a,
|
|
87
|
+
isRestricted: !1,
|
|
88
|
+
since: g(v(a._id)).format("DD/MM/YYYY"),
|
|
89
|
+
restaurants: [n]
|
|
90
|
+
});
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
d.restaurants.some((y) => y.restaurantId === a.restaurantId) || (d.restaurants = E([...d.restaurants, n], {
|
|
94
|
+
selector: "restaurantName"
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
return E([...r.values()], { selector: "name" });
|
|
98
|
+
}
|
|
99
|
+
function M(e) {
|
|
100
|
+
const { restaurants: s } = I(), p = _().roles.value, c = new Map(
|
|
101
|
+
s.value.map((a) => [a._id, a])
|
|
102
|
+
), u = new Map(p.map((a) => [a._id, a.name])), r = e.restaurantRole[0];
|
|
103
|
+
return {
|
|
104
|
+
_id: e._id,
|
|
105
|
+
name: e.name,
|
|
106
|
+
code: e.code,
|
|
107
|
+
passcode: e.passcode,
|
|
108
|
+
isMasterUser: e.isMasterUser,
|
|
109
|
+
isRestricted: e.isRestricted,
|
|
110
|
+
restaurantId: (r == null ? void 0 : r.restaurantId) || "",
|
|
111
|
+
role: (r == null ? void 0 : r.roleId) || "",
|
|
112
|
+
since: g(v(e._id)).format("DD/MM/YYYY"),
|
|
113
|
+
restaurants: E(
|
|
114
|
+
e.restaurantRole.map((a) => {
|
|
115
|
+
const n = c.get(a.restaurantId);
|
|
116
|
+
return {
|
|
117
|
+
restaurantId: a.restaurantId,
|
|
118
|
+
restaurantName: (n == null ? void 0 : n.profile.name) || "",
|
|
119
|
+
restaurantCode: (n == null ? void 0 : n.profile.code) ?? void 0,
|
|
120
|
+
roleId: a.roleId,
|
|
121
|
+
roleName: u.get(a.roleId) || ""
|
|
122
|
+
};
|
|
123
|
+
}),
|
|
124
|
+
{ selector: "restaurantName" }
|
|
125
|
+
)
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
const h = $("employee", () => {
|
|
129
|
+
const e = I(), s = m([]), p = m([]), c = m(0), u = m(!1);
|
|
130
|
+
async function r() {
|
|
131
|
+
try {
|
|
132
|
+
u.value = !0, await e.readRestaurants();
|
|
133
|
+
const t = await o.readEmployees();
|
|
134
|
+
s.value = await T(t);
|
|
135
|
+
} finally {
|
|
136
|
+
u.value = !1;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
async function a(t) {
|
|
140
|
+
try {
|
|
141
|
+
u.value = !0, await e.readRestaurants();
|
|
142
|
+
const i = await o.readEmployeesPage(t);
|
|
143
|
+
p.value = i.items.map(M), c.value = i.total;
|
|
144
|
+
} finally {
|
|
145
|
+
u.value = !1;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
async function n(t, i) {
|
|
149
|
+
await e.readRestaurants();
|
|
150
|
+
const w = i ?? (await o.readEmployeesPage({ ...t, limit: 1, offset: 0 })).total;
|
|
151
|
+
return w === 0 ? [] : (await o.readEmployeesPage({ ...t, limit: w, offset: 0 })).items.map(M);
|
|
152
|
+
}
|
|
153
|
+
async function d(t) {
|
|
154
|
+
await o.createEmployee(t);
|
|
155
|
+
}
|
|
156
|
+
async function y(t, i) {
|
|
157
|
+
await o.updateEmployee(t, i);
|
|
158
|
+
}
|
|
159
|
+
async function P(t) {
|
|
160
|
+
await o.deleteEmployee(t);
|
|
161
|
+
}
|
|
162
|
+
async function U(t) {
|
|
163
|
+
await o.deleteMasterEmployee(t);
|
|
164
|
+
}
|
|
165
|
+
async function Y(t) {
|
|
166
|
+
await o.createMasterEmployee(t);
|
|
167
|
+
}
|
|
168
|
+
async function N(t, i) {
|
|
169
|
+
await o.updateMasterEmployee(t, i);
|
|
170
|
+
}
|
|
171
|
+
async function S(t, i) {
|
|
172
|
+
await o.migrateToMasterEmployee(t, i);
|
|
173
|
+
}
|
|
174
|
+
async function D() {
|
|
175
|
+
await o.syncUsersMeta();
|
|
176
|
+
}
|
|
177
|
+
return {
|
|
178
|
+
employees: s,
|
|
179
|
+
listEmployees: p,
|
|
180
|
+
totalEmployees: c,
|
|
181
|
+
isLoading: u,
|
|
182
|
+
readEmployees: r,
|
|
183
|
+
readEmployeesPage: a,
|
|
184
|
+
readAllEmployeesPage: n,
|
|
185
|
+
createEmployee: d,
|
|
186
|
+
updateEmployee: y,
|
|
187
|
+
deleteEmployee: P,
|
|
188
|
+
createMasterEmployee: Y,
|
|
189
|
+
updateMasterEmployee: N,
|
|
190
|
+
deleteMasterEmployee: U,
|
|
191
|
+
migrateToMasterUser: S,
|
|
192
|
+
syncUsersMeta: D
|
|
193
|
+
};
|
|
194
|
+
}), z = () => {
|
|
195
|
+
const e = h();
|
|
196
|
+
return {
|
|
197
|
+
...e,
|
|
198
|
+
...x(e)
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
export {
|
|
202
|
+
o as E,
|
|
203
|
+
z as u
|
|
204
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineStore as f } from "pinia";
|
|
2
2
|
import { ref as u } from "vue";
|
|
3
|
-
import { g as s, a as v, b as o } from "./restaurant-
|
|
3
|
+
import { g as s, a as v, b as o } from "./restaurant-BTpBmfBV.js";
|
|
4
4
|
const c = {
|
|
5
5
|
async getGrantUsers() {
|
|
6
6
|
return s(await o("grant").get(""));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as B } from "./app-
|
|
1
|
+
import { c as B } from "./app-8samJY5z.js";
|
|
2
2
|
var ma = {}, Zt = {}, l = {}, ji = {}, Ei = {}, Ii = {}, Dn = {};
|
|
3
3
|
(function(e) {
|
|
4
4
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.getParsedType = e.ZodParsedType = e.util = void 0;
|
|
@@ -1819,9 +1819,9 @@ const bt = (e) => (t) => {
|
|
|
1819
1819
|
throw new Error("Invalid business");
|
|
1820
1820
|
}, Ar = () => {
|
|
1821
1821
|
var o;
|
|
1822
|
-
const t = (o = re().currentCountry.value) == null ? void 0 : o.toLowerCase(), r = "
|
|
1822
|
+
const t = (o = re().currentCountry.value) == null ? void 0 : o.toLowerCase(), r = "feedmeapidev.com", s = !t || t === "my" ? `https://query-engine.${r}` : `https://query-engine.${t}.${r}`;
|
|
1823
1823
|
return bt(s)("");
|
|
1824
|
-
}, Tr = () => bt("https://account.
|
|
1824
|
+
}, Tr = () => bt("https://account.feedmedev.cc/api")(""), Cr = () => Ve("user/bypass/validate/");
|
|
1825
1825
|
function tr(e) {
|
|
1826
1826
|
return e.data;
|
|
1827
1827
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineStore as x, storeToRefs as b } from "pinia";
|
|
2
2
|
import { ref as w } from "vue";
|
|
3
3
|
import { useCoreStore as B } from "@feedmepos/mf-common";
|
|
4
|
-
import { s as v } from "./iteration-
|
|
5
|
-
import { g as f, b as p, u as I } from "./restaurant-
|
|
4
|
+
import { s as v } from "./iteration-Dhdew1jW.js";
|
|
5
|
+
import { g as f, b as p, u as I } from "./restaurant-BTpBmfBV.js";
|
|
6
6
|
const R = {
|
|
7
7
|
async readRoles() {
|
|
8
8
|
return f(await p().get("/pos-roles"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as W, c as Z, e as y } from "./iteration-
|
|
2
|
-
import { h as O, d as V, e as _, b as F, n as h, O as q, D as
|
|
1
|
+
import { s as W, c as Z, e as y } from "./iteration-Dhdew1jW.js";
|
|
2
|
+
import { h as O, d as V, e as _, b as F, n as h, O as q, D as M } from "./app-8samJY5z.js";
|
|
3
3
|
import { s as ee } from "./utils-BZkjJbju.js";
|
|
4
|
-
import { g, b, q as
|
|
4
|
+
import { g, b, q as x, u as te } from "./restaurant-BTpBmfBV.js";
|
|
5
5
|
import { defineStore as z, storeToRefs as K } from "pinia";
|
|
6
6
|
import { ref as S, computed as T } from "vue";
|
|
7
7
|
import { useCoreStore as X } from "@feedmepos/mf-common";
|
|
@@ -61,7 +61,7 @@ const E = "/permission-sets", N = {
|
|
|
61
61
|
...K(e)
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
|
-
function
|
|
64
|
+
function D(e) {
|
|
65
65
|
if (e) {
|
|
66
66
|
if (typeof e == "string") {
|
|
67
67
|
if (e === "{}") return;
|
|
@@ -83,7 +83,7 @@ function j(e) {
|
|
|
83
83
|
function Q(e) {
|
|
84
84
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), n = (i, s, a) => {
|
|
85
85
|
var o, u;
|
|
86
|
-
const c =
|
|
86
|
+
const c = D(s.conditions);
|
|
87
87
|
let l = `${s.subject}::${JSON.stringify([...s.actions].sort())}`;
|
|
88
88
|
j(c) || (l += `::${JSON.stringify(c)}`);
|
|
89
89
|
const d = i.get(l);
|
|
@@ -92,7 +92,7 @@ function Q(e) {
|
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
94
|
d.setNames.push(a.name);
|
|
95
|
-
const m =
|
|
95
|
+
const m = D(d.conditions);
|
|
96
96
|
if (!m || !c) {
|
|
97
97
|
d.conditions = void 0;
|
|
98
98
|
return;
|
|
@@ -179,11 +179,11 @@ function H(e, t, r = /* @__PURE__ */ new Set()) {
|
|
|
179
179
|
}
|
|
180
180
|
return n;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function $e(e) {
|
|
183
183
|
const t = Q(e).map(
|
|
184
184
|
({ setNames: i, setId: s, ...a }) => a
|
|
185
185
|
), r = t.filter((i) => !i.inverted), n = t.filter((i) => i.inverted);
|
|
186
|
-
return
|
|
186
|
+
return L(r, n);
|
|
187
187
|
}
|
|
188
188
|
function Ae(e, t, r) {
|
|
189
189
|
const n = /* @__PURE__ */ new Map();
|
|
@@ -326,7 +326,7 @@ function Ne(e, t) {
|
|
|
326
326
|
return f.size === 0 || a.push({ ...o, actions: Array.from(f) }), a;
|
|
327
327
|
}, []);
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function L(e, t) {
|
|
330
330
|
var n, i;
|
|
331
331
|
const r = new Map(e.map((s) => [s.subject, s]));
|
|
332
332
|
for (const s of t) {
|
|
@@ -378,7 +378,7 @@ function M(e, t) {
|
|
|
378
378
|
return Array.from(r.values());
|
|
379
379
|
}
|
|
380
380
|
function le(e, t) {
|
|
381
|
-
const r =
|
|
381
|
+
const r = L(e, t), n = new Set(e.map((s) => s.subject)), i = t.filter(
|
|
382
382
|
(s) => s.inverted && !n.has(s.subject)
|
|
383
383
|
);
|
|
384
384
|
return [...r, ...i];
|
|
@@ -449,16 +449,16 @@ const P = "/permission-assignments", R = {
|
|
|
449
449
|
async fetchReportPermissions(e, t) {
|
|
450
450
|
const r = t ? { lang: t } : {};
|
|
451
451
|
return g(
|
|
452
|
-
await
|
|
452
|
+
await x().get(`/report-query/hrm/${e}/reports`, { params: r })
|
|
453
453
|
);
|
|
454
454
|
},
|
|
455
455
|
async fetchReportPermissionsForPortal(e, t) {
|
|
456
456
|
const r = t ? { isSupportPos: !1, lang: t } : { isSupportPos: !1 };
|
|
457
457
|
return g(
|
|
458
|
-
await
|
|
458
|
+
await x().get(`/report-query/hrm/${e}/reports`, { params: r })
|
|
459
459
|
);
|
|
460
460
|
}
|
|
461
|
-
},
|
|
461
|
+
}, U = S([]), C = S(!1), I = S(!1), $ = S(null), k = S(null), J = S(!1);
|
|
462
462
|
function pe() {
|
|
463
463
|
const e = X();
|
|
464
464
|
async function t() {
|
|
@@ -466,25 +466,25 @@ function pe() {
|
|
|
466
466
|
const n = (s = e.currentBusiness.value) == null ? void 0 : s.id;
|
|
467
467
|
if (!n) return;
|
|
468
468
|
const i = localStorage.getItem("locale");
|
|
469
|
-
if (
|
|
470
|
-
if (
|
|
471
|
-
|
|
469
|
+
if ($.value !== n && (U.value = [], C.value = !1, I.value = !1, $.value = n, J.value = !1), !(C.value && k.value === i)) {
|
|
470
|
+
if (I.value) {
|
|
471
|
+
J.value = !0;
|
|
472
472
|
return;
|
|
473
473
|
}
|
|
474
|
-
|
|
474
|
+
I.value = !0;
|
|
475
475
|
try {
|
|
476
476
|
const a = await fe.fetchReportPermissionsForPortal(n, i);
|
|
477
|
-
if (
|
|
478
|
-
|
|
477
|
+
if ($.value !== n) return;
|
|
478
|
+
U.value = a, C.value = !0, k.value = i;
|
|
479
479
|
} catch (a) {
|
|
480
|
-
if (
|
|
481
|
-
console.warn("Failed to fetch custom report permissions:", a),
|
|
480
|
+
if ($.value !== n) return;
|
|
481
|
+
console.warn("Failed to fetch custom report permissions:", a), U.value = [];
|
|
482
482
|
} finally {
|
|
483
|
-
|
|
483
|
+
$.value === n && (I.value = !1, J.value && (J.value = !1, await t()));
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
const r = T(() =>
|
|
487
|
+
const r = T(() => U.value.map(
|
|
488
488
|
(n) => n.isDefault ? {
|
|
489
489
|
label: n.name,
|
|
490
490
|
subject: `business::report::reports::${n.permissionKey}`,
|
|
@@ -506,8 +506,8 @@ function pe() {
|
|
|
506
506
|
return {
|
|
507
507
|
fetchCustomReportPermissions: t,
|
|
508
508
|
customReportPermissions: r,
|
|
509
|
-
isLoading: T(() =>
|
|
510
|
-
isLoaded: T(() =>
|
|
509
|
+
isLoading: T(() => I.value),
|
|
510
|
+
isLoaded: T(() => C.value)
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
513
|
function A(e) {
|
|
@@ -519,7 +519,7 @@ function A(e) {
|
|
|
519
519
|
), u = s == null ? void 0 : s.customPermissions, c = u ?? e.permissions.map((p) => ({
|
|
520
520
|
...p,
|
|
521
521
|
subject: O(p.subject)
|
|
522
|
-
})), l =
|
|
522
|
+
})), l = L(o, c), d = G(
|
|
523
523
|
le(o, c),
|
|
524
524
|
V
|
|
525
525
|
).filter((p) => !p.inverted), m = be(d), f = m ?? n.value.map((p) => p._id);
|
|
@@ -542,7 +542,7 @@ function A(e) {
|
|
|
542
542
|
}
|
|
543
543
|
const ge = Object.freeze(
|
|
544
544
|
Object.values(q)
|
|
545
|
-
),
|
|
545
|
+
), Ue = {
|
|
546
546
|
async readTeamMembers() {
|
|
547
547
|
return g(
|
|
548
548
|
await b().get("/portal-users")
|
|
@@ -587,11 +587,19 @@ const ge = Object.freeze(
|
|
|
587
587
|
},
|
|
588
588
|
async readTeamMemberPosUserIds() {
|
|
589
589
|
return g(await b().get("/portal-users")).map((t) => t.posUserId);
|
|
590
|
+
},
|
|
591
|
+
async generateMasterUserPasscode(e) {
|
|
592
|
+
return `${g(
|
|
593
|
+
await b().post("/portal-users/generate-passcode", {
|
|
594
|
+
restaurantIds: e.restaurantIds,
|
|
595
|
+
excludePosUserId: e.excludePosUserId
|
|
596
|
+
})
|
|
597
|
+
)}`;
|
|
590
598
|
}
|
|
591
599
|
};
|
|
592
|
-
function
|
|
600
|
+
function Ce(e, t, r) {
|
|
593
601
|
if (e.some((a) => a.subject === "all")) return "All";
|
|
594
|
-
const n = (r ??
|
|
602
|
+
const n = (r ?? M).filter(
|
|
595
603
|
(a) => a.subject === t
|
|
596
604
|
), i = new Set(n.map((a) => w(a).value)), s = e.filter((a) => a.subject === t).filter((a) => i.has(w(a).value));
|
|
597
605
|
return s.length === n.length ? "All" : s.length === 0 ? "-" : `${s.length} permission allow`;
|
|
@@ -652,7 +660,7 @@ function w(e) {
|
|
|
652
660
|
}
|
|
653
661
|
};
|
|
654
662
|
}
|
|
655
|
-
function
|
|
663
|
+
function Je(e) {
|
|
656
664
|
var n, i;
|
|
657
665
|
const t = e.map((s) => w(s)).find((s) => s.isDiscountOperation);
|
|
658
666
|
if (!t) return 100;
|
|
@@ -672,13 +680,13 @@ function Be(e) {
|
|
|
672
680
|
const t = e.find((r) => r.subject === _.Subject.Business.role);
|
|
673
681
|
return t ? t.conditions ? JSON.parse(t.conditions).roleId.$in : null : [];
|
|
674
682
|
}
|
|
675
|
-
function
|
|
683
|
+
function Me(e) {
|
|
676
684
|
const t = w(e);
|
|
677
685
|
if (!t.isReportPermission) return;
|
|
678
686
|
const { name: r, ...n } = t.conditions ?? {};
|
|
679
687
|
return Object.keys(n).length > 0 ? n : void 0;
|
|
680
688
|
}
|
|
681
|
-
function
|
|
689
|
+
function Le(e, t, r) {
|
|
682
690
|
return e.flatMap((n) => {
|
|
683
691
|
const i = ve(n);
|
|
684
692
|
if (!i) return [];
|
|
@@ -700,7 +708,7 @@ function ve(e) {
|
|
|
700
708
|
const t = e.indexOf(":"), r = t === -1 ? e : e.slice(0, t), n = t === -1 ? void 0 : e.slice(t + 1);
|
|
701
709
|
if (t !== -1 && !n) return;
|
|
702
710
|
let i;
|
|
703
|
-
return n ? (i =
|
|
711
|
+
return n ? (i = M.find((s) => {
|
|
704
712
|
if (s.subject !== r) return !1;
|
|
705
713
|
const a = typeof s.conditions == "string" ? JSON.parse(s.conditions) : s.conditions;
|
|
706
714
|
return [a == null ? void 0 : a.operation, a == null ? void 0 : a.name].includes(n);
|
|
@@ -711,7 +719,7 @@ function ve(e) {
|
|
|
711
719
|
conditions: { name: n },
|
|
712
720
|
inverted: !1,
|
|
713
721
|
reason: ""
|
|
714
|
-
})) : i =
|
|
722
|
+
})) : i = M.find((s) => s.subject === r), i ? w(i) : void 0;
|
|
715
723
|
}
|
|
716
724
|
function Fe(e, t) {
|
|
717
725
|
const r = { values: [], passthrough: [], dropped: [] };
|
|
@@ -744,26 +752,26 @@ export {
|
|
|
744
752
|
G as N,
|
|
745
753
|
Q as P,
|
|
746
754
|
fe as R,
|
|
747
|
-
|
|
755
|
+
Ce as a,
|
|
748
756
|
le as b,
|
|
749
757
|
H as c,
|
|
750
758
|
pe as d,
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
759
|
+
Me as e,
|
|
760
|
+
Le as f,
|
|
761
|
+
Je as g,
|
|
754
762
|
Te as h,
|
|
755
763
|
ie as i,
|
|
756
764
|
Be as j,
|
|
757
765
|
be as k,
|
|
758
766
|
_e as l,
|
|
759
|
-
|
|
767
|
+
$e as m,
|
|
760
768
|
Oe as n,
|
|
761
769
|
Ee as o,
|
|
762
770
|
ge as p,
|
|
763
771
|
Ne as q,
|
|
764
772
|
w as r,
|
|
765
773
|
Fe as s,
|
|
766
|
-
|
|
774
|
+
Ue as t,
|
|
767
775
|
ne as u,
|
|
768
776
|
me as v,
|
|
769
777
|
Se as w,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { FdtoUpdatePosUserReq, FdtoUpdatePosMasterUserReq } from '@feedmepos/core/entity';
|
|
2
2
|
import type { Employee, IFdtoEmployeePage, IFdtoPosUser, IReadEmployeesPageReq } from '@/types/employee';
|
|
3
|
+
export interface IGeneratePasscodeParams {
|
|
4
|
+
restaurantIds: string[];
|
|
5
|
+
excludePosUserId?: string;
|
|
6
|
+
}
|
|
3
7
|
declare const EmployeeAPI: {
|
|
4
8
|
readEmployees(): Promise<IFdtoPosUser[]>;
|
|
5
9
|
readEmployeesPage(query: IReadEmployeesPageReq): Promise<IFdtoEmployeePage>;
|
|
@@ -10,7 +14,7 @@ declare const EmployeeAPI: {
|
|
|
10
14
|
updateMasterEmployee(employeeId: string, dto: FdtoUpdatePosMasterUserReq): Promise<void>;
|
|
11
15
|
deleteEmployee(employee: Employee): Promise<void>;
|
|
12
16
|
deleteMasterEmployee(employee: Employee): Promise<void>;
|
|
13
|
-
generateEmployeePasscode(): Promise<string>;
|
|
17
|
+
generateEmployeePasscode(params: IGeneratePasscodeParams): Promise<string>;
|
|
14
18
|
syncUsersMeta(): Promise<void>;
|
|
15
19
|
};
|
|
16
20
|
export default EmployeeAPI;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { IGeneratePasscodeParams } from '@/api/employee';
|
|
1
2
|
import { type IFdtoPortalPermissionsWithVisibilityCondition } from '@feedmepos/hrm-permission';
|
|
2
3
|
import type { FTeamMember, IFdtoCreatePortalUserReq, IFdtoTeamMemberPage, IReadTeamMembersPageReq, IFdtoUpdatePortalUserReq } from '@/types/team';
|
|
4
|
+
export type IGenerateMasterUserPasscodeParams = IGeneratePasscodeParams;
|
|
3
5
|
export declare const portalTeamPermissions: IFdtoPortalPermissionsWithVisibilityCondition[];
|
|
4
6
|
export declare const teamApi: {
|
|
5
7
|
readTeamMembers(): Promise<FTeamMember[]>;
|
|
@@ -9,5 +11,6 @@ export declare const teamApi: {
|
|
|
9
11
|
updateTeamMember(permissionUserId: string, req: IFdtoUpdatePortalUserReq): Promise<FTeamMember>;
|
|
10
12
|
deleteTeamMember(permissionUserId: string): Promise<boolean>;
|
|
11
13
|
readTeamMemberPosUserIds(): Promise<string[]>;
|
|
14
|
+
generateMasterUserPasscode(params: IGenerateMasterUserPasscodeParams): Promise<string>;
|
|
12
15
|
};
|
|
13
16
|
export default teamApi;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label: string;
|
|
3
|
+
hint: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
click: () => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
onClick?: (() => any) | undefined;
|
|
11
|
+
}>, {
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
loading: boolean;
|
|
14
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue: string[];
|
|
3
|
+
masked: boolean;
|
|
4
|
+
length?: number;
|
|
5
|
+
toggleLabel: string;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: string[]) => any;
|
|
9
|
+
"update:masked": (value: boolean) => any;
|
|
10
|
+
complete: (value: string) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
13
|
+
"onUpdate:masked"?: ((value: boolean) => any) | undefined;
|
|
14
|
+
onComplete?: ((value: string) => any) | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
length: number;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
export default _default;
|
|
@@ -9,4 +9,5 @@ declare const filter: {
|
|
|
9
9
|
declare const validate: {
|
|
10
10
|
email(input: string): RegExpMatchArray | null;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
declare function nameInitials(name: string | null | undefined): string;
|
|
13
|
+
export { filter, validate, randomString, nameInitials };
|
|
@@ -197,6 +197,7 @@ export declare const i18nMessages: {
|
|
|
197
197
|
create: string;
|
|
198
198
|
update: string;
|
|
199
199
|
delete: string;
|
|
200
|
+
"generate-passcode": string;
|
|
200
201
|
};
|
|
201
202
|
"pos-user": {
|
|
202
203
|
list: string;
|
|
@@ -422,6 +423,7 @@ export declare const i18nMessages: {
|
|
|
422
423
|
create: string;
|
|
423
424
|
update: string;
|
|
424
425
|
delete: string;
|
|
426
|
+
"generate-passcode": string;
|
|
425
427
|
};
|
|
426
428
|
"pos-user": {
|
|
427
429
|
list: string;
|
|
@@ -647,6 +649,7 @@ export declare const i18nMessages: {
|
|
|
647
649
|
create: string;
|
|
648
650
|
update: string;
|
|
649
651
|
delete: string;
|
|
652
|
+
"generate-passcode": string;
|
|
650
653
|
};
|
|
651
654
|
"pos-user": {
|
|
652
655
|
list: string;
|
|
@@ -872,6 +875,7 @@ export declare const i18nMessages: {
|
|
|
872
875
|
create: string;
|
|
873
876
|
update: string;
|
|
874
877
|
delete: string;
|
|
878
|
+
"generate-passcode": string;
|
|
875
879
|
};
|
|
876
880
|
"pos-user": {
|
|
877
881
|
list: string;
|
|
@@ -29,6 +29,8 @@ export declare const i18nMessages: {
|
|
|
29
29
|
passcode: string;
|
|
30
30
|
passcodeRequired: string;
|
|
31
31
|
passcodeGenerate: string;
|
|
32
|
+
passcodeSelectOutletFirst: string;
|
|
33
|
+
passcodeToggleVisibility: string;
|
|
32
34
|
atLeastOneRestaurant: string;
|
|
33
35
|
roleRequired: string;
|
|
34
36
|
all: string;
|
|
@@ -235,6 +237,8 @@ export declare const i18nMessages: {
|
|
|
235
237
|
passcode: string;
|
|
236
238
|
passcodeRequired: string;
|
|
237
239
|
passcodeGenerate: string;
|
|
240
|
+
passcodeSelectOutletFirst: string;
|
|
241
|
+
passcodeToggleVisibility: string;
|
|
238
242
|
atLeastOneRestaurant: string;
|
|
239
243
|
roleRequired: string;
|
|
240
244
|
all: string;
|
|
@@ -441,6 +445,8 @@ export declare const i18nMessages: {
|
|
|
441
445
|
passcode: string;
|
|
442
446
|
passcodeRequired: string;
|
|
443
447
|
passcodeGenerate: string;
|
|
448
|
+
passcodeSelectOutletFirst: string;
|
|
449
|
+
passcodeToggleVisibility: string;
|
|
444
450
|
atLeastOneRestaurant: string;
|
|
445
451
|
roleRequired: string;
|
|
446
452
|
all: string;
|
|
@@ -646,6 +652,8 @@ export declare const i18nMessages: {
|
|
|
646
652
|
passcode: string;
|
|
647
653
|
passcodeRequired: string;
|
|
648
654
|
passcodeGenerate: string;
|
|
655
|
+
passcodeSelectOutletFirst: string;
|
|
656
|
+
passcodeToggleVisibility: string;
|
|
649
657
|
atLeastOneRestaurant: string;
|
|
650
658
|
roleRequired: string;
|
|
651
659
|
all: string;
|