@feedmepos/mf-hrm-portal 2.0.11-dev.3 → 2.0.12-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 (44) hide show
  1. package/dist/AuditLogList-Am6PW6qN.js +941 -0
  2. package/dist/EmployeeList-00LF0l6U.js +696 -0
  3. package/dist/{Main-DjCFRKkP.js → Main-BC_y5Gzg.js} +4 -4
  4. package/dist/{Main-Bqx0FFmH.js → Main-BY_V1guq.js} +2469 -2459
  5. package/dist/{Main-eVW0teSe.js → Main-Chau30wK.js} +8 -9
  6. package/dist/{PermissionSetList-DL5AL3mB.js → PermissionSetList-CDUFrGRE.js} +124 -128
  7. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CMcQnqyK.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CGIontQw.js} +787 -787
  8. package/dist/RoleList-BVQ4zkA8.js +519 -0
  9. package/dist/TeamMemberList-D65MpqIr.js +1098 -0
  10. package/dist/{TimesheetList-Bz9ZMpHA.js → TimesheetList-Dc295zCI.js} +74 -74
  11. package/dist/{app-BhCUAF8K.js → app-Iv5hLrRX.js} +24 -21
  12. package/dist/app.js +1 -1
  13. package/dist/{dayjs.min-Cxe5QOx7.js → dayjs.min-CJGjjQIJ.js} +1 -1
  14. package/dist/employee-C2Qhr8xO.js +207 -0
  15. package/dist/{index-GgFsP7rK.js → index-5ziPpN4I.js} +106 -83
  16. package/dist/{index-CyJwEUuG.js → index-DzRWjF3a.js} +1 -1
  17. package/dist/{iteration-BljyZld9.js → iteration-L8TLGaCI.js} +488 -476
  18. package/dist/{lodash-D2-GJ54o.js → lodash-Bbes-RWy.js} +1 -1
  19. package/dist/src/api/employee/index.d.ts +9 -8
  20. package/dist/src/api/team/index.d.ts +3 -1
  21. package/dist/src/composables/useDebounce.d.ts +9 -0
  22. package/dist/src/stores/employee.d.ts +515 -6
  23. package/dist/src/stores/team.d.ts +6 -0
  24. package/dist/src/types/employee.d.ts +35 -1
  25. package/dist/src/types/team.d.ts +18 -2
  26. package/dist/src/views/hr/employee/EmployeeForm.vue.d.ts +6 -2
  27. package/dist/src/views/hr/employee/EmployeeList.vue.d.ts +3 -0
  28. package/dist/src/views/team/locales/index.d.ts +3 -0
  29. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +9 -0
  30. package/dist/src/views/team/member/TeamMemberMasterUser.vue.d.ts +5 -5
  31. package/dist/style.css +1 -1
  32. package/dist/{timesheet-C_WtQDqh.js → timesheet-Dbp6blBA.js} +3 -3
  33. package/dist/tsconfig.app.tsbuildinfo +1 -1
  34. package/dist/{useAppStore-B7R116Aw.js → useAppStore-e7cSGuDZ.js} +1 -1
  35. package/dist/useDebounce-BngBuKwH.js +12 -0
  36. package/dist/{useLoading-CwSP2H00.js → useLoading-C8ko-jia.js} +1 -1
  37. package/dist/{useReportPermissions-DVOIk2oR.js → useReportPermissions-B0EDgKey.js} +3 -3
  38. package/package.json +2 -2
  39. package/dist/AuditLogList-E_BtUYs7.js +0 -915
  40. package/dist/EmployeeList-D758_PXx.js +0 -621
  41. package/dist/RoleList-DuXjqXwQ.js +0 -499
  42. package/dist/TeamMemberList-BHpOC5vA.js +0 -989
  43. package/dist/employee--8czm9KP.js +0 -145
  44. package/dist/team-C7-0IiCm.js +0 -33
@@ -1,145 +0,0 @@
1
- import { d as T } from "./dayjs.min-Cxe5QOx7.js";
2
- import { defineStore as _, storeToRefs as U } from "pinia";
3
- import { ref as I } from "vue";
4
- import { useCoreStore as $ } from "@feedmepos/mf-common";
5
- import { b as r, g as o, s as v } from "./iteration-BljyZld9.js";
6
- import { t as b, i as S } from "./index-GgFsP7rK.js";
7
- import { u as x } from "./useAppStore-B7R116Aw.js";
8
- const n = {
9
- async readEmployees() {
10
- return o(await r().get("/pos-users"));
11
- },
12
- async createEmployee(e) {
13
- return o(await r().post("/pos-users", e));
14
- },
15
- async createMasterEmployee(e) {
16
- return o(await r().post("/pos-users/master-user", e));
17
- },
18
- async migrateToMasterEmployee(e, t) {
19
- return o(await r().put(`/pos-users/migrate/${e}`, t));
20
- },
21
- async updateEmployee(e, t) {
22
- return o(await r().put(`/pos-users/${e}`, t));
23
- },
24
- async updateMasterEmployee(e, t) {
25
- return o(await r().put(`/pos-users/master-user/${e}`, t));
26
- },
27
- async deleteEmployee(e) {
28
- return o(
29
- await r().put(`/pos-users/${e._id}`, {
30
- user: e,
31
- roles: []
32
- })
33
- );
34
- },
35
- async deleteMasterEmployee(e) {
36
- return o(
37
- await r().put(`/pos-users/master-user/${e._id}`, {
38
- user: e,
39
- roles: []
40
- })
41
- );
42
- },
43
- async generateEmployeePasscode() {
44
- return `${o(await r().get("/pos-users/generate-passcode"))}`;
45
- },
46
- async syncUsersMeta() {
47
- await r().post("/pos-users/create-users-meta");
48
- }
49
- };
50
- async function i(e) {
51
- const t = x().roles.value, { restaurants: d } = $(), M = e.reduce((u, m) => {
52
- var w;
53
- const { _id: f, restaurantId: l } = m, p = u.findIndex((s) => s._id === f), g = ((w = d.value.find((s) => s._id === l)) == null ? void 0 : w.profile.name) || "", c = t.find((s) => s._id === m.role), E = {
54
- restaurantId: l,
55
- restaurantName: g,
56
- roleId: (c == null ? void 0 : c._id) || "",
57
- roleName: (c == null ? void 0 : c.name) || ""
58
- };
59
- return p < 0 ? u.push({
60
- ...m,
61
- since: T(S(f)).format("DD/MM/YYYY"),
62
- restaurants: [E]
63
- }) : u[p].restaurants.some((s) => s.restaurantId === l) || (u[p].restaurants = v([...u[p].restaurants, E], {
64
- selector: "restaurantName"
65
- })), u;
66
- }, []);
67
- return v(M, { selector: "name" });
68
- }
69
- const D = _("employee", () => {
70
- const e = I([]), t = I(!1), d = I([]);
71
- async function M() {
72
- try {
73
- t.value = !0;
74
- const s = await n.readEmployees();
75
- e.value = await i(s);
76
- } catch (s) {
77
- console.log("Error reading employees:", s);
78
- } finally {
79
- t.value = !1;
80
- }
81
- }
82
- async function u(s) {
83
- const a = await n.createEmployee(s);
84
- e.value = await i(a);
85
- }
86
- async function m(s, a) {
87
- const y = await n.updateEmployee(s, a);
88
- e.value = await i(y);
89
- }
90
- async function f(s) {
91
- const a = await n.deleteEmployee(s);
92
- e.value = await i(a);
93
- }
94
- async function l(s) {
95
- const a = await n.deleteMasterEmployee(s);
96
- e.value = await i(a);
97
- }
98
- async function p(s) {
99
- const a = await n.createMasterEmployee(s);
100
- e.value = await i(a);
101
- }
102
- async function g(s, a) {
103
- const y = await n.updateMasterEmployee(s, a);
104
- e.value = await i(y);
105
- }
106
- async function c(s, a) {
107
- const y = await n.migrateToMasterEmployee(s, a);
108
- e.value = await i(y);
109
- }
110
- async function E() {
111
- try {
112
- d.value = await b.readTeamMemberPosUserIds();
113
- } catch (s) {
114
- console.log("Error reading team member pos user ids:", s);
115
- }
116
- }
117
- async function w() {
118
- await n.syncUsersMeta();
119
- }
120
- return {
121
- employees: e,
122
- restrictEmployeeIds: d,
123
- isLoading: t,
124
- readEmployees: M,
125
- createEmployee: u,
126
- updateEmployee: m,
127
- deleteEmployee: f,
128
- createMasterEmployee: p,
129
- updateMasterEmployee: g,
130
- deleteMasterEmployee: l,
131
- migrateToMasterUser: c,
132
- readTeamMemberPosUserIds: E,
133
- syncUsersMeta: w
134
- };
135
- }), j = () => {
136
- const e = D();
137
- return {
138
- ...e,
139
- ...U(e)
140
- };
141
- };
142
- export {
143
- n as E,
144
- j as u
145
- };
@@ -1,33 +0,0 @@
1
- import { defineStore as d } from "pinia";
2
- import { ref as s, computed as o } from "vue";
3
- import { t as f } from "./index-GgFsP7rK.js";
4
- const I = d("team", () => {
5
- const r = s([]), a = s(!1), m = o(
6
- () => Object.fromEntries(r.value.map((e) => [e.doc.userId, e.name]))
7
- ), n = o(
8
- () => Object.fromEntries(r.value.map((e) => [e.doc.userId, e.email]))
9
- ), u = o(
10
- () => Object.fromEntries(r.value.map((e) => [e.doc.userId, e.phoneNumber]))
11
- );
12
- async function c({ force: e = !1 } = {}) {
13
- if (!(!e && r.value.length > 0))
14
- try {
15
- a.value = !0;
16
- const i = await f.readTeamMembers();
17
- r.value = i.sort((t, l) => t.doc.isOwner ? -1 : t.name.localeCompare(l.name));
18
- } finally {
19
- a.value = !1;
20
- }
21
- }
22
- return {
23
- members: r,
24
- isLoading: a,
25
- userIdToName: m,
26
- userIdToEmail: n,
27
- userIdToPhone: u,
28
- readTeamMembers: c
29
- };
30
- });
31
- export {
32
- I as u
33
- };