@feedmepos/mf-hrm-portal 1.1.4-dev.4 → 2.0.0

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 (51) hide show
  1. package/dist/AuditLogList-Cm3ueTso.js +474 -0
  2. package/dist/EmployeeList-vMcIqBU_.js +626 -0
  3. package/dist/{Main-CG_GcIEk.js → Main-CeGYov-a.js} +8 -8
  4. package/dist/{Main-BLV2Vfz1.js → Main-gHCENd4i.js} +27 -28
  5. package/dist/PermissionSetList-Dw69OYF4.js +323 -0
  6. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-bvPOPUhu.js +3092 -0
  7. package/dist/RoleList-D1CrixYc.js +497 -0
  8. package/dist/TeamMemberList-M0Q8CP4h.js +973 -0
  9. package/dist/{TimesheetList-FXfuZUMw.js → TimesheetList-BmOfy0pc.js} +25 -24
  10. package/dist/api/audit-log/index.d.ts +4 -0
  11. package/dist/api/index.d.ts +5 -0
  12. package/dist/api/report-query/index.d.ts +5 -0
  13. package/dist/api/team/index.d.ts +2 -5
  14. package/dist/app-RUdgf-7_.js +3286 -0
  15. package/dist/app.js +1 -1
  16. package/dist/composables/useReportPermissions.d.ts +14 -0
  17. package/dist/{dayjs.min-CxMnYvrg.js → dayjs.min-D9w2-Exz.js} +13 -13
  18. package/dist/employee-B3jBmvNJ.js +144 -0
  19. package/dist/helpers/permission-set.d.ts +37 -0
  20. package/dist/helpers/rule.d.ts +1 -1
  21. package/dist/index-BMVQbdBd.js +827 -0
  22. package/dist/index-BS6B6k7h.js +10340 -0
  23. package/dist/{lodash-Bbnb5Nlh.js → lodash-CglPbFKR.js} +1 -1
  24. package/dist/stores/permission-set.d.ts +15 -0
  25. package/dist/stores/team.d.ts +16 -4
  26. package/dist/style.css +1 -1
  27. package/dist/team-afjBSzOz.js +33 -0
  28. package/dist/{timesheet-pnAANVbk.js → timesheet-fOBJOS1i.js} +2 -2
  29. package/dist/tsconfig.app.tsbuildinfo +1 -1
  30. package/dist/types/audit-log.d.ts +1 -19
  31. package/dist/types/permission-set.d.ts +4 -0
  32. package/dist/types/report-query.d.ts +6 -0
  33. package/dist/{useAppStore-BJZiy3Q1.js → useAppStore-D-SLROq6.js} +34 -46
  34. package/dist/{useLoading-FywoIKYV.js → useLoading-CLQGJW7G.js} +1 -1
  35. package/dist/useReportPermissions-Cx4ghxj6.js +65 -0
  36. package/dist/views/audit-log/locales/index.d.ts +84 -0
  37. package/dist/views/team/locales/index.d.ts +32 -8
  38. package/package.json +4 -2
  39. package/dist/AuditLogList-CIlv-dA1.js +0 -316
  40. package/dist/EmployeeList-u_rDREgp.js +0 -607
  41. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C0HCpU2w.js +0 -3051
  42. package/dist/RoleList-B5L4I_kf.js +0 -497
  43. package/dist/RolePermissionList-BUHTx8KI.js +0 -285
  44. package/dist/TeamMemberList-BSpbwkTb.js +0 -951
  45. package/dist/app-BTdNT2Fz.js +0 -1637
  46. package/dist/employee-D9A-2noc.js +0 -172
  47. package/dist/index-DEH1isVF.js +0 -8058
  48. package/dist/team-D9GxbwvB.js +0 -26
  49. package/dist/types/permission.d.ts +0 -1
  50. /package/dist/views/team/{role/RolePermissionForm.vue.d.ts → permission-set/PermissionSetForm.vue.d.ts} +0 -0
  51. /package/dist/views/team/{role/RolePermissionList.vue.d.ts → permission-set/PermissionSetList.vue.d.ts} +0 -0
@@ -1,172 +0,0 @@
1
- import { d as v } from "./dayjs.min-CxMnYvrg.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-DEH1isVF.js";
6
- import { u as S } from "./useAppStore-BJZiy3Q1.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
- };