@burdenoff/microfe-healthybowl 2026.813.9 → 2026.813.10
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/healthybowl/hooks/useHealthyBowlSustainability.js +224 -205
- package/dist/healthybowl/hooks/useHealthyBowlSustainability.js.map +1 -1
- package/dist/healthybowl/pages/sustainability/SustainabilityOverviewPage.js +282 -196
- package/dist/healthybowl/pages/sustainability/SustainabilityOverviewPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { useHealthyBowl as e } from "../context/HealthyBowlContext.js";
|
|
2
2
|
import { useCallback as t, useMemo as n } from "react";
|
|
3
3
|
import { gql as r } from "@apollo/client";
|
|
4
|
-
import {
|
|
4
|
+
import { useApolloClient as i, useMutation as a, useQuery as o } from "@apollo/client/react";
|
|
5
5
|
//#region src/healthybowl/hooks/useHealthyBowlSustainability.ts
|
|
6
|
-
var ee = "00000000-0000-0000-0000-000000000001",
|
|
6
|
+
var ee = "00000000-0000-0000-0000-000000000001", s = "\n id farmId farmName year periodStart periodEnd status methodology\n totalScope1 totalScope2 totalScope3 totalCo2e sequesteredCo2e netCo2e\n intensityPerTonne lockedAt verifiedAt notes activityCount createdAt updatedAt\n", c = "\n id inventoryId scope category sourceType sourceRef label quantity unit\n factorKey factorValue factorSet co2e activityDate\n", l = "\n id farmId fieldId practiceType startDate endDate areaHa evidence notes createdAt\n", u = "\n id farmId fieldId practiceId periodStart periodEnd methodology tCo2eSequestered\n baselineSoc currentSoc areaHa confidence notes createdAt\n", d = "\n id farmId creditCode method vintageYear quantityTCo2e registry status\n registrySerial verifierRef pricePerCredit currency baselinePractice\n inventoryId soilCarbonEstimateId regenerativePracticeId linkedFieldIds issuedDate notes createdAt updatedAt\n", f = "\n id farmId fieldId traceBatchId statementCode commodity plotGeojson plotAreaHa\n geoLatitude geoLongitude productionDateFrom productionDateTo cutoffDate\n deforestationRisk cutoffCompliant riskAssessment dataSource lastVerifiedAt\n status statementFileId dueDiligenceRef createdAt updatedAt\n", p = "\n id farmId year reportCode format reportFileId summary generatedAt\n", te = r`
|
|
7
7
|
query GetHealthyBowlCarbonOverview($context: ContextInput!, $farmId: ID, $year: Int) {
|
|
8
8
|
getHealthyBowlCarbonOverview(context: $context, farmId: $farmId, year: $year) {
|
|
9
9
|
farmId farmName farmLocation year hasData
|
|
10
|
-
inventory { ${
|
|
10
|
+
inventory { ${s} }
|
|
11
11
|
totalEmissions emissionsChangePct sequestered netBalance netStatus intensityPerTonne
|
|
12
12
|
scopeBreakdown { scope label co2e percentage }
|
|
13
13
|
soilCarbonTrend { label periodEnd cumulativeTco2e }
|
|
14
14
|
credits { total verified pending draft issued totalTco2e }
|
|
15
|
-
eudr { totalPlots compliantPlots latestStatement { ${
|
|
15
|
+
eudr { totalPlots compliantPlots latestStatement { ${f} } }
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
`, ne = r`
|
|
19
19
|
query GetHealthyBowlGhgInventory($context: ContextInput!, $farmId: ID!, $year: Int) {
|
|
20
|
-
getHealthyBowlGhgInventory(context: $context, farmId: $farmId, year: $year) { ${
|
|
20
|
+
getHealthyBowlGhgInventory(context: $context, farmId: $farmId, year: $year) { ${s} }
|
|
21
21
|
}
|
|
22
22
|
`, re = r`
|
|
23
23
|
query ListHealthyBowlGhgActivities($context: ContextInput!, $inventoryId: ID!, $limit: Int, $offset: Int) {
|
|
24
24
|
listHealthyBowlGhgActivities(context: $context, inventoryId: $inventoryId, limit: $limit, offset: $offset) {
|
|
25
|
-
${
|
|
25
|
+
${c}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
`, ie = r`
|
|
29
29
|
query ListHealthyBowlRegenerativePractices($context: ContextInput!, $farmId: ID, $limit: Int, $offset: Int) {
|
|
30
30
|
listHealthyBowlRegenerativePractices(context: $context, farmId: $farmId, limit: $limit, offset: $offset) {
|
|
31
|
-
${
|
|
31
|
+
${l}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
`, ae = r`
|
|
35
35
|
query ListHealthyBowlSoilCarbonEstimates($context: ContextInput!, $farmId: ID, $limit: Int, $offset: Int) {
|
|
36
36
|
listHealthyBowlSoilCarbonEstimates(context: $context, farmId: $farmId, limit: $limit, offset: $offset) {
|
|
37
|
-
${
|
|
37
|
+
${u}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
`,
|
|
40
|
+
`, m = r`
|
|
41
41
|
query ListHealthyBowlCarbonCredits(
|
|
42
42
|
$context: ContextInput!
|
|
43
43
|
$farmId: ID
|
|
@@ -56,31 +56,39 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
|
|
|
56
56
|
limit: $limit
|
|
57
57
|
offset: $offset
|
|
58
58
|
) {
|
|
59
|
-
items { ${
|
|
59
|
+
items { ${d} }
|
|
60
60
|
total verifiedCount pendingCount draftCount issuedCount totalTco2e
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
`, oe = r`
|
|
64
64
|
query GetHealthyBowlCarbonCredit($context: ContextInput!, $id: ID!) {
|
|
65
|
-
getHealthyBowlCarbonCredit(context: $context, id: $id) { ${
|
|
65
|
+
getHealthyBowlCarbonCredit(context: $context, id: $id) { ${d} }
|
|
66
66
|
}
|
|
67
67
|
`, se = r`
|
|
68
68
|
query ListHealthyBowlEudrStatements($context: ContextInput!, $farmId: ID, $limit: Int, $offset: Int) {
|
|
69
69
|
listHealthyBowlEudrStatements(context: $context, farmId: $farmId, limit: $limit, offset: $offset) {
|
|
70
|
-
${
|
|
70
|
+
${f}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
`, ce = r`
|
|
74
74
|
query GetHealthyBowlEudrStatement($context: ContextInput!, $id: ID!) {
|
|
75
|
-
getHealthyBowlEudrStatement(context: $context, id: $id) { ${
|
|
75
|
+
getHealthyBowlEudrStatement(context: $context, id: $id) { ${f} }
|
|
76
76
|
}
|
|
77
77
|
`, le = r`
|
|
78
78
|
query ListHealthyBowlMrvReports($context: ContextInput!, $farmId: ID, $limit: Int, $offset: Int) {
|
|
79
79
|
listHealthyBowlMrvReports(context: $context, farmId: $farmId, limit: $limit, offset: $offset) {
|
|
80
|
-
${
|
|
80
|
+
${p}
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
`, ue = r`
|
|
84
|
+
query GetHealthyBowlMrvReportFile($context: ContextInput!, $id: ID!) {
|
|
85
|
+
getHealthyBowlMrvReportFile(context: $context, id: $id) {
|
|
86
|
+
${p}
|
|
87
|
+
pdfBase64
|
|
88
|
+
csv
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
`, de = r`
|
|
84
92
|
query GetHealthyBowlSustainabilityFields($context: ContextInput!) {
|
|
85
93
|
getHealthyBowlCropsData(context: $context) {
|
|
86
94
|
fields {
|
|
@@ -91,11 +99,11 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
|
|
|
91
99
|
}
|
|
92
100
|
}
|
|
93
101
|
}
|
|
94
|
-
`,
|
|
102
|
+
`, fe = r`
|
|
95
103
|
mutation RecomputeHealthyBowlGhgInventory($input: RecomputeHealthyBowlGhgInventoryInput!) {
|
|
96
|
-
recomputeHealthyBowlGhgInventory(input: $input) { ${
|
|
104
|
+
recomputeHealthyBowlGhgInventory(input: $input) { ${s} }
|
|
97
105
|
}
|
|
98
|
-
`,
|
|
106
|
+
`, pe = r`
|
|
99
107
|
mutation LockHealthyBowlGhgInventory($context: ContextInput!, $id: ID!) {
|
|
100
108
|
lockHealthyBowlGhgInventory(context: $context, id: $id) {
|
|
101
109
|
id
|
|
@@ -103,7 +111,7 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
|
|
|
103
111
|
lockedAt
|
|
104
112
|
}
|
|
105
113
|
}
|
|
106
|
-
`,
|
|
114
|
+
`, me = r`
|
|
107
115
|
mutation VerifyHealthyBowlGhgInventory($context: ContextInput!, $id: ID!) {
|
|
108
116
|
verifyHealthyBowlGhgInventory(context: $context, id: $id) {
|
|
109
117
|
id
|
|
@@ -111,7 +119,7 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
|
|
|
111
119
|
verifiedAt
|
|
112
120
|
}
|
|
113
121
|
}
|
|
114
|
-
`,
|
|
122
|
+
`, he = r`
|
|
115
123
|
mutation UpsertHealthyBowlGhgActivity($input: UpsertHealthyBowlGhgActivityInput!) {
|
|
116
124
|
upsertHealthyBowlGhgActivity(input: $input) {
|
|
117
125
|
id
|
|
@@ -120,25 +128,25 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
|
|
|
120
128
|
co2e
|
|
121
129
|
}
|
|
122
130
|
}
|
|
123
|
-
`,
|
|
131
|
+
`, ge = r`
|
|
124
132
|
mutation DeleteHealthyBowlGhgActivity($context: ContextInput!, $id: ID!) {
|
|
125
133
|
deleteHealthyBowlGhgActivity(context: $context, id: $id)
|
|
126
134
|
}
|
|
127
|
-
`,
|
|
135
|
+
`, _e = r`
|
|
128
136
|
mutation CreateHealthyBowlRegenerativePractice($input: CreateHealthyBowlRegenerativePracticeInput!) {
|
|
129
137
|
createHealthyBowlRegenerativePractice(input: $input) {
|
|
130
138
|
id
|
|
131
139
|
practiceType
|
|
132
140
|
}
|
|
133
141
|
}
|
|
134
|
-
`,
|
|
142
|
+
`, ve = r`
|
|
135
143
|
mutation UpsertHealthyBowlSoilCarbonEstimate($input: UpsertHealthyBowlSoilCarbonEstimateInput!) {
|
|
136
144
|
upsertHealthyBowlSoilCarbonEstimate(input: $input) {
|
|
137
145
|
id
|
|
138
146
|
tCo2eSequestered
|
|
139
147
|
}
|
|
140
148
|
}
|
|
141
|
-
`,
|
|
149
|
+
`, ye = r`
|
|
142
150
|
mutation CreateHealthyBowlCarbonCredit($input: CreateHealthyBowlCarbonCreditInput!) {
|
|
143
151
|
createHealthyBowlCarbonCredit(input: $input) {
|
|
144
152
|
id
|
|
@@ -147,18 +155,18 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
|
|
|
147
155
|
quantityTCo2e
|
|
148
156
|
}
|
|
149
157
|
}
|
|
150
|
-
`,
|
|
158
|
+
`, be = r`
|
|
151
159
|
mutation TransitionHealthyBowlCarbonCredit($input: TransitionHealthyBowlCarbonCreditInput!) {
|
|
152
160
|
transitionHealthyBowlCarbonCredit(input: $input) {
|
|
153
161
|
id
|
|
154
162
|
status
|
|
155
163
|
}
|
|
156
164
|
}
|
|
157
|
-
`,
|
|
165
|
+
`, xe = r`
|
|
158
166
|
mutation DeleteHealthyBowlCarbonCredit($context: ContextInput!, $id: ID!) {
|
|
159
167
|
deleteHealthyBowlCarbonCredit(context: $context, id: $id)
|
|
160
168
|
}
|
|
161
|
-
`,
|
|
169
|
+
`, Se = r`
|
|
162
170
|
mutation UpsertHealthyBowlEudrStatement($input: UpsertHealthyBowlEudrStatementInput!) {
|
|
163
171
|
upsertHealthyBowlEudrStatement(input: $input) {
|
|
164
172
|
id
|
|
@@ -167,7 +175,7 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
|
|
|
167
175
|
cutoffCompliant
|
|
168
176
|
}
|
|
169
177
|
}
|
|
170
|
-
`,
|
|
178
|
+
`, Ce = r`
|
|
171
179
|
mutation ExportHealthyBowlEudrStatement($context: ContextInput!, $id: ID!) {
|
|
172
180
|
exportHealthyBowlEudrStatement(context: $context, id: $id) {
|
|
173
181
|
statementCode
|
|
@@ -176,11 +184,11 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
|
|
|
176
184
|
fileId
|
|
177
185
|
}
|
|
178
186
|
}
|
|
179
|
-
`,
|
|
187
|
+
`, we = r`
|
|
180
188
|
mutation DeleteHealthyBowlEudrStatement($context: ContextInput!, $id: ID!) {
|
|
181
189
|
deleteHealthyBowlEudrStatement(context: $context, id: $id)
|
|
182
190
|
}
|
|
183
|
-
`,
|
|
191
|
+
`, Te = r`
|
|
184
192
|
mutation GenerateHealthyBowlMrvReport($input: GenerateHealthyBowlMrvReportInput!) {
|
|
185
193
|
generateHealthyBowlMrvReport(input: $input) {
|
|
186
194
|
id
|
|
@@ -196,329 +204,340 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
|
|
|
196
204
|
}
|
|
197
205
|
}
|
|
198
206
|
`;
|
|
199
|
-
function
|
|
207
|
+
function h(e, t) {
|
|
200
208
|
if (typeof document > "u") return;
|
|
201
209
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
202
210
|
r.href = n, r.download = t, document.body.appendChild(r), r.click(), r.remove(), URL.revokeObjectURL(n);
|
|
203
211
|
}
|
|
204
|
-
function
|
|
212
|
+
function g(e, t, n) {
|
|
205
213
|
let r = atob(e), i = new Uint8Array(r.length);
|
|
206
214
|
for (let e = 0; e < r.length; e += 1) i[e] = r.charCodeAt(e);
|
|
207
|
-
|
|
215
|
+
h(new Blob([i], { type: n }), t);
|
|
208
216
|
}
|
|
209
|
-
function
|
|
210
|
-
|
|
217
|
+
function _(e, t, n) {
|
|
218
|
+
h(new Blob([e], { type: n }), t);
|
|
211
219
|
}
|
|
212
|
-
function
|
|
213
|
-
let { workspaceId:
|
|
220
|
+
function v(r = {}) {
|
|
221
|
+
let { workspaceId: s } = e(), c = s || ee, l = n(() => ({ workspaceId: c }), [c]), u = r.include ?? {}, { year: d, creditFilters: f } = r, p = o(te, {
|
|
214
222
|
variables: {
|
|
215
|
-
context:
|
|
223
|
+
context: l,
|
|
216
224
|
farmId: r.farmId ?? null,
|
|
217
|
-
year:
|
|
225
|
+
year: d ?? null
|
|
218
226
|
},
|
|
219
227
|
fetchPolicy: "cache-and-network"
|
|
220
|
-
}),
|
|
228
|
+
}), h = p.data?.getHealthyBowlCarbonOverview ?? null, v = r.farmId ?? h?.farmId ?? null, y = o(ne, {
|
|
221
229
|
variables: {
|
|
222
|
-
context:
|
|
223
|
-
farmId:
|
|
224
|
-
year:
|
|
230
|
+
context: l,
|
|
231
|
+
farmId: v ?? "",
|
|
232
|
+
year: d ?? null
|
|
225
233
|
},
|
|
226
234
|
fetchPolicy: "cache-and-network",
|
|
227
|
-
skip: !
|
|
228
|
-
}),
|
|
235
|
+
skip: !u.ghg || !v
|
|
236
|
+
}), b = y.data?.getHealthyBowlGhgInventory ?? h?.inventory ?? null, x = b?.id ?? null, S = o(re, {
|
|
229
237
|
variables: {
|
|
230
|
-
context:
|
|
231
|
-
inventoryId:
|
|
238
|
+
context: l,
|
|
239
|
+
inventoryId: x ?? "",
|
|
232
240
|
limit: 200,
|
|
233
241
|
offset: 0
|
|
234
242
|
},
|
|
235
243
|
fetchPolicy: "cache-and-network",
|
|
236
|
-
skip: !
|
|
237
|
-
}),
|
|
244
|
+
skip: !u.ghg || !x
|
|
245
|
+
}), C = o(ae, {
|
|
238
246
|
variables: {
|
|
239
|
-
context:
|
|
240
|
-
farmId:
|
|
247
|
+
context: l,
|
|
248
|
+
farmId: v ?? null,
|
|
241
249
|
limit: 100,
|
|
242
250
|
offset: 0
|
|
243
251
|
},
|
|
244
252
|
fetchPolicy: "cache-and-network",
|
|
245
|
-
skip: !
|
|
246
|
-
}),
|
|
253
|
+
skip: !u.soil || !v
|
|
254
|
+
}), w = o(ie, {
|
|
247
255
|
variables: {
|
|
248
|
-
context:
|
|
249
|
-
farmId:
|
|
256
|
+
context: l,
|
|
257
|
+
farmId: v ?? null,
|
|
250
258
|
limit: 100,
|
|
251
259
|
offset: 0
|
|
252
260
|
},
|
|
253
261
|
fetchPolicy: "cache-and-network",
|
|
254
|
-
skip: !
|
|
255
|
-
}),
|
|
262
|
+
skip: !u.soil || !v
|
|
263
|
+
}), T = o(m, {
|
|
256
264
|
variables: {
|
|
257
|
-
context:
|
|
258
|
-
farmId:
|
|
259
|
-
status:
|
|
260
|
-
method:
|
|
261
|
-
vintageYear:
|
|
265
|
+
context: l,
|
|
266
|
+
farmId: v ?? null,
|
|
267
|
+
status: f?.status ?? null,
|
|
268
|
+
method: f?.method ?? null,
|
|
269
|
+
vintageYear: f?.vintageYear ?? null,
|
|
262
270
|
limit: 200,
|
|
263
271
|
offset: 0
|
|
264
272
|
},
|
|
265
273
|
fetchPolicy: "cache-and-network",
|
|
266
|
-
skip: !
|
|
267
|
-
}),
|
|
274
|
+
skip: !u.credits || !v
|
|
275
|
+
}), E = o(m, {
|
|
268
276
|
variables: {
|
|
269
|
-
context:
|
|
270
|
-
farmId:
|
|
277
|
+
context: l,
|
|
278
|
+
farmId: v ?? null,
|
|
271
279
|
limit: 5,
|
|
272
280
|
offset: 0
|
|
273
281
|
},
|
|
274
282
|
fetchPolicy: "cache-and-network",
|
|
275
|
-
skip: !
|
|
276
|
-
}),
|
|
283
|
+
skip: !u.creditsPreview || !v
|
|
284
|
+
}), D = o(se, {
|
|
277
285
|
variables: {
|
|
278
|
-
context:
|
|
279
|
-
farmId:
|
|
286
|
+
context: l,
|
|
287
|
+
farmId: v ?? null,
|
|
280
288
|
limit: 100,
|
|
281
289
|
offset: 0
|
|
282
290
|
},
|
|
283
291
|
fetchPolicy: "cache-and-network",
|
|
284
|
-
skip: !
|
|
285
|
-
}),
|
|
292
|
+
skip: !u.eudr || !v
|
|
293
|
+
}), O = o(le, {
|
|
286
294
|
variables: {
|
|
287
|
-
context:
|
|
288
|
-
farmId:
|
|
295
|
+
context: l,
|
|
296
|
+
farmId: v ?? null,
|
|
289
297
|
limit: 50,
|
|
290
298
|
offset: 0
|
|
291
299
|
},
|
|
292
300
|
fetchPolicy: "cache-and-network",
|
|
293
|
-
skip: !
|
|
294
|
-
}),
|
|
295
|
-
variables: { context:
|
|
301
|
+
skip: !u.mrvReports || !v
|
|
302
|
+
}), k = o(de, {
|
|
303
|
+
variables: { context: l },
|
|
296
304
|
fetchPolicy: "cache-and-network",
|
|
297
|
-
skip: !
|
|
298
|
-
}),
|
|
305
|
+
skip: !u.fields
|
|
306
|
+
}), A = p.refetch, j = y.refetch, M = S.refetch, N = C.refetch, P = w.refetch, F = T.refetch, I = E.refetch, L = D.refetch, R = O.refetch, z = t(async (...e) => {
|
|
299
307
|
await Promise.all(e.map((e) => e().catch(() => {})));
|
|
300
|
-
}, []), [
|
|
308
|
+
}, []), [B] = a(fe), [V] = a(pe), [H] = a(me), [U] = a(he), [W] = a(ge), [G] = a(_e), [K] = a(ve), [q] = a(ye), [J] = a(be), [Y] = a(xe), [Ee] = a(Se), [De] = a(Ce), [Oe] = a(we), ke = i(), [X] = a(Te), Z = t(async (e, t, n) => {
|
|
301
309
|
let r = await e({ variables: t });
|
|
302
310
|
if (r.error) throw r.error instanceof Error ? r.error : Error(String(r.error));
|
|
303
|
-
return await
|
|
304
|
-
}, [
|
|
311
|
+
return await z(...n), r.data;
|
|
312
|
+
}, [z]), Q = t((e) => ({
|
|
305
313
|
...e,
|
|
306
|
-
context:
|
|
307
|
-
}), [
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
314
|
+
context: l
|
|
315
|
+
}), [l]), $ = n(() => [
|
|
316
|
+
A,
|
|
317
|
+
j,
|
|
318
|
+
M
|
|
311
319
|
], [
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
320
|
+
A,
|
|
321
|
+
j,
|
|
322
|
+
M
|
|
315
323
|
]);
|
|
316
324
|
return {
|
|
317
|
-
overview:
|
|
318
|
-
inventory:
|
|
319
|
-
activities:
|
|
320
|
-
soilEstimates:
|
|
321
|
-
practices:
|
|
322
|
-
credits:
|
|
323
|
-
creditsPreview:
|
|
324
|
-
eudrStatements:
|
|
325
|
-
mrvReports:
|
|
326
|
-
fields:
|
|
327
|
-
farmId:
|
|
325
|
+
overview: h,
|
|
326
|
+
inventory: b,
|
|
327
|
+
activities: S.data?.listHealthyBowlGhgActivities ?? [],
|
|
328
|
+
soilEstimates: C.data?.listHealthyBowlSoilCarbonEstimates ?? [],
|
|
329
|
+
practices: w.data?.listHealthyBowlRegenerativePractices ?? [],
|
|
330
|
+
credits: T.data?.listHealthyBowlCarbonCredits ?? null,
|
|
331
|
+
creditsPreview: E.data?.listHealthyBowlCarbonCredits ?? null,
|
|
332
|
+
eudrStatements: D.data?.listHealthyBowlEudrStatements ?? [],
|
|
333
|
+
mrvReports: O.data?.listHealthyBowlMrvReports ?? [],
|
|
334
|
+
fields: k.data?.getHealthyBowlCropsData?.fields ?? [],
|
|
335
|
+
farmId: v,
|
|
328
336
|
loading: {
|
|
329
|
-
overview:
|
|
330
|
-
inventory:
|
|
331
|
-
activities:
|
|
332
|
-
soilEstimates:
|
|
333
|
-
practices:
|
|
334
|
-
credits:
|
|
335
|
-
creditsPreview:
|
|
336
|
-
eudr:
|
|
337
|
-
mrvReports:
|
|
338
|
-
fields:
|
|
337
|
+
overview: p.loading,
|
|
338
|
+
inventory: y.loading,
|
|
339
|
+
activities: S.loading,
|
|
340
|
+
soilEstimates: C.loading,
|
|
341
|
+
practices: w.loading,
|
|
342
|
+
credits: T.loading,
|
|
343
|
+
creditsPreview: E.loading,
|
|
344
|
+
eudr: D.loading,
|
|
345
|
+
mrvReports: O.loading,
|
|
346
|
+
fields: k.loading
|
|
339
347
|
},
|
|
340
348
|
errors: {
|
|
341
|
-
overview:
|
|
342
|
-
inventory:
|
|
343
|
-
activities:
|
|
344
|
-
soilEstimates:
|
|
345
|
-
practices:
|
|
346
|
-
credits:
|
|
347
|
-
creditsPreview:
|
|
348
|
-
eudr:
|
|
349
|
-
mrvReports:
|
|
350
|
-
fields:
|
|
349
|
+
overview: p.error,
|
|
350
|
+
inventory: y.error,
|
|
351
|
+
activities: S.error,
|
|
352
|
+
soilEstimates: C.error,
|
|
353
|
+
practices: w.error,
|
|
354
|
+
credits: T.error,
|
|
355
|
+
creditsPreview: E.error,
|
|
356
|
+
eudr: D.error,
|
|
357
|
+
mrvReports: O.error,
|
|
358
|
+
fields: k.error
|
|
351
359
|
},
|
|
352
|
-
refetchAll: t(() =>
|
|
353
|
-
|
|
354
|
-
O,
|
|
355
|
-
k,
|
|
360
|
+
refetchAll: t(() => z(A, j, M, N, P, F, I, L, R), [
|
|
361
|
+
z,
|
|
356
362
|
A,
|
|
357
363
|
j,
|
|
358
364
|
M,
|
|
359
365
|
N,
|
|
360
366
|
P,
|
|
361
367
|
F,
|
|
362
|
-
I
|
|
368
|
+
I,
|
|
369
|
+
L,
|
|
370
|
+
R
|
|
363
371
|
]),
|
|
364
372
|
recomputeInventory: t(async (e, t) => {
|
|
365
|
-
let n = await
|
|
366
|
-
context:
|
|
373
|
+
let n = await B({ variables: { input: {
|
|
374
|
+
context: l,
|
|
367
375
|
farmId: e,
|
|
368
376
|
...t ? { year: t } : {}
|
|
369
377
|
} } });
|
|
370
378
|
if (n.error) throw n.error;
|
|
371
|
-
return await
|
|
379
|
+
return await z(...$, F, I), n.data?.recomputeHealthyBowlGhgInventory ?? null;
|
|
372
380
|
}, [
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
381
|
+
B,
|
|
382
|
+
l,
|
|
383
|
+
z,
|
|
376
384
|
$,
|
|
377
|
-
|
|
378
|
-
|
|
385
|
+
F,
|
|
386
|
+
I
|
|
379
387
|
]),
|
|
380
|
-
lockInventory: t((e) => Z(
|
|
381
|
-
context:
|
|
388
|
+
lockInventory: t((e) => Z(V, {
|
|
389
|
+
context: l,
|
|
382
390
|
id: e
|
|
383
391
|
}, $), [
|
|
384
392
|
Z,
|
|
385
|
-
|
|
386
|
-
|
|
393
|
+
V,
|
|
394
|
+
l,
|
|
387
395
|
$
|
|
388
396
|
]),
|
|
389
|
-
verifyInventory: t((e) => Z(
|
|
390
|
-
context:
|
|
397
|
+
verifyInventory: t((e) => Z(H, {
|
|
398
|
+
context: l,
|
|
391
399
|
id: e
|
|
392
400
|
}, $), [
|
|
393
401
|
Z,
|
|
394
|
-
|
|
395
|
-
|
|
402
|
+
H,
|
|
403
|
+
l,
|
|
396
404
|
$
|
|
397
405
|
]),
|
|
398
|
-
upsertActivity: t((e) => Z(
|
|
406
|
+
upsertActivity: t((e) => Z(U, { input: Q(e) }, $), [
|
|
399
407
|
Z,
|
|
400
|
-
|
|
408
|
+
U,
|
|
401
409
|
Q,
|
|
402
410
|
$
|
|
403
411
|
]),
|
|
404
|
-
deleteActivity: t((e) => Z(
|
|
405
|
-
context:
|
|
412
|
+
deleteActivity: t((e) => Z(W, {
|
|
413
|
+
context: l,
|
|
406
414
|
id: e
|
|
407
415
|
}, $), [
|
|
408
416
|
Z,
|
|
409
|
-
|
|
410
|
-
|
|
417
|
+
W,
|
|
418
|
+
l,
|
|
411
419
|
$
|
|
412
420
|
]),
|
|
413
|
-
createPractice: t((e) => Z(
|
|
421
|
+
createPractice: t((e) => Z(G, { input: Q(e) }, [P, A]), [
|
|
414
422
|
Z,
|
|
415
|
-
|
|
423
|
+
G,
|
|
416
424
|
Q,
|
|
417
|
-
|
|
418
|
-
|
|
425
|
+
P,
|
|
426
|
+
A
|
|
419
427
|
]),
|
|
420
|
-
upsertSoilEstimate: t((e) => Z(
|
|
428
|
+
upsertSoilEstimate: t((e) => Z(K, { input: Q(e) }, [N, A]), [
|
|
421
429
|
Z,
|
|
422
|
-
|
|
430
|
+
K,
|
|
423
431
|
Q,
|
|
424
|
-
|
|
425
|
-
|
|
432
|
+
N,
|
|
433
|
+
A
|
|
426
434
|
]),
|
|
427
435
|
createCredit: t(async (e) => {
|
|
428
|
-
let t = await
|
|
436
|
+
let t = await q({ variables: { input: Q(e) } });
|
|
429
437
|
if (t.error) throw t.error;
|
|
430
|
-
return await
|
|
438
|
+
return await z(F, I, A), t.data?.createHealthyBowlCarbonCredit ?? null;
|
|
431
439
|
}, [
|
|
432
|
-
|
|
440
|
+
q,
|
|
433
441
|
Q,
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
442
|
+
z,
|
|
443
|
+
F,
|
|
444
|
+
I,
|
|
445
|
+
A
|
|
438
446
|
]),
|
|
439
|
-
transitionCredit: t((e) => Z(
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
447
|
+
transitionCredit: t((e) => Z(J, { input: Q(e) }, [
|
|
448
|
+
F,
|
|
449
|
+
I,
|
|
450
|
+
A
|
|
443
451
|
]), [
|
|
444
452
|
Z,
|
|
445
|
-
|
|
453
|
+
J,
|
|
446
454
|
Q,
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
455
|
+
F,
|
|
456
|
+
I,
|
|
457
|
+
A
|
|
450
458
|
]),
|
|
451
|
-
deleteCredit: t((e) => Z(
|
|
452
|
-
context:
|
|
459
|
+
deleteCredit: t((e) => Z(Y, {
|
|
460
|
+
context: l,
|
|
453
461
|
id: e
|
|
454
462
|
}, [
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
463
|
+
F,
|
|
464
|
+
I,
|
|
465
|
+
A
|
|
458
466
|
]), [
|
|
459
467
|
Z,
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
468
|
+
Y,
|
|
469
|
+
l,
|
|
470
|
+
F,
|
|
471
|
+
I,
|
|
472
|
+
A
|
|
465
473
|
]),
|
|
466
|
-
upsertEudrStatement: t((e) => Z(
|
|
474
|
+
upsertEudrStatement: t((e) => Z(Ee, { input: Q(e) }, [L, A]), [
|
|
467
475
|
Z,
|
|
468
|
-
|
|
476
|
+
Ee,
|
|
469
477
|
Q,
|
|
470
|
-
|
|
471
|
-
|
|
478
|
+
L,
|
|
479
|
+
A
|
|
472
480
|
]),
|
|
473
|
-
deleteEudrStatement: t((e) => Z(
|
|
474
|
-
context:
|
|
481
|
+
deleteEudrStatement: t((e) => Z(Oe, {
|
|
482
|
+
context: l,
|
|
475
483
|
id: e
|
|
476
|
-
}, [
|
|
484
|
+
}, [L, A]), [
|
|
477
485
|
Z,
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
486
|
+
Oe,
|
|
487
|
+
l,
|
|
488
|
+
L,
|
|
489
|
+
A
|
|
482
490
|
]),
|
|
483
491
|
exportEudrStatement: t(async (e) => {
|
|
484
|
-
let t = await
|
|
485
|
-
context:
|
|
492
|
+
let t = await De({ variables: {
|
|
493
|
+
context: l,
|
|
486
494
|
id: e
|
|
487
495
|
} });
|
|
488
496
|
if (t.error) throw t.error;
|
|
489
497
|
let n = t.data?.exportHealthyBowlEudrStatement ?? null;
|
|
490
|
-
return n?.pdfBase64 &&
|
|
498
|
+
return n?.pdfBase64 && g(n.pdfBase64, n.fileName || `${n.statementCode}.pdf`, "application/pdf"), await z(L, A), n;
|
|
491
499
|
}, [
|
|
492
|
-
|
|
493
|
-
|
|
500
|
+
De,
|
|
501
|
+
l,
|
|
502
|
+
z,
|
|
494
503
|
L,
|
|
495
|
-
|
|
496
|
-
O
|
|
504
|
+
A
|
|
497
505
|
]),
|
|
498
506
|
generateMrvReport: t(async (e, t = "PDF", n) => {
|
|
499
507
|
let r = await X({ variables: { input: {
|
|
500
|
-
context:
|
|
508
|
+
context: l,
|
|
501
509
|
farmId: e,
|
|
502
510
|
format: t,
|
|
503
511
|
...n ? { year: n } : {}
|
|
504
512
|
} } });
|
|
505
513
|
if (r.error) throw r.error;
|
|
506
514
|
let i = r.data?.generateHealthyBowlMrvReport ?? null;
|
|
507
|
-
return i && (i.format === "CSV" && i.csv ?
|
|
515
|
+
return i && (i.format === "CSV" && i.csv ? _(i.csv, `${i.reportCode}.csv`, "text/csv") : i.pdfBase64 && g(i.pdfBase64, `${i.reportCode}.pdf`, "application/pdf")), await z(R), i;
|
|
508
516
|
}, [
|
|
509
517
|
X,
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
518
|
+
l,
|
|
519
|
+
z,
|
|
520
|
+
R
|
|
513
521
|
]),
|
|
522
|
+
downloadMrvReport: t(async (e) => {
|
|
523
|
+
let t = (await ke.query({
|
|
524
|
+
query: ue,
|
|
525
|
+
variables: {
|
|
526
|
+
context: l,
|
|
527
|
+
id: e
|
|
528
|
+
},
|
|
529
|
+
fetchPolicy: "network-only"
|
|
530
|
+
})).data?.getHealthyBowlMrvReportFile ?? null;
|
|
531
|
+
return t ? t.format === "CSV" && t.csv ? (_(t.csv, `${t.reportCode}.csv`, "text/csv"), t) : t.pdfBase64 ? (g(t.pdfBase64, `${t.reportCode}.pdf`, "application/pdf"), t) : null : null;
|
|
532
|
+
}, [ke, l]),
|
|
514
533
|
documents: {
|
|
515
534
|
GET_CARBON_CREDIT: oe,
|
|
516
535
|
GET_EUDR_STATEMENT: ce
|
|
517
536
|
},
|
|
518
|
-
context:
|
|
537
|
+
context: l
|
|
519
538
|
};
|
|
520
539
|
}
|
|
521
540
|
//#endregion
|
|
522
|
-
export {
|
|
541
|
+
export { v as useHealthyBowlSustainability };
|
|
523
542
|
|
|
524
543
|
//# sourceMappingURL=useHealthyBowlSustainability.js.map
|