@deepintel-ltd/farmpro-contracts 1.12.0 → 1.14.0
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/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/routes/market-intelligence.routes.d.ts +1052 -1
- package/dist/routes/market-intelligence.routes.d.ts.map +1 -1
- package/dist/routes/market-intelligence.routes.js +97 -1
- package/dist/routes/yield-prediction.routes.d.ts +133 -0
- package/dist/routes/yield-prediction.routes.d.ts.map +1 -1
- package/dist/schemas/yield-prediction.schemas.d.ts +123 -0
- package/dist/schemas/yield-prediction.schemas.d.ts.map +1 -1
- package/dist/schemas/yield-prediction.schemas.js +20 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"market-intelligence.routes.d.ts","sourceRoot":"","sources":["../../src/routes/market-intelligence.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"market-intelligence.routes.d.ts","sourceRoot":"","sources":["../../src/routes/market-intelligence.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,QAAA,MAAM,yBAAyB;;;;;;;;;;IAU7B;;;OAGG;;;IAGH,gEAAgE;;IAEhE,qFAAqF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAErF,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAZ3C;;;WAGG;;;QAGH,gEAAgE;;QAEhE,qFAAqF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBrF,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+GrF,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,OAAO,wBAAwB,CAAC;AACvE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -7,6 +7,35 @@ const marketProjectionSchema = z.object({
|
|
|
7
7
|
outlook: z.string(),
|
|
8
8
|
details: z.string(),
|
|
9
9
|
});
|
|
10
|
+
const priceSourceSchema = z.enum([
|
|
11
|
+
'farm_recent',
|
|
12
|
+
'farm',
|
|
13
|
+
'farm_report',
|
|
14
|
+
'platform',
|
|
15
|
+
'public',
|
|
16
|
+
'none',
|
|
17
|
+
]);
|
|
18
|
+
const cropPriceProjectionSchema = z.object({
|
|
19
|
+
crop: z.string(),
|
|
20
|
+
unit: z.string(),
|
|
21
|
+
currency: z.string(),
|
|
22
|
+
farmAveragePrice: z.number().nullable(),
|
|
23
|
+
farmRecentAveragePrice: z.number().nullable(),
|
|
24
|
+
farmSaleCount: z.number().int().nonnegative(),
|
|
25
|
+
farmLastSaleDate: z.string().datetime().nullable(),
|
|
26
|
+
platformAveragePrice: z.number().nullable(),
|
|
27
|
+
platformFarmCount: z.number().int().nonnegative(),
|
|
28
|
+
/**
|
|
29
|
+
* Best estimate for planning:
|
|
30
|
+
* farm recent → farm all-time → farm report → platform (sales + corroborated reports) → public
|
|
31
|
+
*/
|
|
32
|
+
projectedPrice: z.number().nullable(),
|
|
33
|
+
source: priceSourceSchema,
|
|
34
|
+
/** Farm avg vs platform avg (%); null if either side missing */
|
|
35
|
+
vsPlatformPercent: z.number().nullable(),
|
|
36
|
+
/** Sum of field area (ha) for this crop on the farm; null if unknown / sales-only */
|
|
37
|
+
areaHa: z.number().nullable().optional(),
|
|
38
|
+
});
|
|
10
39
|
export const marketIntelligenceOverviewSchema = z.object({
|
|
11
40
|
farmId: z.string().uuid(),
|
|
12
41
|
domesticSummary: z
|
|
@@ -24,9 +53,42 @@ export const marketIntelligenceOverviewSchema = z.object({
|
|
|
24
53
|
})
|
|
25
54
|
.nullable(),
|
|
26
55
|
projections: z.array(marketProjectionSchema),
|
|
56
|
+
priceProjections: z.array(cropPriceProjectionSchema),
|
|
27
57
|
eudrAlertTitle: z.string().nullable(),
|
|
28
58
|
updatedAt: z.string().datetime(),
|
|
29
59
|
});
|
|
60
|
+
export const createMarketPriceReportSchema = z.object({
|
|
61
|
+
crop: z.string().min(1).max(100),
|
|
62
|
+
pricePerUnit: z.number().positive().max(10_000_000),
|
|
63
|
+
unit: z
|
|
64
|
+
.string()
|
|
65
|
+
.min(1)
|
|
66
|
+
.max(50)
|
|
67
|
+
.optional()
|
|
68
|
+
.transform((u) => {
|
|
69
|
+
const raw = (u || 'kg').trim().toLowerCase();
|
|
70
|
+
if (!raw)
|
|
71
|
+
return 'kg';
|
|
72
|
+
if (raw === 'kilogram' || raw === 'kilograms')
|
|
73
|
+
return 'kg';
|
|
74
|
+
return raw;
|
|
75
|
+
}),
|
|
76
|
+
currency: z.enum(['NGN', 'USD']).optional(),
|
|
77
|
+
observedAt: z.string().datetime().optional(),
|
|
78
|
+
marketLabel: z.string().max(80).optional().nullable(),
|
|
79
|
+
});
|
|
80
|
+
export const marketPriceReportSchema = z.object({
|
|
81
|
+
id: z.string().uuid(),
|
|
82
|
+
farmId: z.string().uuid(),
|
|
83
|
+
crop: z.string(),
|
|
84
|
+
cropKey: z.string(),
|
|
85
|
+
pricePerUnit: z.number(),
|
|
86
|
+
unit: z.string(),
|
|
87
|
+
currency: z.string(),
|
|
88
|
+
observedAt: z.string().datetime(),
|
|
89
|
+
marketLabel: z.string().nullable(),
|
|
90
|
+
createdAt: z.string().datetime(),
|
|
91
|
+
});
|
|
30
92
|
export const marketIntelligenceRouter = c.router({
|
|
31
93
|
getOverview: {
|
|
32
94
|
method: 'GET',
|
|
@@ -40,6 +102,40 @@ export const marketIntelligenceRouter = c.router({
|
|
|
40
102
|
404: jsonApiErrorResponseSchema,
|
|
41
103
|
},
|
|
42
104
|
summary: 'Farm market intelligence overview',
|
|
43
|
-
description: 'National market summaries
|
|
105
|
+
description: 'National market summaries plus crop price projections: farm sales, farm reports, platform knowledge, then public reference',
|
|
106
|
+
},
|
|
107
|
+
createPriceReport: {
|
|
108
|
+
method: 'POST',
|
|
109
|
+
path: '/farms/:farmId/market-intelligence/price-reports',
|
|
110
|
+
pathParams: z.object({
|
|
111
|
+
farmId: z.string().uuid(),
|
|
112
|
+
}),
|
|
113
|
+
body: createMarketPriceReportSchema,
|
|
114
|
+
responses: {
|
|
115
|
+
201: marketPriceReportSchema,
|
|
116
|
+
400: jsonApiErrorResponseSchema,
|
|
117
|
+
401: jsonApiErrorResponseSchema,
|
|
118
|
+
403: jsonApiErrorResponseSchema,
|
|
119
|
+
404: jsonApiErrorResponseSchema,
|
|
120
|
+
},
|
|
121
|
+
summary: 'Submit a market price report',
|
|
122
|
+
description: 'Record an overheard / local market price. Trusted immediately for this farm; shared only after corroboration.',
|
|
123
|
+
},
|
|
124
|
+
listPriceReports: {
|
|
125
|
+
method: 'GET',
|
|
126
|
+
path: '/farms/:farmId/market-intelligence/price-reports',
|
|
127
|
+
pathParams: z.object({
|
|
128
|
+
farmId: z.string().uuid(),
|
|
129
|
+
}),
|
|
130
|
+
query: z.object({
|
|
131
|
+
days: z.coerce.number().int().min(1).max(365).optional().default(90),
|
|
132
|
+
}),
|
|
133
|
+
responses: {
|
|
134
|
+
200: z.object({ data: z.array(marketPriceReportSchema) }),
|
|
135
|
+
401: jsonApiErrorResponseSchema,
|
|
136
|
+
403: jsonApiErrorResponseSchema,
|
|
137
|
+
404: jsonApiErrorResponseSchema,
|
|
138
|
+
},
|
|
139
|
+
summary: 'List recent market price reports for a farm',
|
|
44
140
|
},
|
|
45
141
|
});
|
|
@@ -945,6 +945,49 @@ export declare const yieldPredictionRouter: {
|
|
|
945
945
|
confidenceScore: number;
|
|
946
946
|
daysToHarvest: number | null;
|
|
947
947
|
}>, "many">;
|
|
948
|
+
cashCropStands: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
949
|
+
fieldId: z.ZodString;
|
|
950
|
+
fieldName: z.ZodString;
|
|
951
|
+
cropType: z.ZodString;
|
|
952
|
+
fieldArea: z.ZodNumber;
|
|
953
|
+
plantingDate: z.ZodNullable<z.ZodString>;
|
|
954
|
+
yearsToFirstHarvest: z.ZodNumber;
|
|
955
|
+
ageYears: z.ZodNullable<z.ZodNumber>;
|
|
956
|
+
yearsRemaining: z.ZodNullable<z.ZodNumber>;
|
|
957
|
+
stage: z.ZodEnum<["establishing", "bearing", "unknown_age"]>;
|
|
958
|
+
planningYieldPerHa: z.ZodNullable<z.ZodNumber>;
|
|
959
|
+
planningTotalYield: z.ZodNullable<z.ZodNumber>;
|
|
960
|
+
unit: z.ZodString;
|
|
961
|
+
includedInSeasonRevenue: z.ZodBoolean;
|
|
962
|
+
}, "strip", z.ZodTypeAny, {
|
|
963
|
+
plantingDate: string | null;
|
|
964
|
+
fieldId: string;
|
|
965
|
+
fieldName: string;
|
|
966
|
+
unit: string;
|
|
967
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
968
|
+
cropType: string;
|
|
969
|
+
fieldArea: number;
|
|
970
|
+
yearsToFirstHarvest: number;
|
|
971
|
+
ageYears: number | null;
|
|
972
|
+
yearsRemaining: number | null;
|
|
973
|
+
planningYieldPerHa: number | null;
|
|
974
|
+
planningTotalYield: number | null;
|
|
975
|
+
includedInSeasonRevenue: boolean;
|
|
976
|
+
}, {
|
|
977
|
+
plantingDate: string | null;
|
|
978
|
+
fieldId: string;
|
|
979
|
+
fieldName: string;
|
|
980
|
+
unit: string;
|
|
981
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
982
|
+
cropType: string;
|
|
983
|
+
fieldArea: number;
|
|
984
|
+
yearsToFirstHarvest: number;
|
|
985
|
+
ageYears: number | null;
|
|
986
|
+
yearsRemaining: number | null;
|
|
987
|
+
planningYieldPerHa: number | null;
|
|
988
|
+
planningTotalYield: number | null;
|
|
989
|
+
includedInSeasonRevenue: boolean;
|
|
990
|
+
}>, "many">>;
|
|
948
991
|
overallMetrics: z.ZodObject<{
|
|
949
992
|
totalArea: z.ZodNumber;
|
|
950
993
|
averageConfidence: z.ZodNumber;
|
|
@@ -994,6 +1037,21 @@ export declare const yieldPredictionRouter: {
|
|
|
994
1037
|
confidenceScore: number;
|
|
995
1038
|
daysToHarvest: number | null;
|
|
996
1039
|
}[];
|
|
1040
|
+
cashCropStands: {
|
|
1041
|
+
plantingDate: string | null;
|
|
1042
|
+
fieldId: string;
|
|
1043
|
+
fieldName: string;
|
|
1044
|
+
unit: string;
|
|
1045
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
1046
|
+
cropType: string;
|
|
1047
|
+
fieldArea: number;
|
|
1048
|
+
yearsToFirstHarvest: number;
|
|
1049
|
+
ageYears: number | null;
|
|
1050
|
+
yearsRemaining: number | null;
|
|
1051
|
+
planningYieldPerHa: number | null;
|
|
1052
|
+
planningTotalYield: number | null;
|
|
1053
|
+
includedInSeasonRevenue: boolean;
|
|
1054
|
+
}[];
|
|
997
1055
|
overallMetrics: {
|
|
998
1056
|
totalArea: number;
|
|
999
1057
|
averageConfidence: number;
|
|
@@ -1039,6 +1097,21 @@ export declare const yieldPredictionRouter: {
|
|
|
1039
1097
|
averageConfidence: number;
|
|
1040
1098
|
overallHealthStatus: "critical" | "poor" | "fair" | "good" | "excellent";
|
|
1041
1099
|
};
|
|
1100
|
+
cashCropStands?: {
|
|
1101
|
+
plantingDate: string | null;
|
|
1102
|
+
fieldId: string;
|
|
1103
|
+
fieldName: string;
|
|
1104
|
+
unit: string;
|
|
1105
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
1106
|
+
cropType: string;
|
|
1107
|
+
fieldArea: number;
|
|
1108
|
+
yearsToFirstHarvest: number;
|
|
1109
|
+
ageYears: number | null;
|
|
1110
|
+
yearsRemaining: number | null;
|
|
1111
|
+
planningYieldPerHa: number | null;
|
|
1112
|
+
planningTotalYield: number | null;
|
|
1113
|
+
includedInSeasonRevenue: boolean;
|
|
1114
|
+
}[] | undefined;
|
|
1042
1115
|
}>;
|
|
1043
1116
|
}, "strip", z.ZodTypeAny, {
|
|
1044
1117
|
type: "farm-yield-summaries";
|
|
@@ -1078,6 +1151,21 @@ export declare const yieldPredictionRouter: {
|
|
|
1078
1151
|
confidenceScore: number;
|
|
1079
1152
|
daysToHarvest: number | null;
|
|
1080
1153
|
}[];
|
|
1154
|
+
cashCropStands: {
|
|
1155
|
+
plantingDate: string | null;
|
|
1156
|
+
fieldId: string;
|
|
1157
|
+
fieldName: string;
|
|
1158
|
+
unit: string;
|
|
1159
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
1160
|
+
cropType: string;
|
|
1161
|
+
fieldArea: number;
|
|
1162
|
+
yearsToFirstHarvest: number;
|
|
1163
|
+
ageYears: number | null;
|
|
1164
|
+
yearsRemaining: number | null;
|
|
1165
|
+
planningYieldPerHa: number | null;
|
|
1166
|
+
planningTotalYield: number | null;
|
|
1167
|
+
includedInSeasonRevenue: boolean;
|
|
1168
|
+
}[];
|
|
1081
1169
|
overallMetrics: {
|
|
1082
1170
|
totalArea: number;
|
|
1083
1171
|
averageConfidence: number;
|
|
@@ -1127,6 +1215,21 @@ export declare const yieldPredictionRouter: {
|
|
|
1127
1215
|
averageConfidence: number;
|
|
1128
1216
|
overallHealthStatus: "critical" | "poor" | "fair" | "good" | "excellent";
|
|
1129
1217
|
};
|
|
1218
|
+
cashCropStands?: {
|
|
1219
|
+
plantingDate: string | null;
|
|
1220
|
+
fieldId: string;
|
|
1221
|
+
fieldName: string;
|
|
1222
|
+
unit: string;
|
|
1223
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
1224
|
+
cropType: string;
|
|
1225
|
+
fieldArea: number;
|
|
1226
|
+
yearsToFirstHarvest: number;
|
|
1227
|
+
ageYears: number | null;
|
|
1228
|
+
yearsRemaining: number | null;
|
|
1229
|
+
planningYieldPerHa: number | null;
|
|
1230
|
+
planningTotalYield: number | null;
|
|
1231
|
+
includedInSeasonRevenue: boolean;
|
|
1232
|
+
}[] | undefined;
|
|
1130
1233
|
};
|
|
1131
1234
|
}>;
|
|
1132
1235
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1168,6 +1271,21 @@ export declare const yieldPredictionRouter: {
|
|
|
1168
1271
|
confidenceScore: number;
|
|
1169
1272
|
daysToHarvest: number | null;
|
|
1170
1273
|
}[];
|
|
1274
|
+
cashCropStands: {
|
|
1275
|
+
plantingDate: string | null;
|
|
1276
|
+
fieldId: string;
|
|
1277
|
+
fieldName: string;
|
|
1278
|
+
unit: string;
|
|
1279
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
1280
|
+
cropType: string;
|
|
1281
|
+
fieldArea: number;
|
|
1282
|
+
yearsToFirstHarvest: number;
|
|
1283
|
+
ageYears: number | null;
|
|
1284
|
+
yearsRemaining: number | null;
|
|
1285
|
+
planningYieldPerHa: number | null;
|
|
1286
|
+
planningTotalYield: number | null;
|
|
1287
|
+
includedInSeasonRevenue: boolean;
|
|
1288
|
+
}[];
|
|
1171
1289
|
overallMetrics: {
|
|
1172
1290
|
totalArea: number;
|
|
1173
1291
|
averageConfidence: number;
|
|
@@ -1219,6 +1337,21 @@ export declare const yieldPredictionRouter: {
|
|
|
1219
1337
|
averageConfidence: number;
|
|
1220
1338
|
overallHealthStatus: "critical" | "poor" | "fair" | "good" | "excellent";
|
|
1221
1339
|
};
|
|
1340
|
+
cashCropStands?: {
|
|
1341
|
+
plantingDate: string | null;
|
|
1342
|
+
fieldId: string;
|
|
1343
|
+
fieldName: string;
|
|
1344
|
+
unit: string;
|
|
1345
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
1346
|
+
cropType: string;
|
|
1347
|
+
fieldArea: number;
|
|
1348
|
+
yearsToFirstHarvest: number;
|
|
1349
|
+
ageYears: number | null;
|
|
1350
|
+
yearsRemaining: number | null;
|
|
1351
|
+
planningYieldPerHa: number | null;
|
|
1352
|
+
planningTotalYield: number | null;
|
|
1353
|
+
includedInSeasonRevenue: boolean;
|
|
1354
|
+
}[] | undefined;
|
|
1222
1355
|
};
|
|
1223
1356
|
};
|
|
1224
1357
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yield-prediction.routes.d.ts","sourceRoot":"","sources":["../../src/routes/yield-prediction.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"yield-prediction.routes.d.ts","sourceRoot":"","sources":["../../src/routes/yield-prediction.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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}
|
|
@@ -622,6 +622,52 @@ export declare const fieldYieldSummarySchema: z.ZodObject<{
|
|
|
622
622
|
confidenceScore: number;
|
|
623
623
|
daysToHarvest: number | null;
|
|
624
624
|
}>;
|
|
625
|
+
/** Multi-year / tree cash-crop stand for Market Watch orchard ledger (not season hero). */
|
|
626
|
+
export declare const cashCropStandSchema: z.ZodObject<{
|
|
627
|
+
fieldId: z.ZodString;
|
|
628
|
+
fieldName: z.ZodString;
|
|
629
|
+
cropType: z.ZodString;
|
|
630
|
+
fieldArea: z.ZodNumber;
|
|
631
|
+
plantingDate: z.ZodNullable<z.ZodString>;
|
|
632
|
+
yearsToFirstHarvest: z.ZodNumber;
|
|
633
|
+
ageYears: z.ZodNullable<z.ZodNumber>;
|
|
634
|
+
yearsRemaining: z.ZodNullable<z.ZodNumber>;
|
|
635
|
+
stage: z.ZodEnum<["establishing", "bearing", "unknown_age"]>;
|
|
636
|
+
/** Cold-start or harvest-calibrated kg/ha when bearing and catalog/history exists. */
|
|
637
|
+
planningYieldPerHa: z.ZodNullable<z.ZodNumber>;
|
|
638
|
+
planningTotalYield: z.ZodNullable<z.ZodNumber>;
|
|
639
|
+
unit: z.ZodString;
|
|
640
|
+
/** True when this stand also contributes to this-season field/crop summaries. */
|
|
641
|
+
includedInSeasonRevenue: z.ZodBoolean;
|
|
642
|
+
}, "strip", z.ZodTypeAny, {
|
|
643
|
+
plantingDate: string | null;
|
|
644
|
+
fieldId: string;
|
|
645
|
+
fieldName: string;
|
|
646
|
+
unit: string;
|
|
647
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
648
|
+
cropType: string;
|
|
649
|
+
fieldArea: number;
|
|
650
|
+
yearsToFirstHarvest: number;
|
|
651
|
+
ageYears: number | null;
|
|
652
|
+
yearsRemaining: number | null;
|
|
653
|
+
planningYieldPerHa: number | null;
|
|
654
|
+
planningTotalYield: number | null;
|
|
655
|
+
includedInSeasonRevenue: boolean;
|
|
656
|
+
}, {
|
|
657
|
+
plantingDate: string | null;
|
|
658
|
+
fieldId: string;
|
|
659
|
+
fieldName: string;
|
|
660
|
+
unit: string;
|
|
661
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
662
|
+
cropType: string;
|
|
663
|
+
fieldArea: number;
|
|
664
|
+
yearsToFirstHarvest: number;
|
|
665
|
+
ageYears: number | null;
|
|
666
|
+
yearsRemaining: number | null;
|
|
667
|
+
planningYieldPerHa: number | null;
|
|
668
|
+
planningTotalYield: number | null;
|
|
669
|
+
includedInSeasonRevenue: boolean;
|
|
670
|
+
}>;
|
|
625
671
|
export declare const farmYieldSummarySchema: z.ZodObject<{
|
|
626
672
|
farmId: z.ZodString;
|
|
627
673
|
farmName: z.ZodString;
|
|
@@ -722,6 +768,52 @@ export declare const farmYieldSummarySchema: z.ZodObject<{
|
|
|
722
768
|
confidenceScore: number;
|
|
723
769
|
daysToHarvest: number | null;
|
|
724
770
|
}>, "many">;
|
|
771
|
+
/** Tree / perennial stands (cashew, cocoa, …) — always listed when planted. */
|
|
772
|
+
cashCropStands: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
773
|
+
fieldId: z.ZodString;
|
|
774
|
+
fieldName: z.ZodString;
|
|
775
|
+
cropType: z.ZodString;
|
|
776
|
+
fieldArea: z.ZodNumber;
|
|
777
|
+
plantingDate: z.ZodNullable<z.ZodString>;
|
|
778
|
+
yearsToFirstHarvest: z.ZodNumber;
|
|
779
|
+
ageYears: z.ZodNullable<z.ZodNumber>;
|
|
780
|
+
yearsRemaining: z.ZodNullable<z.ZodNumber>;
|
|
781
|
+
stage: z.ZodEnum<["establishing", "bearing", "unknown_age"]>;
|
|
782
|
+
/** Cold-start or harvest-calibrated kg/ha when bearing and catalog/history exists. */
|
|
783
|
+
planningYieldPerHa: z.ZodNullable<z.ZodNumber>;
|
|
784
|
+
planningTotalYield: z.ZodNullable<z.ZodNumber>;
|
|
785
|
+
unit: z.ZodString;
|
|
786
|
+
/** True when this stand also contributes to this-season field/crop summaries. */
|
|
787
|
+
includedInSeasonRevenue: z.ZodBoolean;
|
|
788
|
+
}, "strip", z.ZodTypeAny, {
|
|
789
|
+
plantingDate: string | null;
|
|
790
|
+
fieldId: string;
|
|
791
|
+
fieldName: string;
|
|
792
|
+
unit: string;
|
|
793
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
794
|
+
cropType: string;
|
|
795
|
+
fieldArea: number;
|
|
796
|
+
yearsToFirstHarvest: number;
|
|
797
|
+
ageYears: number | null;
|
|
798
|
+
yearsRemaining: number | null;
|
|
799
|
+
planningYieldPerHa: number | null;
|
|
800
|
+
planningTotalYield: number | null;
|
|
801
|
+
includedInSeasonRevenue: boolean;
|
|
802
|
+
}, {
|
|
803
|
+
plantingDate: string | null;
|
|
804
|
+
fieldId: string;
|
|
805
|
+
fieldName: string;
|
|
806
|
+
unit: string;
|
|
807
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
808
|
+
cropType: string;
|
|
809
|
+
fieldArea: number;
|
|
810
|
+
yearsToFirstHarvest: number;
|
|
811
|
+
ageYears: number | null;
|
|
812
|
+
yearsRemaining: number | null;
|
|
813
|
+
planningYieldPerHa: number | null;
|
|
814
|
+
planningTotalYield: number | null;
|
|
815
|
+
includedInSeasonRevenue: boolean;
|
|
816
|
+
}>, "many">>;
|
|
725
817
|
overallMetrics: z.ZodObject<{
|
|
726
818
|
totalArea: z.ZodNumber;
|
|
727
819
|
averageConfidence: z.ZodNumber;
|
|
@@ -771,6 +863,21 @@ export declare const farmYieldSummarySchema: z.ZodObject<{
|
|
|
771
863
|
confidenceScore: number;
|
|
772
864
|
daysToHarvest: number | null;
|
|
773
865
|
}[];
|
|
866
|
+
cashCropStands: {
|
|
867
|
+
plantingDate: string | null;
|
|
868
|
+
fieldId: string;
|
|
869
|
+
fieldName: string;
|
|
870
|
+
unit: string;
|
|
871
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
872
|
+
cropType: string;
|
|
873
|
+
fieldArea: number;
|
|
874
|
+
yearsToFirstHarvest: number;
|
|
875
|
+
ageYears: number | null;
|
|
876
|
+
yearsRemaining: number | null;
|
|
877
|
+
planningYieldPerHa: number | null;
|
|
878
|
+
planningTotalYield: number | null;
|
|
879
|
+
includedInSeasonRevenue: boolean;
|
|
880
|
+
}[];
|
|
774
881
|
overallMetrics: {
|
|
775
882
|
totalArea: number;
|
|
776
883
|
averageConfidence: number;
|
|
@@ -816,6 +923,21 @@ export declare const farmYieldSummarySchema: z.ZodObject<{
|
|
|
816
923
|
averageConfidence: number;
|
|
817
924
|
overallHealthStatus: "critical" | "poor" | "fair" | "good" | "excellent";
|
|
818
925
|
};
|
|
926
|
+
cashCropStands?: {
|
|
927
|
+
plantingDate: string | null;
|
|
928
|
+
fieldId: string;
|
|
929
|
+
fieldName: string;
|
|
930
|
+
unit: string;
|
|
931
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
932
|
+
cropType: string;
|
|
933
|
+
fieldArea: number;
|
|
934
|
+
yearsToFirstHarvest: number;
|
|
935
|
+
ageYears: number | null;
|
|
936
|
+
yearsRemaining: number | null;
|
|
937
|
+
planningYieldPerHa: number | null;
|
|
938
|
+
planningTotalYield: number | null;
|
|
939
|
+
includedInSeasonRevenue: boolean;
|
|
940
|
+
}[] | undefined;
|
|
819
941
|
}>;
|
|
820
942
|
export declare const yieldPredictionQuerySchema: z.ZodObject<{
|
|
821
943
|
historicalYears: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -864,6 +986,7 @@ export type PredictionFactor = z.infer<typeof predictionFactorSchema>;
|
|
|
864
986
|
export type YieldRecommendation = z.infer<typeof yieldRecommendationSchema>;
|
|
865
987
|
export type YieldPrediction = z.infer<typeof yieldPredictionSchema>;
|
|
866
988
|
export type FieldYieldSummary = z.infer<typeof fieldYieldSummarySchema>;
|
|
989
|
+
export type CashCropStand = z.infer<typeof cashCropStandSchema>;
|
|
867
990
|
export type FarmYieldSummary = z.infer<typeof farmYieldSummarySchema>;
|
|
868
991
|
export type YieldPredictionQuery = z.infer<typeof yieldPredictionQuerySchema>;
|
|
869
992
|
export type FarmYieldQuery = z.infer<typeof farmYieldQuerySchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yield-prediction.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/yield-prediction.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,8BAA8B,mDAAiD,CAAC;AAC7F,eAAO,MAAM,kBAAkB,8DAA4D,CAAC;AAC5F,eAAO,MAAM,qBAAqB,+DAA6D,CAAC;AAMhG,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;EAQhC,CAAC;AAMH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;EAQvC,CAAC;AAMH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;EAQhC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASrC,CAAC;AAMH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;EAQjC,CAAC;AAMH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;EAOpC,CAAC;AAMH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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qB,CAAC,CAAC;AACpE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -133,6 +133,24 @@ export const fieldYieldSummarySchema = z.object({
|
|
|
133
133
|
healthStatus: healthStatusSchema,
|
|
134
134
|
daysToHarvest: z.number().nullable(),
|
|
135
135
|
});
|
|
136
|
+
/** Multi-year / tree cash-crop stand for Market Watch orchard ledger (not season hero). */
|
|
137
|
+
export const cashCropStandSchema = z.object({
|
|
138
|
+
fieldId: z.string().uuid(),
|
|
139
|
+
fieldName: z.string(),
|
|
140
|
+
cropType: z.string(),
|
|
141
|
+
fieldArea: z.number(),
|
|
142
|
+
plantingDate: z.string().datetime().nullable(),
|
|
143
|
+
yearsToFirstHarvest: z.number().positive(),
|
|
144
|
+
ageYears: z.number().nullable(),
|
|
145
|
+
yearsRemaining: z.number().nullable(),
|
|
146
|
+
stage: z.enum(['establishing', 'bearing', 'unknown_age']),
|
|
147
|
+
/** Cold-start or harvest-calibrated kg/ha when bearing and catalog/history exists. */
|
|
148
|
+
planningYieldPerHa: z.number().nullable(),
|
|
149
|
+
planningTotalYield: z.number().nullable(),
|
|
150
|
+
unit: z.string(),
|
|
151
|
+
/** True when this stand also contributes to this-season field/crop summaries. */
|
|
152
|
+
includedInSeasonRevenue: z.boolean(),
|
|
153
|
+
});
|
|
136
154
|
export const farmYieldSummarySchema = z.object({
|
|
137
155
|
farmId: z.string().uuid(),
|
|
138
156
|
farmName: z.string(),
|
|
@@ -157,6 +175,8 @@ export const farmYieldSummarySchema = z.object({
|
|
|
157
175
|
})),
|
|
158
176
|
// Individual field summaries
|
|
159
177
|
fieldSummaries: z.array(fieldYieldSummarySchema),
|
|
178
|
+
/** Tree / perennial stands (cashew, cocoa, …) — always listed when planted. */
|
|
179
|
+
cashCropStands: z.array(cashCropStandSchema).default([]),
|
|
160
180
|
// Overall farm metrics
|
|
161
181
|
overallMetrics: z.object({
|
|
162
182
|
totalArea: z.number(),
|