@feedmepos/mf-hrm-portal 2.0.5-dev → 2.0.6-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 (130) hide show
  1. package/dist/AuditLogList-BxigxQv3.js +492 -0
  2. package/dist/{EmployeeList-B_pgDSOf.js → EmployeeList-DyvqwZtw.js} +6 -6
  3. package/dist/{Main-DsOSGRS7.js → Main-B8tSMq-U.js} +8 -8
  4. package/dist/{Main-BVogGot1.js → Main-CtH5MCty.js} +5 -5
  5. package/dist/PermissionSetList-DCONmOgn.js +323 -0
  6. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-07Dsea27.js +3092 -0
  7. package/dist/{RoleList-B09gFRrt.js → RoleList-jykDD_zm.js} +6 -6
  8. package/dist/{SelectFilter-NbXrJ4iH.js → SelectFilter-DUj7GBtT.js} +93 -89
  9. package/dist/TeamMemberList-DMrPgF1l.js +973 -0
  10. package/dist/{TimesheetList-BykQ0VO_.js → TimesheetList-Bk1XF9xy.js} +6 -6
  11. package/dist/{app-D0y0UR-U.js → app-BPlaahxK.js} +688 -785
  12. package/dist/app.js +1 -1
  13. package/dist/{dayjs.min-COoXlyZR.js → dayjs.min-LweNOSZ_.js} +1 -1
  14. package/dist/{employee-UNFKUR2e.js → employee-DPfiL6rd.js} +3 -3
  15. package/dist/{index-2et9Y2xR.js → index-BAhsHYNv.js} +1 -1
  16. package/dist/{index-BPGh5yHT.js → index-CBxn7cxI.js} +1570 -1637
  17. package/dist/{lodash-CDk6w3_I.js → lodash-D1uG3PY3.js} +1 -1
  18. package/dist/{api → src/api}/permission-assignment/index.d.ts +0 -3
  19. package/dist/{api → src/api}/report-query/index.d.ts +0 -1
  20. package/dist/{components → src/components}/form/SelectFilter.vue.d.ts +2 -0
  21. package/dist/{helpers → src/helpers}/permission-set.d.ts +0 -9
  22. package/dist/{helpers → src/helpers}/rule.d.ts +1 -4
  23. package/dist/{types → src/types}/report-query.d.ts +0 -1
  24. package/dist/{views → src/views}/team/components/BasePermission.vue.d.ts +0 -17
  25. package/dist/{team-B0EB57-E.js → team-B1osnB4U.js} +1 -1
  26. package/dist/{timesheet-DmthH-5T.js → timesheet-rte2utJf.js} +2 -2
  27. package/dist/tsconfig.app.tsbuildinfo +1 -1
  28. package/dist/{useAppStore-Ba_pxve9.js → useAppStore-CqrjwnF_.js} +1 -1
  29. package/dist/{useLoading-PuFP-Lbd.js → useLoading-B5IjfVEP.js} +1 -1
  30. package/dist/useReportPermissions-C4Q29AQJ.js +65 -0
  31. package/package.json +2 -2
  32. package/dist/AuditLogList-BvEIB73A.js +0 -474
  33. package/dist/PermissionSetList-B243twFl.js +0 -327
  34. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-JopeRj37.js +0 -3287
  35. package/dist/TeamMemberList-DZKq2mDD.js +0 -979
  36. package/dist/composables/useCustomReportPermissions.d.ts +0 -7
  37. package/dist/useReportPermissions-mKoU-8Yq.js +0 -59
  38. /package/dist/{App.vue.d.ts → src/App.vue.d.ts} +0 -0
  39. /package/dist/{Entry.vue.d.ts → src/Entry.vue.d.ts} +0 -0
  40. /package/dist/{api → src/api}/audit-log/index.d.ts +0 -0
  41. /package/dist/{api → src/api}/employee/index.d.ts +0 -0
  42. /package/dist/{api → src/api}/index.d.ts +0 -0
  43. /package/dist/{api → src/api}/inventory/index.d.ts +0 -0
  44. /package/dist/{api → src/api}/permission-set/index.d.ts +0 -0
  45. /package/dist/{api → src/api}/public-setting/index.d.ts +0 -0
  46. /package/dist/{api → src/api}/role/index.d.ts +0 -0
  47. /package/dist/{api → src/api}/team/index.d.ts +0 -0
  48. /package/dist/{api → src/api}/timesheet/index.d.ts +0 -0
  49. /package/dist/{api → src/api}/user/index.d.ts +0 -0
  50. /package/dist/{app.d.ts → src/app.d.ts} +0 -0
  51. /package/dist/{components → src/components}/AppForm.vue.d.ts +0 -0
  52. /package/dist/{components → src/components}/CheckboxInput.vue.d.ts +0 -0
  53. /package/dist/{components → src/components}/CollapsibleWrapper.vue.d.ts +0 -0
  54. /package/dist/{components → src/components}/Navigator.vue.d.ts +0 -0
  55. /package/dist/{components → src/components}/Splash.vue.d.ts +0 -0
  56. /package/dist/{components → src/components}/button/ResponsiveFabButton.vue.d.ts +0 -0
  57. /package/dist/{components → src/components}/layout/FormColumn.vue.d.ts +0 -0
  58. /package/dist/{components → src/components}/layout/FormItem.vue.d.ts +0 -0
  59. /package/dist/{components → src/components}/layout/FormSection.vue.d.ts +0 -0
  60. /package/dist/{components → src/components}/layout/FullWrapper.vue.d.ts +0 -0
  61. /package/dist/{components → src/components}/layout/HorizontalSplitter.vue.d.ts +0 -0
  62. /package/dist/{components → src/components}/layout/LottieAnimation.vue.d.ts +0 -0
  63. /package/dist/{components → src/components}/layout/PageLayout.vue.d.ts +0 -0
  64. /package/dist/{components → src/components}/loading/AppLoading.vue.d.ts +0 -0
  65. /package/dist/{components → src/components}/loading/PageLoading.vue.d.ts +0 -0
  66. /package/dist/{components → src/components}/loading/index.d.ts +0 -0
  67. /package/dist/{components → src/components}/menu/BottomSheetMenu.vue.d.ts +0 -0
  68. /package/dist/{components → src/components}/menu/BottomSheetMenuItem.vue.d.ts +0 -0
  69. /package/dist/{components → src/components}/menu/ResponsiveContextMenu.vue.d.ts +0 -0
  70. /package/dist/{components → src/components}/table/EmptyDataTemplate/Icon.vue.d.ts +0 -0
  71. /package/dist/{components → src/components}/table/EmptyDataTemplate/index.d.ts +0 -0
  72. /package/dist/{components → src/components}/table/EmptyDataTemplate/index.vue.d.ts +0 -0
  73. /package/dist/{composables → src/composables}/useAppStore.d.ts +0 -0
  74. /package/dist/{composables → src/composables}/useDateRange.d.ts +0 -0
  75. /package/dist/{composables → src/composables}/useDiscardConfirm.d.ts +0 -0
  76. /package/dist/{composables → src/composables}/useElementPosition.d.ts +0 -0
  77. /package/dist/{composables → src/composables}/useFilterSelector.d.ts +0 -0
  78. /package/dist/{composables → src/composables}/useLoading.d.ts +0 -0
  79. /package/dist/{composables → src/composables}/useMessage.d.ts +0 -0
  80. /package/dist/{composables → src/composables}/useReportPermissions.d.ts +0 -0
  81. /package/dist/{composables → src/composables}/useRestaurantMap.d.ts +0 -0
  82. /package/dist/{composables → src/composables}/useSearch.d.ts +0 -0
  83. /package/dist/{composables → src/composables}/useSheet.d.ts +0 -0
  84. /package/dist/{helpers → src/helpers}/component.d.ts +0 -0
  85. /package/dist/{helpers → src/helpers}/iteration.d.ts +0 -0
  86. /package/dist/{helpers → src/helpers}/object.d.ts +0 -0
  87. /package/dist/{helpers → src/helpers}/portal-user.d.ts +0 -0
  88. /package/dist/{helpers → src/helpers}/string.d.ts +0 -0
  89. /package/dist/{helpers → src/helpers}/utils.d.ts +0 -0
  90. /package/dist/{main.d.ts → src/main.d.ts} +0 -0
  91. /package/dist/{router → src/router}/index.d.ts +0 -0
  92. /package/dist/{router → src/router}/shared.d.ts +0 -0
  93. /package/dist/{stores → src/stores}/employee.d.ts +0 -0
  94. /package/dist/{stores → src/stores}/permission-assignment.d.ts +0 -0
  95. /package/dist/{stores → src/stores}/permission-set.d.ts +0 -0
  96. /package/dist/{stores → src/stores}/role.d.ts +0 -0
  97. /package/dist/{stores → src/stores}/team.d.ts +0 -0
  98. /package/dist/{stores → src/stores}/timesheet.d.ts +0 -0
  99. /package/dist/{types → src/types}/audit-log.d.ts +0 -0
  100. /package/dist/{types → src/types}/employee.d.ts +0 -0
  101. /package/dist/{types → src/types}/permission-assignment.d.ts +0 -0
  102. /package/dist/{types → src/types}/permission-set.d.ts +0 -0
  103. /package/dist/{types → src/types}/restaurant.d.ts +0 -0
  104. /package/dist/{types → src/types}/role.d.ts +0 -0
  105. /package/dist/{types → src/types}/team.d.ts +0 -0
  106. /package/dist/{types → src/types}/timesheet.d.ts +0 -0
  107. /package/dist/{views → src/views}/audit-log/AuditLogList.vue.d.ts +0 -0
  108. /package/dist/{views → src/views}/audit-log/locales/index.d.ts +0 -0
  109. /package/dist/{views → src/views}/hr/Main.vue.d.ts +0 -0
  110. /package/dist/{views → src/views}/hr/employee/Employee.vue.d.ts +0 -0
  111. /package/dist/{views → src/views}/hr/employee/EmployeeForm.vue.d.ts +0 -0
  112. /package/dist/{views → src/views}/hr/employee/EmployeeList.vue.d.ts +0 -0
  113. /package/dist/{views → src/views}/hr/locales/index.d.ts +0 -0
  114. /package/dist/{views → src/views}/hr/role/RoleForm.vue.d.ts +0 -0
  115. /package/dist/{views → src/views}/hr/role/RoleList.vue.d.ts +0 -0
  116. /package/dist/{views → src/views}/hr/timesheet/TimesheetList.vue.d.ts +0 -0
  117. /package/dist/{views → src/views}/team/Main.vue.d.ts +0 -0
  118. /package/dist/{views → src/views}/team/components/ConditionPermission.vue.d.ts +0 -0
  119. /package/dist/{views → src/views}/team/components/InheritPermissionTooltip.vue.d.ts +0 -0
  120. /package/dist/{views → src/views}/team/components/PermissionWithTooltip.vue.d.ts +0 -0
  121. /package/dist/{views → src/views}/team/components/PortalPermissionEditor.vue.d.ts +0 -0
  122. /package/dist/{views → src/views}/team/components/PortalUserSearcher.vue.d.ts +0 -0
  123. /package/dist/{views → src/views}/team/components/PosRolePermission.vue.d.ts +0 -0
  124. /package/dist/{views → src/views}/team/locales/index.d.ts +0 -0
  125. /package/dist/{views → src/views}/team/member/AddMemberForm.vue.d.ts +0 -0
  126. /package/dist/{views → src/views}/team/member/MemberInfo.vue.d.ts +0 -0
  127. /package/dist/{views → src/views}/team/member/TeamMemberList.vue.d.ts +0 -0
  128. /package/dist/{views → src/views}/team/member/TeamMemberMasterUser.vue.d.ts +0 -0
  129. /package/dist/{views → src/views}/team/permission-set/PermissionSetForm.vue.d.ts +0 -0
  130. /package/dist/{views → src/views}/team/permission-set/PermissionSetList.vue.d.ts +0 -0
@@ -0,0 +1,492 @@
1
+ import { defineComponent as de, ref as h, computed as k, watch as R, resolveComponent as D, createElementBlock as f, openBlock as m, Fragment as F, createVNode as d, unref as n, withCtx as N, createElementVNode as e, createBlock as $, createCommentVNode as x, toDisplayString as s, renderList as re, createTextVNode as Y } from "vue";
2
+ import { d as ce } from "./dayjs.min-LweNOSZ_.js";
3
+ import { useI18n as ue, useCoreStore as me } from "@feedmepos/mf-common";
4
+ import { G, _ as fe } from "./app-BPlaahxK.js";
5
+ import { _ as pe } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
6
+ import { _ as ve } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
7
+ import { components as J } from "@feedmepos/ui-library";
8
+ import { g as _e, b as ge, p as Z } from "./index-CBxn7cxI.js";
9
+ import { u as he } from "./team-B1osnB4U.js";
10
+ import { S as U } from "./SelectFilter-DUj7GBtT.js";
11
+ const be = "/audit-logs", xe = {
12
+ async read(i) {
13
+ var O, g, L, w;
14
+ const o = {
15
+ limit: (i == null ? void 0 : i.limit) ?? 100,
16
+ offset: (i == null ? void 0 : i.offset) ?? 0,
17
+ ...i != null && i.from ? { from: i.from } : {},
18
+ ...i != null && i.to ? { to: i.to } : {},
19
+ ...(O = i == null ? void 0 : i.userIds) != null && O.length ? { userIds: i.userIds } : {},
20
+ ...(g = i == null ? void 0 : i.subjects) != null && g.length ? { subjects: i.subjects } : {},
21
+ ...(L = i == null ? void 0 : i.actions) != null && L.length ? { actions: i.actions } : {},
22
+ ...(w = i == null ? void 0 : i.outcomes) != null && w.length ? { outcomes: i.outcomes } : {}
23
+ };
24
+ return console.log("[AuditLogAPI] request params:", o), _e(
25
+ await ge().get(be, {
26
+ params: o,
27
+ // Serialize arrays as repeated params: key=val1&key=val2
28
+ // (NestJS @Query expects this; axios default adds brackets which break matching)
29
+ paramsSerializer: (a) => {
30
+ const y = new URLSearchParams();
31
+ for (const [p, b] of Object.entries(a))
32
+ if (Array.isArray(b))
33
+ for (const A of b) y.append(p, String(A));
34
+ else b != null && y.append(p, String(b));
35
+ return console.log("[AuditLogAPI] serialized query string:", y.toString()), y.toString();
36
+ }
37
+ })
38
+ );
39
+ }
40
+ }, ye = {
41
+ class: "flex flex-1 flex-col gap-16 min-h-0"
42
+ }, Le = {
43
+ class: "flex items-center gap-8"
44
+ }, Se = {
45
+ class: "w-fit"
46
+ }, ke = {
47
+ class: "w-fit"
48
+ }, we = {
49
+ class: "w-fit"
50
+ }, Ie = {
51
+ class: "w-fit"
52
+ }, Ce = {
53
+ class: "flex h-full flex-col"
54
+ }, Pe = {
55
+ key: 0,
56
+ class: "flex shrink-0 items-center justify-end border-t border-fm-color-border-default py-4"
57
+ }, Te = {
58
+ class: "text-sm text-fm-color-typo-secondary"
59
+ }, Ve = {
60
+ key: 0,
61
+ class: "space-y-12 p-4 text-sm"
62
+ }, je = {
63
+ class: "rounded-lg border border-fm-color-border-default"
64
+ }, De = {
65
+ class: "flex items-start justify-between gap-8 p-12"
66
+ }, Oe = {
67
+ class: "text-base font-bold leading-snug text-fm-color-typo-primary flex-1 min-w-0"
68
+ }, Ae = {
69
+ class: "audit-log-operation-label-detail font-semibold"
70
+ }, Fe = {
71
+ class: "space-y-12 p-12"
72
+ }, Ne = {
73
+ class: "text-xs text-fm-color-typo-secondary"
74
+ }, Ue = {
75
+ class: "font-semibold"
76
+ }, Be = {
77
+ key: 0
78
+ }, Ee = {
79
+ class: "text-xs text-fm-color-typo-secondary"
80
+ }, Re = {
81
+ class: "font-semibold"
82
+ }, qe = {
83
+ class: "text-xs text-fm-color-typo-secondary"
84
+ }, ze = {
85
+ class: "break-all font-mono text-xs font-semibold"
86
+ }, Me = {
87
+ class: "text-xs text-fm-color-typo-secondary"
88
+ }, Ke = {
89
+ class: "font-semibold"
90
+ }, $e = {
91
+ class: "text-xs text-fm-color-typo-secondary"
92
+ }, Ye = {
93
+ class: "font-semibold"
94
+ }, Ge = {
95
+ key: 1
96
+ }, Je = {
97
+ class: "text-xs text-fm-color-typo-secondary"
98
+ }, Ze = {
99
+ class: "font-semibold"
100
+ }, He = {
101
+ class: "text-xs text-fm-color-typo-secondary"
102
+ }, Qe = {
103
+ class: "break-all font-mono text-xs font-semibold"
104
+ }, We = {
105
+ class: "text-xs text-fm-color-typo-secondary"
106
+ }, Xe = {
107
+ class: "font-semibold"
108
+ }, et = {
109
+ class: "rounded-lg border border-fm-color-border-default"
110
+ }, tt = {
111
+ class: "p-12"
112
+ }, ot = {
113
+ class: "text-base font-bold text-fm-color-typo-primary"
114
+ }, at = {
115
+ class: "space-y-12 p-12"
116
+ }, lt = {
117
+ key: 0
118
+ }, st = {
119
+ class: "text-xs text-fm-color-typo-secondary"
120
+ }, nt = {
121
+ class: "font-semibold"
122
+ }, it = {
123
+ class: "text-xs text-fm-color-typo-secondary"
124
+ }, dt = {
125
+ class: "font-semibold"
126
+ }, rt = {
127
+ key: 1
128
+ }, ct = {
129
+ class: "text-xs text-fm-color-typo-secondary"
130
+ }, ut = {
131
+ class: "font-semibold"
132
+ }, mt = {
133
+ class: "break-all font-mono text-xs text-fm-color-typo-secondary"
134
+ }, ft = {
135
+ class: "font-semibold"
136
+ }, pt = {
137
+ key: 0,
138
+ class: "break-all font-mono text-xs text-fm-color-typo-secondary"
139
+ }, vt = {
140
+ key: 2
141
+ }, _t = {
142
+ class: "text-xs text-fm-color-typo-secondary"
143
+ }, gt = {
144
+ class: "mt-4 space-y-4"
145
+ }, ht = {
146
+ class: "flex h-16 w-16 shrink-0 items-center justify-center rounded-full bg-fm-color-primary-default text-xs font-bold text-white"
147
+ }, bt = {
148
+ class: "text-xs font-semibold"
149
+ }, xt = {
150
+ key: 0,
151
+ class: "text-fm-color-typo-secondary"
152
+ }, yt = {
153
+ class: "text-xs text-fm-color-typo-secondary"
154
+ }, Lt = {
155
+ class: "font-mono text-xs font-semibold"
156
+ }, St = {
157
+ class: "text-xs text-fm-color-typo-secondary"
158
+ }, kt = {
159
+ class: "break-all font-mono text-xs font-semibold"
160
+ }, wt = {
161
+ key: 3
162
+ }, It = {
163
+ class: "text-xs text-fm-color-typo-secondary"
164
+ }, Ct = {
165
+ class: "mt-4 max-h-[400px] overflow-auto rounded bg-gray-100 p-8 font-mono text-xs leading-relaxed shadow-inner"
166
+ }, q = 100, Bt = /* @__PURE__ */ de({
167
+ __name: "AuditLogList",
168
+ setup(i) {
169
+ const {
170
+ t: o
171
+ } = ue(), O = me(), g = he(), L = h(!1), w = h([]), a = h(null), y = h(!1), p = h(1), b = h(!1), A = ce().format("YYYY-MM-DD"), I = h({
172
+ startDate: A,
173
+ endDate: A
174
+ }), C = h(), P = h(), T = h(), V = h();
175
+ function H(l) {
176
+ return typeof l == "string" ? [l] : Array.isArray(l) ? l.filter((t) => typeof t == "string") : [];
177
+ }
178
+ const Q = k(() => g.members.map((l) => ({
179
+ label: l.name,
180
+ value: l.doc.userId
181
+ }))), W = k(() => {
182
+ const l = Z.flatMap((c) => H(c.subject).map((_) => ({
183
+ label: c.label,
184
+ value: _
185
+ }))), t = Object.entries(G).map(([c, _]) => ({
186
+ label: _,
187
+ value: c
188
+ })), r = /* @__PURE__ */ new Set(), v = [];
189
+ for (const c of [...l, ...t])
190
+ r.has(c.value) || (r.add(c.value), v.push(c));
191
+ return v;
192
+ });
193
+ function X(l, t) {
194
+ const r = t.toLowerCase();
195
+ return !!(l.label.toLowerCase().includes(r) || l.value.replace(/^business::/, "").toLowerCase().includes(r) || l.value.toLowerCase().includes(r));
196
+ }
197
+ const ee = k(() => [{
198
+ label: o("auditLog.action.manage"),
199
+ value: "manage"
200
+ }, {
201
+ label: o("auditLog.action.create"),
202
+ value: "create"
203
+ }, {
204
+ label: o("auditLog.action.read"),
205
+ value: "read"
206
+ }, {
207
+ label: o("auditLog.action.update"),
208
+ value: "update"
209
+ }, {
210
+ label: o("auditLog.action.delete"),
211
+ value: "delete"
212
+ }]), te = k(() => [{
213
+ label: o("auditLog.outcome.allowed"),
214
+ value: "allowed"
215
+ }, {
216
+ label: o("auditLog.outcome.denied"),
217
+ value: "denied"
218
+ }, {
219
+ label: o("auditLog.outcome.skipped"),
220
+ value: "skipped"
221
+ }]), oe = k(() => {
222
+ const {
223
+ startDate: l,
224
+ endDate: t
225
+ } = I.value;
226
+ return l && t ? `${l} – ${t}` : l || t || o("auditLog.dateRange.placeholder");
227
+ }), B = k(() => w.value);
228
+ function z(l) {
229
+ var t;
230
+ return ((t = Z.find((r) => r.subject === l)) == null ? void 0 : t.label) ?? G[l];
231
+ }
232
+ const M = {
233
+ allowed: "success",
234
+ denied: "critical",
235
+ skipped: "warning"
236
+ }, ae = [{
237
+ accessorKey: "timestamp",
238
+ header: () => o("auditLog.columns.timestamp"),
239
+ cell(l) {
240
+ const t = l.row.original;
241
+ return new Date(t.timestamp).toLocaleString();
242
+ }
243
+ }, {
244
+ accessorKey: "userId",
245
+ header: () => o("auditLog.columns.user"),
246
+ enableSorting: !1,
247
+ size: 220,
248
+ cell(l) {
249
+ const t = l.row.original, r = g.userIdToName[t.userId], v = g.userIdToPhone[t.userId], c = g.userIdToEmail[t.userId];
250
+ return d("div", {
251
+ class: "flex items-center gap-8"
252
+ }, [d(J.FmAvatar, {
253
+ initials: r || t.userId,
254
+ size: "sm",
255
+ class: "shrink-0"
256
+ }, null), d("div", {
257
+ class: "min-w-0"
258
+ }, [r && d("p", {
259
+ class: "truncate font-semibold"
260
+ }, [r, v && d("span", {
261
+ class: "font-normal"
262
+ }, [Y(" ("), v, Y(")")])]), c && d("p", {
263
+ class: "truncate"
264
+ }, [c]), d("p", {
265
+ class: "truncate font-mono text-[10px] text-fm-color-typo-tertiary"
266
+ }, [t.userId])])]);
267
+ }
268
+ }, {
269
+ accessorKey: "subject",
270
+ header: () => o("auditLog.columns.subject"),
271
+ meta: {
272
+ cellClass: "text-left"
273
+ },
274
+ cell(l) {
275
+ const t = l.row.original, r = z(t.subject);
276
+ return r ? d("div", {
277
+ class: "text-left"
278
+ }, [d("span", null, [r]), d("p", {
279
+ class: "text-xs text-fm-color-typo-tertiary"
280
+ }, [t.subject])]) : d("div", {
281
+ class: "text-left"
282
+ }, [t.subject]);
283
+ }
284
+ }, {
285
+ accessorKey: "action",
286
+ header: () => o("auditLog.columns.action"),
287
+ enableSorting: !1
288
+ }, {
289
+ accessorKey: "operationLabel",
290
+ header: () => o("auditLog.columns.operation"),
291
+ enableSorting: !1,
292
+ size: 240,
293
+ meta: {
294
+ cellSpanClass: "audit-log-operation-label-table"
295
+ },
296
+ cell(l) {
297
+ return l.row.original.metadata.operationLabel ?? "-";
298
+ }
299
+ }, {
300
+ accessorKey: "outcome",
301
+ header: () => o("auditLog.columns.outcome"),
302
+ enableSorting: !1,
303
+ cell(l) {
304
+ const t = l.row.original;
305
+ return d(J.FmChip, {
306
+ variant: M[t.outcome] ?? "neutral",
307
+ label: t.outcome,
308
+ compact: !0
309
+ }, null);
310
+ }
311
+ }];
312
+ function K(l, t = !1) {
313
+ const [r, v, c] = l.split("-").map(Number), _ = new Date(r, v - 1, c);
314
+ return t && _.setDate(_.getDate() + 1), _.toISOString().slice(0, 19).replace("T", " ");
315
+ }
316
+ async function j() {
317
+ var l, t, r, v;
318
+ L.value = !0;
319
+ try {
320
+ const {
321
+ startDate: c,
322
+ endDate: _
323
+ } = I.value, E = (p.value - 1) * q, u = {
324
+ limit: q,
325
+ offset: E,
326
+ // Convert local date boundaries to UTC ISO strings so ClickHouse
327
+ // (which stores timestamps in UTC) receives the correct range.
328
+ ...c ? {
329
+ from: K(c)
330
+ } : {},
331
+ ..._ ? {
332
+ to: K(_, !0)
333
+ } : {},
334
+ ...(l = C.value) != null && l.length ? {
335
+ userIds: C.value
336
+ } : {},
337
+ ...(t = P.value) != null && t.length ? {
338
+ subjects: P.value
339
+ } : {},
340
+ ...(r = V.value) != null && r.length ? {
341
+ actions: V.value
342
+ } : {},
343
+ ...(v = T.value) != null && v.length ? {
344
+ outcomes: T.value
345
+ } : {}
346
+ }, S = await xe.read(u);
347
+ w.value = S, b.value = S.length === q;
348
+ } finally {
349
+ L.value = !1;
350
+ }
351
+ }
352
+ R(I, () => {
353
+ p.value = 1, j();
354
+ }), R([C, P, T, V], () => {
355
+ p.value = 1, j();
356
+ });
357
+ async function le() {
358
+ p.value > 1 && (p.value--, await j());
359
+ }
360
+ async function se() {
361
+ b.value && (p.value++, await j());
362
+ }
363
+ function ne(l) {
364
+ a.value = l, y.value = !0;
365
+ }
366
+ function ie() {
367
+ y.value = !1, a.value = null;
368
+ }
369
+ return R(O.currentBusiness, (l) => {
370
+ l && (p.value = 1, g.readTeamMembers(), j());
371
+ }, {
372
+ immediate: !0
373
+ }), (l, t) => {
374
+ const r = D("FmChip"), v = D("FmDateRangePicker"), c = D("FmTable"), _ = D("FmButton"), E = D("FmSideSheet");
375
+ return m(), f(F, null, [d(pe, {
376
+ heading: n(o)("auditLog.title")
377
+ }, {
378
+ default: N(() => [e("div", ye, [e("div", Le, [d(v, {
379
+ modelValue: I.value,
380
+ "onUpdate:modelValue": t[0] || (t[0] = (u) => I.value = u),
381
+ "show-predefined-range": ""
382
+ }, {
383
+ "trigger-button": N(() => [d(r, {
384
+ label: oe.value,
385
+ icon: "calendar_month"
386
+ }, null, 8, ["label"])]),
387
+ _: 1
388
+ }, 8, ["modelValue"]), e("div", Se, [d(U, {
389
+ modelValue: C.value,
390
+ "onUpdate:modelValue": t[1] || (t[1] = (u) => C.value = u),
391
+ items: Q.value,
392
+ multiple: "",
393
+ variant: "dark",
394
+ placeholder: n(o)("auditLog.filter.user_placeholder"),
395
+ "selected-prefix": n(o)("auditLog.filter.selected_user_prefix"),
396
+ "chip-icon": "account_circle"
397
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), e("div", ke, [d(U, {
398
+ modelValue: P.value,
399
+ "onUpdate:modelValue": t[2] || (t[2] = (u) => P.value = u),
400
+ items: W.value,
401
+ "filter-fn": X,
402
+ multiple: "",
403
+ variant: "dark",
404
+ placeholder: n(o)("auditLog.filter.subject_placeholder"),
405
+ "selected-prefix": n(o)("auditLog.filter.selected_subject_prefix"),
406
+ "chip-icon": "badge"
407
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), e("div", we, [d(U, {
408
+ modelValue: V.value,
409
+ "onUpdate:modelValue": t[3] || (t[3] = (u) => V.value = u),
410
+ items: ee.value,
411
+ multiple: "",
412
+ variant: "dark",
413
+ placeholder: n(o)("auditLog.filter.action_placeholder"),
414
+ "selected-prefix": n(o)("auditLog.filter.selected_action_prefix"),
415
+ searchable: !1
416
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), e("div", Ie, [d(U, {
417
+ modelValue: T.value,
418
+ "onUpdate:modelValue": t[4] || (t[4] = (u) => T.value = u),
419
+ items: te.value,
420
+ multiple: "",
421
+ variant: "dark",
422
+ placeholder: n(o)("auditLog.filter.status_placeholder"),
423
+ "selected-prefix": n(o)("auditLog.filter.selected_status_prefix"),
424
+ searchable: !1,
425
+ "chip-icon": "check_circle"
426
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])]), !L.value && B.value.length === 0 ? (m(), $(n(ve), {
427
+ key: 0,
428
+ title: n(o)("auditLog.noData.title"),
429
+ subtitle: n(o)("auditLog.noData.subtitle")
430
+ }, null, 8, ["title", "subtitle"])) : (m(), $(fe, {
431
+ key: 1
432
+ }, {
433
+ default: N(() => [e("div", Ce, [d(c, {
434
+ "column-defs": ae,
435
+ "row-data": B.value,
436
+ "page-size": B.value.length,
437
+ loading: L.value,
438
+ "pin-header-row": "",
439
+ "hide-footer": "",
440
+ class: "min-h-0 flex-1 cursor-pointer",
441
+ onRowClick: t[5] || (t[5] = (u) => ne(u.original))
442
+ }, null, 8, ["row-data", "page-size", "loading"]), p.value > 1 || b.value ? (m(), f("div", Pe, [d(_, {
443
+ variant: "tertiary",
444
+ icon: "chevron_left",
445
+ disabled: p.value === 1,
446
+ "aria-label": n(o)("auditLog.pagination.prevPage"),
447
+ onClick: le
448
+ }, null, 8, ["disabled", "aria-label"]), e("span", Te, s(n(o)("auditLog.pagination.page", {
449
+ page: p.value
450
+ })), 1), d(_, {
451
+ variant: "tertiary",
452
+ icon: "chevron_right",
453
+ disabled: !b.value,
454
+ "aria-label": n(o)("auditLog.pagination.nextPage"),
455
+ onClick: se
456
+ }, null, 8, ["disabled", "aria-label"])])) : x("", !0)])]),
457
+ _: 1
458
+ }))])]),
459
+ _: 1
460
+ }, 8, ["heading"]), d(E, {
461
+ header: n(o)("auditLog.detail.header"),
462
+ "model-value": y.value,
463
+ "max-width": 480,
464
+ "dismiss-away": "",
465
+ "onUpdate:modelValue": t[6] || (t[6] = (u) => {
466
+ u || ie();
467
+ })
468
+ }, {
469
+ default: N(() => [a.value ? (m(), f("div", Ve, [e("div", je, [e("div", De, [e("div", Oe, [e("p", Ae, s(a.value.metadata.operationLabel || "-"), 1)]), d(r, {
470
+ variant: M[a.value.outcome] ?? "neutral",
471
+ label: a.value.outcome,
472
+ compact: ""
473
+ }, null, 8, ["variant", "label"])]), t[7] || (t[7] = e("hr", {
474
+ class: "border-fm-color-border-default"
475
+ }, null, -1)), e("div", Fe, [e("div", null, [e("p", Ne, s(n(o)("auditLog.detail.timestamp")), 1), e("p", Ue, s(new Date(a.value.timestamp).toLocaleString()), 1)]), n(g).userIdToName[a.value.userId] ? (m(), f("div", Be, [e("p", Ee, s(n(o)("auditLog.detail.user")), 1), e("p", Re, s(n(g).userIdToName[a.value.userId]), 1)])) : x("", !0), e("div", null, [e("p", qe, s(n(o)("auditLog.detail.email")), 1), e("p", ze, s(n(g).userIdToEmail[a.value.userId] || a.value.userId), 1)]), e("div", null, [e("p", Me, s(n(o)("auditLog.detail.action")), 1), e("p", Ke, s(a.value.action), 1)]), e("div", null, [e("p", $e, s(n(o)("auditLog.detail.subject")), 1), e("p", Ye, s(z(a.value.subject) || a.value.subject), 1)]), a.value.field ? (m(), f("div", Ge, [e("p", Je, s(n(o)("auditLog.detail.field")), 1), e("p", Ze, s(a.value.field), 1)])) : x("", !0), e("div", null, [e("p", He, s(n(o)("auditLog.detail.business")), 1), e("p", Qe, s(a.value.businessId || "-"), 1)]), e("div", null, [e("p", We, s(n(o)("auditLog.detail.restaurant")), 1), e("p", Xe, s(a.value.restaurantId || "-"), 1)])])]), e("div", et, [e("div", tt, [e("p", ot, s(n(o)("auditLog.detail.metadata")), 1)]), t[8] || (t[8] = e("hr", {
476
+ class: "border-fm-color-border-default"
477
+ }, null, -1)), e("div", at, [a.value.metadata.reason ? (m(), f("div", lt, [e("p", st, s(n(o)("auditLog.detail.reason")), 1), e("p", nt, s(a.value.metadata.reason), 1)])) : x("", !0), e("div", null, [e("p", it, s(n(o)("auditLog.detail.resolvedFrom")), 1), e("p", dt, s(a.value.metadata.resolvedFrom), 1)]), a.value.metadata.permissionSetId ? (m(), f("div", rt, [e("p", ct, s(n(o)("auditLog.detail.permissionSet")), 1), a.value.metadata.resolvedFrom === "systemPermissionSet" ? (m(), f(F, {
478
+ key: 0
479
+ }, [e("p", ut, s(a.value.metadata.permissionSetName) + " (system)", 1), e("p", mt, s(a.value.metadata.permissionSetId), 1)], 64)) : (m(), f(F, {
480
+ key: 1
481
+ }, [e("p", ft, s(a.value.metadata.permissionSetName || a.value.metadata.permissionSetId), 1), a.value.metadata.permissionSetName ? (m(), f("p", pt, s(a.value.metadata.permissionSetId), 1)) : x("", !0)], 64))])) : x("", !0), a.value.metadata.trace && a.value.metadata.trace.length > 0 ? (m(), f("div", vt, [e("p", _t, s(n(o)("auditLog.detail.permissionTrace")), 1), e("ol", gt, [(m(!0), f(F, null, re(a.value.metadata.trace, (u, S) => (m(), f("li", {
482
+ key: S,
483
+ class: "flex items-center gap-6"
484
+ }, [e("span", ht, s(S + 1), 1), e("span", bt, s(u), 1), S < a.value.metadata.trace.length - 1 ? (m(), f("span", xt, "→")) : x("", !0)]))), 128))])])) : x("", !0), e("div", null, [e("p", yt, s(n(o)("auditLog.detail.requestMethod")), 1), e("p", Lt, s(a.value.metadata.requestMethod), 1)]), e("div", null, [e("p", St, s(n(o)("auditLog.detail.requestPath")), 1), e("p", kt, s(a.value.metadata.requestPath), 1)]), a.value.metadata.requestBody && Object.keys(a.value.metadata.requestBody).length > 0 ? (m(), f("div", wt, [e("p", It, s(n(o)("auditLog.detail.requestBody")), 1), e("pre", Ct, s(JSON.stringify(a.value.metadata.requestBody, null, 2)), 1)])) : x("", !0)])])])) : x("", !0)]),
485
+ _: 1
486
+ }, 8, ["header", "model-value"])], 64);
487
+ };
488
+ }
489
+ });
490
+ export {
491
+ Bt as default
492
+ };
@@ -1,15 +1,15 @@
1
1
  import { createElementBlock as $, openBlock as g, createElementVNode as m, toRaw as Me, defineComponent as _e, ref as _, computed as w, watch as be, resolveComponent as p, Fragment as G, renderSlot as Ie, createVNode as u, unref as o, withCtx as h, createBlock as D, createCommentVNode as Q, isRef as ne, renderList as Ve, toDisplayString as K, onMounted as $e, h as re, createTextVNode as Oe, withModifiers as Le } from "vue";
2
2
  import { useCoreStore as Fe, useI18n as we, RestaurantSelector as ce } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as xe, components as Ue, useDialog as Ne, useBreakpoints as Be, FmButtonVariant as De } from "@feedmepos/ui-library";
4
- import { _ as Pe, S as pe } from "./SelectFilter-NbXrJ4iH.js";
5
- import { _ as Te } from "./app-D0y0UR-U.js";
4
+ import { _ as Pe, S as pe } from "./SelectFilter-DUj7GBtT.js";
5
+ import { _ as Te } from "./app-BPlaahxK.js";
6
6
  import { _ as ze } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
7
7
  import { u as ke } from "./useSearch-B6WK1LBB.js";
8
- import { u as Se, E as Ae } from "./employee-UNFKUR2e.js";
9
- import { l as je } from "./lodash-CDk6w3_I.js";
8
+ import { u as Se, E as Ae } from "./employee-DPfiL6rd.js";
9
+ import { l as je } from "./lodash-D1uG3PY3.js";
10
10
  import { u as Ke, _ as ve, a as fe, b as Ge } from "./useRestaurantMap-D5BNPLKh.js";
11
- import { u as qe } from "./useLoading-PuFP-Lbd.js";
12
- import { u as ue } from "./useAppStore-Ba_pxve9.js";
11
+ import { u as qe } from "./useLoading-B5IjfVEP.js";
12
+ import { u as ue } from "./useAppStore-CqrjwnF_.js";
13
13
  const He = {};
14
14
  function Je(S, O) {
15
15
  return g(), $("div", null, [...O[0] || (O[0] = [
@@ -3,16 +3,16 @@ import { useRouter as of, useRoute as cf } from "vue-router";
3
3
  import { useCoreStore as hf, useI18n as uf } from "@feedmepos/mf-common";
4
4
  import { _ as vf } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
5
  import { _ as pf } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
6
- import { u as df } from "./useAppStore-Ba_pxve9.js";
6
+ import { u as df } from "./useAppStore-CqrjwnF_.js";
7
7
  import "@feedmepos/ui-library";
8
8
  /* empty css */
9
- import { u as mf } from "./employee-UNFKUR2e.js";
10
- import "./lodash-CDk6w3_I.js";
11
- import "./index-BPGh5yHT.js";
12
- import { R as vt } from "./app-D0y0UR-U.js";
13
- import "./useReportPermissions-mKoU-8Yq.js";
14
- import "./dayjs.min-COoXlyZR.js";
15
- import "./timesheet-DmthH-5T.js";
9
+ import { u as mf } from "./employee-DPfiL6rd.js";
10
+ import "./lodash-D1uG3PY3.js";
11
+ import "./index-CBxn7cxI.js";
12
+ import { R as vt } from "./app-BPlaahxK.js";
13
+ import "./useReportPermissions-C4Q29AQJ.js";
14
+ import "./dayjs.min-LweNOSZ_.js";
15
+ import "./timesheet-rte2utJf.js";
16
16
  var In = {};
17
17
  /*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
18
18
  var jt = {};
@@ -4,13 +4,13 @@ import { useI18n as N } from "@feedmepos/mf-common";
4
4
  import { _ as g } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
5
  import { _ as h } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
6
6
  import "@feedmepos/ui-library";
7
- import "./index-BPGh5yHT.js";
8
- import { R as v } from "./app-D0y0UR-U.js";
9
- import "./useAppStore-Ba_pxve9.js";
10
- import "./index-2et9Y2xR.js";
7
+ import "./index-CBxn7cxI.js";
8
+ import { R as v } from "./app-BPlaahxK.js";
9
+ import "./useAppStore-CqrjwnF_.js";
10
+ import "./index-BAhsHYNv.js";
11
11
  /* empty css */
12
12
  /* empty css */
13
- import "./team-B0EB57-E.js";
13
+ import "./team-B1osnB4U.js";
14
14
  const w = { class: "space-y-24" }, P = /* @__PURE__ */ V({
15
15
  __name: "Main",
16
16
  setup(x) {