@burdenoff/microfe-healthybowl 2026.1119.2 → 2026.1120.1
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/pages/GettingStartedPage.js +76 -76
- package/dist/healthybowl/pages/contracts/contract-forms/CreateContractModal.js +80 -80
- package/dist/healthybowl/pages/contracts/contract-forms/RecordDeliveryModal.js +54 -54
- package/dist/healthybowl/pages/crops/HarvestDetailsPage.js +26 -24
- package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js +239 -239
- package/dist/healthybowl/pages/distribution/PickupLocationFormModal.js +124 -124
- package/dist/healthybowl/pages/distribution/PickupManifestPage.js +75 -75
- package/dist/healthybowl/pages/field-capture/ObservationLogPage.js +40 -39
- package/dist/healthybowl/pages/financial/BankReconciliationPage.js +220 -219
- package/dist/healthybowl/pages/financial/ChartOfAccountsPage.js +59 -59
- package/dist/healthybowl/pages/financial/CostByCropPage.js +58 -58
- package/dist/healthybowl/pages/financial/JournalEntryModal.js +59 -57
- package/dist/healthybowl/pages/financial/MachinerySpendPage.js +55 -54
- package/dist/healthybowl/pages/inputs-insurance/InputPlanFormModal.js +115 -113
- package/dist/healthybowl/pages/inputs-insurance/InputsInsuranceOverviewPage.js +247 -245
- package/dist/healthybowl/pages/inputs-insurance/LoanFacilitationPage.js +92 -90
- package/dist/healthybowl/pages/inputs-insurance/PolicyClaimsPage.js +74 -72
- package/dist/healthybowl/pages/irrigation/IrrigationPage.js +475 -475
- package/dist/healthybowl/pages/market/market-prices/PriceAlertRuleModal.js +68 -68
- package/dist/healthybowl/pages/marketplace/AuctionsView.js +76 -76
- package/dist/healthybowl/pages/marketplace/SharedMarketView.js +104 -104
- package/dist/healthybowl/pages/nursery/NurseryProvenancePage.js +395 -395
- package/dist/healthybowl/pages/reports-api/ReportsApiPage.js +103 -103
- package/dist/healthybowl/pages/soil/field-sensors/RegisterProbeModal.js +59 -59
- package/dist/healthybowl/pages/soil/field-sensors/ThresholdsModal.js +54 -53
- package/dist/healthybowl/pages/tasks/JobCardPage.js +18 -18
- package/dist/healthybowl/pages/traceability/PrintLabelDialog.js +91 -91
- package/dist/healthybowl/pages/traceability/QRCodesPage.js +134 -134
- package/dist/healthybowl/pages/weather/WeatherAlertRulesPage.js +266 -266
- package/dist/healthybowl/pages/weather/WeatherSettingsPage.js +239 -239
- package/dist/node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js +1068 -1068
- package/package.json +3 -3
|
@@ -11,65 +11,65 @@ import { useI18n as c } from "@burdenoff/fe-libs/shared/providers/shell/I18nProv
|
|
|
11
11
|
import { ArrowRight as l, CheckCircle2 as u, Sprout as d } from "lucide-react";
|
|
12
12
|
import { useNavigate as f } from "react-router";
|
|
13
13
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
14
|
-
import { EmphasisPanel as h, GlassCard as g } from "@burdenoff/fe-libs/ui";
|
|
14
|
+
import { EmphasisPanel as h, GlassCard as g, ThemedSelect as _ } from "@burdenoff/fe-libs/ui";
|
|
15
15
|
// src/healthybowl/pages/GettingStartedPage.tsx
|
|
16
|
-
var
|
|
16
|
+
var v = {
|
|
17
17
|
name: "",
|
|
18
18
|
owner: "",
|
|
19
19
|
location: "",
|
|
20
20
|
totalArea: 0,
|
|
21
21
|
areaUnit: "acres",
|
|
22
22
|
organicCertified: !1
|
|
23
|
-
},
|
|
24
|
-
let { t:
|
|
25
|
-
if (!
|
|
26
|
-
if (!
|
|
27
|
-
title:
|
|
28
|
-
description:
|
|
23
|
+
}, y = "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", b = () => {
|
|
24
|
+
let { t: b } = c(), { farm: x, createFarm: S, loadings: C, errors: w, refetch: T } = o(), E = f(), { buildPath: D } = a(), { toasts: O, toast: k, dismiss: A } = i(), [j, M] = s(v), [N, P] = s(!1), F = !!x?.id, I = async () => {
|
|
25
|
+
if (!C.dashboard) {
|
|
26
|
+
if (!j.name.trim() || !j.owner.trim() || !j.location.trim()) k({
|
|
27
|
+
title: b("healthybowl.gettingStarted.toast.missingDetails.title", "Missing details"),
|
|
28
|
+
description: b("healthybowl.gettingStarted.toast.missingDetails.description", "Please fill in farm name, owner, and location."),
|
|
29
29
|
variant: "warning"
|
|
30
30
|
});
|
|
31
|
-
else if (!Number.isFinite(
|
|
32
|
-
title:
|
|
33
|
-
description:
|
|
31
|
+
else if (!Number.isFinite(j.totalArea) || j.totalArea <= 0) k({
|
|
32
|
+
title: b("healthybowl.gettingStarted.toast.invalidArea.title", "Invalid area"),
|
|
33
|
+
description: b("healthybowl.gettingStarted.toast.invalidArea.description", "Total area must be greater than zero."),
|
|
34
34
|
variant: "warning"
|
|
35
35
|
});
|
|
36
36
|
else {
|
|
37
|
-
|
|
37
|
+
P(!0);
|
|
38
38
|
try {
|
|
39
|
-
await
|
|
40
|
-
name:
|
|
41
|
-
owner:
|
|
42
|
-
location:
|
|
43
|
-
totalArea:
|
|
44
|
-
areaUnit:
|
|
45
|
-
organicCertified:
|
|
46
|
-
}),
|
|
47
|
-
title:
|
|
48
|
-
description:
|
|
39
|
+
await S({
|
|
40
|
+
name: j.name.trim(),
|
|
41
|
+
owner: j.owner.trim(),
|
|
42
|
+
location: j.location.trim(),
|
|
43
|
+
totalArea: j.totalArea,
|
|
44
|
+
areaUnit: j.areaUnit,
|
|
45
|
+
organicCertified: j.organicCertified
|
|
46
|
+
}), k({
|
|
47
|
+
title: b("healthybowl.gettingStarted.toast.farmCreated.title", "Farm created"),
|
|
48
|
+
description: b("healthybowl.gettingStarted.toast.farmCreated.description", "{{name}} is ready — next, add a field.", { name: j.name }),
|
|
49
49
|
variant: "success"
|
|
50
|
-
}),
|
|
50
|
+
}), M(v);
|
|
51
51
|
} catch (e) {
|
|
52
|
-
|
|
53
|
-
title:
|
|
52
|
+
k({
|
|
53
|
+
title: b("healthybowl.gettingStarted.toast.createFarmError.title", "Could not create farm"),
|
|
54
54
|
description: e instanceof Error ? e.message : String(e),
|
|
55
55
|
variant: "error"
|
|
56
56
|
});
|
|
57
57
|
} finally {
|
|
58
|
-
|
|
58
|
+
P(!1);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
return /* @__PURE__ */ m(e, {
|
|
64
64
|
testId: "getting-started-page",
|
|
65
|
-
title:
|
|
66
|
-
titleAccent:
|
|
67
|
-
description:
|
|
65
|
+
title: b("healthybowl.gettingStarted.title", "Get Started"),
|
|
66
|
+
titleAccent: b("healthybowl.gettingStarted.titleAccent", "Started"),
|
|
67
|
+
description: b("healthybowl.gettingStarted.description", "Set up your farm to start tracking operations"),
|
|
68
68
|
purpose: "New here? This is the quickest way to get going. Create your farm, then add a field and your first crop — once that's done, the dashboard, weather, finances and the rest of HealthyBowl come to life with your own data.",
|
|
69
|
-
children: [
|
|
69
|
+
children: [C.dashboard ? /* @__PURE__ */ p(r, {}) : w.dashboard ? /* @__PURE__ */ p(t, { onRetry: T }) : /* @__PURE__ */ m("div", {
|
|
70
70
|
className: "mx-auto max-w-2xl space-y-6",
|
|
71
71
|
children: [
|
|
72
|
-
|
|
72
|
+
F && /* @__PURE__ */ m(h, {
|
|
73
73
|
className: "flex items-center gap-3",
|
|
74
74
|
children: [
|
|
75
75
|
/* @__PURE__ */ p(u, { className: "h-5 w-5 shrink-0 text-primary" }),
|
|
@@ -77,22 +77,22 @@ var _ = {
|
|
|
77
77
|
className: "flex-1",
|
|
78
78
|
children: [/* @__PURE__ */ p("p", {
|
|
79
79
|
className: "text-sm font-medium text-text-primary",
|
|
80
|
-
children:
|
|
80
|
+
children: b("healthybowl.gettingStarted.banner.ready", "Farm ready: {{name}}", { name: x.name })
|
|
81
81
|
}), /* @__PURE__ */ p("p", {
|
|
82
82
|
className: "text-xs text-text-secondary",
|
|
83
|
-
children:
|
|
83
|
+
children: b("healthybowl.gettingStarted.banner.next", "Next, add a field — or add another farm below.")
|
|
84
84
|
})]
|
|
85
85
|
}),
|
|
86
86
|
/* @__PURE__ */ m("div", {
|
|
87
87
|
className: "flex items-center gap-2",
|
|
88
88
|
children: [/* @__PURE__ */ p("button", {
|
|
89
|
-
onClick: () =>
|
|
89
|
+
onClick: () => E(D("crops/fields")),
|
|
90
90
|
className: "min-h-[44px] rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas",
|
|
91
|
-
children:
|
|
91
|
+
children: b("healthybowl.gettingStarted.banner.addField", "Add a field")
|
|
92
92
|
}), /* @__PURE__ */ p("button", {
|
|
93
|
-
onClick: () =>
|
|
93
|
+
onClick: () => E(D("")),
|
|
94
94
|
className: "min-h-[44px] rounded-md border border-border-seam px-3 py-1.5 text-sm text-text-primary transition-colors hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas",
|
|
95
|
-
children:
|
|
95
|
+
children: b("healthybowl.gettingStarted.banner.dashboard", "Dashboard")
|
|
96
96
|
})]
|
|
97
97
|
})
|
|
98
98
|
]
|
|
@@ -105,24 +105,24 @@ var _ = {
|
|
|
105
105
|
children: [
|
|
106
106
|
/* @__PURE__ */ p(d, { className: "h-4 w-4 text-primary" }),
|
|
107
107
|
" ",
|
|
108
|
-
|
|
108
|
+
b("healthybowl.gettingStarted.steps.farm", "1. Farm")
|
|
109
109
|
]
|
|
110
110
|
}),
|
|
111
111
|
/* @__PURE__ */ p(l, { className: "h-4 w-4" }),
|
|
112
|
-
/* @__PURE__ */ p("span", { children:
|
|
112
|
+
/* @__PURE__ */ p("span", { children: b("healthybowl.gettingStarted.steps.field", "2. Field") }),
|
|
113
113
|
/* @__PURE__ */ p(l, { className: "h-4 w-4" }),
|
|
114
|
-
/* @__PURE__ */ p("span", { children:
|
|
114
|
+
/* @__PURE__ */ p("span", { children: b("healthybowl.gettingStarted.steps.crop", "3. Crop") })
|
|
115
115
|
]
|
|
116
116
|
}),
|
|
117
117
|
/* @__PURE__ */ m("form", {
|
|
118
118
|
onSubmit: (e) => {
|
|
119
|
-
e.preventDefault(),
|
|
119
|
+
e.preventDefault(), I();
|
|
120
120
|
},
|
|
121
121
|
className: "space-y-4 rounded-xl border border-border-seam bg-gloss-card p-6 shadow-pop",
|
|
122
122
|
children: [
|
|
123
123
|
/* @__PURE__ */ p("h2", {
|
|
124
124
|
className: "text-lg font-semibold text-text-primary",
|
|
125
|
-
children:
|
|
125
|
+
children: b("healthybowl.gettingStarted.form.heading", "Create your farm")
|
|
126
126
|
}),
|
|
127
127
|
/* @__PURE__ */ m("div", {
|
|
128
128
|
className: "grid gap-4 sm:grid-cols-2",
|
|
@@ -131,85 +131,85 @@ var _ = {
|
|
|
131
131
|
className: "block",
|
|
132
132
|
children: [/* @__PURE__ */ p("span", {
|
|
133
133
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
134
|
-
children:
|
|
134
|
+
children: b("healthybowl.gettingStarted.form.fields.name.label", "Farm name *")
|
|
135
135
|
}), /* @__PURE__ */ p("input", {
|
|
136
|
-
value:
|
|
137
|
-
onChange: (e) =>
|
|
136
|
+
value: j.name,
|
|
137
|
+
onChange: (e) => M((t) => ({
|
|
138
138
|
...t,
|
|
139
139
|
name: e.target.value
|
|
140
140
|
})),
|
|
141
|
-
placeholder:
|
|
141
|
+
placeholder: b("healthybowl.gettingStarted.form.fields.name.placeholder", "Green Valley Organic Farm"),
|
|
142
142
|
maxLength: 200,
|
|
143
|
-
className:
|
|
143
|
+
className: y
|
|
144
144
|
})]
|
|
145
145
|
}),
|
|
146
146
|
/* @__PURE__ */ m("label", {
|
|
147
147
|
className: "block",
|
|
148
148
|
children: [/* @__PURE__ */ p("span", {
|
|
149
149
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
150
|
-
children:
|
|
150
|
+
children: b("healthybowl.gettingStarted.form.fields.owner.label", "Owner *")
|
|
151
151
|
}), /* @__PURE__ */ p("input", {
|
|
152
|
-
value:
|
|
153
|
-
onChange: (e) =>
|
|
152
|
+
value: j.owner,
|
|
153
|
+
onChange: (e) => M((t) => ({
|
|
154
154
|
...t,
|
|
155
155
|
owner: e.target.value
|
|
156
156
|
})),
|
|
157
|
-
placeholder:
|
|
157
|
+
placeholder: b("healthybowl.gettingStarted.form.fields.owner.placeholder", "Your name"),
|
|
158
158
|
maxLength: 200,
|
|
159
|
-
className:
|
|
159
|
+
className: y
|
|
160
160
|
})]
|
|
161
161
|
}),
|
|
162
162
|
/* @__PURE__ */ m("label", {
|
|
163
163
|
className: "block sm:col-span-2",
|
|
164
164
|
children: [/* @__PURE__ */ p("span", {
|
|
165
165
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
166
|
-
children:
|
|
166
|
+
children: b("healthybowl.gettingStarted.form.fields.location.label", "Location *")
|
|
167
167
|
}), /* @__PURE__ */ p("input", {
|
|
168
|
-
value:
|
|
169
|
-
onChange: (e) =>
|
|
168
|
+
value: j.location,
|
|
169
|
+
onChange: (e) => M((t) => ({
|
|
170
170
|
...t,
|
|
171
171
|
location: e.target.value
|
|
172
172
|
})),
|
|
173
|
-
placeholder:
|
|
173
|
+
placeholder: b("healthybowl.gettingStarted.form.fields.location.placeholder", "District, State"),
|
|
174
174
|
maxLength: 500,
|
|
175
|
-
className:
|
|
175
|
+
className: y
|
|
176
176
|
})]
|
|
177
177
|
}),
|
|
178
178
|
/* @__PURE__ */ m("label", {
|
|
179
179
|
className: "block",
|
|
180
180
|
children: [/* @__PURE__ */ p("span", {
|
|
181
181
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
182
|
-
children:
|
|
182
|
+
children: b("healthybowl.gettingStarted.form.fields.totalArea.label", "Total area *")
|
|
183
183
|
}), /* @__PURE__ */ p("input", {
|
|
184
184
|
type: "number",
|
|
185
185
|
min: 0,
|
|
186
|
-
value:
|
|
187
|
-
onChange: (e) =>
|
|
186
|
+
value: j.totalArea || "",
|
|
187
|
+
onChange: (e) => M((t) => ({
|
|
188
188
|
...t,
|
|
189
189
|
totalArea: Number(e.target.value)
|
|
190
190
|
})),
|
|
191
191
|
placeholder: "0",
|
|
192
|
-
className:
|
|
192
|
+
className: y
|
|
193
193
|
})]
|
|
194
194
|
}),
|
|
195
195
|
/* @__PURE__ */ m("label", {
|
|
196
196
|
className: "block",
|
|
197
197
|
children: [/* @__PURE__ */ p("span", {
|
|
198
198
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
199
|
-
children:
|
|
200
|
-
}), /* @__PURE__ */ m(
|
|
201
|
-
value:
|
|
202
|
-
onChange: (e) =>
|
|
199
|
+
children: b("healthybowl.gettingStarted.form.fields.unit.label", "Unit")
|
|
200
|
+
}), /* @__PURE__ */ m(_, {
|
|
201
|
+
value: j.areaUnit,
|
|
202
|
+
onChange: (e) => M((t) => ({
|
|
203
203
|
...t,
|
|
204
204
|
areaUnit: e.target.value
|
|
205
205
|
})),
|
|
206
|
-
className:
|
|
206
|
+
className: y,
|
|
207
207
|
children: [/* @__PURE__ */ p("option", {
|
|
208
208
|
value: "acres",
|
|
209
|
-
children:
|
|
209
|
+
children: b("healthybowl.gettingStarted.form.fields.unit.options.acres", "Acres")
|
|
210
210
|
}), /* @__PURE__ */ p("option", {
|
|
211
211
|
value: "hectares",
|
|
212
|
-
children:
|
|
212
|
+
children: b("healthybowl.gettingStarted.form.fields.unit.options.hectares", "Hectares")
|
|
213
213
|
})]
|
|
214
214
|
})]
|
|
215
215
|
}),
|
|
@@ -217,15 +217,15 @@ var _ = {
|
|
|
217
217
|
className: "flex items-center gap-2 sm:col-span-2",
|
|
218
218
|
children: [/* @__PURE__ */ p("input", {
|
|
219
219
|
type: "checkbox",
|
|
220
|
-
checked:
|
|
221
|
-
onChange: (e) =>
|
|
220
|
+
checked: j.organicCertified,
|
|
221
|
+
onChange: (e) => M((t) => ({
|
|
222
222
|
...t,
|
|
223
223
|
organicCertified: e.target.checked
|
|
224
224
|
})),
|
|
225
225
|
className: "h-4 w-4 rounded border-border-subtle text-primary focus:ring-[var(--color-focus-ring)]"
|
|
226
226
|
}), /* @__PURE__ */ p("span", {
|
|
227
227
|
className: "text-sm text-text-primary",
|
|
228
|
-
children:
|
|
228
|
+
children: b("healthybowl.gettingStarted.form.fields.organicCertified.label", "This farm is organic certified")
|
|
229
229
|
})]
|
|
230
230
|
})
|
|
231
231
|
]
|
|
@@ -234,18 +234,18 @@ var _ = {
|
|
|
234
234
|
className: "flex justify-end pt-2",
|
|
235
235
|
children: /* @__PURE__ */ m("button", {
|
|
236
236
|
type: "submit",
|
|
237
|
-
disabled:
|
|
237
|
+
disabled: N || C.dashboard,
|
|
238
238
|
className: "flex min-h-[44px] items-center gap-1.5 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas disabled:opacity-60",
|
|
239
|
-
children: [
|
|
239
|
+
children: [N ? b("healthybowl.gettingStarted.form.submit.creating", "Creating...") : C.dashboard ? b("healthybowl.common.loading", "Loading…") : b("healthybowl.gettingStarted.form.submit.create", "Create Farm"), !N && !C.dashboard && /* @__PURE__ */ p(l, { className: "h-4 w-4" })]
|
|
240
240
|
})
|
|
241
241
|
})
|
|
242
242
|
]
|
|
243
243
|
})
|
|
244
244
|
]
|
|
245
245
|
}), /* @__PURE__ */ p(n, {
|
|
246
|
-
toasts:
|
|
247
|
-
onDismiss:
|
|
246
|
+
toasts: O,
|
|
247
|
+
onDismiss: A
|
|
248
248
|
})]
|
|
249
249
|
});
|
|
250
250
|
};
|
|
251
|
-
export {
|
|
251
|
+
export { b as GettingStartedPage };
|
|
@@ -5,55 +5,55 @@ import { PRICING_MODELS as n } from "../../../utils/contracts.js";
|
|
|
5
5
|
import { useEffect as r, useRef as i, useState as a } from "react";
|
|
6
6
|
import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
7
7
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
-
import { Button as u, Input as d } from "@burdenoff/fe-libs/ui";
|
|
8
|
+
import { Button as u, Input as d, ThemedSelect as f } from "@burdenoff/fe-libs/ui";
|
|
9
9
|
// src/healthybowl/pages/contracts/contract-forms/CreateContractModal.tsx
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let { t:
|
|
13
|
-
key:
|
|
10
|
+
var p = "mb-1 block text-sm font-medium text-text-primary", m = "flex h-9 w-full rounded-md border border-border bg-bg-surface px-3 py-1 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary";
|
|
11
|
+
function h({ open: h, onClose: g, onSubmit: _ }) {
|
|
12
|
+
let { t: v } = o(), [y, b] = a(""), [x, S] = a(""), [C, w] = a(""), [T, E] = a("quintal"), [D, O] = a(""), [k, A] = a("FIXED"), [j, M] = a(""), N = i(0), P = () => ({
|
|
13
|
+
key: N.current += 1,
|
|
14
14
|
label: "",
|
|
15
15
|
requirement: ""
|
|
16
|
-
}), [
|
|
16
|
+
}), [F, I] = a(() => [P()]), [L, R] = a(""), [z, B] = a(!1), [V, H] = a(null);
|
|
17
17
|
r(() => {
|
|
18
|
-
|
|
19
|
-
}, [
|
|
20
|
-
let
|
|
18
|
+
h && (H(null), B(!1), b(""), S(""), w(""), E("quintal"), O(""), A("FIXED"), M(""), I([P()]), R(""));
|
|
19
|
+
}, [h]);
|
|
20
|
+
let U = Number(C), W = Number(D), G = y.trim() !== "" && Number.isFinite(U) && U > 0 && Number.isFinite(W) && W >= 0;
|
|
21
21
|
return /* @__PURE__ */ c(e, {
|
|
22
|
-
open:
|
|
23
|
-
onClose:
|
|
24
|
-
title:
|
|
25
|
-
description:
|
|
22
|
+
open: h,
|
|
23
|
+
onClose: g,
|
|
24
|
+
title: v("healthybowl.contracts.create.title", "New farming contract"),
|
|
25
|
+
description: v("healthybowl.contracts.create.description", "Define a forward crop programme — crop, quota and agreed price. It starts as a draft; invite farms next."),
|
|
26
26
|
size: "md",
|
|
27
27
|
footer: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(u, {
|
|
28
28
|
variant: "outline",
|
|
29
|
-
onClick:
|
|
30
|
-
disabled:
|
|
31
|
-
children:
|
|
29
|
+
onClick: g,
|
|
30
|
+
disabled: z,
|
|
31
|
+
children: v("healthybowl.common.cancel", "Cancel")
|
|
32
32
|
}), /* @__PURE__ */ c(u, {
|
|
33
33
|
onClick: async () => {
|
|
34
|
-
if (!
|
|
34
|
+
if (!G) H(v("healthybowl.contracts.create.validation", "Enter a crop, a positive quota and an agreed price."));
|
|
35
35
|
else {
|
|
36
|
-
|
|
36
|
+
B(!0), H(null);
|
|
37
37
|
try {
|
|
38
|
-
await
|
|
39
|
-
crop:
|
|
40
|
-
variety:
|
|
41
|
-
quotaQty:
|
|
42
|
-
unit:
|
|
43
|
-
agreedPrice:
|
|
44
|
-
pricingModel:
|
|
45
|
-
documentFileId:
|
|
46
|
-
qualitySpec: t(
|
|
47
|
-
}),
|
|
38
|
+
await _({
|
|
39
|
+
crop: y.trim(),
|
|
40
|
+
variety: x.trim() || null,
|
|
41
|
+
quotaQty: U,
|
|
42
|
+
unit: T.trim() || "quintal",
|
|
43
|
+
agreedPrice: W,
|
|
44
|
+
pricingModel: k,
|
|
45
|
+
documentFileId: j.trim() || null,
|
|
46
|
+
qualitySpec: t(F, L)
|
|
47
|
+
}), g();
|
|
48
48
|
} catch (e) {
|
|
49
|
-
|
|
49
|
+
H(e instanceof Error ? e.message : String(e));
|
|
50
50
|
} finally {
|
|
51
|
-
|
|
51
|
+
B(!1);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
disabled:
|
|
56
|
-
children:
|
|
55
|
+
disabled: z || !G,
|
|
56
|
+
children: z ? v("healthybowl.contracts.create.saving", "Creating…") : v("healthybowl.contracts.create.submit", "Create contract")
|
|
57
57
|
})] }),
|
|
58
58
|
children: /* @__PURE__ */ l("div", {
|
|
59
59
|
className: "space-y-4",
|
|
@@ -61,86 +61,86 @@ function m({ open: m, onClose: h, onSubmit: g }) {
|
|
|
61
61
|
/* @__PURE__ */ l("div", {
|
|
62
62
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
63
63
|
children: [/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
64
|
-
className:
|
|
64
|
+
className: p,
|
|
65
65
|
htmlFor: "ct-crop",
|
|
66
|
-
children:
|
|
66
|
+
children: v("healthybowl.contracts.create.crop", "Crop")
|
|
67
67
|
}), /* @__PURE__ */ c(d, {
|
|
68
68
|
id: "ct-crop",
|
|
69
|
-
value:
|
|
70
|
-
onChange: (e) =>
|
|
69
|
+
value: y,
|
|
70
|
+
onChange: (e) => b(e.target.value),
|
|
71
71
|
placeholder: "Maize"
|
|
72
72
|
})] }), /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
73
|
-
className:
|
|
73
|
+
className: p,
|
|
74
74
|
htmlFor: "ct-variety",
|
|
75
|
-
children:
|
|
75
|
+
children: v("healthybowl.contracts.create.variety", "Variety (optional)")
|
|
76
76
|
}), /* @__PURE__ */ c(d, {
|
|
77
77
|
id: "ct-variety",
|
|
78
|
-
value:
|
|
79
|
-
onChange: (e) =>
|
|
78
|
+
value: x,
|
|
79
|
+
onChange: (e) => S(e.target.value)
|
|
80
80
|
})] })]
|
|
81
81
|
}),
|
|
82
82
|
/* @__PURE__ */ l("div", {
|
|
83
83
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
|
|
84
84
|
children: [
|
|
85
85
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
86
|
-
className:
|
|
86
|
+
className: p,
|
|
87
87
|
htmlFor: "ct-quota",
|
|
88
|
-
children:
|
|
88
|
+
children: v("healthybowl.contracts.create.quota", "Quota qty")
|
|
89
89
|
}), /* @__PURE__ */ c(d, {
|
|
90
90
|
id: "ct-quota",
|
|
91
91
|
type: "number",
|
|
92
92
|
min: 0,
|
|
93
|
-
value:
|
|
94
|
-
onChange: (e) =>
|
|
93
|
+
value: C,
|
|
94
|
+
onChange: (e) => w(e.target.value),
|
|
95
95
|
placeholder: "400"
|
|
96
96
|
})] }),
|
|
97
97
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
98
|
-
className:
|
|
98
|
+
className: p,
|
|
99
99
|
htmlFor: "ct-unit",
|
|
100
|
-
children:
|
|
100
|
+
children: v("healthybowl.contracts.create.unit", "Unit")
|
|
101
101
|
}), /* @__PURE__ */ c(d, {
|
|
102
102
|
id: "ct-unit",
|
|
103
|
-
value:
|
|
104
|
-
onChange: (e) =>
|
|
103
|
+
value: T,
|
|
104
|
+
onChange: (e) => E(e.target.value),
|
|
105
105
|
placeholder: "quintal"
|
|
106
106
|
})] }),
|
|
107
107
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
108
|
-
className:
|
|
108
|
+
className: p,
|
|
109
109
|
htmlFor: "ct-price",
|
|
110
|
-
children:
|
|
110
|
+
children: v("healthybowl.contracts.create.price", "Agreed price (₹/unit)")
|
|
111
111
|
}), /* @__PURE__ */ c(d, {
|
|
112
112
|
id: "ct-price",
|
|
113
113
|
type: "number",
|
|
114
114
|
min: 0,
|
|
115
|
-
value:
|
|
116
|
-
onChange: (e) =>
|
|
115
|
+
value: D,
|
|
116
|
+
onChange: (e) => O(e.target.value),
|
|
117
117
|
placeholder: "2150"
|
|
118
118
|
})] })
|
|
119
119
|
]
|
|
120
120
|
}),
|
|
121
121
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
122
|
-
className:
|
|
122
|
+
className: p,
|
|
123
123
|
htmlFor: "ct-pricing",
|
|
124
|
-
children:
|
|
125
|
-
}), /* @__PURE__ */ c(
|
|
124
|
+
children: v("healthybowl.contracts.create.pricingModel", "Pricing model")
|
|
125
|
+
}), /* @__PURE__ */ c(f, {
|
|
126
126
|
id: "ct-pricing",
|
|
127
|
-
className:
|
|
128
|
-
value:
|
|
129
|
-
onChange: (e) =>
|
|
127
|
+
className: m,
|
|
128
|
+
value: k,
|
|
129
|
+
onChange: (e) => A(e.target.value),
|
|
130
130
|
children: n.map((e) => /* @__PURE__ */ c("option", {
|
|
131
131
|
value: e.value,
|
|
132
132
|
children: e.label
|
|
133
133
|
}, e.value))
|
|
134
134
|
})] }),
|
|
135
135
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
136
|
-
className:
|
|
136
|
+
className: p,
|
|
137
137
|
htmlFor: "ct-doc",
|
|
138
|
-
children:
|
|
138
|
+
children: v("healthybowl.contracts.create.document", "Signed contract file id (optional)")
|
|
139
139
|
}), /* @__PURE__ */ c(d, {
|
|
140
140
|
id: "ct-doc",
|
|
141
|
-
value:
|
|
142
|
-
onChange: (e) =>
|
|
143
|
-
placeholder:
|
|
141
|
+
value: j,
|
|
142
|
+
onChange: (e) => M(e.target.value),
|
|
143
|
+
placeholder: v("healthybowl.contracts.create.documentPlaceholder", "files-svc file id")
|
|
144
144
|
})] }),
|
|
145
145
|
/* @__PURE__ */ l("div", {
|
|
146
146
|
className: "rounded-lg border border-border-subtle p-3",
|
|
@@ -148,49 +148,49 @@ function m({ open: m, onClose: h, onSubmit: g }) {
|
|
|
148
148
|
/* @__PURE__ */ l("div", {
|
|
149
149
|
className: "mb-1 flex items-center justify-between",
|
|
150
150
|
children: [/* @__PURE__ */ c("span", {
|
|
151
|
-
className:
|
|
152
|
-
children:
|
|
151
|
+
className: p,
|
|
152
|
+
children: v("healthybowl.contracts.create.quality", "Quality standard (optional)")
|
|
153
153
|
}), /* @__PURE__ */ c(u, {
|
|
154
154
|
type: "button",
|
|
155
155
|
size: "sm",
|
|
156
156
|
variant: "ghost",
|
|
157
|
-
onClick: () =>
|
|
158
|
-
children:
|
|
157
|
+
onClick: () => I((e) => [...e, P()]),
|
|
158
|
+
children: v("healthybowl.contracts.create.quality.add", "Add criterion")
|
|
159
159
|
})]
|
|
160
160
|
}),
|
|
161
161
|
/* @__PURE__ */ c("p", {
|
|
162
162
|
className: "mb-2 text-xs text-text-secondary",
|
|
163
|
-
children:
|
|
163
|
+
children: v("healthybowl.contracts.create.quality.help", "What the produce must meet. Agreed now, shown to the grader at delivery, and recorded on the result — so an accept or reject can be explained.")
|
|
164
164
|
}),
|
|
165
165
|
/* @__PURE__ */ c("div", {
|
|
166
166
|
className: "space-y-2",
|
|
167
|
-
children:
|
|
167
|
+
children: F.map((e, t) => /* @__PURE__ */ l("div", {
|
|
168
168
|
className: "flex items-center gap-2",
|
|
169
169
|
children: [
|
|
170
170
|
/* @__PURE__ */ c(d, {
|
|
171
171
|
"aria-label": `Criterion ${t + 1} name`,
|
|
172
172
|
value: e.label,
|
|
173
|
-
onChange: (e) =>
|
|
173
|
+
onChange: (e) => I((n) => n.map((n, r) => r === t ? {
|
|
174
174
|
...n,
|
|
175
175
|
label: e.target.value
|
|
176
176
|
} : n)),
|
|
177
|
-
placeholder:
|
|
177
|
+
placeholder: v("healthybowl.contracts.create.quality.label", "Moisture")
|
|
178
178
|
}),
|
|
179
179
|
/* @__PURE__ */ c(d, {
|
|
180
180
|
"aria-label": `Criterion ${t + 1} requirement`,
|
|
181
181
|
value: e.requirement,
|
|
182
|
-
onChange: (e) =>
|
|
182
|
+
onChange: (e) => I((n) => n.map((n, r) => r === t ? {
|
|
183
183
|
...n,
|
|
184
184
|
requirement: e.target.value
|
|
185
185
|
} : n)),
|
|
186
|
-
placeholder:
|
|
186
|
+
placeholder: v("healthybowl.contracts.create.quality.requirement", "max 12%")
|
|
187
187
|
}),
|
|
188
188
|
/* @__PURE__ */ c(u, {
|
|
189
189
|
type: "button",
|
|
190
190
|
size: "sm",
|
|
191
191
|
variant: "ghost",
|
|
192
192
|
"aria-label": `Remove criterion ${t + 1}`,
|
|
193
|
-
onClick: () =>
|
|
193
|
+
onClick: () => I((e) => e.filter((e, n) => n !== t)),
|
|
194
194
|
children: "×"
|
|
195
195
|
})
|
|
196
196
|
]
|
|
@@ -199,18 +199,18 @@ function m({ open: m, onClose: h, onSubmit: g }) {
|
|
|
199
199
|
/* @__PURE__ */ c(d, {
|
|
200
200
|
className: "mt-2",
|
|
201
201
|
"aria-label": "Quality notes",
|
|
202
|
-
value:
|
|
203
|
-
onChange: (e) =>
|
|
204
|
-
placeholder:
|
|
202
|
+
value: L,
|
|
203
|
+
onChange: (e) => R(e.target.value),
|
|
204
|
+
placeholder: v("healthybowl.contracts.create.quality.notes", "How and when it is sampled (optional)")
|
|
205
205
|
})
|
|
206
206
|
]
|
|
207
207
|
}),
|
|
208
|
-
|
|
208
|
+
V ? /* @__PURE__ */ c("div", {
|
|
209
209
|
className: "rounded-md border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
210
|
-
children:
|
|
210
|
+
children: V
|
|
211
211
|
}) : null
|
|
212
212
|
]
|
|
213
213
|
})
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
-
export {
|
|
216
|
+
export { h as CreateContractModal };
|