@burdenoff/microfe-assethandler 2026.814.1 → 2026.817.2
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/assethandler/pages/PortfolioPortfolioOverviewPage.d.ts.map +1 -1
- package/dist/assethandler/pages/PortfolioPortfolioOverviewPage.js +75 -63
- package/dist/assethandler/pages/PortfolioPortfolioOverviewPage.js.map +1 -1
- package/dist/assethandler/providers/AssetHandlerProvider.d.ts.map +1 -1
- package/dist/assethandler/providers/AssetHandlerProvider.js +97 -36
- package/dist/assethandler/providers/AssetHandlerProvider.js.map +1 -1
- package/dist/assethandler/store/assethandlerStore.d.ts.map +1 -1
- package/dist/assethandler/store/assethandlerStore.js +19 -19
- package/dist/assethandler/store/assethandlerStore.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortfolioPortfolioOverviewPage.d.ts","sourceRoot":"","sources":["../../../src/assethandler/pages/PortfolioPortfolioOverviewPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PortfolioPortfolioOverviewPage.d.ts","sourceRoot":"","sources":["../../../src/assethandler/pages/PortfolioPortfolioOverviewPage.tsx"],"names":[],"mappings":"AA0HA,wBAAgB,8BAA8B,gCAwR7C"}
|
|
@@ -9,13 +9,13 @@ import { StatTile as s } from "../components/StatTile.js";
|
|
|
9
9
|
import { ChartCard as c } from "../components/ChartCard.js";
|
|
10
10
|
import "../components/index.js";
|
|
11
11
|
import { useMemo as l } from "react";
|
|
12
|
-
import { Activity as u, Building2 as d, CheckCircle2 as f, DollarSign as
|
|
13
|
-
import { gql as
|
|
14
|
-
import { useQuery as
|
|
12
|
+
import { Activity as u, Building2 as d, CheckCircle2 as f, DollarSign as ee, Layers as p, MapPin as m, Package as h, PieChart as g, TrendingDown as _, Wallet as v, Wrench as y } from "lucide-react";
|
|
13
|
+
import { gql as b } from "@apollo/client";
|
|
14
|
+
import { useQuery as x } from "@apollo/client/react";
|
|
15
15
|
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
16
16
|
import { GradientText as T, IllustratedEmptyState as E, PagePurpose as D, Table as O, TableBody as k, TableCell as A, TableHead as j, TableHeader as M, TableRow as N } from "@burdenoff/fe-libs/ui";
|
|
17
17
|
//#region src/assethandler/pages/PortfolioPortfolioOverviewPage.tsx
|
|
18
|
-
var P =
|
|
18
|
+
var P = b`
|
|
19
19
|
query AssetHandlerFinancialSummaryOverview {
|
|
20
20
|
financialSummary {
|
|
21
21
|
totalAssetValue
|
|
@@ -28,36 +28,48 @@ var P = x`
|
|
|
28
28
|
transactionExpense
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
`, F =
|
|
32
|
-
|
|
31
|
+
`, F = b`
|
|
32
|
+
query AssetHandlerPortfolioAssetTco {
|
|
33
|
+
assets {
|
|
34
|
+
id
|
|
35
|
+
totalCostOfOwnership
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`, I = (e) => e === void 0 ? "—" : e;
|
|
39
|
+
function L(e) {
|
|
33
40
|
return e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
34
41
|
}
|
|
35
|
-
function
|
|
42
|
+
function R(e, t) {
|
|
36
43
|
let n = e.reduce((e, n) => {
|
|
37
44
|
let r = t(n);
|
|
38
45
|
return e[r] = (e[r] || 0) + 1, e;
|
|
39
46
|
}, {});
|
|
40
47
|
return Object.entries(n).sort((e, t) => t[1] - e[1]);
|
|
41
48
|
}
|
|
42
|
-
var
|
|
49
|
+
var z = {
|
|
43
50
|
success: "bg-status-success-bg-subtle text-status-success-text",
|
|
44
51
|
warning: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
45
52
|
error: "bg-status-error-bg-subtle text-status-error-text",
|
|
46
53
|
info: "bg-status-info-bg-subtle text-status-info-text",
|
|
47
54
|
neutral: "bg-bg-sunken text-text-secondary"
|
|
48
|
-
},
|
|
49
|
-
function
|
|
55
|
+
}, B = (e) => e === "active" ? "success" : e === "maintenance" ? "warning" : e === "disposed" ? "error" : "neutral";
|
|
56
|
+
function V({ tone: e, children: t }) {
|
|
50
57
|
return /* @__PURE__ */ C("span", {
|
|
51
|
-
className: i("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium capitalize whitespace-nowrap",
|
|
58
|
+
className: i("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium capitalize whitespace-nowrap", z[e]),
|
|
52
59
|
children: t
|
|
53
60
|
});
|
|
54
61
|
}
|
|
55
|
-
function
|
|
56
|
-
let { format: i } = n(),
|
|
62
|
+
function H() {
|
|
63
|
+
let { format: i } = n(), b = (e) => i(Math.round(e)), z = r(), { assets: H } = e(), { data: U } = x(P, {
|
|
57
64
|
fetchPolicy: "cache-and-network",
|
|
58
65
|
errorPolicy: "all"
|
|
59
|
-
}),
|
|
60
|
-
|
|
66
|
+
}), W = U?.financialSummary, { data: G } = x(F, {
|
|
67
|
+
fetchPolicy: "cache-and-network",
|
|
68
|
+
errorPolicy: "all"
|
|
69
|
+
}), K = l(() => {
|
|
70
|
+
if (G?.assets?.length) return G.assets.reduce((e, t) => e + (t.totalCostOfOwnership ?? 0), 0);
|
|
71
|
+
}, [G]), q = l(() => {
|
|
72
|
+
let e = H.reduce((e, t) => {
|
|
61
73
|
let n = t.department?.trim() || "Unassigned", r = e[n] ?? {
|
|
62
74
|
count: 0,
|
|
63
75
|
value: 0
|
|
@@ -65,16 +77,16 @@ function V() {
|
|
|
65
77
|
return r.count += 1, r.value += t.currentValue ?? 0, e[n] = r, e;
|
|
66
78
|
}, {});
|
|
67
79
|
return Object.entries(e).sort((e, t) => t[1].value - e[1].value);
|
|
68
|
-
}, [
|
|
80
|
+
}, [H]), J = l(() => q.filter(([, { value: e }]) => e > 0).slice(0, 8).map(([e, { value: t }]) => ({
|
|
69
81
|
department: e,
|
|
70
82
|
value: Math.round(t)
|
|
71
|
-
})), [
|
|
83
|
+
})), [q]), Y = l(() => R(H, (e) => L(e.category)), [H]), X = l(() => R(H, (e) => e.status), [H]), Z = l(() => R(H, (e) => e.condition), [H]), Q = l(() => R(H, (e) => e.location.trim() || "Unlocated"), [H]), te = l(() => Y.map(([e, t]) => ({
|
|
72
84
|
name: e,
|
|
73
85
|
value: t
|
|
74
|
-
})), [
|
|
75
|
-
status:
|
|
86
|
+
})), [Y]), ne = l(() => X.map(([e, t]) => ({
|
|
87
|
+
status: L(e),
|
|
76
88
|
count: t
|
|
77
|
-
})), [
|
|
89
|
+
})), [X]), re = l(() => {
|
|
78
90
|
let e = [
|
|
79
91
|
"excellent",
|
|
80
92
|
"good",
|
|
@@ -82,11 +94,11 @@ function V() {
|
|
|
82
94
|
"poor",
|
|
83
95
|
"damaged"
|
|
84
96
|
];
|
|
85
|
-
return [...
|
|
86
|
-
condition:
|
|
97
|
+
return [...Z].sort((t, n) => e.indexOf(t[0]) - e.indexOf(n[0])).map(([e, t]) => ({
|
|
98
|
+
condition: L(e),
|
|
87
99
|
count: t
|
|
88
100
|
}));
|
|
89
|
-
}, [
|
|
101
|
+
}, [Z]), $ = X.find(([e]) => e === "active")?.[1] ?? 0, ie = X.find(([e]) => e === "maintenance")?.[1] ?? 0, ae = Q.filter(([e]) => e !== "Unlocated").length;
|
|
90
102
|
return /* @__PURE__ */ w("div", {
|
|
91
103
|
className: "space-y-6 p-4 sm:p-6",
|
|
92
104
|
children: [
|
|
@@ -105,7 +117,7 @@ function V() {
|
|
|
105
117
|
})
|
|
106
118
|
] }),
|
|
107
119
|
/* @__PURE__ */ C(D, { children: "The big-picture view of everything you own: how many assets you have and how they break down by category, status, condition and location. Use it to inform replacement planning and audit." }),
|
|
108
|
-
|
|
120
|
+
H.length === 0 ? /* @__PURE__ */ C(E, {
|
|
109
121
|
illustration: "empty-data",
|
|
110
122
|
title: "No assets in your portfolio yet",
|
|
111
123
|
description: "Once you add assets, this overview will summarise them by category, status, condition and location."
|
|
@@ -116,27 +128,27 @@ function V() {
|
|
|
116
128
|
/* @__PURE__ */ C(s, {
|
|
117
129
|
hero: !0,
|
|
118
130
|
label: "Total Asset Value",
|
|
119
|
-
value:
|
|
120
|
-
format:
|
|
121
|
-
icon:
|
|
131
|
+
value: I(W?.totalAssetValue),
|
|
132
|
+
format: b,
|
|
133
|
+
icon: ee
|
|
122
134
|
}),
|
|
123
135
|
/* @__PURE__ */ C(s, {
|
|
124
136
|
label: "Total Depreciation",
|
|
125
|
-
value:
|
|
126
|
-
format:
|
|
127
|
-
icon:
|
|
137
|
+
value: I(W?.totalDepreciation),
|
|
138
|
+
format: b,
|
|
139
|
+
icon: _
|
|
128
140
|
}),
|
|
129
141
|
/* @__PURE__ */ C(s, {
|
|
130
142
|
label: "Total Cost of Ownership",
|
|
131
|
-
value:
|
|
132
|
-
format:
|
|
133
|
-
icon:
|
|
143
|
+
value: I(K),
|
|
144
|
+
format: b,
|
|
145
|
+
icon: v
|
|
134
146
|
}),
|
|
135
147
|
/* @__PURE__ */ C(s, {
|
|
136
|
-
label:
|
|
137
|
-
value:
|
|
148
|
+
label: z("assethandler.portfolio.metrics.totalAssets", "Total {{assets}}"),
|
|
149
|
+
value: H.length,
|
|
138
150
|
format: t,
|
|
139
|
-
icon:
|
|
151
|
+
icon: h
|
|
140
152
|
})
|
|
141
153
|
]
|
|
142
154
|
}),
|
|
@@ -147,23 +159,23 @@ function V() {
|
|
|
147
159
|
label: "Active",
|
|
148
160
|
value: $,
|
|
149
161
|
icon: f,
|
|
150
|
-
delta: `${
|
|
162
|
+
delta: `${H.length > 0 ? Math.round($ / H.length * 100) : 0}% of estate`,
|
|
151
163
|
deltaTone: "neutral"
|
|
152
164
|
}),
|
|
153
165
|
/* @__PURE__ */ C(s, {
|
|
154
166
|
label: "In Maintenance",
|
|
155
|
-
value:
|
|
156
|
-
icon:
|
|
167
|
+
value: ie,
|
|
168
|
+
icon: y
|
|
157
169
|
}),
|
|
158
170
|
/* @__PURE__ */ C(s, {
|
|
159
171
|
label: "Locations",
|
|
160
|
-
value:
|
|
161
|
-
icon:
|
|
172
|
+
value: ae,
|
|
173
|
+
icon: m
|
|
162
174
|
}),
|
|
163
175
|
/* @__PURE__ */ C(s, {
|
|
164
176
|
label: "Categories",
|
|
165
|
-
value:
|
|
166
|
-
icon:
|
|
177
|
+
value: Y.length,
|
|
178
|
+
icon: p
|
|
167
179
|
})
|
|
168
180
|
]
|
|
169
181
|
}),
|
|
@@ -171,11 +183,11 @@ function V() {
|
|
|
171
183
|
className: "grid gap-6 lg:grid-cols-2",
|
|
172
184
|
children: [/* @__PURE__ */ C(c, {
|
|
173
185
|
title: "Assets by Category",
|
|
174
|
-
icon:
|
|
186
|
+
icon: g,
|
|
175
187
|
children: /* @__PURE__ */ C(o, {
|
|
176
|
-
data:
|
|
177
|
-
centerLabel:
|
|
178
|
-
centerValue:
|
|
188
|
+
data: te,
|
|
189
|
+
centerLabel: z("assethandler.portfolio.donut.centerLabel", "{{assets}}"),
|
|
190
|
+
centerValue: H.length,
|
|
179
191
|
height: 280,
|
|
180
192
|
ariaLabel: "Assets by category"
|
|
181
193
|
})
|
|
@@ -183,12 +195,12 @@ function V() {
|
|
|
183
195
|
title: "Value by Department",
|
|
184
196
|
subtitle: "Summed current book value",
|
|
185
197
|
icon: d,
|
|
186
|
-
children:
|
|
198
|
+
children: J.length === 0 ? /* @__PURE__ */ C(E, {
|
|
187
199
|
illustration: "empty-data",
|
|
188
200
|
title: "No department values yet",
|
|
189
201
|
description: "Assign departments and record current values to see this breakdown."
|
|
190
202
|
}) : /* @__PURE__ */ C(a, {
|
|
191
|
-
data:
|
|
203
|
+
data: J,
|
|
192
204
|
xKey: "department",
|
|
193
205
|
series: [{
|
|
194
206
|
key: "value",
|
|
@@ -196,8 +208,8 @@ function V() {
|
|
|
196
208
|
}],
|
|
197
209
|
orientation: "horizontal",
|
|
198
210
|
categoryWidth: 120,
|
|
199
|
-
height: Math.max(220,
|
|
200
|
-
valueFormat:
|
|
211
|
+
height: Math.max(220, J.length * 44),
|
|
212
|
+
valueFormat: b,
|
|
201
213
|
ariaLabel: "Current value by department"
|
|
202
214
|
})
|
|
203
215
|
})]
|
|
@@ -208,7 +220,7 @@ function V() {
|
|
|
208
220
|
title: "Assets by Status",
|
|
209
221
|
icon: u,
|
|
210
222
|
children: /* @__PURE__ */ C(a, {
|
|
211
|
-
data:
|
|
223
|
+
data: ne,
|
|
212
224
|
xKey: "status",
|
|
213
225
|
series: [{
|
|
214
226
|
key: "count",
|
|
@@ -219,13 +231,13 @@ function V() {
|
|
|
219
231
|
})
|
|
220
232
|
}), /* @__PURE__ */ C(c, {
|
|
221
233
|
title: "Assets by Location",
|
|
222
|
-
icon:
|
|
234
|
+
icon: m,
|
|
223
235
|
children: /* @__PURE__ */ C("div", {
|
|
224
236
|
className: "overflow-x-auto",
|
|
225
237
|
children: /* @__PURE__ */ w(O, { children: [/* @__PURE__ */ C(M, { children: /* @__PURE__ */ w(N, { children: [/* @__PURE__ */ C(j, { children: "Location" }), /* @__PURE__ */ C(j, {
|
|
226
238
|
className: "text-right",
|
|
227
239
|
children: "Assets"
|
|
228
|
-
})] }) }), /* @__PURE__ */ C(k, { children:
|
|
240
|
+
})] }) }), /* @__PURE__ */ C(k, { children: Q.map(([e, t]) => /* @__PURE__ */ w(N, { children: [/* @__PURE__ */ C(A, {
|
|
229
241
|
className: "font-medium",
|
|
230
242
|
children: e
|
|
231
243
|
}), /* @__PURE__ */ C(A, {
|
|
@@ -239,9 +251,9 @@ function V() {
|
|
|
239
251
|
className: "grid gap-6 lg:grid-cols-2",
|
|
240
252
|
children: [/* @__PURE__ */ C(c, {
|
|
241
253
|
title: "Asset Condition Mix",
|
|
242
|
-
icon:
|
|
254
|
+
icon: y,
|
|
243
255
|
children: /* @__PURE__ */ C(a, {
|
|
244
|
-
data:
|
|
256
|
+
data: re,
|
|
245
257
|
xKey: "condition",
|
|
246
258
|
series: [{
|
|
247
259
|
key: "count",
|
|
@@ -253,7 +265,7 @@ function V() {
|
|
|
253
265
|
}), /* @__PURE__ */ C(c, {
|
|
254
266
|
title: "Department Breakdown",
|
|
255
267
|
subtitle: "Assets and current value",
|
|
256
|
-
icon:
|
|
268
|
+
icon: v,
|
|
257
269
|
children: /* @__PURE__ */ C("div", {
|
|
258
270
|
className: "overflow-x-auto",
|
|
259
271
|
children: /* @__PURE__ */ w(O, { children: [/* @__PURE__ */ C(M, { children: /* @__PURE__ */ w(N, { children: [
|
|
@@ -266,7 +278,7 @@ function V() {
|
|
|
266
278
|
className: "text-right",
|
|
267
279
|
children: "Current Value"
|
|
268
280
|
})
|
|
269
|
-
] }) }), /* @__PURE__ */ C(k, { children:
|
|
281
|
+
] }) }), /* @__PURE__ */ C(k, { children: q.map(([e, { count: t, value: n }]) => /* @__PURE__ */ w(N, { children: [
|
|
270
282
|
/* @__PURE__ */ C(A, {
|
|
271
283
|
className: "font-medium",
|
|
272
284
|
children: e
|
|
@@ -277,7 +289,7 @@ function V() {
|
|
|
277
289
|
}),
|
|
278
290
|
/* @__PURE__ */ C(A, {
|
|
279
291
|
className: "text-right tabular-nums",
|
|
280
|
-
children:
|
|
292
|
+
children: b(n)
|
|
281
293
|
})
|
|
282
294
|
] }, e)) })] })
|
|
283
295
|
})
|
|
@@ -288,10 +300,10 @@ function V() {
|
|
|
288
300
|
icon: u,
|
|
289
301
|
children: /* @__PURE__ */ C("div", {
|
|
290
302
|
className: "flex flex-wrap gap-3",
|
|
291
|
-
children:
|
|
303
|
+
children: X.map(([e, t]) => /* @__PURE__ */ w("div", {
|
|
292
304
|
className: "flex items-center gap-2 rounded-lg border border-border-seam bg-gloss-card p-3",
|
|
293
|
-
children: [/* @__PURE__ */ C(
|
|
294
|
-
tone:
|
|
305
|
+
children: [/* @__PURE__ */ C(V, {
|
|
306
|
+
tone: B(e),
|
|
295
307
|
children: e.replace(/_/g, " ")
|
|
296
308
|
}), /* @__PURE__ */ C("span", {
|
|
297
309
|
className: "text-lg font-bold tabular-nums",
|
|
@@ -305,6 +317,6 @@ function V() {
|
|
|
305
317
|
});
|
|
306
318
|
}
|
|
307
319
|
//#endregion
|
|
308
|
-
export {
|
|
320
|
+
export { H as PortfolioPortfolioOverviewPage };
|
|
309
321
|
|
|
310
322
|
//# sourceMappingURL=PortfolioPortfolioOverviewPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortfolioPortfolioOverviewPage.js","names":[],"sources":["../../../src/assethandler/pages/PortfolioPortfolioOverviewPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { useAssetMoney } from '../providers/AssetHandlerProvider';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n GradientText,\n PagePurpose,\n IllustratedEmptyState,\n} from '@burdenoff/fe-libs/ui';\nimport {\n Package,\n CheckCircle2,\n Wrench,\n MapPin,\n DollarSign,\n TrendingDown,\n Wallet,\n PieChart,\n Building2,\n Activity,\n Layers,\n} from 'lucide-react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { useAssetHandlerStore, type Asset } from '../store/assethandlerStore';\nimport { useCopy } from '../hooks/useCopy';\nimport { cn } from '../utils/cn';\nimport {\n StatTile,\n ChartCard,\n DonutChart,\n BarsChart,\n formatCompact,\n type ChartDatum,\n type DonutSlice,\n} from '../components';\n\n// ─── Backend financial rollup (wspace-assethandler-svc) ──────────────────────\ninterface AssetHandlerFinancialSummary {\n totalAssetValue: number;\n totalDepreciation: number;\n totalMaintenanceSpend: number;\n budgetAllocated: number;\n budgetSpent: number;\n invoicesOutstanding: number;\n invoicesOutstandingCount: number;\n transactionExpense: number;\n}\n\nconst FINANCIAL_SUMMARY_QUERY = gql`\n query AssetHandlerFinancialSummaryOverview {\n financialSummary {\n totalAssetValue\n totalDepreciation\n totalMaintenanceSpend\n budgetAllocated\n budgetSpent\n invoicesOutstanding\n invoicesOutstandingCount\n transactionExpense\n }\n }\n`;\n\nconst moneyOrDash = (value: number | undefined): number | string =>\n value === undefined ? '—' : value;\n\nfunction titleCase(value: string): string {\n return value.replace(/_/g, ' ').replace(/\\b\\w/g, (c) => c.toUpperCase());\n}\n\nfunction countBy(assets: Asset[], key: (a: Asset) => string): Array<[string, number]> {\n const map = assets.reduce<Record<string, number>>((acc, a) => {\n const k = key(a);\n acc[k] = (acc[k] || 0) + 1;\n return acc;\n }, {});\n return Object.entries(map).sort((a, b) => b[1] - a[1]);\n}\n\ntype PillTone = 'success' | 'warning' | 'error' | 'info' | 'neutral';\nconst PILL_CLASS: Record<PillTone, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n error: 'bg-status-error-bg-subtle text-status-error-text',\n info: 'bg-status-info-bg-subtle text-status-info-text',\n neutral: 'bg-bg-sunken text-text-secondary',\n};\nconst statusTone = (status: string): PillTone =>\n status === 'active'\n ? 'success'\n : status === 'maintenance'\n ? 'warning'\n : status === 'disposed'\n ? 'error'\n : 'neutral';\nfunction StatusPill({ tone, children }: { tone: PillTone; children: React.ReactNode }) {\n return (\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium capitalize whitespace-nowrap',\n PILL_CLASS[tone]\n )}\n >\n {children}\n </span>\n );\n}\n\nexport function PortfolioPortfolioOverviewPage() {\n const { format: money } = useAssetMoney();\n const moneyFull = (value: number) => money(Math.round(value));\n const tc = useCopy();\n const { assets } = useAssetHandlerStore();\n\n const { data: financialData } = useQuery<{ financialSummary: AssetHandlerFinancialSummary }>(\n FINANCIAL_SUMMARY_QUERY,\n { fetchPolicy: 'cache-and-network', errorPolicy: 'all' }\n );\n const financialSummary = financialData?.financialSummary;\n\n // TCO summed from store assets (undefined per-asset figures treated as 0).\n const totalCostOfOwnership = useMemo(\n () => assets.reduce((sum, a) => sum + (a.totalCostOfOwnership ?? 0), 0),\n [assets]\n );\n\n // Per-department count + summed current value, sorted by value desc.\n const byDepartment = useMemo(() => {\n const map = assets.reduce<Record<string, { count: number; value: number }>>((acc, a) => {\n const dept = a.department?.trim() || 'Unassigned';\n const entry = acc[dept] ?? { count: 0, value: 0 };\n entry.count += 1;\n entry.value += a.currentValue ?? 0;\n acc[dept] = entry;\n return acc;\n }, {});\n return Object.entries(map).sort((a, b) => b[1].value - a[1].value);\n }, [assets]);\n\n const departmentBars = useMemo<ChartDatum[]>(\n () =>\n byDepartment\n .filter(([, { value }]) => value > 0)\n .slice(0, 8)\n .map(([dept, { value }]) => ({ department: dept, value: Math.round(value) })),\n [byDepartment]\n );\n\n const byCategory = useMemo(() => countBy(assets, (a) => titleCase(a.category)), [assets]);\n const byStatus = useMemo(() => countBy(assets, (a) => a.status), [assets]);\n const byCondition = useMemo(() => countBy(assets, (a) => a.condition), [assets]);\n const byLocation = useMemo(\n () => countBy(assets, (a) => a.location.trim() || 'Unlocated'),\n [assets]\n );\n\n const categoryDonut = useMemo<DonutSlice[]>(\n () => byCategory.map(([name, value]) => ({ name, value })),\n [byCategory]\n );\n const statusBars = useMemo<ChartDatum[]>(\n () => byStatus.map(([status, count]) => ({ status: titleCase(status), count })),\n [byStatus]\n );\n const conditionBars = useMemo<ChartDatum[]>(() => {\n const order = ['excellent', 'good', 'fair', 'poor', 'damaged'];\n return [...byCondition]\n .sort((a, b) => order.indexOf(a[0]) - order.indexOf(b[0]))\n .map(([condition, count]) => ({ condition: titleCase(condition), count }));\n }, [byCondition]);\n\n const activeCount = byStatus.find(([s]) => s === 'active')?.[1] ?? 0;\n const maintenanceCount = byStatus.find(([s]) => s === 'maintenance')?.[1] ?? 0;\n const locationCount = byLocation.filter(([l]) => l !== 'Unlocated').length;\n\n return (\n <div className=\"space-y-6 p-4 sm:p-6\">\n <div>\n <p className=\"text-xs font-semibold uppercase tracking-wide text-text-muted\">\n Portfolio Overview\n </p>\n <h1 className=\"mt-1 text-2xl font-bold sm:text-3xl\">\n <GradientText>Portfolio Overview</GradientText>\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Management-level rollup of the entire estate — how it is distributed and what it is worth.\n </p>\n </div>\n\n <PagePurpose>\n The big-picture view of everything you own: how many assets you have and how they break down\n by category, status, condition and location. Use it to inform replacement planning and\n audit.\n </PagePurpose>\n\n {assets.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No assets in your portfolio yet\"\n description=\"Once you add assets, this overview will summarise them by category, status, condition and location.\"\n />\n ) : (\n <>\n {/* Primary value KPIs */}\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <StatTile\n hero\n label=\"Total Asset Value\"\n value={moneyOrDash(financialSummary?.totalAssetValue)}\n format={moneyFull}\n icon={DollarSign}\n />\n <StatTile\n label=\"Total Depreciation\"\n value={moneyOrDash(financialSummary?.totalDepreciation)}\n format={moneyFull}\n icon={TrendingDown}\n />\n <StatTile\n label=\"Total Cost of Ownership\"\n value={totalCostOfOwnership}\n format={moneyFull}\n icon={Wallet}\n />\n <StatTile\n label={tc('assethandler.portfolio.metrics.totalAssets', 'Total {{assets}}')}\n value={assets.length}\n format={formatCompact}\n icon={Package}\n />\n </div>\n\n {/* Secondary count KPIs */}\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <StatTile\n label=\"Active\"\n value={activeCount}\n icon={CheckCircle2}\n delta={`${assets.length > 0 ? Math.round((activeCount / assets.length) * 100) : 0}% of estate`}\n deltaTone=\"neutral\"\n />\n <StatTile label=\"In Maintenance\" value={maintenanceCount} icon={Wrench} />\n <StatTile label=\"Locations\" value={locationCount} icon={MapPin} />\n <StatTile label=\"Categories\" value={byCategory.length} icon={Layers} />\n </div>\n\n {/* Category donut + Value by department */}\n <div className=\"grid gap-6 lg:grid-cols-2\">\n <ChartCard title=\"Assets by Category\" icon={PieChart}>\n <DonutChart\n data={categoryDonut}\n centerLabel={tc('assethandler.portfolio.donut.centerLabel', '{{assets}}')}\n centerValue={assets.length}\n height={280}\n ariaLabel=\"Assets by category\"\n />\n </ChartCard>\n\n <ChartCard\n title=\"Value by Department\"\n subtitle=\"Summed current book value\"\n icon={Building2}\n >\n {departmentBars.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No department values yet\"\n description=\"Assign departments and record current values to see this breakdown.\"\n />\n ) : (\n <BarsChart\n data={departmentBars}\n xKey=\"department\"\n series={[{ key: 'value', label: 'Current value' }]}\n orientation=\"horizontal\"\n categoryWidth={120}\n height={Math.max(220, departmentBars.length * 44)}\n valueFormat={moneyFull}\n ariaLabel=\"Current value by department\"\n />\n )}\n </ChartCard>\n </div>\n\n {/* Status bars + Location table */}\n <div className=\"grid gap-6 lg:grid-cols-2\">\n <ChartCard title=\"Assets by Status\" icon={Activity}>\n <BarsChart\n data={statusBars}\n xKey=\"status\"\n series={[{ key: 'count', label: 'Assets' }]}\n height={260}\n ariaLabel=\"Assets by status\"\n />\n </ChartCard>\n\n <ChartCard title=\"Assets by Location\" icon={MapPin}>\n <div className=\"overflow-x-auto\">\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>Location</TableHead>\n <TableHead className=\"text-right\">Assets</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {byLocation.map(([location, count]) => (\n <TableRow key={location}>\n <TableCell className=\"font-medium\">{location}</TableCell>\n <TableCell className=\"text-right tabular-nums\">{count}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n </ChartCard>\n </div>\n\n {/* Condition mix + Department value table */}\n <div className=\"grid gap-6 lg:grid-cols-2\">\n <ChartCard title=\"Asset Condition Mix\" icon={Wrench}>\n <BarsChart\n data={conditionBars}\n xKey=\"condition\"\n series={[{ key: 'count', label: 'Assets' }]}\n height={260}\n ariaLabel=\"Assets by condition\"\n />\n </ChartCard>\n\n <ChartCard\n title=\"Department Breakdown\"\n subtitle=\"Assets and current value\"\n icon={Wallet}\n >\n <div className=\"overflow-x-auto\">\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>Department</TableHead>\n <TableHead className=\"text-right\">Assets</TableHead>\n <TableHead className=\"text-right\">Current Value</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {byDepartment.map(([dept, { count, value }]) => (\n <TableRow key={dept}>\n <TableCell className=\"font-medium\">{dept}</TableCell>\n <TableCell className=\"text-right tabular-nums\">{count}</TableCell>\n <TableCell className=\"text-right tabular-nums\">\n {moneyFull(value)}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n </ChartCard>\n </div>\n\n {/* Status legend chips */}\n <ChartCard title=\"Status Breakdown\" icon={Activity}>\n <div className=\"flex flex-wrap gap-3\">\n {byStatus.map(([status, count]) => (\n <div\n key={status}\n className=\"flex items-center gap-2 rounded-lg border border-border-seam bg-gloss-card p-3\"\n >\n <StatusPill tone={statusTone(status)}>{status.replace(/_/g, ' ')}</StatusPill>\n <span className=\"text-lg font-bold tabular-nums\">{count}</span>\n </div>\n ))}\n </div>\n </ChartCard>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAqDA,IAAM,IAA0B,CAAG;;;;;;;;;;;;;GAe7B,KAAe,MACnB,MAAU,KAAA,IAAY,MAAM;AAE9B,SAAS,EAAU,GAAuB;AACxC,QAAO,EAAM,QAAQ,MAAM,IAAI,CAAC,QAAQ,UAAU,MAAM,EAAE,aAAa,CAAC;;AAG1E,SAAS,EAAQ,GAAiB,GAAoD;CACpF,IAAM,IAAM,EAAO,QAAgC,GAAK,MAAM;EAC5D,IAAM,IAAI,EAAI,EAAE;AAEhB,SADA,EAAI,MAAM,EAAI,MAAM,KAAK,GAClB;IACN,EAAE,CAAC;AACN,QAAO,OAAO,QAAQ,EAAI,CAAC,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,GAAG;;AAIxD,IAAM,IAAuC;CAC3C,SAAS;CACT,SAAS;CACT,OAAO;CACP,MAAM;CACN,SAAS;CACV,EACK,KAAc,MAClB,MAAW,WACP,YACA,MAAW,gBACT,YACA,MAAW,aACT,UACA;AACV,SAAS,EAAW,EAAE,SAAM,eAA2D;AACrF,QACE,kBAAC,QAAD;E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ACb,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UAAA;QACE,kBAAC,GAAD,EAAA,UAAW,cAAsB,CAAA;QACjC,kBAAC,GAAD;SAAW,WAAU;mBAAa;SAAkB,CAAA;QACpD,kBAAC,GAAD;SAAW,WAAU;mBAAa;SAAyB,CAAA;QAClD,EAAA,CAAA,EACC,CAAA,EACd,kBAAC,GAAD,EAAA,UACG,EAAa,KAAK,CAAC,GAAM,EAAE,UAAO,gBACjC,kBAAC,GAAD,EAAA,UAAA;QACE,kBAAC,GAAD;SAAW,WAAU;mBAAe;SAAiB,CAAA;QACrD,kBAAC,GAAD;SAAW,WAAU;mBAA2B;SAAkB,CAAA;QAClE,kBAAC,GAAD;SAAW,WAAU;mBAClB,EAAU,EAAM;SACP,CAAA;QACH,EAAA,EANI,EAMJ,CACX,EACQ,CAAA,CACN,EAAA,CAAA;OACJ,CAAA;MACI,CAAA,CACR;;IAGN,kBAAC,GAAD;KAAW,OAAM;KAAmB,MAAM;eACxC,kBAAC,OAAD;MAAK,WAAU;gBACZ,EAAS,KAAK,CAAC,GAAQ,OACtB,kBAAC,OAAD;OAEE,WAAU;iBAFZ,CAIE,kBAAC,GAAD;QAAY,MAAM,EAAW,EAAO;kBAAG,EAAO,QAAQ,MAAM,IAAI;QAAc,CAAA,EAC9E,kBAAC,QAAD;QAAM,WAAU;kBAAkC;QAAa,CAAA,CAC3D;SALC,EAKD,CACN;MACE,CAAA;KACI,CAAA;IACX,EAAA,CAAA;GAED"}
|
|
1
|
+
{"version":3,"file":"PortfolioPortfolioOverviewPage.js","names":[],"sources":["../../../src/assethandler/pages/PortfolioPortfolioOverviewPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { useAssetMoney } from '../providers/AssetHandlerProvider';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n GradientText,\n PagePurpose,\n IllustratedEmptyState,\n} from '@burdenoff/fe-libs/ui';\nimport {\n Package,\n CheckCircle2,\n Wrench,\n MapPin,\n DollarSign,\n TrendingDown,\n Wallet,\n PieChart,\n Building2,\n Activity,\n Layers,\n} from 'lucide-react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { useAssetHandlerStore, type Asset } from '../store/assethandlerStore';\nimport { useCopy } from '../hooks/useCopy';\nimport { cn } from '../utils/cn';\nimport {\n StatTile,\n ChartCard,\n DonutChart,\n BarsChart,\n formatCompact,\n type ChartDatum,\n type DonutSlice,\n} from '../components';\n\n// ─── Backend financial rollup (wspace-assethandler-svc) ──────────────────────\ninterface AssetHandlerFinancialSummary {\n totalAssetValue: number;\n totalDepreciation: number;\n totalMaintenanceSpend: number;\n budgetAllocated: number;\n budgetSpent: number;\n invoicesOutstanding: number;\n invoicesOutstandingCount: number;\n transactionExpense: number;\n}\n\nconst FINANCIAL_SUMMARY_QUERY = gql`\n query AssetHandlerFinancialSummaryOverview {\n financialSummary {\n totalAssetValue\n totalDepreciation\n totalMaintenanceSpend\n budgetAllocated\n budgetSpent\n invoicesOutstanding\n invoicesOutstandingCount\n transactionExpense\n }\n }\n`;\n\nconst ASSET_TCO_QUERY = gql`\n query AssetHandlerPortfolioAssetTco {\n assets {\n id\n totalCostOfOwnership\n }\n }\n`;\n\nconst moneyOrDash = (value: number | undefined): number | string =>\n value === undefined ? '—' : value;\n\nfunction titleCase(value: string): string {\n return value.replace(/_/g, ' ').replace(/\\b\\w/g, (c) => c.toUpperCase());\n}\n\nfunction countBy(assets: Asset[], key: (a: Asset) => string): Array<[string, number]> {\n const map = assets.reduce<Record<string, number>>((acc, a) => {\n const k = key(a);\n acc[k] = (acc[k] || 0) + 1;\n return acc;\n }, {});\n return Object.entries(map).sort((a, b) => b[1] - a[1]);\n}\n\ntype PillTone = 'success' | 'warning' | 'error' | 'info' | 'neutral';\nconst PILL_CLASS: Record<PillTone, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n error: 'bg-status-error-bg-subtle text-status-error-text',\n info: 'bg-status-info-bg-subtle text-status-info-text',\n neutral: 'bg-bg-sunken text-text-secondary',\n};\nconst statusTone = (status: string): PillTone =>\n status === 'active'\n ? 'success'\n : status === 'maintenance'\n ? 'warning'\n : status === 'disposed'\n ? 'error'\n : 'neutral';\nfunction StatusPill({ tone, children }: { tone: PillTone; children: React.ReactNode }) {\n return (\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium capitalize whitespace-nowrap',\n PILL_CLASS[tone]\n )}\n >\n {children}\n </span>\n );\n}\n\nexport function PortfolioPortfolioOverviewPage() {\n const { format: money } = useAssetMoney();\n const moneyFull = (value: number) => money(Math.round(value));\n const tc = useCopy();\n const { assets } = useAssetHandlerStore();\n\n const { data: financialData } = useQuery<{ financialSummary: AssetHandlerFinancialSummary }>(\n FINANCIAL_SUMMARY_QUERY,\n { fetchPolicy: 'cache-and-network', errorPolicy: 'all' }\n );\n const financialSummary = financialData?.financialSummary;\n\n // TCO is fetched here rather than in the module bootstrap. Each\n // Asset.totalCostOfOwnership costs two aggregate queries server-side, so\n // selecting it for every asset is 2N database operations and blew past this\n // service's concurrency ceiling, taking the whole bootstrap — and therefore\n // every AssetHandler page — down with it (BOFF-6381, BOFF-6395). Scoping it\n // to the one page that shows the figure keeps that cost off every other\n // page, and lets this tile degrade to a dash on its own if the query fails\n // rather than reporting a silently-wrong total.\n const { data: tcoData } = useQuery<{\n assets: Array<{ id: string; totalCostOfOwnership?: number | null }>;\n }>(ASSET_TCO_QUERY, { fetchPolicy: 'cache-and-network', errorPolicy: 'all' });\n const totalCostOfOwnership = useMemo(() => {\n if (!tcoData?.assets?.length) return undefined;\n return tcoData.assets.reduce((sum, a) => sum + (a.totalCostOfOwnership ?? 0), 0);\n }, [tcoData]);\n\n // Per-department count + summed current value, sorted by value desc.\n const byDepartment = useMemo(() => {\n const map = assets.reduce<Record<string, { count: number; value: number }>>((acc, a) => {\n const dept = a.department?.trim() || 'Unassigned';\n const entry = acc[dept] ?? { count: 0, value: 0 };\n entry.count += 1;\n entry.value += a.currentValue ?? 0;\n acc[dept] = entry;\n return acc;\n }, {});\n return Object.entries(map).sort((a, b) => b[1].value - a[1].value);\n }, [assets]);\n\n const departmentBars = useMemo<ChartDatum[]>(\n () =>\n byDepartment\n .filter(([, { value }]) => value > 0)\n .slice(0, 8)\n .map(([dept, { value }]) => ({ department: dept, value: Math.round(value) })),\n [byDepartment]\n );\n\n const byCategory = useMemo(() => countBy(assets, (a) => titleCase(a.category)), [assets]);\n const byStatus = useMemo(() => countBy(assets, (a) => a.status), [assets]);\n const byCondition = useMemo(() => countBy(assets, (a) => a.condition), [assets]);\n const byLocation = useMemo(\n () => countBy(assets, (a) => a.location.trim() || 'Unlocated'),\n [assets]\n );\n\n const categoryDonut = useMemo<DonutSlice[]>(\n () => byCategory.map(([name, value]) => ({ name, value })),\n [byCategory]\n );\n const statusBars = useMemo<ChartDatum[]>(\n () => byStatus.map(([status, count]) => ({ status: titleCase(status), count })),\n [byStatus]\n );\n const conditionBars = useMemo<ChartDatum[]>(() => {\n const order = ['excellent', 'good', 'fair', 'poor', 'damaged'];\n return [...byCondition]\n .sort((a, b) => order.indexOf(a[0]) - order.indexOf(b[0]))\n .map(([condition, count]) => ({ condition: titleCase(condition), count }));\n }, [byCondition]);\n\n const activeCount = byStatus.find(([s]) => s === 'active')?.[1] ?? 0;\n const maintenanceCount = byStatus.find(([s]) => s === 'maintenance')?.[1] ?? 0;\n const locationCount = byLocation.filter(([l]) => l !== 'Unlocated').length;\n\n return (\n <div className=\"space-y-6 p-4 sm:p-6\">\n <div>\n <p className=\"text-xs font-semibold uppercase tracking-wide text-text-muted\">\n Portfolio Overview\n </p>\n <h1 className=\"mt-1 text-2xl font-bold sm:text-3xl\">\n <GradientText>Portfolio Overview</GradientText>\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Management-level rollup of the entire estate — how it is distributed and what it is worth.\n </p>\n </div>\n\n <PagePurpose>\n The big-picture view of everything you own: how many assets you have and how they break down\n by category, status, condition and location. Use it to inform replacement planning and\n audit.\n </PagePurpose>\n\n {assets.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No assets in your portfolio yet\"\n description=\"Once you add assets, this overview will summarise them by category, status, condition and location.\"\n />\n ) : (\n <>\n {/* Primary value KPIs */}\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <StatTile\n hero\n label=\"Total Asset Value\"\n value={moneyOrDash(financialSummary?.totalAssetValue)}\n format={moneyFull}\n icon={DollarSign}\n />\n <StatTile\n label=\"Total Depreciation\"\n value={moneyOrDash(financialSummary?.totalDepreciation)}\n format={moneyFull}\n icon={TrendingDown}\n />\n <StatTile\n label=\"Total Cost of Ownership\"\n value={moneyOrDash(totalCostOfOwnership)}\n format={moneyFull}\n icon={Wallet}\n />\n <StatTile\n label={tc('assethandler.portfolio.metrics.totalAssets', 'Total {{assets}}')}\n value={assets.length}\n format={formatCompact}\n icon={Package}\n />\n </div>\n\n {/* Secondary count KPIs */}\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <StatTile\n label=\"Active\"\n value={activeCount}\n icon={CheckCircle2}\n delta={`${assets.length > 0 ? Math.round((activeCount / assets.length) * 100) : 0}% of estate`}\n deltaTone=\"neutral\"\n />\n <StatTile label=\"In Maintenance\" value={maintenanceCount} icon={Wrench} />\n <StatTile label=\"Locations\" value={locationCount} icon={MapPin} />\n <StatTile label=\"Categories\" value={byCategory.length} icon={Layers} />\n </div>\n\n {/* Category donut + Value by department */}\n <div className=\"grid gap-6 lg:grid-cols-2\">\n <ChartCard title=\"Assets by Category\" icon={PieChart}>\n <DonutChart\n data={categoryDonut}\n centerLabel={tc('assethandler.portfolio.donut.centerLabel', '{{assets}}')}\n centerValue={assets.length}\n height={280}\n ariaLabel=\"Assets by category\"\n />\n </ChartCard>\n\n <ChartCard\n title=\"Value by Department\"\n subtitle=\"Summed current book value\"\n icon={Building2}\n >\n {departmentBars.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No department values yet\"\n description=\"Assign departments and record current values to see this breakdown.\"\n />\n ) : (\n <BarsChart\n data={departmentBars}\n xKey=\"department\"\n series={[{ key: 'value', label: 'Current value' }]}\n orientation=\"horizontal\"\n categoryWidth={120}\n height={Math.max(220, departmentBars.length * 44)}\n valueFormat={moneyFull}\n ariaLabel=\"Current value by department\"\n />\n )}\n </ChartCard>\n </div>\n\n {/* Status bars + Location table */}\n <div className=\"grid gap-6 lg:grid-cols-2\">\n <ChartCard title=\"Assets by Status\" icon={Activity}>\n <BarsChart\n data={statusBars}\n xKey=\"status\"\n series={[{ key: 'count', label: 'Assets' }]}\n height={260}\n ariaLabel=\"Assets by status\"\n />\n </ChartCard>\n\n <ChartCard title=\"Assets by Location\" icon={MapPin}>\n <div className=\"overflow-x-auto\">\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>Location</TableHead>\n <TableHead className=\"text-right\">Assets</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {byLocation.map(([location, count]) => (\n <TableRow key={location}>\n <TableCell className=\"font-medium\">{location}</TableCell>\n <TableCell className=\"text-right tabular-nums\">{count}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n </ChartCard>\n </div>\n\n {/* Condition mix + Department value table */}\n <div className=\"grid gap-6 lg:grid-cols-2\">\n <ChartCard title=\"Asset Condition Mix\" icon={Wrench}>\n <BarsChart\n data={conditionBars}\n xKey=\"condition\"\n series={[{ key: 'count', label: 'Assets' }]}\n height={260}\n ariaLabel=\"Assets by condition\"\n />\n </ChartCard>\n\n <ChartCard\n title=\"Department Breakdown\"\n subtitle=\"Assets and current value\"\n icon={Wallet}\n >\n <div className=\"overflow-x-auto\">\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>Department</TableHead>\n <TableHead className=\"text-right\">Assets</TableHead>\n <TableHead className=\"text-right\">Current Value</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {byDepartment.map(([dept, { count, value }]) => (\n <TableRow key={dept}>\n <TableCell className=\"font-medium\">{dept}</TableCell>\n <TableCell className=\"text-right tabular-nums\">{count}</TableCell>\n <TableCell className=\"text-right tabular-nums\">\n {moneyFull(value)}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n </ChartCard>\n </div>\n\n {/* Status legend chips */}\n <ChartCard title=\"Status Breakdown\" icon={Activity}>\n <div className=\"flex flex-wrap gap-3\">\n {byStatus.map(([status, count]) => (\n <div\n key={status}\n className=\"flex items-center gap-2 rounded-lg border border-border-seam bg-gloss-card p-3\"\n >\n <StatusPill tone={statusTone(status)}>{status.replace(/_/g, ' ')}</StatusPill>\n <span className=\"text-lg font-bold tabular-nums\">{count}</span>\n </div>\n ))}\n </div>\n </ChartCard>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAqDA,IAAM,IAA0B,CAAG;;;;;;;;;;;;;GAe7B,IAAkB,CAAG;;;;;;;GASrB,KAAe,MACnB,MAAU,KAAA,IAAY,MAAM;AAE9B,SAAS,EAAU,GAAuB;AACxC,QAAO,EAAM,QAAQ,MAAM,IAAI,CAAC,QAAQ,UAAU,MAAM,EAAE,aAAa,CAAC;;AAG1E,SAAS,EAAQ,GAAiB,GAAoD;CACpF,IAAM,IAAM,EAAO,QAAgC,GAAK,MAAM;EAC5D,IAAM,IAAI,EAAI,EAAE;AAEhB,SADA,EAAI,MAAM,EAAI,MAAM,KAAK,GAClB;IACN,EAAE,CAAC;AACN,QAAO,OAAO,QAAQ,EAAI,CAAC,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,GAAG;;AAIxD,IAAM,IAAuC;CAC3C,SAAS;CACT,SAAS;CACT,OAAO;CACP,MAAM;CACN,SAAS;CACV,EACK,KAAc,MAClB,MAAW,WACP,YACA,MAAW,gBACT,YACA,MAAW,aACT,UACA;A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sources":["../../../src/assethandler/providers/AssetHandlerProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAItD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"AssetHandlerProvider.d.ts","sourceRoot":"","sources":["../../../src/assethandler/providers/AssetHandlerProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAItD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AA6UpE,eAAO,MAAM,eAAe,6BAI3B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;CAAgD,CAAC;AAEjF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAMrE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,QAAO;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,KAAK,MAAM,CAAC;IACrD,kEAAkE;IAClE,OAAO,EAAE,cAAc,CAAC;CAazB,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,QAAO,GAAG,CAAC,MAAM,CAGjD,CAAC;AAEF,eAAO,MAAM,4BAA4B,QAAO;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;CAIpD,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,CAwC7E,CAAC"}
|
|
@@ -5,17 +5,11 @@ import "../utils/categoryPresentation.js";
|
|
|
5
5
|
import { createContext as i, useContext as a, useEffect as o, useMemo as s } from "react";
|
|
6
6
|
import { MemoryRouter as c } from "react-router";
|
|
7
7
|
import { ApolloClient as l, HttpLink as u, InMemoryCache as d, gql as f } from "@apollo/client";
|
|
8
|
-
import { ApolloProvider as p,
|
|
9
|
-
import { jsx as
|
|
8
|
+
import { ApolloProvider as p, useApolloClient as m, useQuery as h } from "@apollo/client/react";
|
|
9
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
10
10
|
//#region src/assethandler/providers/AssetHandlerProvider.tsx
|
|
11
|
-
var
|
|
11
|
+
var v = i(null), y = f`
|
|
12
12
|
query AssetHandlerBootstrap {
|
|
13
|
-
dashboardOverview {
|
|
14
|
-
totalAssets
|
|
15
|
-
openIncidents
|
|
16
|
-
openWorkOrders
|
|
17
|
-
totalTransactions
|
|
18
|
-
}
|
|
19
13
|
assets {
|
|
20
14
|
id
|
|
21
15
|
assetNumber
|
|
@@ -44,8 +38,32 @@ var _ = i(null), v = f`
|
|
|
44
38
|
disposalNotes
|
|
45
39
|
currentValue
|
|
46
40
|
accumulatedDepreciation
|
|
47
|
-
totalCostOfOwnership
|
|
41
|
+
# totalCostOfOwnership is deliberately NOT selected here. Unlike
|
|
42
|
+
# currentValue and accumulatedDepreciation, which are computed in-process
|
|
43
|
+
# from fields already on the row, Asset.totalCostOfOwnership calls
|
|
44
|
+
# AssetHandlerService.computeAssetTco, which issues TWO aggregate queries
|
|
45
|
+
# per asset (maintenanceRecord + workOrder) under Promise.all. Selecting
|
|
46
|
+
# it turns this one-root query into 1 + 2N database operations — 21 for
|
|
47
|
+
# ten assets — against a service that caps out around three (BOFF-6395),
|
|
48
|
+
# so it errored the batch and left the whole module empty again even
|
|
49
|
+
# after the bootstrap was split. It scales with the number of assets, so
|
|
50
|
+
# it can never be made to fit here.
|
|
51
|
+
#
|
|
52
|
+
# The only consumer that read it from the store is
|
|
53
|
+
# PortfolioPortfolioOverviewPage, which now fetches it itself.
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`, b = f`
|
|
57
|
+
query AssetHandlerBootstrapOverview {
|
|
58
|
+
dashboardOverview {
|
|
59
|
+
totalAssets
|
|
60
|
+
openIncidents
|
|
61
|
+
openWorkOrders
|
|
62
|
+
totalTransactions
|
|
48
63
|
}
|
|
64
|
+
}
|
|
65
|
+
`, x = f`
|
|
66
|
+
query AssetHandlerBootstrapOps {
|
|
49
67
|
incidents {
|
|
50
68
|
id
|
|
51
69
|
title
|
|
@@ -73,6 +91,9 @@ var _ = i(null), v = f`
|
|
|
73
91
|
updatedAt
|
|
74
92
|
completedAt
|
|
75
93
|
}
|
|
94
|
+
}
|
|
95
|
+
`, S = f`
|
|
96
|
+
query AssetHandlerBootstrapMaintenance {
|
|
76
97
|
maintenanceRecords {
|
|
77
98
|
id
|
|
78
99
|
assetId
|
|
@@ -101,6 +122,9 @@ var _ = i(null), v = f`
|
|
|
101
122
|
department
|
|
102
123
|
occurredAt
|
|
103
124
|
}
|
|
125
|
+
}
|
|
126
|
+
`, C = f`
|
|
127
|
+
query AssetHandlerBootstrapItil {
|
|
104
128
|
changeRequests {
|
|
105
129
|
id
|
|
106
130
|
title
|
|
@@ -132,6 +156,9 @@ var _ = i(null), v = f`
|
|
|
132
156
|
createdAt
|
|
133
157
|
updatedAt
|
|
134
158
|
}
|
|
159
|
+
}
|
|
160
|
+
`, w = f`
|
|
161
|
+
query AssetHandlerBootstrapFinance {
|
|
135
162
|
budgets {
|
|
136
163
|
id
|
|
137
164
|
name
|
|
@@ -156,6 +183,9 @@ var _ = i(null), v = f`
|
|
|
156
183
|
relatedPO
|
|
157
184
|
paidAt
|
|
158
185
|
}
|
|
186
|
+
}
|
|
187
|
+
`, T = f`
|
|
188
|
+
query AssetHandlerBootstrapSecurity {
|
|
159
189
|
securityEvents: getVaultSecurityEvents {
|
|
160
190
|
items {
|
|
161
191
|
id
|
|
@@ -201,48 +231,79 @@ var _ = i(null), v = f`
|
|
|
201
231
|
}
|
|
202
232
|
}
|
|
203
233
|
`;
|
|
204
|
-
function
|
|
205
|
-
let t = e((e) => e.hydrateFromBootstrap), n = e((e) => e.setBootstrapRefetch),
|
|
234
|
+
function E() {
|
|
235
|
+
let t = e((e) => e.hydrateFromBootstrap), n = e((e) => e.setBootstrapRefetch), r = m(), i = h(y, {
|
|
206
236
|
fetchPolicy: "cache-and-network",
|
|
207
237
|
errorPolicy: "all"
|
|
208
238
|
});
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}, [
|
|
212
|
-
i
|
|
213
|
-
|
|
239
|
+
o(() => {
|
|
240
|
+
i.data && t(i.data);
|
|
241
|
+
}, [i.data, t]), o(() => {
|
|
242
|
+
if (!i.data) return;
|
|
243
|
+
let e = !1;
|
|
244
|
+
return (async () => {
|
|
245
|
+
for (let n of [
|
|
246
|
+
b,
|
|
247
|
+
x,
|
|
248
|
+
S,
|
|
249
|
+
C,
|
|
250
|
+
w,
|
|
251
|
+
T
|
|
252
|
+
]) {
|
|
253
|
+
if (e) return;
|
|
254
|
+
try {
|
|
255
|
+
let i = await r.query({
|
|
256
|
+
query: n,
|
|
257
|
+
fetchPolicy: "network-only",
|
|
258
|
+
errorPolicy: "all"
|
|
259
|
+
});
|
|
260
|
+
!e && i.data && t(i.data);
|
|
261
|
+
} catch {}
|
|
262
|
+
}
|
|
263
|
+
})(), () => {
|
|
264
|
+
e = !0;
|
|
265
|
+
};
|
|
266
|
+
}, [
|
|
267
|
+
i.data,
|
|
268
|
+
r,
|
|
269
|
+
t
|
|
270
|
+
]);
|
|
271
|
+
let a = i.refetch;
|
|
272
|
+
return o(() => (n(() => {
|
|
273
|
+
a();
|
|
274
|
+
}), () => n(null)), [a, n]), null;
|
|
214
275
|
}
|
|
215
|
-
var
|
|
216
|
-
let e = a(
|
|
276
|
+
var D = () => {
|
|
277
|
+
let e = a(v);
|
|
217
278
|
if (!e) throw Error("useAssetHandler must be used within AssetHandlerProvider");
|
|
218
279
|
return e;
|
|
219
|
-
},
|
|
280
|
+
}, O = {
|
|
220
281
|
asset: "Asset",
|
|
221
282
|
assets: "Assets"
|
|
222
|
-
},
|
|
223
|
-
let { terminology: e } =
|
|
283
|
+
}, k = () => {
|
|
284
|
+
let { terminology: e } = D();
|
|
224
285
|
return {
|
|
225
|
-
asset: e?.asset ||
|
|
226
|
-
assets: e?.assets ||
|
|
286
|
+
asset: e?.asset || O.asset,
|
|
287
|
+
assets: e?.assets || O.assets
|
|
227
288
|
};
|
|
228
|
-
},
|
|
229
|
-
let { currency: e } =
|
|
289
|
+
}, A = () => {
|
|
290
|
+
let { currency: e } = D(), i = e || "USD";
|
|
230
291
|
return s(() => ({
|
|
231
292
|
currency: i,
|
|
232
293
|
symbol: t(i),
|
|
233
294
|
format: (e) => n(e, i),
|
|
234
295
|
compact: r(i)
|
|
235
296
|
}), [i]);
|
|
236
|
-
},
|
|
237
|
-
let { hiddenCategoryIds: e } =
|
|
297
|
+
}, j = () => {
|
|
298
|
+
let { hiddenCategoryIds: e } = D();
|
|
238
299
|
return s(() => new Set(e ?? []), [e]);
|
|
239
|
-
},
|
|
240
|
-
let { categoryLabels: e, categoryOptions: t } =
|
|
300
|
+
}, M = () => {
|
|
301
|
+
let { categoryLabels: e, categoryOptions: t } = D();
|
|
241
302
|
return {
|
|
242
303
|
labels: e,
|
|
243
304
|
options: t
|
|
244
305
|
};
|
|
245
|
-
},
|
|
306
|
+
}, N = ({ children: e, ...t }) => {
|
|
246
307
|
let n = s(() => new l({
|
|
247
308
|
link: new u({
|
|
248
309
|
uri: t.apiGatewayUrl ? `${t.apiGatewayUrl}/workspaces/graphql` : "/workspaces/graphql",
|
|
@@ -256,16 +317,16 @@ var b = () => {
|
|
|
256
317
|
t.apiGatewayUrl,
|
|
257
318
|
t.authToken,
|
|
258
319
|
t.workspaceToken
|
|
259
|
-
]), r = !!t.basePath, i = /* @__PURE__ */
|
|
320
|
+
]), r = !!t.basePath, i = /* @__PURE__ */ _(v.Provider, {
|
|
260
321
|
value: t,
|
|
261
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ g(E, {}), e]
|
|
262
323
|
});
|
|
263
|
-
return r ? i : /* @__PURE__ */
|
|
324
|
+
return r ? i : /* @__PURE__ */ g(p, {
|
|
264
325
|
client: n,
|
|
265
|
-
children: /* @__PURE__ */
|
|
326
|
+
children: /* @__PURE__ */ g(c, { children: i })
|
|
266
327
|
});
|
|
267
328
|
};
|
|
268
329
|
//#endregion
|
|
269
|
-
export {
|
|
330
|
+
export { N as AssetHandlerProvider, M as useAssetCategoryPresentation, D as useAssetHandler, A as useAssetMoney, k as useAssetTerminology, j as useHiddenCategoryIds };
|
|
270
331
|
|
|
271
332
|
//# sourceMappingURL=AssetHandlerProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetHandlerProvider.js","names":[],"sources":["../../../src/assethandler/providers/AssetHandlerProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useEffect } from 'react';\nimport { MemoryRouter } from 'react-router';\nimport { ApolloClient, HttpLink, InMemoryCache, gql } from '@apollo/client';\nimport { ApolloProvider, useQuery } from '@apollo/client/react';\nimport type { AssetHandlerRootProps } from '../types';\nimport type { AssetHandlerBootstrapPayload } from '../store/assethandlerStore';\nimport { useAssetHandlerStore } from '../store/assethandlerStore';\nimport { DEFAULT_CURRENCY, currencySymbol, formatMoney } from '../utils/money';\nimport type { ValueFormatter } from '../components/charts/chartTheme';\nimport { formatCurrencyCompact } from '../components/charts/chartTheme';\nexport { formatAssetCategory } from '../utils/categoryPresentation';\n\ntype AssetHandlerContextValue = AssetHandlerRootProps;\n\nconst AssetHandlerContext = createContext<AssetHandlerContextValue | null>(null);\n\nconst ASSETHANDLER_BOOTSTRAP_QUERY = gql`\n query AssetHandlerBootstrap {\n dashboardOverview {\n totalAssets\n openIncidents\n openWorkOrders\n totalTransactions\n }\n assets {\n id\n assetNumber\n name\n description\n category\n status\n condition\n serialNumber\n locationName\n assignedTo\n tags\n createdAt\n updatedAt\n purchaseValue\n purchaseDate\n usefulLifeMonths\n salvageValue\n depreciationMethod\n meterUnit\n department\n warrantyExpiry\n supplier\n disposalDate\n disposalMethod\n disposalNotes\n currentValue\n accumulatedDepreciation\n totalCostOfOwnership\n }\n incidents {\n id\n title\n description\n category\n priority\n status\n assignedTo\n reportedBy\n reportedAt\n resolvedAt\n resolution\n slaBreached\n }\n workOrders {\n id\n title\n description\n type\n status\n priority\n assetId\n assignedTo\n createdAt\n updatedAt\n completedAt\n }\n maintenanceRecords {\n id\n assetId\n title\n description\n type\n status\n priority\n scheduledAt\n completedAt\n estimatedCost\n actualCost\n checklist\n createdAt\n updatedAt\n }\n transactions {\n id\n type\n status\n amount\n currency\n category\n description\n vendor\n department\n occurredAt\n }\n changeRequests {\n id\n title\n description\n type\n status\n risk\n requestedBy\n assignedTo\n affectedAssets\n scheduledStart\n scheduledEnd\n approvals\n createdAt\n updatedAt\n }\n problems {\n id\n title\n description\n status\n priority\n category\n assignedTo\n relatedIncidents\n rootCause\n workaround\n resolution\n createdAt\n updatedAt\n }\n budgets {\n id\n name\n category\n allocated\n spent\n remaining\n period\n department\n status\n }\n invoices {\n id\n number\n vendor\n amount\n currency\n issueDate\n dueDate\n status\n items\n relatedPO\n paidAt\n }\n securityEvents: getVaultSecurityEvents {\n items {\n id\n eventType\n severity\n title: message\n description\n source: resourceType\n userId\n ipAddress\n occurredAt: timestamp\n resolved: reviewed\n }\n }\n complianceFrameworks: securityComplianceFrameworks(filter: { sourceProduct: \"assethandler\" }) {\n items {\n id\n name\n version\n status\n score\n totalControls\n passedControls\n failedControls\n lastAssessment\n nextAssessment\n lastAssessedAt\n }\n }\n securityPolicies: securityGovernancePolicies(filter: { sourceProduct: \"assethandler\" }) {\n items {\n id\n name\n description\n category\n status\n version\n effectiveDate\n reviewDate\n owner\n applicableTo\n }\n }\n }\n`;\n\nfunction AssetHandlerBootstrapHydrator() {\n const hydrateFromBootstrap = useAssetHandlerStore((s) => s.hydrateFromBootstrap);\n const setBootstrapRefetch = useAssetHandlerStore((s) => s.setBootstrapRefetch);\n const { data, refetch } = useQuery<AssetHandlerBootstrapPayload>(ASSETHANDLER_BOOTSTRAP_QUERY, {\n fetchPolicy: 'cache-and-network',\n errorPolicy: 'all',\n });\n\n useEffect(() => {\n if (data) {\n hydrateFromBootstrap(data);\n }\n }, [data, hydrateFromBootstrap]);\n\n useEffect(() => {\n setBootstrapRefetch(() => {\n void refetch();\n });\n return () => setBootstrapRefetch(null);\n }, [refetch, setBootstrapRefetch]);\n\n return null;\n}\n\nexport const useAssetHandler = () => {\n const context = useContext(AssetHandlerContext);\n if (!context) throw new Error('useAssetHandler must be used within AssetHandlerProvider');\n return context;\n};\n\nexport const DEFAULT_TERMINOLOGY = { asset: 'Asset', assets: 'Assets' } as const;\n\n/**\n * Resolved singular/plural noun for the module, applying consumer overrides on\n * top of the module defaults (\"Asset\"/\"Assets\").\n */\nexport const useAssetTerminology = (): { asset: string; assets: string } => {\n const { terminology } = useAssetHandler();\n return {\n asset: terminology?.asset || DEFAULT_TERMINOLOGY.asset,\n assets: terminology?.assets || DEFAULT_TERMINOLOGY.assets,\n };\n};\n\n/**\n * Resolved money presentation for the module: the consumer's `currency` prop\n * with the module default (\"USD\") applied, plus the three formatters every\n * surface needs. Amounts are never converted — see {@link formatMoney}.\n */\nexport const useAssetMoney = (): {\n currency: string;\n symbol: string;\n /** Full amount; renders an em dash for null/undefined/non-finite. */\n format: (value: number | null | undefined) => string;\n /** Compact amount for axis ticks and dense KPIs, e.g. `₹8.5L`. */\n compact: ValueFormatter;\n} => {\n const { currency } = useAssetHandler();\n const resolved = currency || DEFAULT_CURRENCY;\n return useMemo(\n () => ({\n currency: resolved,\n symbol: currencySymbol(resolved),\n format: (value: number | null | undefined) => formatMoney(value, resolved),\n compact: formatCurrencyCompact(resolved),\n }),\n [resolved]\n );\n};\n\n/** Set of category ids the consumer asked to hide (empty by default). */\nexport const useHiddenCategoryIds = (): Set<string> => {\n const { hiddenCategoryIds } = useAssetHandler();\n return useMemo(() => new Set(hiddenCategoryIds ?? []), [hiddenCategoryIds]);\n};\n\nexport const useAssetCategoryPresentation = (): {\n labels?: Record<string, string>;\n options?: AssetHandlerRootProps['categoryOptions'];\n} => {\n const { categoryLabels, categoryOptions } = useAssetHandler();\n return { labels: categoryLabels, options: categoryOptions };\n};\n\nexport const AssetHandlerProvider: FC<PropsWithChildren<AssetHandlerRootProps>> = ({\n children,\n ...props\n}) => {\n const apolloClient = useMemo(\n () =>\n new ApolloClient({\n link: new HttpLink({\n uri: props.apiGatewayUrl\n ? `${props.apiGatewayUrl}/workspaces/graphql`\n : '/workspaces/graphql',\n headers: props.authToken\n ? {\n Authorization: `Bearer ${props.authToken}`,\n ...(props.workspaceToken\n ? { 'X-Workspace-Authorization': `Bearer ${props.workspaceToken}` }\n : {}),\n }\n : undefined,\n }),\n cache: new InMemoryCache(),\n }),\n [props.apiGatewayUrl, props.authToken, props.workspaceToken]\n );\n\n const isIntegrated = !!props.basePath;\n const content = (\n <AssetHandlerContext.Provider value={props}>\n <AssetHandlerBootstrapHydrator />\n {children}\n </AssetHandlerContext.Provider>\n );\n\n return isIntegrated ? (\n content\n ) : (\n <ApolloProvider client={apolloClient}>\n <MemoryRouter>{content}</MemoryRouter>\n </ApolloProvider>\n );\n};\n"],"mappings":";;;;;;;;;;AAeA,IAAM,IAAsB,EAA+C,KAAK,EAE1E,IAA+B,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAiB;GAGhD,KAAsE,EACjF,aACA,GAAG,QACC;CACJ,IAAM,IAAe,QAEjB,IAAI,EAAa;EACf,MAAM,IAAI,EAAS;GACjB,KAAK,EAAM,gBACP,GAAG,EAAM,cAAc,uBACvB;GACJ,SAAS,EAAM,YACX;IACE,eAAe,UAAU,EAAM;IAC/B,GAAI,EAAM,iBACN,EAAE,6BAA6B,UAAU,EAAM,kBAAkB,GACjE,EAAE;IACP,GACD,KAAA;GACL,CAAC;EACF,OAAO,IAAI,GAAe;EAC3B,CAAC,EACJ;EAAC,EAAM;EAAe,EAAM;EAAW,EAAM;EAAe,CAC7D,EAEK,IAAe,CAAC,CAAC,EAAM,UACvB,IACJ,kBAAC,EAAoB,UAArB;EAA8B,OAAO;YAArC,CACE,kBAAC,GAAD,EAAiC,CAAA,EAChC,EAC4B;;AAGjC,QAAO,IACL,IAEA,kBAAC,GAAD;EAAgB,QAAQ;YACtB,kBAAC,GAAD,EAAA,UAAe,GAAuB,CAAA;EACvB,CAAA"}
|
|
1
|
+
{"version":3,"file":"AssetHandlerProvider.js","names":[],"sources":["../../../src/assethandler/providers/AssetHandlerProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useEffect } from 'react';\nimport { MemoryRouter } from 'react-router';\nimport { ApolloClient, HttpLink, InMemoryCache, gql } from '@apollo/client';\nimport { ApolloProvider, useApolloClient, useQuery } from '@apollo/client/react';\nimport type { AssetHandlerRootProps } from '../types';\nimport type { AssetHandlerBootstrapPayload } from '../store/assethandlerStore';\nimport { useAssetHandlerStore } from '../store/assethandlerStore';\nimport { DEFAULT_CURRENCY, currencySymbol, formatMoney } from '../utils/money';\nimport type { ValueFormatter } from '../components/charts/chartTheme';\nimport { formatCurrencyCompact } from '../components/charts/chartTheme';\nexport { formatAssetCategory } from '../utils/categoryPresentation';\n\ntype AssetHandlerContextValue = AssetHandlerRootProps;\n\nconst AssetHandlerContext = createContext<AssetHandlerContextValue | null>(null);\n\n/**\n * The module's data is fetched as several small queries rather than one query\n * with all thirteen root fields.\n *\n * BOFF-6381: `wspace-assethandler-svc` sets `enableRlsGucTagging: true`, so\n * be-sdk routes every Prisma call through `runOperationWithRlsGuc`, which wraps\n * it in its own interactive transaction and pins a pooled connection for the\n * duration. GraphQL resolves root fields in parallel, so the old single query\n * asked for thirteen simultaneously-pinned transactions from a service that\n * measured a hard ceiling of about three. It failed 100% of the time in\n * production — `data: null`, so `hydrateFromBootstrap` never ran and every\n * AssetHandler page rendered empty, including the machinery register.\n *\n * Measured against prod (success rate by concurrent operations):\n * 1 -> 100% 2 -> 100% 3 -> 100% 4 -> 90% 6 -> 57% 8 -> 45%\n * A sibling service without the extension was 100% at all of those, so the\n * ceiling is this service's, not the database's.\n *\n * The batches below are therefore sized to stay at or under that ceiling, and\n * the hydrator awaits them one at a time — issuing them in parallel would\n * recreate exactly the concurrency the split exists to avoid.\n * `dashboardOverview` is alone because it internally fans out to four parallel\n * counts in `AssetHandlerService.getDashboardOverview`.\n *\n * The first batch keeps the name `AssetHandlerBootstrap` so the ~36 existing\n * `refetchQueries: ['AssetHandlerBootstrap']` call sites keep working. When it\n * refetches, its new `data` identity re-runs the sequential loop, so those\n * sites still refresh the whole module, as before.\n */\n\nconst Q_ASSETS = gql`\n query AssetHandlerBootstrap {\n assets {\n id\n assetNumber\n name\n description\n category\n status\n condition\n serialNumber\n locationName\n assignedTo\n tags\n createdAt\n updatedAt\n purchaseValue\n purchaseDate\n usefulLifeMonths\n salvageValue\n depreciationMethod\n meterUnit\n department\n warrantyExpiry\n supplier\n disposalDate\n disposalMethod\n disposalNotes\n currentValue\n accumulatedDepreciation\n # totalCostOfOwnership is deliberately NOT selected here. Unlike\n # currentValue and accumulatedDepreciation, which are computed in-process\n # from fields already on the row, Asset.totalCostOfOwnership calls\n # AssetHandlerService.computeAssetTco, which issues TWO aggregate queries\n # per asset (maintenanceRecord + workOrder) under Promise.all. Selecting\n # it turns this one-root query into 1 + 2N database operations — 21 for\n # ten assets — against a service that caps out around three (BOFF-6395),\n # so it errored the batch and left the whole module empty again even\n # after the bootstrap was split. It scales with the number of assets, so\n # it can never be made to fit here.\n #\n # The only consumer that read it from the store is\n # PortfolioPortfolioOverviewPage, which now fetches it itself.\n }\n }\n`;\n\nconst Q_OVERVIEW = gql`\n query AssetHandlerBootstrapOverview {\n dashboardOverview {\n totalAssets\n openIncidents\n openWorkOrders\n totalTransactions\n }\n }\n`;\n\nconst Q_OPS = gql`\n query AssetHandlerBootstrapOps {\n incidents {\n id\n title\n description\n category\n priority\n status\n assignedTo\n reportedBy\n reportedAt\n resolvedAt\n resolution\n slaBreached\n }\n workOrders {\n id\n title\n description\n type\n status\n priority\n assetId\n assignedTo\n createdAt\n updatedAt\n completedAt\n }\n }\n`;\n\nconst Q_MAINTENANCE = gql`\n query AssetHandlerBootstrapMaintenance {\n maintenanceRecords {\n id\n assetId\n title\n description\n type\n status\n priority\n scheduledAt\n completedAt\n estimatedCost\n actualCost\n checklist\n createdAt\n updatedAt\n }\n transactions {\n id\n type\n status\n amount\n currency\n category\n description\n vendor\n department\n occurredAt\n }\n }\n`;\n\nconst Q_ITIL = gql`\n query AssetHandlerBootstrapItil {\n changeRequests {\n id\n title\n description\n type\n status\n risk\n requestedBy\n assignedTo\n affectedAssets\n scheduledStart\n scheduledEnd\n approvals\n createdAt\n updatedAt\n }\n problems {\n id\n title\n description\n status\n priority\n category\n assignedTo\n relatedIncidents\n rootCause\n workaround\n resolution\n createdAt\n updatedAt\n }\n }\n`;\n\nconst Q_FINANCE = gql`\n query AssetHandlerBootstrapFinance {\n budgets {\n id\n name\n category\n allocated\n spent\n remaining\n period\n department\n status\n }\n invoices {\n id\n number\n vendor\n amount\n currency\n issueDate\n dueDate\n status\n items\n relatedPO\n paidAt\n }\n }\n`;\n\nconst Q_SECURITY = gql`\n query AssetHandlerBootstrapSecurity {\n securityEvents: getVaultSecurityEvents {\n items {\n id\n eventType\n severity\n title: message\n description\n source: resourceType\n userId\n ipAddress\n occurredAt: timestamp\n resolved: reviewed\n }\n }\n complianceFrameworks: securityComplianceFrameworks(filter: { sourceProduct: \"assethandler\" }) {\n items {\n id\n name\n version\n status\n score\n totalControls\n passedControls\n failedControls\n lastAssessment\n nextAssessment\n lastAssessedAt\n }\n }\n securityPolicies: securityGovernancePolicies(filter: { sourceProduct: \"assethandler\" }) {\n items {\n id\n name\n description\n category\n status\n version\n effectiveDate\n reviewDate\n owner\n applicableTo\n }\n }\n }\n`;\n\nfunction AssetHandlerBootstrapHydrator() {\n const hydrateFromBootstrap = useAssetHandlerStore((s) => s.hydrateFromBootstrap);\n const setBootstrapRefetch = useAssetHandlerStore((s) => s.setBootstrapRefetch);\n\n const client = useApolloClient();\n\n // Batch 1 stays a `useQuery` named `AssetHandlerBootstrap` so Apollo keeps it\n // as an active, named, cached query — that is what makes the existing\n // `refetchQueries: ['AssetHandlerBootstrap']` call sites work.\n const assets = useQuery<AssetHandlerBootstrapPayload>(Q_ASSETS, {\n fetchPolicy: 'cache-and-network',\n errorPolicy: 'all',\n });\n\n useEffect(() => {\n if (assets.data) hydrateFromBootstrap(assets.data);\n }, [assets.data, hydrateFromBootstrap]);\n\n // The remaining batches run strictly one after another, awaited in a loop\n // rather than as parallel hooks — running them concurrently would recreate\n // exactly the load the split exists to avoid. Hydration is additive, so a\n // batch that fails leaves its slice at the previous value instead of\n // blanking the whole module the way the single combined query did.\n useEffect(() => {\n if (!assets.data) return;\n let cancelled = false;\n void (async () => {\n for (const query of [Q_OVERVIEW, Q_OPS, Q_MAINTENANCE, Q_ITIL, Q_FINANCE, Q_SECURITY]) {\n if (cancelled) return;\n try {\n const result = await client.query<AssetHandlerBootstrapPayload>({\n query,\n fetchPolicy: 'network-only',\n errorPolicy: 'all',\n });\n if (!cancelled && result.data) hydrateFromBootstrap(result.data);\n } catch {\n // One failed section must not stop the others, and must not clear\n // what is already on screen.\n }\n }\n })();\n return () => {\n cancelled = true;\n };\n }, [assets.data, client, hydrateFromBootstrap]);\n\n // Refetching batch 1 is enough to refresh the module: a new `assets.data`\n // identity re-runs the sequential loop above, so the existing\n // `refetchQueries: ['AssetHandlerBootstrap']` sites still refresh everything.\n const refetchAssets = assets.refetch;\n useEffect(() => {\n setBootstrapRefetch(() => {\n void refetchAssets();\n });\n return () => setBootstrapRefetch(null);\n }, [refetchAssets, setBootstrapRefetch]);\n\n return null;\n}\n\nexport const useAssetHandler = () => {\n const context = useContext(AssetHandlerContext);\n if (!context) throw new Error('useAssetHandler must be used within AssetHandlerProvider');\n return context;\n};\n\nexport const DEFAULT_TERMINOLOGY = { asset: 'Asset', assets: 'Assets' } as const;\n\n/**\n * Resolved singular/plural noun for the module, applying consumer overrides on\n * top of the module defaults (\"Asset\"/\"Assets\").\n */\nexport const useAssetTerminology = (): { asset: string; assets: string } => {\n const { terminology } = useAssetHandler();\n return {\n asset: terminology?.asset || DEFAULT_TERMINOLOGY.asset,\n assets: terminology?.assets || DEFAULT_TERMINOLOGY.assets,\n };\n};\n\n/**\n * Resolved money presentation for the module: the consumer's `currency` prop\n * with the module default (\"USD\") applied, plus the three formatters every\n * surface needs. Amounts are never converted — see {@link formatMoney}.\n */\nexport const useAssetMoney = (): {\n currency: string;\n symbol: string;\n /** Full amount; renders an em dash for null/undefined/non-finite. */\n format: (value: number | null | undefined) => string;\n /** Compact amount for axis ticks and dense KPIs, e.g. `₹8.5L`. */\n compact: ValueFormatter;\n} => {\n const { currency } = useAssetHandler();\n const resolved = currency || DEFAULT_CURRENCY;\n return useMemo(\n () => ({\n currency: resolved,\n symbol: currencySymbol(resolved),\n format: (value: number | null | undefined) => formatMoney(value, resolved),\n compact: formatCurrencyCompact(resolved),\n }),\n [resolved]\n );\n};\n\n/** Set of category ids the consumer asked to hide (empty by default). */\nexport const useHiddenCategoryIds = (): Set<string> => {\n const { hiddenCategoryIds } = useAssetHandler();\n return useMemo(() => new Set(hiddenCategoryIds ?? []), [hiddenCategoryIds]);\n};\n\nexport const useAssetCategoryPresentation = (): {\n labels?: Record<string, string>;\n options?: AssetHandlerRootProps['categoryOptions'];\n} => {\n const { categoryLabels, categoryOptions } = useAssetHandler();\n return { labels: categoryLabels, options: categoryOptions };\n};\n\nexport const AssetHandlerProvider: FC<PropsWithChildren<AssetHandlerRootProps>> = ({\n children,\n ...props\n}) => {\n const apolloClient = useMemo(\n () =>\n new ApolloClient({\n link: new HttpLink({\n uri: props.apiGatewayUrl\n ? `${props.apiGatewayUrl}/workspaces/graphql`\n : '/workspaces/graphql',\n headers: props.authToken\n ? {\n Authorization: `Bearer ${props.authToken}`,\n ...(props.workspaceToken\n ? { 'X-Workspace-Authorization': `Bearer ${props.workspaceToken}` }\n : {}),\n }\n : undefined,\n }),\n cache: new InMemoryCache(),\n }),\n [props.apiGatewayUrl, props.authToken, props.workspaceToken]\n );\n\n const isIntegrated = !!props.basePath;\n const content = (\n <AssetHandlerContext.Provider value={props}>\n <AssetHandlerBootstrapHydrator />\n {children}\n </AssetHandlerContext.Provider>\n );\n\n return isIntegrated ? (\n content\n ) : (\n <ApolloProvider client={apolloClient}>\n <MemoryRouter>{content}</MemoryRouter>\n </ApolloProvider>\n );\n};\n"],"mappings":";;;;;;;;;;AAeA,IAAM,IAAsB,EAA+C,KAAK,EAgC1E,IAAW,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+Cd,IAAa,CAAG;;;;;;;;;GAWhB,IAAQ,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCX,IAAgB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCnB,IAAS,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCZ,IAAY,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6Bf,IAAa,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDtB,SAAS,IAAgC;CACvC,IAAM,IAAuB,GAAsB,MAAM,EAAE,qBAAqB,EAC1E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C;CACrD,IAAM,EAAE,yBAAsB,GAAiB;AAC/C,QAAO,QAAc,IAAI,IAAI,KAAqB,EAAE,CAAC,EAAE,CAAC,EAAkB,CAAC;GAGhE,UAGR;CACH,IAAM,EAAE,mBAAgB,uBAAoB,GAAiB;AAC7D,QAAO;EAAE,QAAQ;EAAgB,SAAS;EAAiB;GAGhD,KAAsE,EACjF,aACA,GAAG,QACC;CACJ,IAAM,IAAe,QAEjB,IAAI,EAAa;EACf,MAAM,IAAI,EAAS;GACjB,KAAK,EAAM,gBACP,GAAG,EAAM,cAAc,uBACvB;GACJ,SAAS,EAAM,YACX;IACE,eAAe,UAAU,EAAM;IAC/B,GAAI,EAAM,iBACN,EAAE,6BAA6B,UAAU,EAAM,kBAAkB,GACjE,EAAE;IACP,GACD,KAAA;GACL,CAAC;EACF,OAAO,IAAI,GAAe;EAC3B,CAAC,EACJ;EAAC,EAAM;EAAe,EAAM;EAAW,EAAM;EAAe,CAC7D,EAEK,IAAe,CAAC,CAAC,EAAM,UACvB,IACJ,kBAAC,EAAoB,UAArB;EAA8B,OAAO;YAArC,CACE,kBAAC,GAAD,EAAiC,CAAA,EAChC,EAC4B;;AAGjC,QAAO,IACL,IAEA,kBAAC,GAAD;EAAgB,QAAQ;YACtB,kBAAC,GAAD,EAAA,UAAe,GAAuB,CAAA;EACvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assethandlerStore.d.ts","sourceRoot":"","sources":["../../../src/assethandler/store/assethandlerStore.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AACzF,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAChF,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG,kBAAkB,GAAG,MAAM,CAAC;AAE/E,MAAM,WAAW,KAAK;IAC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AO,EAAE,CAAC;IACpB,YAAY,EAAE,kBAAkB,EAAE,CAAC;IACnC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IACxC,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;IAC5C,gBAAgB,EAAE,cAAc,EAAE,CAAC;IACnC,UAAU,EAAE,SAAS,EAAE,CAAC;IAExB,oBAAoB,EAAE,CAAC,OAAO,EAAE,4BAA4B,KAAK,IAAI,CAAC;IAEtE;;;;;OAKG;IACH,gBAAgB,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IACtC,mBAAmB,EAAE,CAAC,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5D,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,eAAO,MAAM,oBAAoB,gFA4Q9B,CAAC"}
|
|
@@ -194,27 +194,27 @@ var t = e((e, t) => ({
|
|
|
194
194
|
reviewDate: e.reviewDate,
|
|
195
195
|
owner: e.owner,
|
|
196
196
|
applicableTo: e.applicableTo
|
|
197
|
-
}))
|
|
197
|
+
})), p = t.dashboardOverview ? {
|
|
198
|
+
totalAssets: t.dashboardOverview.totalAssets ?? e.length,
|
|
199
|
+
openIncidents: t.dashboardOverview.openIncidents ?? 0,
|
|
200
|
+
openWorkOrders: t.dashboardOverview.openWorkOrders ?? 0,
|
|
201
|
+
totalTransactions: t.dashboardOverview.totalTransactions ?? 0
|
|
202
|
+
} : null;
|
|
198
203
|
return {
|
|
199
204
|
hydrated: !0,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
} :
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
budgets: c,
|
|
214
|
-
invoices: l,
|
|
215
|
-
securityEvents: u,
|
|
216
|
-
complianceFrameworks: d,
|
|
217
|
-
securityPolicies: f
|
|
205
|
+
...t.dashboardOverview === void 0 ? {} : { overview: p },
|
|
206
|
+
...t.assets === void 0 ? {} : { assets: e },
|
|
207
|
+
...t.incidents === void 0 ? {} : { incidents: n },
|
|
208
|
+
...t.changeRequests === void 0 ? {} : { changeRequests: o },
|
|
209
|
+
...t.problems === void 0 ? {} : { problems: s },
|
|
210
|
+
...t.workOrders === void 0 ? {} : { workOrders: r },
|
|
211
|
+
...t.maintenanceRecords === void 0 ? {} : { maintenanceRecords: i },
|
|
212
|
+
...t.transactions === void 0 ? {} : { transactions: a },
|
|
213
|
+
...t.budgets === void 0 ? {} : { budgets: c },
|
|
214
|
+
...t.invoices === void 0 ? {} : { invoices: l },
|
|
215
|
+
...t.securityEvents === void 0 ? {} : { securityEvents: u },
|
|
216
|
+
...t.complianceFrameworks === void 0 ? {} : { complianceFrameworks: d },
|
|
217
|
+
...t.securityPolicies === void 0 ? {} : { securityPolicies: f }
|
|
218
218
|
};
|
|
219
219
|
})
|
|
220
220
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assethandlerStore.js","names":[],"sources":["../../../src/assethandler/store/assethandlerStore.ts"],"sourcesContent":["import { create } from 'zustand';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// View-model types — aligned 1:1 with wspace-assethandler-svc GraphQL schema.\n// Backend enum values (UPPER_CASE) are lowercased once during hydration so the\n// UI can render them directly. No field in this store is invented client-side;\n// everything is hydrated from the bootstrap query in AssetHandlerProvider.\n// ─────────────────────────────────────────────────────────────────────────────\n\n// ─── Asset Types ──────────────────────────────────────────────────\nexport type AssetStatus = 'active' | 'inactive' | 'maintenance' | 'retired' | 'disposed';\nexport type AssetCondition = 'excellent' | 'good' | 'fair' | 'poor' | 'damaged';\nexport type DepreciationMethod = 'straight_line' | 'reducing_balance' | 'none';\n\nexport interface Asset {\n id: string;\n name: string;\n description: string;\n category: string;\n status: AssetStatus;\n condition: AssetCondition;\n serialNumber: string;\n assetTag: string;\n location: string;\n assignedTo: string;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // ─── Financial / depreciation (backend-computed where noted) ───\n purchaseValue?: number;\n purchaseDate?: string;\n usefulLifeMonths?: number;\n salvageValue?: number;\n depreciationMethod?: DepreciationMethod;\n /** What this asset's usage meter counts — HOURS | KM | MILES | CYCLES | UNITS. */\n meterUnit?: string | null;\n department?: string;\n warrantyExpiry?: string;\n supplier?: string;\n disposalDate?: string;\n disposalMethod?: string;\n disposalNotes?: string;\n /** Computed book value (floored at salvage); undefined if no purchaseValue. */\n currentValue?: number;\n /** Computed accumulated depreciation. */\n accumulatedDepreciation?: number;\n /** Computed = purchaseValue + maintenance actualCost + work-order cost. */\n totalCostOfOwnership?: number;\n}\n\n// ─── ITIL Types ───────────────────────────────────────────────────\nexport type IncidentPriority = 'critical' | 'high' | 'medium' | 'low';\nexport type IncidentStatus = 'open' | 'in_progress' | 'resolved' | 'closed';\nexport type ChangeStatus =\n | 'draft'\n | 'submitted'\n | 'approved'\n | 'in_progress'\n | 'completed'\n | 'rejected';\nexport type ChangeRisk = 'low' | 'medium' | 'high' | 'critical';\nexport type ProblemStatus = 'open' | 'investigating' | 'known_error' | 'resolved' | 'closed';\n\nexport interface Incident {\n id: string;\n title: string;\n description: string;\n category: string;\n priority: IncidentPriority;\n status: IncidentStatus;\n assignedTo: string;\n reportedBy: string;\n createdAt: string;\n resolvedAt?: string;\n resolution?: string;\n slaBreached: boolean;\n}\n\nexport interface ChangeRequest {\n id: string;\n title: string;\n description: string;\n type: string;\n status: ChangeStatus;\n risk: ChangeRisk;\n requestedBy: string;\n assignedTo: string;\n affectedAssets: string[];\n scheduledStart: string;\n scheduledEnd: string;\n createdAt: string;\n approvals: { name: string; status: string; date: string }[];\n}\n\nexport interface Problem {\n id: string;\n title: string;\n description: string;\n status: ProblemStatus;\n priority: IncidentPriority;\n category: string;\n assignedTo: string;\n relatedIncidents: string[];\n rootCause?: string;\n workaround?: string;\n resolution?: string;\n createdAt: string;\n updatedAt: string;\n}\n\n// ─── Finance Types ────────────────────────────────────────────────\nexport type TransactionType = 'purchase' | 'lease' | 'disposal' | 'transfer' | 'maintenance';\nexport type TransactionStatus = 'pending' | 'approved' | 'completed' | 'rejected';\n\nexport interface FinanceTransaction {\n id: string;\n type: TransactionType;\n amount: number;\n currency: string;\n description: string;\n category: string;\n date: string;\n status: TransactionStatus;\n vendor?: string;\n department: string;\n}\n\nexport interface Budget {\n id: string;\n name: string;\n category: string;\n allocated: number;\n spent: number;\n remaining: number;\n period: string;\n department: string;\n status: 'on_track' | 'over_budget' | 'under_budget';\n}\n\nexport interface Invoice {\n id: string;\n number: string;\n vendor: string;\n amount: number;\n currency: string;\n issueDate: string;\n dueDate: string;\n status: 'draft' | 'sent' | 'paid' | 'overdue' | 'cancelled';\n items: { description: string; qty: number; unitPrice: number; total: number }[];\n relatedPO?: string;\n paidAt?: string;\n}\n\n// ─── Maintenance Types ────────────────────────────────────────────\nexport type MaintenancePriority = 'critical' | 'high' | 'medium' | 'low';\n\nexport interface MaintenanceRecord {\n id: string;\n assetId: string;\n type: string;\n priority: MaintenancePriority;\n status: string;\n title: string;\n description: string;\n scheduledDate?: string;\n completedDate?: string;\n estimatedCost?: number;\n actualCost?: number;\n checklist: { task: string; completed: boolean }[];\n}\n\n// ─── Security Types ───────────────────────────────────────────────\nexport interface SecurityEvent {\n id: string;\n type: string;\n severity: 'critical' | 'high' | 'medium' | 'low' | 'info';\n title: string;\n description: string;\n source: string;\n userId?: string;\n ipAddress?: string;\n timestamp: string;\n resolved: boolean;\n}\n\nexport interface ComplianceFramework {\n id: string;\n name: string;\n version: string;\n status: 'compliant' | 'non_compliant' | 'partial' | 'under_review';\n score: number;\n totalControls: number;\n passedControls: number;\n failedControls: number;\n lastAssessment: string;\n nextAssessment: string;\n lastAssessedAt?: string;\n}\n\nexport interface SecurityPolicy {\n id: string;\n name: string;\n description: string;\n category: string;\n status: 'active' | 'draft' | 'deprecated' | 'under_review';\n version: string;\n effectiveDate: string;\n reviewDate: string;\n owner: string;\n applicableTo: string[];\n}\n\n// ─── Operations Types ─────────────────────────────────────────────\nexport interface WorkOrder {\n id: string;\n title: string;\n description: string;\n priority: 'critical' | 'high' | 'medium' | 'low';\n status: 'draft' | 'scheduled' | 'approved' | 'in_progress' | 'completed' | 'cancelled';\n assignedTo: string;\n assetId: string;\n type: string;\n createdAt: string;\n completedAt?: string;\n}\n\n// ─── Dashboard Types ──────────────────────────────────────────────\nexport interface DashboardOverview {\n totalAssets: number;\n openIncidents: number;\n openWorkOrders: number;\n totalTransactions: number;\n}\n\n// ─── Bootstrap payload (raw backend shapes) ───────────────────────\nexport interface AssetHandlerBootstrapPayload {\n dashboardOverview?: {\n totalAssets?: number;\n openIncidents?: number;\n openWorkOrders?: number;\n totalTransactions?: number;\n } | null;\n assets?: Array<{\n id: string;\n assetNumber: string;\n name: string;\n description?: string | null;\n category: string;\n status: string;\n condition: string;\n serialNumber?: string | null;\n locationName?: string | null;\n assignedTo?: string | null;\n tags?: string[];\n createdAt?: string;\n updatedAt?: string;\n purchaseValue?: number | null;\n purchaseDate?: string | null;\n usefulLifeMonths?: number | null;\n salvageValue?: number | null;\n depreciationMethod?: string | null;\n meterUnit?: string | null;\n department?: string | null;\n warrantyExpiry?: string | null;\n supplier?: string | null;\n disposalDate?: string | null;\n disposalMethod?: string | null;\n disposalNotes?: string | null;\n currentValue?: number | null;\n accumulatedDepreciation?: number | null;\n totalCostOfOwnership?: number | null;\n }> | null;\n incidents?: Array<{\n id: string;\n title: string;\n description: string;\n category: string;\n priority: string;\n status: string;\n assignedTo?: string | null;\n reportedBy: string;\n reportedAt: string;\n resolvedAt?: string | null;\n resolution?: string | null;\n slaBreached: boolean;\n }> | null;\n workOrders?: Array<{\n id: string;\n title: string;\n description?: string | null;\n type: string;\n status: string;\n priority: string;\n assetId?: string | null;\n assignedTo?: string | null;\n createdAt: string;\n completedAt?: string | null;\n }> | null;\n maintenanceRecords?: Array<{\n id: string;\n assetId: string;\n title: string;\n description?: string | null;\n type: string;\n status: string;\n priority: string;\n scheduledAt?: string | null;\n completedAt?: string | null;\n estimatedCost?: number | null;\n actualCost?: number | null;\n checklist?: Array<Record<string, unknown>>;\n }> | null;\n transactions?: Array<{\n id: string;\n type: string;\n status: string;\n amount: number;\n currency: string;\n category: string;\n description: string;\n vendor?: string | null;\n department?: string | null;\n occurredAt: string;\n }> | null;\n changeRequests?: Array<{\n id: string;\n title: string;\n description: string;\n type: string;\n status: string;\n risk: string;\n requestedBy: string;\n assignedTo?: string | null;\n affectedAssets: string[];\n scheduledStart?: string | null;\n scheduledEnd?: string | null;\n approvals?: Array<{ name?: string; status?: string; date?: string }>;\n createdAt: string;\n }> | null;\n problems?: Array<{\n id: string;\n title: string;\n description: string;\n status: string;\n priority: string;\n category: string;\n assignedTo?: string | null;\n relatedIncidents: string[];\n rootCause?: string | null;\n workaround?: string | null;\n resolution?: string | null;\n createdAt: string;\n updatedAt: string;\n }> | null;\n budgets?: Array<{\n id: string;\n name: string;\n category: string;\n allocated: number;\n spent: number;\n remaining: number;\n period: string;\n department: string;\n status: string;\n }> | null;\n invoices?: Array<{\n id: string;\n number: string;\n vendor: string;\n amount: number;\n currency: string;\n issueDate: string;\n dueDate: string;\n status: string;\n items?: Array<{ description?: string; qty?: number; unitPrice?: number; total?: number }>;\n relatedPO?: string | null;\n paidAt?: string | null;\n }> | null;\n securityEvents?: {\n items: Array<{\n id: string;\n eventType: string;\n severity: string;\n title: string;\n description?: string | null;\n source?: string | null;\n userId?: string | null;\n ipAddress?: string | null;\n occurredAt: string;\n resolved: boolean;\n }>;\n } | null;\n complianceFrameworks?: {\n items: Array<{\n id: string;\n name: string;\n version: string;\n status: string;\n score: number;\n totalControls: number;\n passedControls: number;\n failedControls: number;\n lastAssessment: string;\n nextAssessment: string;\n lastAssessedAt?: string | null;\n }>;\n } | null;\n securityPolicies?: {\n items: Array<{\n id: string;\n name: string;\n description?: string | null;\n category: string;\n status: string;\n version: string;\n effectiveDate: string;\n reviewDate: string;\n owner: string;\n applicableTo: string[];\n }>;\n } | null;\n}\n\ninterface AssetHandlerState {\n /** True once the bootstrap query has hydrated the store at least once. */\n hydrated: boolean;\n\n // Domain data — always sourced from the backend, never seeded locally.\n overview: DashboardOverview | null;\n assets: Asset[];\n incidents: Incident[];\n changeRequests: ChangeRequest[];\n problems: Problem[];\n transactions: FinanceTransaction[];\n budgets: Budget[];\n invoices: Invoice[];\n maintenanceRecords: MaintenanceRecord[];\n securityEvents: SecurityEvent[];\n complianceFrameworks: ComplianceFramework[];\n securityPolicies: SecurityPolicy[];\n workOrders: WorkOrder[];\n\n hydrateFromBootstrap: (payload: AssetHandlerBootstrapPayload) => void;\n\n /**\n * Imperative refetch of the bootstrap query, registered by the provider's\n * hydrator. Pages that mutate domain data can call `refetchBootstrap()` to\n * pull fresh store data. Prefer Apollo `refetchQueries: ['AssetHandlerBootstrap']`\n * on the mutation itself; use this for cross-component imperative refresh.\n */\n bootstrapRefetch: (() => void) | null;\n setBootstrapRefetch: (refetch: (() => void) | null) => void;\n refetchBootstrap: () => void;\n}\n\nexport const useAssetHandlerStore = create<AssetHandlerState>((set, get) => ({\n hydrated: false,\n\n bootstrapRefetch: null,\n setBootstrapRefetch: (refetch) => set({ bootstrapRefetch: refetch }),\n refetchBootstrap: () => {\n get().bootstrapRefetch?.();\n },\n\n overview: null,\n assets: [],\n incidents: [],\n changeRequests: [],\n problems: [],\n transactions: [],\n budgets: [],\n invoices: [],\n maintenanceRecords: [],\n securityEvents: [],\n complianceFrameworks: [],\n securityPolicies: [],\n workOrders: [],\n\n hydrateFromBootstrap: (payload) =>\n set(() => {\n const assets: Asset[] = (payload.assets ?? []).map((asset) => ({\n id: asset.id,\n name: asset.name,\n description: asset.description ?? '',\n category: asset.category.toLowerCase(),\n status: asset.status.toLowerCase() as AssetStatus,\n condition: asset.condition.toLowerCase() as AssetCondition,\n serialNumber: asset.serialNumber ?? '',\n assetTag: asset.assetNumber,\n location: asset.locationName ?? '',\n assignedTo: asset.assignedTo ?? '',\n tags: asset.tags ?? [],\n createdAt: asset.createdAt ?? '',\n updatedAt: asset.updatedAt ?? '',\n purchaseValue: asset.purchaseValue ?? undefined,\n purchaseDate: asset.purchaseDate ?? undefined,\n usefulLifeMonths: asset.usefulLifeMonths ?? undefined,\n salvageValue: asset.salvageValue ?? undefined,\n depreciationMethod: asset.depreciationMethod\n ? (asset.depreciationMethod.toLowerCase() as DepreciationMethod)\n : undefined,\n // Kept UPPER-CASE, unlike depreciationMethod above: it is compared against the\n // GraphQL enum values, not against a lower-cased UI string.\n meterUnit: asset.meterUnit ?? null,\n department: asset.department ?? undefined,\n warrantyExpiry: asset.warrantyExpiry ?? undefined,\n supplier: asset.supplier ?? undefined,\n disposalDate: asset.disposalDate ?? undefined,\n disposalMethod: asset.disposalMethod ?? undefined,\n disposalNotes: asset.disposalNotes ?? undefined,\n currentValue: asset.currentValue ?? undefined,\n accumulatedDepreciation: asset.accumulatedDepreciation ?? undefined,\n totalCostOfOwnership: asset.totalCostOfOwnership ?? undefined,\n }));\n\n const incidents: Incident[] = (payload.incidents ?? []).map((incident) => ({\n id: incident.id,\n title: incident.title,\n description: incident.description,\n category: incident.category,\n priority: incident.priority.toLowerCase() as IncidentPriority,\n status: incident.status.toLowerCase() as IncidentStatus,\n assignedTo: incident.assignedTo ?? '',\n reportedBy: incident.reportedBy,\n createdAt: incident.reportedAt,\n resolvedAt: incident.resolvedAt ?? undefined,\n resolution: incident.resolution ?? undefined,\n slaBreached: incident.slaBreached,\n }));\n\n const workOrders: WorkOrder[] = (payload.workOrders ?? []).map((workOrder) => ({\n id: workOrder.id,\n title: workOrder.title,\n description: workOrder.description ?? '',\n assetId: workOrder.assetId ?? '',\n priority: workOrder.priority.toLowerCase() as WorkOrder['priority'],\n status: workOrder.status.toLowerCase() as WorkOrder['status'],\n assignedTo: workOrder.assignedTo ?? '',\n createdAt: workOrder.createdAt,\n completedAt: workOrder.completedAt ?? undefined,\n type: workOrder.type.toLowerCase(),\n }));\n\n const maintenanceRecords: MaintenanceRecord[] = (payload.maintenanceRecords ?? []).map(\n (record) => ({\n id: record.id,\n assetId: record.assetId,\n type: record.type.toLowerCase(),\n priority: record.priority.toLowerCase() as MaintenancePriority,\n status: record.status.toLowerCase(),\n title: record.title,\n description: record.description ?? '',\n scheduledDate: record.scheduledAt ?? undefined,\n completedDate: record.completedAt ?? undefined,\n estimatedCost: record.estimatedCost ?? undefined,\n actualCost: record.actualCost ?? undefined,\n checklist: (record.checklist ?? []).map((item) => ({\n task: String(item.task ?? 'Task'),\n completed: Boolean(item.completed ?? false),\n })),\n })\n );\n\n const transactions: FinanceTransaction[] = (payload.transactions ?? []).map((tx) => ({\n id: tx.id,\n type: tx.type.toLowerCase() as TransactionType,\n amount: tx.amount,\n currency: tx.currency,\n description: tx.description,\n category: tx.category,\n date: tx.occurredAt,\n status: tx.status.toLowerCase() as TransactionStatus,\n vendor: tx.vendor ?? undefined,\n department: tx.department ?? '',\n }));\n\n const changeRequests: ChangeRequest[] = (payload.changeRequests ?? []).map((change) => ({\n id: change.id,\n title: change.title,\n description: change.description,\n type: change.type.toLowerCase(),\n status: change.status.toLowerCase() as ChangeStatus,\n risk: change.risk.toLowerCase() as ChangeRisk,\n requestedBy: change.requestedBy,\n assignedTo: change.assignedTo ?? '',\n affectedAssets: change.affectedAssets,\n scheduledStart: change.scheduledStart ?? '',\n scheduledEnd: change.scheduledEnd ?? '',\n createdAt: change.createdAt,\n approvals: (change.approvals ?? []).map((approval) => ({\n name: approval.name ?? 'Approver',\n status: approval.status ?? 'pending',\n date: approval.date ?? change.createdAt,\n })),\n }));\n\n const problems: Problem[] = (payload.problems ?? []).map((problem) => ({\n id: problem.id,\n title: problem.title,\n description: problem.description,\n status: problem.status.toLowerCase() as ProblemStatus,\n priority: problem.priority.toLowerCase() as IncidentPriority,\n category: problem.category,\n assignedTo: problem.assignedTo ?? '',\n relatedIncidents: problem.relatedIncidents,\n rootCause: problem.rootCause ?? undefined,\n workaround: problem.workaround ?? undefined,\n resolution: problem.resolution ?? undefined,\n createdAt: problem.createdAt,\n updatedAt: problem.updatedAt,\n }));\n\n const budgets: Budget[] = (payload.budgets ?? []).map((budget) => ({\n id: budget.id,\n name: budget.name,\n category: budget.category,\n allocated: budget.allocated,\n spent: budget.spent,\n remaining: budget.remaining,\n period: budget.period,\n department: budget.department,\n status: budget.status.toLowerCase() as Budget['status'],\n }));\n\n const invoices: Invoice[] = (payload.invoices ?? []).map((invoice) => ({\n id: invoice.id,\n number: invoice.number,\n vendor: invoice.vendor,\n amount: invoice.amount,\n currency: invoice.currency,\n issueDate: invoice.issueDate,\n dueDate: invoice.dueDate,\n status: invoice.status.toLowerCase() as Invoice['status'],\n items: (invoice.items ?? []).map((item) => ({\n description: item.description ?? 'Line item',\n qty: item.qty ?? 1,\n unitPrice: item.unitPrice ?? item.total ?? 0,\n total: item.total ?? item.unitPrice ?? 0,\n })),\n relatedPO: invoice.relatedPO ?? undefined,\n paidAt: invoice.paidAt ?? undefined,\n }));\n\n const securityEvents: SecurityEvent[] = (payload.securityEvents?.items ?? []).map(\n (event) => ({\n id: event.id,\n type: event.eventType,\n severity: event.severity.toLowerCase() as SecurityEvent['severity'],\n title: event.title,\n description: event.description ?? '',\n source: event.source ?? 'security',\n userId: event.userId ?? undefined,\n ipAddress: event.ipAddress ?? undefined,\n timestamp: event.occurredAt,\n resolved: event.resolved,\n })\n );\n\n const complianceFrameworks: ComplianceFramework[] = (\n payload.complianceFrameworks?.items ?? []\n ).map((framework) => ({\n id: framework.id,\n name: framework.name,\n version: framework.version,\n status: framework.status.toLowerCase() as ComplianceFramework['status'],\n score: framework.score,\n totalControls: framework.totalControls,\n passedControls: framework.passedControls,\n failedControls: framework.failedControls,\n lastAssessment: framework.lastAssessment,\n nextAssessment: framework.nextAssessment,\n lastAssessedAt: framework.lastAssessedAt ?? undefined,\n }));\n\n const securityPolicies: SecurityPolicy[] = (payload.securityPolicies?.items ?? []).map(\n (policy) => ({\n id: policy.id,\n name: policy.name,\n description: policy.description ?? '',\n category: policy.category,\n status: policy.status.toLowerCase() as SecurityPolicy['status'],\n version: policy.version,\n effectiveDate: policy.effectiveDate,\n reviewDate: policy.reviewDate,\n owner: policy.owner,\n applicableTo: policy.applicableTo,\n })\n );\n\n const overview: DashboardOverview | null = payload.dashboardOverview\n ? {\n totalAssets: payload.dashboardOverview.totalAssets ?? assets.length,\n openIncidents: payload.dashboardOverview.openIncidents ?? 0,\n openWorkOrders: payload.dashboardOverview.openWorkOrders ?? 0,\n totalTransactions: payload.dashboardOverview.totalTransactions ?? 0,\n }\n : null;\n\n return {\n hydrated: true,\n overview,\n assets,\n incidents,\n changeRequests,\n problems,\n workOrders,\n maintenanceRecords,\n transactions,\n budgets,\n invoices,\n securityEvents,\n complianceFrameworks,\n securityPolicies,\n };\n }),\n}));\n"],"mappings":";;AAucA,IAAa,IAAuB,GAA2B,GAAK,OAAS;CAC3E,UAAU;CAEV,kBAAkB;CAClB,sBAAsB,MAAY,EAAI,EAAE,kBAAkB,GAAS,CAAC;CACpE,wBAAwB;AACtB,KAAK,CAAC,oBAAoB;;CAG5B,UAAU;CACV,QAAQ,EAAE;CACV,WAAW,EAAE;CACb,gBAAgB,EAAE;CAClB,UAAU,EAAE;CACZ,cAAc,EAAE;CAChB,SAAS,EAAE;CACX,UAAU,EAAE;CACZ,oBAAoB,EAAE;CACtB,gBAAgB,EAAE;CAClB,sBAAsB,EAAE;CACxB,kBAAkB,EAAE;CACpB,YAAY,EAAE;CAEd,uBAAuB,MACrB,QAAU;EACR,IAAM,KAAmB,EAAQ,UAAU,EAAE,EAAE,KAAK,OAAW;GAC7D,IAAI,EAAM;GACV,MAAM,EAAM;GACZ,aAAa,EAAM,eAAe;GAClC,UAAU,EAAM,SAAS,aAAa;GACtC,QAAQ,EAAM,OAAO,aAAa;GAClC,WAAW,E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,"file":"assethandlerStore.js","names":[],"sources":["../../../src/assethandler/store/assethandlerStore.ts"],"sourcesContent":["import { create } from 'zustand';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// View-model types — aligned 1:1 with wspace-assethandler-svc GraphQL schema.\n// Backend enum values (UPPER_CASE) are lowercased once during hydration so the\n// UI can render them directly. No field in this store is invented client-side;\n// everything is hydrated from the bootstrap query in AssetHandlerProvider.\n// ─────────────────────────────────────────────────────────────────────────────\n\n// ─── Asset Types ──────────────────────────────────────────────────\nexport type AssetStatus = 'active' | 'inactive' | 'maintenance' | 'retired' | 'disposed';\nexport type AssetCondition = 'excellent' | 'good' | 'fair' | 'poor' | 'damaged';\nexport type DepreciationMethod = 'straight_line' | 'reducing_balance' | 'none';\n\nexport interface Asset {\n id: string;\n name: string;\n description: string;\n category: string;\n status: AssetStatus;\n condition: AssetCondition;\n serialNumber: string;\n assetTag: string;\n location: string;\n assignedTo: string;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // ─── Financial / depreciation (backend-computed where noted) ───\n purchaseValue?: number;\n purchaseDate?: string;\n usefulLifeMonths?: number;\n salvageValue?: number;\n depreciationMethod?: DepreciationMethod;\n /** What this asset's usage meter counts — HOURS | KM | MILES | CYCLES | UNITS. */\n meterUnit?: string | null;\n department?: string;\n warrantyExpiry?: string;\n supplier?: string;\n disposalDate?: string;\n disposalMethod?: string;\n disposalNotes?: string;\n /** Computed book value (floored at salvage); undefined if no purchaseValue. */\n currentValue?: number;\n /** Computed accumulated depreciation. */\n accumulatedDepreciation?: number;\n /** Computed = purchaseValue + maintenance actualCost + work-order cost. */\n totalCostOfOwnership?: number;\n}\n\n// ─── ITIL Types ───────────────────────────────────────────────────\nexport type IncidentPriority = 'critical' | 'high' | 'medium' | 'low';\nexport type IncidentStatus = 'open' | 'in_progress' | 'resolved' | 'closed';\nexport type ChangeStatus =\n | 'draft'\n | 'submitted'\n | 'approved'\n | 'in_progress'\n | 'completed'\n | 'rejected';\nexport type ChangeRisk = 'low' | 'medium' | 'high' | 'critical';\nexport type ProblemStatus = 'open' | 'investigating' | 'known_error' | 'resolved' | 'closed';\n\nexport interface Incident {\n id: string;\n title: string;\n description: string;\n category: string;\n priority: IncidentPriority;\n status: IncidentStatus;\n assignedTo: string;\n reportedBy: string;\n createdAt: string;\n resolvedAt?: string;\n resolution?: string;\n slaBreached: boolean;\n}\n\nexport interface ChangeRequest {\n id: string;\n title: string;\n description: string;\n type: string;\n status: ChangeStatus;\n risk: ChangeRisk;\n requestedBy: string;\n assignedTo: string;\n affectedAssets: string[];\n scheduledStart: string;\n scheduledEnd: string;\n createdAt: string;\n approvals: { name: string; status: string; date: string }[];\n}\n\nexport interface Problem {\n id: string;\n title: string;\n description: string;\n status: ProblemStatus;\n priority: IncidentPriority;\n category: string;\n assignedTo: string;\n relatedIncidents: string[];\n rootCause?: string;\n workaround?: string;\n resolution?: string;\n createdAt: string;\n updatedAt: string;\n}\n\n// ─── Finance Types ────────────────────────────────────────────────\nexport type TransactionType = 'purchase' | 'lease' | 'disposal' | 'transfer' | 'maintenance';\nexport type TransactionStatus = 'pending' | 'approved' | 'completed' | 'rejected';\n\nexport interface FinanceTransaction {\n id: string;\n type: TransactionType;\n amount: number;\n currency: string;\n description: string;\n category: string;\n date: string;\n status: TransactionStatus;\n vendor?: string;\n department: string;\n}\n\nexport interface Budget {\n id: string;\n name: string;\n category: string;\n allocated: number;\n spent: number;\n remaining: number;\n period: string;\n department: string;\n status: 'on_track' | 'over_budget' | 'under_budget';\n}\n\nexport interface Invoice {\n id: string;\n number: string;\n vendor: string;\n amount: number;\n currency: string;\n issueDate: string;\n dueDate: string;\n status: 'draft' | 'sent' | 'paid' | 'overdue' | 'cancelled';\n items: { description: string; qty: number; unitPrice: number; total: number }[];\n relatedPO?: string;\n paidAt?: string;\n}\n\n// ─── Maintenance Types ────────────────────────────────────────────\nexport type MaintenancePriority = 'critical' | 'high' | 'medium' | 'low';\n\nexport interface MaintenanceRecord {\n id: string;\n assetId: string;\n type: string;\n priority: MaintenancePriority;\n status: string;\n title: string;\n description: string;\n scheduledDate?: string;\n completedDate?: string;\n estimatedCost?: number;\n actualCost?: number;\n checklist: { task: string; completed: boolean }[];\n}\n\n// ─── Security Types ───────────────────────────────────────────────\nexport interface SecurityEvent {\n id: string;\n type: string;\n severity: 'critical' | 'high' | 'medium' | 'low' | 'info';\n title: string;\n description: string;\n source: string;\n userId?: string;\n ipAddress?: string;\n timestamp: string;\n resolved: boolean;\n}\n\nexport interface ComplianceFramework {\n id: string;\n name: string;\n version: string;\n status: 'compliant' | 'non_compliant' | 'partial' | 'under_review';\n score: number;\n totalControls: number;\n passedControls: number;\n failedControls: number;\n lastAssessment: string;\n nextAssessment: string;\n lastAssessedAt?: string;\n}\n\nexport interface SecurityPolicy {\n id: string;\n name: string;\n description: string;\n category: string;\n status: 'active' | 'draft' | 'deprecated' | 'under_review';\n version: string;\n effectiveDate: string;\n reviewDate: string;\n owner: string;\n applicableTo: string[];\n}\n\n// ─── Operations Types ─────────────────────────────────────────────\nexport interface WorkOrder {\n id: string;\n title: string;\n description: string;\n priority: 'critical' | 'high' | 'medium' | 'low';\n status: 'draft' | 'scheduled' | 'approved' | 'in_progress' | 'completed' | 'cancelled';\n assignedTo: string;\n assetId: string;\n type: string;\n createdAt: string;\n completedAt?: string;\n}\n\n// ─── Dashboard Types ──────────────────────────────────────────────\nexport interface DashboardOverview {\n totalAssets: number;\n openIncidents: number;\n openWorkOrders: number;\n totalTransactions: number;\n}\n\n// ─── Bootstrap payload (raw backend shapes) ───────────────────────\nexport interface AssetHandlerBootstrapPayload {\n dashboardOverview?: {\n totalAssets?: number;\n openIncidents?: number;\n openWorkOrders?: number;\n totalTransactions?: number;\n } | null;\n assets?: Array<{\n id: string;\n assetNumber: string;\n name: string;\n description?: string | null;\n category: string;\n status: string;\n condition: string;\n serialNumber?: string | null;\n locationName?: string | null;\n assignedTo?: string | null;\n tags?: string[];\n createdAt?: string;\n updatedAt?: string;\n purchaseValue?: number | null;\n purchaseDate?: string | null;\n usefulLifeMonths?: number | null;\n salvageValue?: number | null;\n depreciationMethod?: string | null;\n meterUnit?: string | null;\n department?: string | null;\n warrantyExpiry?: string | null;\n supplier?: string | null;\n disposalDate?: string | null;\n disposalMethod?: string | null;\n disposalNotes?: string | null;\n currentValue?: number | null;\n accumulatedDepreciation?: number | null;\n totalCostOfOwnership?: number | null;\n }> | null;\n incidents?: Array<{\n id: string;\n title: string;\n description: string;\n category: string;\n priority: string;\n status: string;\n assignedTo?: string | null;\n reportedBy: string;\n reportedAt: string;\n resolvedAt?: string | null;\n resolution?: string | null;\n slaBreached: boolean;\n }> | null;\n workOrders?: Array<{\n id: string;\n title: string;\n description?: string | null;\n type: string;\n status: string;\n priority: string;\n assetId?: string | null;\n assignedTo?: string | null;\n createdAt: string;\n completedAt?: string | null;\n }> | null;\n maintenanceRecords?: Array<{\n id: string;\n assetId: string;\n title: string;\n description?: string | null;\n type: string;\n status: string;\n priority: string;\n scheduledAt?: string | null;\n completedAt?: string | null;\n estimatedCost?: number | null;\n actualCost?: number | null;\n checklist?: Array<Record<string, unknown>>;\n }> | null;\n transactions?: Array<{\n id: string;\n type: string;\n status: string;\n amount: number;\n currency: string;\n category: string;\n description: string;\n vendor?: string | null;\n department?: string | null;\n occurredAt: string;\n }> | null;\n changeRequests?: Array<{\n id: string;\n title: string;\n description: string;\n type: string;\n status: string;\n risk: string;\n requestedBy: string;\n assignedTo?: string | null;\n affectedAssets: string[];\n scheduledStart?: string | null;\n scheduledEnd?: string | null;\n approvals?: Array<{ name?: string; status?: string; date?: string }>;\n createdAt: string;\n }> | null;\n problems?: Array<{\n id: string;\n title: string;\n description: string;\n status: string;\n priority: string;\n category: string;\n assignedTo?: string | null;\n relatedIncidents: string[];\n rootCause?: string | null;\n workaround?: string | null;\n resolution?: string | null;\n createdAt: string;\n updatedAt: string;\n }> | null;\n budgets?: Array<{\n id: string;\n name: string;\n category: string;\n allocated: number;\n spent: number;\n remaining: number;\n period: string;\n department: string;\n status: string;\n }> | null;\n invoices?: Array<{\n id: string;\n number: string;\n vendor: string;\n amount: number;\n currency: string;\n issueDate: string;\n dueDate: string;\n status: string;\n items?: Array<{ description?: string; qty?: number; unitPrice?: number; total?: number }>;\n relatedPO?: string | null;\n paidAt?: string | null;\n }> | null;\n securityEvents?: {\n items: Array<{\n id: string;\n eventType: string;\n severity: string;\n title: string;\n description?: string | null;\n source?: string | null;\n userId?: string | null;\n ipAddress?: string | null;\n occurredAt: string;\n resolved: boolean;\n }>;\n } | null;\n complianceFrameworks?: {\n items: Array<{\n id: string;\n name: string;\n version: string;\n status: string;\n score: number;\n totalControls: number;\n passedControls: number;\n failedControls: number;\n lastAssessment: string;\n nextAssessment: string;\n lastAssessedAt?: string | null;\n }>;\n } | null;\n securityPolicies?: {\n items: Array<{\n id: string;\n name: string;\n description?: string | null;\n category: string;\n status: string;\n version: string;\n effectiveDate: string;\n reviewDate: string;\n owner: string;\n applicableTo: string[];\n }>;\n } | null;\n}\n\ninterface AssetHandlerState {\n /** True once the bootstrap query has hydrated the store at least once. */\n hydrated: boolean;\n\n // Domain data — always sourced from the backend, never seeded locally.\n overview: DashboardOverview | null;\n assets: Asset[];\n incidents: Incident[];\n changeRequests: ChangeRequest[];\n problems: Problem[];\n transactions: FinanceTransaction[];\n budgets: Budget[];\n invoices: Invoice[];\n maintenanceRecords: MaintenanceRecord[];\n securityEvents: SecurityEvent[];\n complianceFrameworks: ComplianceFramework[];\n securityPolicies: SecurityPolicy[];\n workOrders: WorkOrder[];\n\n hydrateFromBootstrap: (payload: AssetHandlerBootstrapPayload) => void;\n\n /**\n * Imperative refetch of the bootstrap query, registered by the provider's\n * hydrator. Pages that mutate domain data can call `refetchBootstrap()` to\n * pull fresh store data. Prefer Apollo `refetchQueries: ['AssetHandlerBootstrap']`\n * on the mutation itself; use this for cross-component imperative refresh.\n */\n bootstrapRefetch: (() => void) | null;\n setBootstrapRefetch: (refetch: (() => void) | null) => void;\n refetchBootstrap: () => void;\n}\n\nexport const useAssetHandlerStore = create<AssetHandlerState>((set, get) => ({\n hydrated: false,\n\n bootstrapRefetch: null,\n setBootstrapRefetch: (refetch) => set({ bootstrapRefetch: refetch }),\n refetchBootstrap: () => {\n get().bootstrapRefetch?.();\n },\n\n overview: null,\n assets: [],\n incidents: [],\n changeRequests: [],\n problems: [],\n transactions: [],\n budgets: [],\n invoices: [],\n maintenanceRecords: [],\n securityEvents: [],\n complianceFrameworks: [],\n securityPolicies: [],\n workOrders: [],\n\n hydrateFromBootstrap: (payload) =>\n set(() => {\n const assets: Asset[] = (payload.assets ?? []).map((asset) => ({\n id: asset.id,\n name: asset.name,\n description: asset.description ?? '',\n category: asset.category.toLowerCase(),\n status: asset.status.toLowerCase() as AssetStatus,\n condition: asset.condition.toLowerCase() as AssetCondition,\n serialNumber: asset.serialNumber ?? '',\n assetTag: asset.assetNumber,\n location: asset.locationName ?? '',\n assignedTo: asset.assignedTo ?? '',\n tags: asset.tags ?? [],\n createdAt: asset.createdAt ?? '',\n updatedAt: asset.updatedAt ?? '',\n purchaseValue: asset.purchaseValue ?? undefined,\n purchaseDate: asset.purchaseDate ?? undefined,\n usefulLifeMonths: asset.usefulLifeMonths ?? undefined,\n salvageValue: asset.salvageValue ?? undefined,\n depreciationMethod: asset.depreciationMethod\n ? (asset.depreciationMethod.toLowerCase() as DepreciationMethod)\n : undefined,\n // Kept UPPER-CASE, unlike depreciationMethod above: it is compared against the\n // GraphQL enum values, not against a lower-cased UI string.\n meterUnit: asset.meterUnit ?? null,\n department: asset.department ?? undefined,\n warrantyExpiry: asset.warrantyExpiry ?? undefined,\n supplier: asset.supplier ?? undefined,\n disposalDate: asset.disposalDate ?? undefined,\n disposalMethod: asset.disposalMethod ?? undefined,\n disposalNotes: asset.disposalNotes ?? undefined,\n currentValue: asset.currentValue ?? undefined,\n accumulatedDepreciation: asset.accumulatedDepreciation ?? undefined,\n totalCostOfOwnership: asset.totalCostOfOwnership ?? undefined,\n }));\n\n const incidents: Incident[] = (payload.incidents ?? []).map((incident) => ({\n id: incident.id,\n title: incident.title,\n description: incident.description,\n category: incident.category,\n priority: incident.priority.toLowerCase() as IncidentPriority,\n status: incident.status.toLowerCase() as IncidentStatus,\n assignedTo: incident.assignedTo ?? '',\n reportedBy: incident.reportedBy,\n createdAt: incident.reportedAt,\n resolvedAt: incident.resolvedAt ?? undefined,\n resolution: incident.resolution ?? undefined,\n slaBreached: incident.slaBreached,\n }));\n\n const workOrders: WorkOrder[] = (payload.workOrders ?? []).map((workOrder) => ({\n id: workOrder.id,\n title: workOrder.title,\n description: workOrder.description ?? '',\n assetId: workOrder.assetId ?? '',\n priority: workOrder.priority.toLowerCase() as WorkOrder['priority'],\n status: workOrder.status.toLowerCase() as WorkOrder['status'],\n assignedTo: workOrder.assignedTo ?? '',\n createdAt: workOrder.createdAt,\n completedAt: workOrder.completedAt ?? undefined,\n type: workOrder.type.toLowerCase(),\n }));\n\n const maintenanceRecords: MaintenanceRecord[] = (payload.maintenanceRecords ?? []).map(\n (record) => ({\n id: record.id,\n assetId: record.assetId,\n type: record.type.toLowerCase(),\n priority: record.priority.toLowerCase() as MaintenancePriority,\n status: record.status.toLowerCase(),\n title: record.title,\n description: record.description ?? '',\n scheduledDate: record.scheduledAt ?? undefined,\n completedDate: record.completedAt ?? undefined,\n estimatedCost: record.estimatedCost ?? undefined,\n actualCost: record.actualCost ?? undefined,\n checklist: (record.checklist ?? []).map((item) => ({\n task: String(item.task ?? 'Task'),\n completed: Boolean(item.completed ?? false),\n })),\n })\n );\n\n const transactions: FinanceTransaction[] = (payload.transactions ?? []).map((tx) => ({\n id: tx.id,\n type: tx.type.toLowerCase() as TransactionType,\n amount: tx.amount,\n currency: tx.currency,\n description: tx.description,\n category: tx.category,\n date: tx.occurredAt,\n status: tx.status.toLowerCase() as TransactionStatus,\n vendor: tx.vendor ?? undefined,\n department: tx.department ?? '',\n }));\n\n const changeRequests: ChangeRequest[] = (payload.changeRequests ?? []).map((change) => ({\n id: change.id,\n title: change.title,\n description: change.description,\n type: change.type.toLowerCase(),\n status: change.status.toLowerCase() as ChangeStatus,\n risk: change.risk.toLowerCase() as ChangeRisk,\n requestedBy: change.requestedBy,\n assignedTo: change.assignedTo ?? '',\n affectedAssets: change.affectedAssets,\n scheduledStart: change.scheduledStart ?? '',\n scheduledEnd: change.scheduledEnd ?? '',\n createdAt: change.createdAt,\n approvals: (change.approvals ?? []).map((approval) => ({\n name: approval.name ?? 'Approver',\n status: approval.status ?? 'pending',\n date: approval.date ?? change.createdAt,\n })),\n }));\n\n const problems: Problem[] = (payload.problems ?? []).map((problem) => ({\n id: problem.id,\n title: problem.title,\n description: problem.description,\n status: problem.status.toLowerCase() as ProblemStatus,\n priority: problem.priority.toLowerCase() as IncidentPriority,\n category: problem.category,\n assignedTo: problem.assignedTo ?? '',\n relatedIncidents: problem.relatedIncidents,\n rootCause: problem.rootCause ?? undefined,\n workaround: problem.workaround ?? undefined,\n resolution: problem.resolution ?? undefined,\n createdAt: problem.createdAt,\n updatedAt: problem.updatedAt,\n }));\n\n const budgets: Budget[] = (payload.budgets ?? []).map((budget) => ({\n id: budget.id,\n name: budget.name,\n category: budget.category,\n allocated: budget.allocated,\n spent: budget.spent,\n remaining: budget.remaining,\n period: budget.period,\n department: budget.department,\n status: budget.status.toLowerCase() as Budget['status'],\n }));\n\n const invoices: Invoice[] = (payload.invoices ?? []).map((invoice) => ({\n id: invoice.id,\n number: invoice.number,\n vendor: invoice.vendor,\n amount: invoice.amount,\n currency: invoice.currency,\n issueDate: invoice.issueDate,\n dueDate: invoice.dueDate,\n status: invoice.status.toLowerCase() as Invoice['status'],\n items: (invoice.items ?? []).map((item) => ({\n description: item.description ?? 'Line item',\n qty: item.qty ?? 1,\n unitPrice: item.unitPrice ?? item.total ?? 0,\n total: item.total ?? item.unitPrice ?? 0,\n })),\n relatedPO: invoice.relatedPO ?? undefined,\n paidAt: invoice.paidAt ?? undefined,\n }));\n\n const securityEvents: SecurityEvent[] = (payload.securityEvents?.items ?? []).map(\n (event) => ({\n id: event.id,\n type: event.eventType,\n severity: event.severity.toLowerCase() as SecurityEvent['severity'],\n title: event.title,\n description: event.description ?? '',\n source: event.source ?? 'security',\n userId: event.userId ?? undefined,\n ipAddress: event.ipAddress ?? undefined,\n timestamp: event.occurredAt,\n resolved: event.resolved,\n })\n );\n\n const complianceFrameworks: ComplianceFramework[] = (\n payload.complianceFrameworks?.items ?? []\n ).map((framework) => ({\n id: framework.id,\n name: framework.name,\n version: framework.version,\n status: framework.status.toLowerCase() as ComplianceFramework['status'],\n score: framework.score,\n totalControls: framework.totalControls,\n passedControls: framework.passedControls,\n failedControls: framework.failedControls,\n lastAssessment: framework.lastAssessment,\n nextAssessment: framework.nextAssessment,\n lastAssessedAt: framework.lastAssessedAt ?? undefined,\n }));\n\n const securityPolicies: SecurityPolicy[] = (payload.securityPolicies?.items ?? []).map(\n (policy) => ({\n id: policy.id,\n name: policy.name,\n description: policy.description ?? '',\n category: policy.category,\n status: policy.status.toLowerCase() as SecurityPolicy['status'],\n version: policy.version,\n effectiveDate: policy.effectiveDate,\n reviewDate: policy.reviewDate,\n owner: policy.owner,\n applicableTo: policy.applicableTo,\n })\n );\n\n const overview: DashboardOverview | null = payload.dashboardOverview\n ? {\n totalAssets: payload.dashboardOverview.totalAssets ?? assets.length,\n openIncidents: payload.dashboardOverview.openIncidents ?? 0,\n openWorkOrders: payload.dashboardOverview.openWorkOrders ?? 0,\n totalTransactions: payload.dashboardOverview.totalTransactions ?? 0,\n }\n : null;\n\n // Only overwrite the slices this payload actually carries. The provider\n // fetches the module's data as several smaller queries rather than one\n // 13-root query (BOFF-6381 — wspace-assethandler-svc rejects more than\n // ~3 concurrent operations, so the single combined query failed 100% of\n // the time in production and left every page empty). Each batch hydrates\n // independently, so a rebuild of all thirteen slices here would let a\n // later batch wipe an earlier one back to `[]`. zustand's `set` merges\n // shallowly, so an omitted key keeps its previous value.\n return {\n hydrated: true,\n ...(payload.dashboardOverview !== undefined ? { overview } : {}),\n ...(payload.assets !== undefined ? { assets } : {}),\n ...(payload.incidents !== undefined ? { incidents } : {}),\n ...(payload.changeRequests !== undefined ? { changeRequests } : {}),\n ...(payload.problems !== undefined ? { problems } : {}),\n ...(payload.workOrders !== undefined ? { workOrders } : {}),\n ...(payload.maintenanceRecords !== undefined ? { maintenanceRecords } : {}),\n ...(payload.transactions !== undefined ? { transactions } : {}),\n ...(payload.budgets !== undefined ? { budgets } : {}),\n ...(payload.invoices !== undefined ? { invoices } : {}),\n ...(payload.securityEvents !== undefined ? { securityEvents } : {}),\n ...(payload.complianceFrameworks !== undefined ? { complianceFrameworks } : {}),\n ...(payload.securityPolicies !== undefined ? { securityPolicies } : {}),\n };\n }),\n}));\n"],"mappings":";;AAucA,IAAa,IAAuB,GAA2B,GAAK,OAAS;CAC3E,UAAU;CAEV,kBAAkB;CAClB,sBAAsB,MAAY,EAAI,EAAE,kBAAkB,GAAS,CAAC;CACpE,wBAAwB;AACtB,KAAK,CAAC,oBAAoB;;CAG5B,UAAU;CACV,QAAQ,EAAE;CACV,WAAW,EAAE;CACb,gBAAgB,EAAE;CAClB,UAAU,EAAE;CACZ,cAAc,EAAE;CAChB,SAAS,EAAE;CACX,UAAU,EAAE;CACZ,oBAAoB,EAAE;CACtB,gBAAgB,EAAE;CAClB,sBAAsB,EAAE;CACxB,kBAAkB,EAAE;CACpB,YAAY,EAAE;CAEd,uBAAuB,MACrB,QAAU;EACR,IAAM,KAAmB,EAAQ,UAAU,EAAE,EAAE,KAAK,OAAW;GAC7D,IAAI,EAAM;GACV,MAAM,EAAM;GACZ,aAAa,EAAM,eAAe;GAClC,UAAU,EAAM,SAAS,aAAa;GACtC,QAAQ,EAAM,OAAO,aAAa;GAClC,WAAW,EAAM,UAAU,aAAa;GACxC,cAAc,EAAM,gBAAgB;GACpC,UAAU,EAAM;GAChB,UAAU,EAAM,gBAAgB;GAChC,YAAY,EAAM,cAAc;GAChC,MAAM,EAAM,QAAQ,EAAE;GACtB,WAAW,EAAM,aAAa;GAC9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