@deepintel-ltd/farmpro-contracts 1.3.0 → 1.3.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.
@@ -0,0 +1,3519 @@
1
+ import { z } from 'zod';
2
+ export declare const fieldObservationsRouter: {
3
+ createFarmObservation: {
4
+ summary: "Upload farm observation photo for AI analysis";
5
+ method: "POST";
6
+ contentType: "multipart/form-data";
7
+ body: import("@ts-rest/core").ContractPlainType<{
8
+ photo: File;
9
+ } & {
10
+ type: string;
11
+ id: string;
12
+ attributes: {
13
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
14
+ location?: {
15
+ lat: number;
16
+ lng: number;
17
+ accuracy?: number | undefined;
18
+ } | undefined;
19
+ fieldId?: string | undefined;
20
+ capturedAt?: string | undefined;
21
+ userNotes?: string | undefined;
22
+ cropStageAtTime?: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | undefined;
23
+ };
24
+ relationships?: Record<string, unknown> | undefined;
25
+ links?: Record<string, string> | undefined;
26
+ meta?: Record<string, unknown> | undefined;
27
+ }>;
28
+ path: "/farms/:farmId/observations";
29
+ responses: {
30
+ 202: z.ZodObject<{
31
+ message: z.ZodString;
32
+ observationId: z.ZodString;
33
+ status: z.ZodLiteral<"accepted">;
34
+ }, "strip", z.ZodTypeAny, {
35
+ status: "accepted";
36
+ message: string;
37
+ observationId: string;
38
+ }, {
39
+ status: "accepted";
40
+ message: string;
41
+ observationId: string;
42
+ }>;
43
+ 400: z.ZodObject<{
44
+ message: z.ZodString;
45
+ code: z.ZodString;
46
+ }, "strip", z.ZodTypeAny, {
47
+ code: string;
48
+ message: string;
49
+ }, {
50
+ code: string;
51
+ message: string;
52
+ }>;
53
+ 404: z.ZodObject<{
54
+ message: z.ZodString;
55
+ code: z.ZodString;
56
+ }, "strip", z.ZodTypeAny, {
57
+ code: string;
58
+ message: string;
59
+ }, {
60
+ code: string;
61
+ message: string;
62
+ }>;
63
+ };
64
+ };
65
+ createObservation: {
66
+ summary: "Upload field observation photo for AI analysis";
67
+ method: "POST";
68
+ contentType: "multipart/form-data";
69
+ body: import("@ts-rest/core").ContractPlainType<{
70
+ photo: File;
71
+ } & {
72
+ type: string;
73
+ id: string;
74
+ attributes: {
75
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
76
+ location?: {
77
+ lat: number;
78
+ lng: number;
79
+ accuracy?: number | undefined;
80
+ } | undefined;
81
+ fieldId?: string | undefined;
82
+ capturedAt?: string | undefined;
83
+ userNotes?: string | undefined;
84
+ cropStageAtTime?: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | undefined;
85
+ };
86
+ relationships?: Record<string, unknown> | undefined;
87
+ links?: Record<string, string> | undefined;
88
+ meta?: Record<string, unknown> | undefined;
89
+ }>;
90
+ path: "/fields/:fieldId/observations";
91
+ responses: {
92
+ 202: z.ZodObject<{
93
+ message: z.ZodString;
94
+ observationId: z.ZodString;
95
+ status: z.ZodLiteral<"accepted">;
96
+ }, "strip", z.ZodTypeAny, {
97
+ status: "accepted";
98
+ message: string;
99
+ observationId: string;
100
+ }, {
101
+ status: "accepted";
102
+ message: string;
103
+ observationId: string;
104
+ }>;
105
+ 400: z.ZodObject<{
106
+ message: z.ZodString;
107
+ code: z.ZodString;
108
+ }, "strip", z.ZodTypeAny, {
109
+ code: string;
110
+ message: string;
111
+ }, {
112
+ code: string;
113
+ message: string;
114
+ }>;
115
+ 404: z.ZodObject<{
116
+ message: z.ZodString;
117
+ code: z.ZodString;
118
+ }, "strip", z.ZodTypeAny, {
119
+ code: string;
120
+ message: string;
121
+ }, {
122
+ code: string;
123
+ message: string;
124
+ }>;
125
+ };
126
+ };
127
+ getObservation: {
128
+ summary: "Get observation details and analysis results";
129
+ method: "GET";
130
+ path: "/observations/:id";
131
+ responses: {
132
+ 200: z.ZodObject<{
133
+ data: z.ZodObject<{
134
+ type: z.ZodLiteral<string>;
135
+ id: z.ZodString;
136
+ attributes: z.ZodObject<{
137
+ fieldId: z.ZodNullable<z.ZodString>;
138
+ farmId: z.ZodString;
139
+ uploadedBy: z.ZodString;
140
+ photoUrl: z.ZodString;
141
+ photoThumbnail: z.ZodNullable<z.ZodString>;
142
+ location: z.ZodNullable<z.ZodObject<{
143
+ lat: z.ZodNumber;
144
+ lng: z.ZodNumber;
145
+ accuracy: z.ZodOptional<z.ZodNumber>;
146
+ }, "strip", z.ZodTypeAny, {
147
+ lat: number;
148
+ lng: number;
149
+ accuracy?: number | undefined;
150
+ }, {
151
+ lat: number;
152
+ lng: number;
153
+ accuracy?: number | undefined;
154
+ }>>;
155
+ capturedAt: z.ZodDate;
156
+ observationType: z.ZodEnum<["disease", "pest", "nutrient", "weed", "general", "health_check"]>;
157
+ userNotes: z.ZodNullable<z.ZodString>;
158
+ cropStageAtTime: z.ZodNullable<z.ZodEnum<["planted", "germination", "vegetative", "flowering", "fruiting", "mature", "harvested"]>>;
159
+ analysisStatus: z.ZodEnum<["pending", "processing", "completed", "failed"]>;
160
+ analysisCompletedAt: z.ZodNullable<z.ZodDate>;
161
+ identifiedCrop: z.ZodNullable<z.ZodString>;
162
+ identifiedCropConfidence: z.ZodNullable<z.ZodNumber>;
163
+ diagnosisType: z.ZodNullable<z.ZodString>;
164
+ diagnosisConfidence: z.ZodNullable<z.ZodNumber>;
165
+ severity: z.ZodNullable<z.ZodEnum<["low", "medium", "high", "critical"]>>;
166
+ affectedArea: z.ZodNullable<z.ZodEnum<["localized", "widespread", "entire_field"]>>;
167
+ healthScore: z.ZodNullable<z.ZodNumber>;
168
+ analysisDetails: z.ZodNullable<z.ZodObject<{
169
+ plantIdentification: z.ZodOptional<z.ZodObject<{
170
+ scientificName: z.ZodString;
171
+ commonNames: z.ZodArray<z.ZodString, "many">;
172
+ confidence: z.ZodNumber;
173
+ provider: z.ZodString;
174
+ }, "strip", z.ZodTypeAny, {
175
+ confidence: number;
176
+ scientificName: string;
177
+ commonNames: string[];
178
+ provider: string;
179
+ }, {
180
+ confidence: number;
181
+ scientificName: string;
182
+ commonNames: string[];
183
+ provider: string;
184
+ }>>;
185
+ primaryIssue: z.ZodOptional<z.ZodObject<{
186
+ name: z.ZodString;
187
+ category: z.ZodString;
188
+ confidence: z.ZodNumber;
189
+ provider: z.ZodString;
190
+ visualIndicators: z.ZodArray<z.ZodString, "many">;
191
+ }, "strip", z.ZodTypeAny, {
192
+ name: string;
193
+ category: string;
194
+ confidence: number;
195
+ provider: string;
196
+ visualIndicators: string[];
197
+ }, {
198
+ name: string;
199
+ category: string;
200
+ confidence: number;
201
+ provider: string;
202
+ visualIndicators: string[];
203
+ }>>;
204
+ secondaryIssues: z.ZodOptional<z.ZodArray<z.ZodObject<{
205
+ name: z.ZodString;
206
+ confidence: z.ZodNumber;
207
+ reasoning: z.ZodString;
208
+ }, "strip", z.ZodTypeAny, {
209
+ name: string;
210
+ confidence: number;
211
+ reasoning: string;
212
+ }, {
213
+ name: string;
214
+ confidence: number;
215
+ reasoning: string;
216
+ }>, "many">>;
217
+ environmentalFactors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
218
+ satelliteCorrelation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
219
+ historicalMatches: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
220
+ }, "strip", z.ZodTypeAny, {
221
+ plantIdentification?: {
222
+ confidence: number;
223
+ scientificName: string;
224
+ commonNames: string[];
225
+ provider: string;
226
+ } | undefined;
227
+ primaryIssue?: {
228
+ name: string;
229
+ category: string;
230
+ confidence: number;
231
+ provider: string;
232
+ visualIndicators: string[];
233
+ } | undefined;
234
+ secondaryIssues?: {
235
+ name: string;
236
+ confidence: number;
237
+ reasoning: string;
238
+ }[] | undefined;
239
+ environmentalFactors?: Record<string, string> | undefined;
240
+ satelliteCorrelation?: Record<string, any> | undefined;
241
+ historicalMatches?: any[] | undefined;
242
+ }, {
243
+ plantIdentification?: {
244
+ confidence: number;
245
+ scientificName: string;
246
+ commonNames: string[];
247
+ provider: string;
248
+ } | undefined;
249
+ primaryIssue?: {
250
+ name: string;
251
+ category: string;
252
+ confidence: number;
253
+ provider: string;
254
+ visualIndicators: string[];
255
+ } | undefined;
256
+ secondaryIssues?: {
257
+ name: string;
258
+ confidence: number;
259
+ reasoning: string;
260
+ }[] | undefined;
261
+ environmentalFactors?: Record<string, string> | undefined;
262
+ satelliteCorrelation?: Record<string, any> | undefined;
263
+ historicalMatches?: any[] | undefined;
264
+ }>>;
265
+ recommendations: z.ZodNullable<z.ZodArray<z.ZodObject<{
266
+ priority: z.ZodNumber;
267
+ action: z.ZodString;
268
+ details: z.ZodString;
269
+ timing: z.ZodString;
270
+ materials: z.ZodOptional<z.ZodArray<z.ZodObject<{
271
+ inventoryItemId: z.ZodOptional<z.ZodString>;
272
+ name: z.ZodString;
273
+ quantity: z.ZodNumber;
274
+ unit: z.ZodString;
275
+ costPerUnit: z.ZodOptional<z.ZodNumber>;
276
+ totalCost: z.ZodOptional<z.ZodNumber>;
277
+ availability: z.ZodOptional<z.ZodString>;
278
+ }, "strip", z.ZodTypeAny, {
279
+ name: string;
280
+ unit: string;
281
+ quantity: number;
282
+ inventoryItemId?: string | undefined;
283
+ totalCost?: number | undefined;
284
+ costPerUnit?: number | undefined;
285
+ availability?: string | undefined;
286
+ }, {
287
+ name: string;
288
+ unit: string;
289
+ quantity: number;
290
+ inventoryItemId?: string | undefined;
291
+ totalCost?: number | undefined;
292
+ costPerUnit?: number | undefined;
293
+ availability?: string | undefined;
294
+ }>, "many">>;
295
+ applicationMethod: z.ZodOptional<z.ZodString>;
296
+ expectedOutcome: z.ZodOptional<z.ZodString>;
297
+ preventiveMeasures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
298
+ estimatedTime: z.ZodOptional<z.ZodString>;
299
+ riskLevel: z.ZodOptional<z.ZodString>;
300
+ }, "strip", z.ZodTypeAny, {
301
+ priority: number;
302
+ action: string;
303
+ details: string;
304
+ timing: string;
305
+ materials?: {
306
+ name: string;
307
+ unit: string;
308
+ quantity: number;
309
+ inventoryItemId?: string | undefined;
310
+ totalCost?: number | undefined;
311
+ costPerUnit?: number | undefined;
312
+ availability?: string | undefined;
313
+ }[] | undefined;
314
+ applicationMethod?: string | undefined;
315
+ expectedOutcome?: string | undefined;
316
+ preventiveMeasures?: string[] | undefined;
317
+ estimatedTime?: string | undefined;
318
+ riskLevel?: string | undefined;
319
+ }, {
320
+ priority: number;
321
+ action: string;
322
+ details: string;
323
+ timing: string;
324
+ materials?: {
325
+ name: string;
326
+ unit: string;
327
+ quantity: number;
328
+ inventoryItemId?: string | undefined;
329
+ totalCost?: number | undefined;
330
+ costPerUnit?: number | undefined;
331
+ availability?: string | undefined;
332
+ }[] | undefined;
333
+ applicationMethod?: string | undefined;
334
+ expectedOutcome?: string | undefined;
335
+ preventiveMeasures?: string[] | undefined;
336
+ estimatedTime?: string | undefined;
337
+ riskLevel?: string | undefined;
338
+ }>, "many">>;
339
+ estimatedCost: z.ZodNullable<z.ZodNumber>;
340
+ urgencyScore: z.ZodNullable<z.ZodNumber>;
341
+ similarCasesCount: z.ZodNullable<z.ZodNumber>;
342
+ actionStatus: z.ZodEnum<["pending", "in_progress", "completed", "dismissed"]>;
343
+ actionTakenAt: z.ZodNullable<z.ZodDate>;
344
+ actionNotes: z.ZodNullable<z.ZodString>;
345
+ generatedAlertId: z.ZodNullable<z.ZodString>;
346
+ relatedTaskId: z.ZodNullable<z.ZodString>;
347
+ analysisProvider: z.ZodNullable<z.ZodString>;
348
+ processingTime: z.ZodNullable<z.ZodNumber>;
349
+ modelVersion: z.ZodNullable<z.ZodString>;
350
+ phase: z.ZodNullable<z.ZodString>;
351
+ } & {
352
+ createdAt: z.ZodString;
353
+ updatedAt: z.ZodString;
354
+ }, "strip", z.ZodTypeAny, {
355
+ createdAt: string;
356
+ updatedAt: string;
357
+ location: {
358
+ lat: number;
359
+ lng: number;
360
+ accuracy?: number | undefined;
361
+ } | null;
362
+ farmId: string;
363
+ fieldId: string | null;
364
+ estimatedCost: number | null;
365
+ recommendations: {
366
+ priority: number;
367
+ action: string;
368
+ details: string;
369
+ timing: string;
370
+ materials?: {
371
+ name: string;
372
+ unit: string;
373
+ quantity: number;
374
+ inventoryItemId?: string | undefined;
375
+ totalCost?: number | undefined;
376
+ costPerUnit?: number | undefined;
377
+ availability?: string | undefined;
378
+ }[] | undefined;
379
+ applicationMethod?: string | undefined;
380
+ expectedOutcome?: string | undefined;
381
+ preventiveMeasures?: string[] | undefined;
382
+ estimatedTime?: string | undefined;
383
+ riskLevel?: string | undefined;
384
+ }[] | null;
385
+ severity: "critical" | "high" | "medium" | "low" | null;
386
+ uploadedBy: string;
387
+ photoUrl: string;
388
+ photoThumbnail: string | null;
389
+ capturedAt: Date;
390
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
391
+ userNotes: string | null;
392
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
393
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
394
+ analysisCompletedAt: Date | null;
395
+ identifiedCrop: string | null;
396
+ identifiedCropConfidence: number | null;
397
+ diagnosisType: string | null;
398
+ diagnosisConfidence: number | null;
399
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
400
+ healthScore: number | null;
401
+ analysisDetails: {
402
+ plantIdentification?: {
403
+ confidence: number;
404
+ scientificName: string;
405
+ commonNames: string[];
406
+ provider: string;
407
+ } | undefined;
408
+ primaryIssue?: {
409
+ name: string;
410
+ category: string;
411
+ confidence: number;
412
+ provider: string;
413
+ visualIndicators: string[];
414
+ } | undefined;
415
+ secondaryIssues?: {
416
+ name: string;
417
+ confidence: number;
418
+ reasoning: string;
419
+ }[] | undefined;
420
+ environmentalFactors?: Record<string, string> | undefined;
421
+ satelliteCorrelation?: Record<string, any> | undefined;
422
+ historicalMatches?: any[] | undefined;
423
+ } | null;
424
+ urgencyScore: number | null;
425
+ similarCasesCount: number | null;
426
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
427
+ actionTakenAt: Date | null;
428
+ actionNotes: string | null;
429
+ generatedAlertId: string | null;
430
+ relatedTaskId: string | null;
431
+ analysisProvider: string | null;
432
+ processingTime: number | null;
433
+ modelVersion: string | null;
434
+ phase: string | null;
435
+ }, {
436
+ createdAt: string;
437
+ updatedAt: string;
438
+ location: {
439
+ lat: number;
440
+ lng: number;
441
+ accuracy?: number | undefined;
442
+ } | null;
443
+ farmId: string;
444
+ fieldId: string | null;
445
+ estimatedCost: number | null;
446
+ recommendations: {
447
+ priority: number;
448
+ action: string;
449
+ details: string;
450
+ timing: string;
451
+ materials?: {
452
+ name: string;
453
+ unit: string;
454
+ quantity: number;
455
+ inventoryItemId?: string | undefined;
456
+ totalCost?: number | undefined;
457
+ costPerUnit?: number | undefined;
458
+ availability?: string | undefined;
459
+ }[] | undefined;
460
+ applicationMethod?: string | undefined;
461
+ expectedOutcome?: string | undefined;
462
+ preventiveMeasures?: string[] | undefined;
463
+ estimatedTime?: string | undefined;
464
+ riskLevel?: string | undefined;
465
+ }[] | null;
466
+ severity: "critical" | "high" | "medium" | "low" | null;
467
+ uploadedBy: string;
468
+ photoUrl: string;
469
+ photoThumbnail: string | null;
470
+ capturedAt: Date;
471
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
472
+ userNotes: string | null;
473
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
474
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
475
+ analysisCompletedAt: Date | null;
476
+ identifiedCrop: string | null;
477
+ identifiedCropConfidence: number | null;
478
+ diagnosisType: string | null;
479
+ diagnosisConfidence: number | null;
480
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
481
+ healthScore: number | null;
482
+ analysisDetails: {
483
+ plantIdentification?: {
484
+ confidence: number;
485
+ scientificName: string;
486
+ commonNames: string[];
487
+ provider: string;
488
+ } | undefined;
489
+ primaryIssue?: {
490
+ name: string;
491
+ category: string;
492
+ confidence: number;
493
+ provider: string;
494
+ visualIndicators: string[];
495
+ } | undefined;
496
+ secondaryIssues?: {
497
+ name: string;
498
+ confidence: number;
499
+ reasoning: string;
500
+ }[] | undefined;
501
+ environmentalFactors?: Record<string, string> | undefined;
502
+ satelliteCorrelation?: Record<string, any> | undefined;
503
+ historicalMatches?: any[] | undefined;
504
+ } | null;
505
+ urgencyScore: number | null;
506
+ similarCasesCount: number | null;
507
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
508
+ actionTakenAt: Date | null;
509
+ actionNotes: string | null;
510
+ generatedAlertId: string | null;
511
+ relatedTaskId: string | null;
512
+ analysisProvider: string | null;
513
+ processingTime: number | null;
514
+ modelVersion: string | null;
515
+ phase: string | null;
516
+ }>;
517
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
518
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
519
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
520
+ }, "strip", z.ZodTypeAny, {
521
+ type: string;
522
+ id: string;
523
+ attributes: {
524
+ createdAt: string;
525
+ updatedAt: string;
526
+ location: {
527
+ lat: number;
528
+ lng: number;
529
+ accuracy?: number | undefined;
530
+ } | null;
531
+ farmId: string;
532
+ fieldId: string | null;
533
+ estimatedCost: number | null;
534
+ recommendations: {
535
+ priority: number;
536
+ action: string;
537
+ details: string;
538
+ timing: string;
539
+ materials?: {
540
+ name: string;
541
+ unit: string;
542
+ quantity: number;
543
+ inventoryItemId?: string | undefined;
544
+ totalCost?: number | undefined;
545
+ costPerUnit?: number | undefined;
546
+ availability?: string | undefined;
547
+ }[] | undefined;
548
+ applicationMethod?: string | undefined;
549
+ expectedOutcome?: string | undefined;
550
+ preventiveMeasures?: string[] | undefined;
551
+ estimatedTime?: string | undefined;
552
+ riskLevel?: string | undefined;
553
+ }[] | null;
554
+ severity: "critical" | "high" | "medium" | "low" | null;
555
+ uploadedBy: string;
556
+ photoUrl: string;
557
+ photoThumbnail: string | null;
558
+ capturedAt: Date;
559
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
560
+ userNotes: string | null;
561
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
562
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
563
+ analysisCompletedAt: Date | null;
564
+ identifiedCrop: string | null;
565
+ identifiedCropConfidence: number | null;
566
+ diagnosisType: string | null;
567
+ diagnosisConfidence: number | null;
568
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
569
+ healthScore: number | null;
570
+ analysisDetails: {
571
+ plantIdentification?: {
572
+ confidence: number;
573
+ scientificName: string;
574
+ commonNames: string[];
575
+ provider: string;
576
+ } | undefined;
577
+ primaryIssue?: {
578
+ name: string;
579
+ category: string;
580
+ confidence: number;
581
+ provider: string;
582
+ visualIndicators: string[];
583
+ } | undefined;
584
+ secondaryIssues?: {
585
+ name: string;
586
+ confidence: number;
587
+ reasoning: string;
588
+ }[] | undefined;
589
+ environmentalFactors?: Record<string, string> | undefined;
590
+ satelliteCorrelation?: Record<string, any> | undefined;
591
+ historicalMatches?: any[] | undefined;
592
+ } | null;
593
+ urgencyScore: number | null;
594
+ similarCasesCount: number | null;
595
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
596
+ actionTakenAt: Date | null;
597
+ actionNotes: string | null;
598
+ generatedAlertId: string | null;
599
+ relatedTaskId: string | null;
600
+ analysisProvider: string | null;
601
+ processingTime: number | null;
602
+ modelVersion: string | null;
603
+ phase: string | null;
604
+ };
605
+ relationships?: Record<string, unknown> | undefined;
606
+ links?: Record<string, string> | undefined;
607
+ meta?: Record<string, unknown> | undefined;
608
+ }, {
609
+ type: string;
610
+ id: string;
611
+ attributes: {
612
+ createdAt: string;
613
+ updatedAt: string;
614
+ location: {
615
+ lat: number;
616
+ lng: number;
617
+ accuracy?: number | undefined;
618
+ } | null;
619
+ farmId: string;
620
+ fieldId: string | null;
621
+ estimatedCost: number | null;
622
+ recommendations: {
623
+ priority: number;
624
+ action: string;
625
+ details: string;
626
+ timing: string;
627
+ materials?: {
628
+ name: string;
629
+ unit: string;
630
+ quantity: number;
631
+ inventoryItemId?: string | undefined;
632
+ totalCost?: number | undefined;
633
+ costPerUnit?: number | undefined;
634
+ availability?: string | undefined;
635
+ }[] | undefined;
636
+ applicationMethod?: string | undefined;
637
+ expectedOutcome?: string | undefined;
638
+ preventiveMeasures?: string[] | undefined;
639
+ estimatedTime?: string | undefined;
640
+ riskLevel?: string | undefined;
641
+ }[] | null;
642
+ severity: "critical" | "high" | "medium" | "low" | null;
643
+ uploadedBy: string;
644
+ photoUrl: string;
645
+ photoThumbnail: string | null;
646
+ capturedAt: Date;
647
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
648
+ userNotes: string | null;
649
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
650
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
651
+ analysisCompletedAt: Date | null;
652
+ identifiedCrop: string | null;
653
+ identifiedCropConfidence: number | null;
654
+ diagnosisType: string | null;
655
+ diagnosisConfidence: number | null;
656
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
657
+ healthScore: number | null;
658
+ analysisDetails: {
659
+ plantIdentification?: {
660
+ confidence: number;
661
+ scientificName: string;
662
+ commonNames: string[];
663
+ provider: string;
664
+ } | undefined;
665
+ primaryIssue?: {
666
+ name: string;
667
+ category: string;
668
+ confidence: number;
669
+ provider: string;
670
+ visualIndicators: string[];
671
+ } | undefined;
672
+ secondaryIssues?: {
673
+ name: string;
674
+ confidence: number;
675
+ reasoning: string;
676
+ }[] | undefined;
677
+ environmentalFactors?: Record<string, string> | undefined;
678
+ satelliteCorrelation?: Record<string, any> | undefined;
679
+ historicalMatches?: any[] | undefined;
680
+ } | null;
681
+ urgencyScore: number | null;
682
+ similarCasesCount: number | null;
683
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
684
+ actionTakenAt: Date | null;
685
+ actionNotes: string | null;
686
+ generatedAlertId: string | null;
687
+ relatedTaskId: string | null;
688
+ analysisProvider: string | null;
689
+ processingTime: number | null;
690
+ modelVersion: string | null;
691
+ phase: string | null;
692
+ };
693
+ relationships?: Record<string, unknown> | undefined;
694
+ links?: Record<string, string> | undefined;
695
+ meta?: Record<string, unknown> | undefined;
696
+ }>;
697
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
698
+ type: z.ZodString;
699
+ id: z.ZodString;
700
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
701
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
702
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
703
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
704
+ }, "strip", z.ZodTypeAny, {
705
+ type: string;
706
+ id: string;
707
+ attributes?: Record<string, unknown> | undefined;
708
+ relationships?: Record<string, unknown> | undefined;
709
+ links?: Record<string, string> | undefined;
710
+ meta?: Record<string, unknown> | undefined;
711
+ }, {
712
+ type: string;
713
+ id: string;
714
+ attributes?: Record<string, unknown> | undefined;
715
+ relationships?: Record<string, unknown> | undefined;
716
+ links?: Record<string, string> | undefined;
717
+ meta?: Record<string, unknown> | undefined;
718
+ }>, "many">>;
719
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
720
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
721
+ }, "strip", z.ZodTypeAny, {
722
+ data: {
723
+ type: string;
724
+ id: string;
725
+ attributes: {
726
+ createdAt: string;
727
+ updatedAt: string;
728
+ location: {
729
+ lat: number;
730
+ lng: number;
731
+ accuracy?: number | undefined;
732
+ } | null;
733
+ farmId: string;
734
+ fieldId: string | null;
735
+ estimatedCost: number | null;
736
+ recommendations: {
737
+ priority: number;
738
+ action: string;
739
+ details: string;
740
+ timing: string;
741
+ materials?: {
742
+ name: string;
743
+ unit: string;
744
+ quantity: number;
745
+ inventoryItemId?: string | undefined;
746
+ totalCost?: number | undefined;
747
+ costPerUnit?: number | undefined;
748
+ availability?: string | undefined;
749
+ }[] | undefined;
750
+ applicationMethod?: string | undefined;
751
+ expectedOutcome?: string | undefined;
752
+ preventiveMeasures?: string[] | undefined;
753
+ estimatedTime?: string | undefined;
754
+ riskLevel?: string | undefined;
755
+ }[] | null;
756
+ severity: "critical" | "high" | "medium" | "low" | null;
757
+ uploadedBy: string;
758
+ photoUrl: string;
759
+ photoThumbnail: string | null;
760
+ capturedAt: Date;
761
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
762
+ userNotes: string | null;
763
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
764
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
765
+ analysisCompletedAt: Date | null;
766
+ identifiedCrop: string | null;
767
+ identifiedCropConfidence: number | null;
768
+ diagnosisType: string | null;
769
+ diagnosisConfidence: number | null;
770
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
771
+ healthScore: number | null;
772
+ analysisDetails: {
773
+ plantIdentification?: {
774
+ confidence: number;
775
+ scientificName: string;
776
+ commonNames: string[];
777
+ provider: string;
778
+ } | undefined;
779
+ primaryIssue?: {
780
+ name: string;
781
+ category: string;
782
+ confidence: number;
783
+ provider: string;
784
+ visualIndicators: string[];
785
+ } | undefined;
786
+ secondaryIssues?: {
787
+ name: string;
788
+ confidence: number;
789
+ reasoning: string;
790
+ }[] | undefined;
791
+ environmentalFactors?: Record<string, string> | undefined;
792
+ satelliteCorrelation?: Record<string, any> | undefined;
793
+ historicalMatches?: any[] | undefined;
794
+ } | null;
795
+ urgencyScore: number | null;
796
+ similarCasesCount: number | null;
797
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
798
+ actionTakenAt: Date | null;
799
+ actionNotes: string | null;
800
+ generatedAlertId: string | null;
801
+ relatedTaskId: string | null;
802
+ analysisProvider: string | null;
803
+ processingTime: number | null;
804
+ modelVersion: string | null;
805
+ phase: string | null;
806
+ };
807
+ relationships?: Record<string, unknown> | undefined;
808
+ links?: Record<string, string> | undefined;
809
+ meta?: Record<string, unknown> | undefined;
810
+ };
811
+ links?: Record<string, string> | undefined;
812
+ meta?: Record<string, unknown> | undefined;
813
+ included?: {
814
+ type: string;
815
+ id: string;
816
+ attributes?: Record<string, unknown> | undefined;
817
+ relationships?: Record<string, unknown> | undefined;
818
+ links?: Record<string, string> | undefined;
819
+ meta?: Record<string, unknown> | undefined;
820
+ }[] | undefined;
821
+ }, {
822
+ data: {
823
+ type: string;
824
+ id: string;
825
+ attributes: {
826
+ createdAt: string;
827
+ updatedAt: string;
828
+ location: {
829
+ lat: number;
830
+ lng: number;
831
+ accuracy?: number | undefined;
832
+ } | null;
833
+ farmId: string;
834
+ fieldId: string | null;
835
+ estimatedCost: number | null;
836
+ recommendations: {
837
+ priority: number;
838
+ action: string;
839
+ details: string;
840
+ timing: string;
841
+ materials?: {
842
+ name: string;
843
+ unit: string;
844
+ quantity: number;
845
+ inventoryItemId?: string | undefined;
846
+ totalCost?: number | undefined;
847
+ costPerUnit?: number | undefined;
848
+ availability?: string | undefined;
849
+ }[] | undefined;
850
+ applicationMethod?: string | undefined;
851
+ expectedOutcome?: string | undefined;
852
+ preventiveMeasures?: string[] | undefined;
853
+ estimatedTime?: string | undefined;
854
+ riskLevel?: string | undefined;
855
+ }[] | null;
856
+ severity: "critical" | "high" | "medium" | "low" | null;
857
+ uploadedBy: string;
858
+ photoUrl: string;
859
+ photoThumbnail: string | null;
860
+ capturedAt: Date;
861
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
862
+ userNotes: string | null;
863
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
864
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
865
+ analysisCompletedAt: Date | null;
866
+ identifiedCrop: string | null;
867
+ identifiedCropConfidence: number | null;
868
+ diagnosisType: string | null;
869
+ diagnosisConfidence: number | null;
870
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
871
+ healthScore: number | null;
872
+ analysisDetails: {
873
+ plantIdentification?: {
874
+ confidence: number;
875
+ scientificName: string;
876
+ commonNames: string[];
877
+ provider: string;
878
+ } | undefined;
879
+ primaryIssue?: {
880
+ name: string;
881
+ category: string;
882
+ confidence: number;
883
+ provider: string;
884
+ visualIndicators: string[];
885
+ } | undefined;
886
+ secondaryIssues?: {
887
+ name: string;
888
+ confidence: number;
889
+ reasoning: string;
890
+ }[] | undefined;
891
+ environmentalFactors?: Record<string, string> | undefined;
892
+ satelliteCorrelation?: Record<string, any> | undefined;
893
+ historicalMatches?: any[] | undefined;
894
+ } | null;
895
+ urgencyScore: number | null;
896
+ similarCasesCount: number | null;
897
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
898
+ actionTakenAt: Date | null;
899
+ actionNotes: string | null;
900
+ generatedAlertId: string | null;
901
+ relatedTaskId: string | null;
902
+ analysisProvider: string | null;
903
+ processingTime: number | null;
904
+ modelVersion: string | null;
905
+ phase: string | null;
906
+ };
907
+ relationships?: Record<string, unknown> | undefined;
908
+ links?: Record<string, string> | undefined;
909
+ meta?: Record<string, unknown> | undefined;
910
+ };
911
+ links?: Record<string, string> | undefined;
912
+ meta?: Record<string, unknown> | undefined;
913
+ included?: {
914
+ type: string;
915
+ id: string;
916
+ attributes?: Record<string, unknown> | undefined;
917
+ relationships?: Record<string, unknown> | undefined;
918
+ links?: Record<string, string> | undefined;
919
+ meta?: Record<string, unknown> | undefined;
920
+ }[] | undefined;
921
+ }>;
922
+ 404: z.ZodObject<{
923
+ message: z.ZodString;
924
+ code: z.ZodString;
925
+ }, "strip", z.ZodTypeAny, {
926
+ code: string;
927
+ message: string;
928
+ }, {
929
+ code: string;
930
+ message: string;
931
+ }>;
932
+ };
933
+ };
934
+ listFieldObservations: {
935
+ query: z.ZodObject<{
936
+ fieldId: z.ZodOptional<z.ZodString>;
937
+ status: z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "failed"]>>;
938
+ observationType: z.ZodOptional<z.ZodString>;
939
+ severity: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
940
+ startDate: z.ZodOptional<z.ZodString>;
941
+ endDate: z.ZodOptional<z.ZodString>;
942
+ page: z.ZodDefault<z.ZodString>;
943
+ pageSize: z.ZodDefault<z.ZodString>;
944
+ }, "strip", z.ZodTypeAny, {
945
+ pageSize: string;
946
+ page: string;
947
+ status?: "pending" | "completed" | "processing" | "failed" | undefined;
948
+ fieldId?: string | undefined;
949
+ severity?: "critical" | "high" | "medium" | "low" | undefined;
950
+ startDate?: string | undefined;
951
+ endDate?: string | undefined;
952
+ observationType?: string | undefined;
953
+ }, {
954
+ status?: "pending" | "completed" | "processing" | "failed" | undefined;
955
+ pageSize?: string | undefined;
956
+ fieldId?: string | undefined;
957
+ severity?: "critical" | "high" | "medium" | "low" | undefined;
958
+ startDate?: string | undefined;
959
+ endDate?: string | undefined;
960
+ observationType?: string | undefined;
961
+ page?: string | undefined;
962
+ }>;
963
+ summary: "List all observations for a field";
964
+ method: "GET";
965
+ path: "/fields/:fieldId/observations";
966
+ responses: {
967
+ 200: z.ZodObject<{
968
+ data: z.ZodArray<z.ZodObject<{
969
+ type: z.ZodLiteral<string>;
970
+ id: z.ZodString;
971
+ attributes: z.ZodObject<{
972
+ fieldId: z.ZodNullable<z.ZodString>;
973
+ farmId: z.ZodString;
974
+ uploadedBy: z.ZodString;
975
+ photoUrl: z.ZodString;
976
+ photoThumbnail: z.ZodNullable<z.ZodString>;
977
+ location: z.ZodNullable<z.ZodObject<{
978
+ lat: z.ZodNumber;
979
+ lng: z.ZodNumber;
980
+ accuracy: z.ZodOptional<z.ZodNumber>;
981
+ }, "strip", z.ZodTypeAny, {
982
+ lat: number;
983
+ lng: number;
984
+ accuracy?: number | undefined;
985
+ }, {
986
+ lat: number;
987
+ lng: number;
988
+ accuracy?: number | undefined;
989
+ }>>;
990
+ capturedAt: z.ZodDate;
991
+ observationType: z.ZodEnum<["disease", "pest", "nutrient", "weed", "general", "health_check"]>;
992
+ userNotes: z.ZodNullable<z.ZodString>;
993
+ cropStageAtTime: z.ZodNullable<z.ZodEnum<["planted", "germination", "vegetative", "flowering", "fruiting", "mature", "harvested"]>>;
994
+ analysisStatus: z.ZodEnum<["pending", "processing", "completed", "failed"]>;
995
+ analysisCompletedAt: z.ZodNullable<z.ZodDate>;
996
+ identifiedCrop: z.ZodNullable<z.ZodString>;
997
+ identifiedCropConfidence: z.ZodNullable<z.ZodNumber>;
998
+ diagnosisType: z.ZodNullable<z.ZodString>;
999
+ diagnosisConfidence: z.ZodNullable<z.ZodNumber>;
1000
+ severity: z.ZodNullable<z.ZodEnum<["low", "medium", "high", "critical"]>>;
1001
+ affectedArea: z.ZodNullable<z.ZodEnum<["localized", "widespread", "entire_field"]>>;
1002
+ healthScore: z.ZodNullable<z.ZodNumber>;
1003
+ analysisDetails: z.ZodNullable<z.ZodObject<{
1004
+ plantIdentification: z.ZodOptional<z.ZodObject<{
1005
+ scientificName: z.ZodString;
1006
+ commonNames: z.ZodArray<z.ZodString, "many">;
1007
+ confidence: z.ZodNumber;
1008
+ provider: z.ZodString;
1009
+ }, "strip", z.ZodTypeAny, {
1010
+ confidence: number;
1011
+ scientificName: string;
1012
+ commonNames: string[];
1013
+ provider: string;
1014
+ }, {
1015
+ confidence: number;
1016
+ scientificName: string;
1017
+ commonNames: string[];
1018
+ provider: string;
1019
+ }>>;
1020
+ primaryIssue: z.ZodOptional<z.ZodObject<{
1021
+ name: z.ZodString;
1022
+ category: z.ZodString;
1023
+ confidence: z.ZodNumber;
1024
+ provider: z.ZodString;
1025
+ visualIndicators: z.ZodArray<z.ZodString, "many">;
1026
+ }, "strip", z.ZodTypeAny, {
1027
+ name: string;
1028
+ category: string;
1029
+ confidence: number;
1030
+ provider: string;
1031
+ visualIndicators: string[];
1032
+ }, {
1033
+ name: string;
1034
+ category: string;
1035
+ confidence: number;
1036
+ provider: string;
1037
+ visualIndicators: string[];
1038
+ }>>;
1039
+ secondaryIssues: z.ZodOptional<z.ZodArray<z.ZodObject<{
1040
+ name: z.ZodString;
1041
+ confidence: z.ZodNumber;
1042
+ reasoning: z.ZodString;
1043
+ }, "strip", z.ZodTypeAny, {
1044
+ name: string;
1045
+ confidence: number;
1046
+ reasoning: string;
1047
+ }, {
1048
+ name: string;
1049
+ confidence: number;
1050
+ reasoning: string;
1051
+ }>, "many">>;
1052
+ environmentalFactors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1053
+ satelliteCorrelation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1054
+ historicalMatches: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
1055
+ }, "strip", z.ZodTypeAny, {
1056
+ plantIdentification?: {
1057
+ confidence: number;
1058
+ scientificName: string;
1059
+ commonNames: string[];
1060
+ provider: string;
1061
+ } | undefined;
1062
+ primaryIssue?: {
1063
+ name: string;
1064
+ category: string;
1065
+ confidence: number;
1066
+ provider: string;
1067
+ visualIndicators: string[];
1068
+ } | undefined;
1069
+ secondaryIssues?: {
1070
+ name: string;
1071
+ confidence: number;
1072
+ reasoning: string;
1073
+ }[] | undefined;
1074
+ environmentalFactors?: Record<string, string> | undefined;
1075
+ satelliteCorrelation?: Record<string, any> | undefined;
1076
+ historicalMatches?: any[] | undefined;
1077
+ }, {
1078
+ plantIdentification?: {
1079
+ confidence: number;
1080
+ scientificName: string;
1081
+ commonNames: string[];
1082
+ provider: string;
1083
+ } | undefined;
1084
+ primaryIssue?: {
1085
+ name: string;
1086
+ category: string;
1087
+ confidence: number;
1088
+ provider: string;
1089
+ visualIndicators: string[];
1090
+ } | undefined;
1091
+ secondaryIssues?: {
1092
+ name: string;
1093
+ confidence: number;
1094
+ reasoning: string;
1095
+ }[] | undefined;
1096
+ environmentalFactors?: Record<string, string> | undefined;
1097
+ satelliteCorrelation?: Record<string, any> | undefined;
1098
+ historicalMatches?: any[] | undefined;
1099
+ }>>;
1100
+ recommendations: z.ZodNullable<z.ZodArray<z.ZodObject<{
1101
+ priority: z.ZodNumber;
1102
+ action: z.ZodString;
1103
+ details: z.ZodString;
1104
+ timing: z.ZodString;
1105
+ materials: z.ZodOptional<z.ZodArray<z.ZodObject<{
1106
+ inventoryItemId: z.ZodOptional<z.ZodString>;
1107
+ name: z.ZodString;
1108
+ quantity: z.ZodNumber;
1109
+ unit: z.ZodString;
1110
+ costPerUnit: z.ZodOptional<z.ZodNumber>;
1111
+ totalCost: z.ZodOptional<z.ZodNumber>;
1112
+ availability: z.ZodOptional<z.ZodString>;
1113
+ }, "strip", z.ZodTypeAny, {
1114
+ name: string;
1115
+ unit: string;
1116
+ quantity: number;
1117
+ inventoryItemId?: string | undefined;
1118
+ totalCost?: number | undefined;
1119
+ costPerUnit?: number | undefined;
1120
+ availability?: string | undefined;
1121
+ }, {
1122
+ name: string;
1123
+ unit: string;
1124
+ quantity: number;
1125
+ inventoryItemId?: string | undefined;
1126
+ totalCost?: number | undefined;
1127
+ costPerUnit?: number | undefined;
1128
+ availability?: string | undefined;
1129
+ }>, "many">>;
1130
+ applicationMethod: z.ZodOptional<z.ZodString>;
1131
+ expectedOutcome: z.ZodOptional<z.ZodString>;
1132
+ preventiveMeasures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1133
+ estimatedTime: z.ZodOptional<z.ZodString>;
1134
+ riskLevel: z.ZodOptional<z.ZodString>;
1135
+ }, "strip", z.ZodTypeAny, {
1136
+ priority: number;
1137
+ action: string;
1138
+ details: string;
1139
+ timing: string;
1140
+ materials?: {
1141
+ name: string;
1142
+ unit: string;
1143
+ quantity: number;
1144
+ inventoryItemId?: string | undefined;
1145
+ totalCost?: number | undefined;
1146
+ costPerUnit?: number | undefined;
1147
+ availability?: string | undefined;
1148
+ }[] | undefined;
1149
+ applicationMethod?: string | undefined;
1150
+ expectedOutcome?: string | undefined;
1151
+ preventiveMeasures?: string[] | undefined;
1152
+ estimatedTime?: string | undefined;
1153
+ riskLevel?: string | undefined;
1154
+ }, {
1155
+ priority: number;
1156
+ action: string;
1157
+ details: string;
1158
+ timing: string;
1159
+ materials?: {
1160
+ name: string;
1161
+ unit: string;
1162
+ quantity: number;
1163
+ inventoryItemId?: string | undefined;
1164
+ totalCost?: number | undefined;
1165
+ costPerUnit?: number | undefined;
1166
+ availability?: string | undefined;
1167
+ }[] | undefined;
1168
+ applicationMethod?: string | undefined;
1169
+ expectedOutcome?: string | undefined;
1170
+ preventiveMeasures?: string[] | undefined;
1171
+ estimatedTime?: string | undefined;
1172
+ riskLevel?: string | undefined;
1173
+ }>, "many">>;
1174
+ estimatedCost: z.ZodNullable<z.ZodNumber>;
1175
+ urgencyScore: z.ZodNullable<z.ZodNumber>;
1176
+ similarCasesCount: z.ZodNullable<z.ZodNumber>;
1177
+ actionStatus: z.ZodEnum<["pending", "in_progress", "completed", "dismissed"]>;
1178
+ actionTakenAt: z.ZodNullable<z.ZodDate>;
1179
+ actionNotes: z.ZodNullable<z.ZodString>;
1180
+ generatedAlertId: z.ZodNullable<z.ZodString>;
1181
+ relatedTaskId: z.ZodNullable<z.ZodString>;
1182
+ analysisProvider: z.ZodNullable<z.ZodString>;
1183
+ processingTime: z.ZodNullable<z.ZodNumber>;
1184
+ modelVersion: z.ZodNullable<z.ZodString>;
1185
+ phase: z.ZodNullable<z.ZodString>;
1186
+ } & {
1187
+ createdAt: z.ZodString;
1188
+ updatedAt: z.ZodString;
1189
+ }, "strip", z.ZodTypeAny, {
1190
+ createdAt: string;
1191
+ updatedAt: string;
1192
+ location: {
1193
+ lat: number;
1194
+ lng: number;
1195
+ accuracy?: number | undefined;
1196
+ } | null;
1197
+ farmId: string;
1198
+ fieldId: string | null;
1199
+ estimatedCost: number | null;
1200
+ recommendations: {
1201
+ priority: number;
1202
+ action: string;
1203
+ details: string;
1204
+ timing: string;
1205
+ materials?: {
1206
+ name: string;
1207
+ unit: string;
1208
+ quantity: number;
1209
+ inventoryItemId?: string | undefined;
1210
+ totalCost?: number | undefined;
1211
+ costPerUnit?: number | undefined;
1212
+ availability?: string | undefined;
1213
+ }[] | undefined;
1214
+ applicationMethod?: string | undefined;
1215
+ expectedOutcome?: string | undefined;
1216
+ preventiveMeasures?: string[] | undefined;
1217
+ estimatedTime?: string | undefined;
1218
+ riskLevel?: string | undefined;
1219
+ }[] | null;
1220
+ severity: "critical" | "high" | "medium" | "low" | null;
1221
+ uploadedBy: string;
1222
+ photoUrl: string;
1223
+ photoThumbnail: string | null;
1224
+ capturedAt: Date;
1225
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
1226
+ userNotes: string | null;
1227
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
1228
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
1229
+ analysisCompletedAt: Date | null;
1230
+ identifiedCrop: string | null;
1231
+ identifiedCropConfidence: number | null;
1232
+ diagnosisType: string | null;
1233
+ diagnosisConfidence: number | null;
1234
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
1235
+ healthScore: number | null;
1236
+ analysisDetails: {
1237
+ plantIdentification?: {
1238
+ confidence: number;
1239
+ scientificName: string;
1240
+ commonNames: string[];
1241
+ provider: string;
1242
+ } | undefined;
1243
+ primaryIssue?: {
1244
+ name: string;
1245
+ category: string;
1246
+ confidence: number;
1247
+ provider: string;
1248
+ visualIndicators: string[];
1249
+ } | undefined;
1250
+ secondaryIssues?: {
1251
+ name: string;
1252
+ confidence: number;
1253
+ reasoning: string;
1254
+ }[] | undefined;
1255
+ environmentalFactors?: Record<string, string> | undefined;
1256
+ satelliteCorrelation?: Record<string, any> | undefined;
1257
+ historicalMatches?: any[] | undefined;
1258
+ } | null;
1259
+ urgencyScore: number | null;
1260
+ similarCasesCount: number | null;
1261
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
1262
+ actionTakenAt: Date | null;
1263
+ actionNotes: string | null;
1264
+ generatedAlertId: string | null;
1265
+ relatedTaskId: string | null;
1266
+ analysisProvider: string | null;
1267
+ processingTime: number | null;
1268
+ modelVersion: string | null;
1269
+ phase: string | null;
1270
+ }, {
1271
+ createdAt: string;
1272
+ updatedAt: string;
1273
+ location: {
1274
+ lat: number;
1275
+ lng: number;
1276
+ accuracy?: number | undefined;
1277
+ } | null;
1278
+ farmId: string;
1279
+ fieldId: string | null;
1280
+ estimatedCost: number | null;
1281
+ recommendations: {
1282
+ priority: number;
1283
+ action: string;
1284
+ details: string;
1285
+ timing: string;
1286
+ materials?: {
1287
+ name: string;
1288
+ unit: string;
1289
+ quantity: number;
1290
+ inventoryItemId?: string | undefined;
1291
+ totalCost?: number | undefined;
1292
+ costPerUnit?: number | undefined;
1293
+ availability?: string | undefined;
1294
+ }[] | undefined;
1295
+ applicationMethod?: string | undefined;
1296
+ expectedOutcome?: string | undefined;
1297
+ preventiveMeasures?: string[] | undefined;
1298
+ estimatedTime?: string | undefined;
1299
+ riskLevel?: string | undefined;
1300
+ }[] | null;
1301
+ severity: "critical" | "high" | "medium" | "low" | null;
1302
+ uploadedBy: string;
1303
+ photoUrl: string;
1304
+ photoThumbnail: string | null;
1305
+ capturedAt: Date;
1306
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
1307
+ userNotes: string | null;
1308
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
1309
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
1310
+ analysisCompletedAt: Date | null;
1311
+ identifiedCrop: string | null;
1312
+ identifiedCropConfidence: number | null;
1313
+ diagnosisType: string | null;
1314
+ diagnosisConfidence: number | null;
1315
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
1316
+ healthScore: number | null;
1317
+ analysisDetails: {
1318
+ plantIdentification?: {
1319
+ confidence: number;
1320
+ scientificName: string;
1321
+ commonNames: string[];
1322
+ provider: string;
1323
+ } | undefined;
1324
+ primaryIssue?: {
1325
+ name: string;
1326
+ category: string;
1327
+ confidence: number;
1328
+ provider: string;
1329
+ visualIndicators: string[];
1330
+ } | undefined;
1331
+ secondaryIssues?: {
1332
+ name: string;
1333
+ confidence: number;
1334
+ reasoning: string;
1335
+ }[] | undefined;
1336
+ environmentalFactors?: Record<string, string> | undefined;
1337
+ satelliteCorrelation?: Record<string, any> | undefined;
1338
+ historicalMatches?: any[] | undefined;
1339
+ } | null;
1340
+ urgencyScore: number | null;
1341
+ similarCasesCount: number | null;
1342
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
1343
+ actionTakenAt: Date | null;
1344
+ actionNotes: string | null;
1345
+ generatedAlertId: string | null;
1346
+ relatedTaskId: string | null;
1347
+ analysisProvider: string | null;
1348
+ processingTime: number | null;
1349
+ modelVersion: string | null;
1350
+ phase: string | null;
1351
+ }>;
1352
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1353
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1354
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1355
+ }, "strip", z.ZodTypeAny, {
1356
+ type: string;
1357
+ id: string;
1358
+ attributes: {
1359
+ createdAt: string;
1360
+ updatedAt: string;
1361
+ location: {
1362
+ lat: number;
1363
+ lng: number;
1364
+ accuracy?: number | undefined;
1365
+ } | null;
1366
+ farmId: string;
1367
+ fieldId: string | null;
1368
+ estimatedCost: number | null;
1369
+ recommendations: {
1370
+ priority: number;
1371
+ action: string;
1372
+ details: string;
1373
+ timing: string;
1374
+ materials?: {
1375
+ name: string;
1376
+ unit: string;
1377
+ quantity: number;
1378
+ inventoryItemId?: string | undefined;
1379
+ totalCost?: number | undefined;
1380
+ costPerUnit?: number | undefined;
1381
+ availability?: string | undefined;
1382
+ }[] | undefined;
1383
+ applicationMethod?: string | undefined;
1384
+ expectedOutcome?: string | undefined;
1385
+ preventiveMeasures?: string[] | undefined;
1386
+ estimatedTime?: string | undefined;
1387
+ riskLevel?: string | undefined;
1388
+ }[] | null;
1389
+ severity: "critical" | "high" | "medium" | "low" | null;
1390
+ uploadedBy: string;
1391
+ photoUrl: string;
1392
+ photoThumbnail: string | null;
1393
+ capturedAt: Date;
1394
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
1395
+ userNotes: string | null;
1396
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
1397
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
1398
+ analysisCompletedAt: Date | null;
1399
+ identifiedCrop: string | null;
1400
+ identifiedCropConfidence: number | null;
1401
+ diagnosisType: string | null;
1402
+ diagnosisConfidence: number | null;
1403
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
1404
+ healthScore: number | null;
1405
+ analysisDetails: {
1406
+ plantIdentification?: {
1407
+ confidence: number;
1408
+ scientificName: string;
1409
+ commonNames: string[];
1410
+ provider: string;
1411
+ } | undefined;
1412
+ primaryIssue?: {
1413
+ name: string;
1414
+ category: string;
1415
+ confidence: number;
1416
+ provider: string;
1417
+ visualIndicators: string[];
1418
+ } | undefined;
1419
+ secondaryIssues?: {
1420
+ name: string;
1421
+ confidence: number;
1422
+ reasoning: string;
1423
+ }[] | undefined;
1424
+ environmentalFactors?: Record<string, string> | undefined;
1425
+ satelliteCorrelation?: Record<string, any> | undefined;
1426
+ historicalMatches?: any[] | undefined;
1427
+ } | null;
1428
+ urgencyScore: number | null;
1429
+ similarCasesCount: number | null;
1430
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
1431
+ actionTakenAt: Date | null;
1432
+ actionNotes: string | null;
1433
+ generatedAlertId: string | null;
1434
+ relatedTaskId: string | null;
1435
+ analysisProvider: string | null;
1436
+ processingTime: number | null;
1437
+ modelVersion: string | null;
1438
+ phase: string | null;
1439
+ };
1440
+ relationships?: Record<string, unknown> | undefined;
1441
+ links?: Record<string, string> | undefined;
1442
+ meta?: Record<string, unknown> | undefined;
1443
+ }, {
1444
+ type: string;
1445
+ id: string;
1446
+ attributes: {
1447
+ createdAt: string;
1448
+ updatedAt: string;
1449
+ location: {
1450
+ lat: number;
1451
+ lng: number;
1452
+ accuracy?: number | undefined;
1453
+ } | null;
1454
+ farmId: string;
1455
+ fieldId: string | null;
1456
+ estimatedCost: number | null;
1457
+ recommendations: {
1458
+ priority: number;
1459
+ action: string;
1460
+ details: string;
1461
+ timing: string;
1462
+ materials?: {
1463
+ name: string;
1464
+ unit: string;
1465
+ quantity: number;
1466
+ inventoryItemId?: string | undefined;
1467
+ totalCost?: number | undefined;
1468
+ costPerUnit?: number | undefined;
1469
+ availability?: string | undefined;
1470
+ }[] | undefined;
1471
+ applicationMethod?: string | undefined;
1472
+ expectedOutcome?: string | undefined;
1473
+ preventiveMeasures?: string[] | undefined;
1474
+ estimatedTime?: string | undefined;
1475
+ riskLevel?: string | undefined;
1476
+ }[] | null;
1477
+ severity: "critical" | "high" | "medium" | "low" | null;
1478
+ uploadedBy: string;
1479
+ photoUrl: string;
1480
+ photoThumbnail: string | null;
1481
+ capturedAt: Date;
1482
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
1483
+ userNotes: string | null;
1484
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
1485
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
1486
+ analysisCompletedAt: Date | null;
1487
+ identifiedCrop: string | null;
1488
+ identifiedCropConfidence: number | null;
1489
+ diagnosisType: string | null;
1490
+ diagnosisConfidence: number | null;
1491
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
1492
+ healthScore: number | null;
1493
+ analysisDetails: {
1494
+ plantIdentification?: {
1495
+ confidence: number;
1496
+ scientificName: string;
1497
+ commonNames: string[];
1498
+ provider: string;
1499
+ } | undefined;
1500
+ primaryIssue?: {
1501
+ name: string;
1502
+ category: string;
1503
+ confidence: number;
1504
+ provider: string;
1505
+ visualIndicators: string[];
1506
+ } | undefined;
1507
+ secondaryIssues?: {
1508
+ name: string;
1509
+ confidence: number;
1510
+ reasoning: string;
1511
+ }[] | undefined;
1512
+ environmentalFactors?: Record<string, string> | undefined;
1513
+ satelliteCorrelation?: Record<string, any> | undefined;
1514
+ historicalMatches?: any[] | undefined;
1515
+ } | null;
1516
+ urgencyScore: number | null;
1517
+ similarCasesCount: number | null;
1518
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
1519
+ actionTakenAt: Date | null;
1520
+ actionNotes: string | null;
1521
+ generatedAlertId: string | null;
1522
+ relatedTaskId: string | null;
1523
+ analysisProvider: string | null;
1524
+ processingTime: number | null;
1525
+ modelVersion: string | null;
1526
+ phase: string | null;
1527
+ };
1528
+ relationships?: Record<string, unknown> | undefined;
1529
+ links?: Record<string, string> | undefined;
1530
+ meta?: Record<string, unknown> | undefined;
1531
+ }>, "many">;
1532
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
1533
+ type: z.ZodString;
1534
+ id: z.ZodString;
1535
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1536
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1537
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1538
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1539
+ }, "strip", z.ZodTypeAny, {
1540
+ type: string;
1541
+ id: string;
1542
+ attributes?: Record<string, unknown> | undefined;
1543
+ relationships?: Record<string, unknown> | undefined;
1544
+ links?: Record<string, string> | undefined;
1545
+ meta?: Record<string, unknown> | undefined;
1546
+ }, {
1547
+ type: string;
1548
+ id: string;
1549
+ attributes?: Record<string, unknown> | undefined;
1550
+ relationships?: Record<string, unknown> | undefined;
1551
+ links?: Record<string, string> | undefined;
1552
+ meta?: Record<string, unknown> | undefined;
1553
+ }>, "many">>;
1554
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1555
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1556
+ }, "strip", z.ZodTypeAny, {
1557
+ data: {
1558
+ type: string;
1559
+ id: string;
1560
+ attributes: {
1561
+ createdAt: string;
1562
+ updatedAt: string;
1563
+ location: {
1564
+ lat: number;
1565
+ lng: number;
1566
+ accuracy?: number | undefined;
1567
+ } | null;
1568
+ farmId: string;
1569
+ fieldId: string | null;
1570
+ estimatedCost: number | null;
1571
+ recommendations: {
1572
+ priority: number;
1573
+ action: string;
1574
+ details: string;
1575
+ timing: string;
1576
+ materials?: {
1577
+ name: string;
1578
+ unit: string;
1579
+ quantity: number;
1580
+ inventoryItemId?: string | undefined;
1581
+ totalCost?: number | undefined;
1582
+ costPerUnit?: number | undefined;
1583
+ availability?: string | undefined;
1584
+ }[] | undefined;
1585
+ applicationMethod?: string | undefined;
1586
+ expectedOutcome?: string | undefined;
1587
+ preventiveMeasures?: string[] | undefined;
1588
+ estimatedTime?: string | undefined;
1589
+ riskLevel?: string | undefined;
1590
+ }[] | null;
1591
+ severity: "critical" | "high" | "medium" | "low" | null;
1592
+ uploadedBy: string;
1593
+ photoUrl: string;
1594
+ photoThumbnail: string | null;
1595
+ capturedAt: Date;
1596
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
1597
+ userNotes: string | null;
1598
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
1599
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
1600
+ analysisCompletedAt: Date | null;
1601
+ identifiedCrop: string | null;
1602
+ identifiedCropConfidence: number | null;
1603
+ diagnosisType: string | null;
1604
+ diagnosisConfidence: number | null;
1605
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
1606
+ healthScore: number | null;
1607
+ analysisDetails: {
1608
+ plantIdentification?: {
1609
+ confidence: number;
1610
+ scientificName: string;
1611
+ commonNames: string[];
1612
+ provider: string;
1613
+ } | undefined;
1614
+ primaryIssue?: {
1615
+ name: string;
1616
+ category: string;
1617
+ confidence: number;
1618
+ provider: string;
1619
+ visualIndicators: string[];
1620
+ } | undefined;
1621
+ secondaryIssues?: {
1622
+ name: string;
1623
+ confidence: number;
1624
+ reasoning: string;
1625
+ }[] | undefined;
1626
+ environmentalFactors?: Record<string, string> | undefined;
1627
+ satelliteCorrelation?: Record<string, any> | undefined;
1628
+ historicalMatches?: any[] | undefined;
1629
+ } | null;
1630
+ urgencyScore: number | null;
1631
+ similarCasesCount: number | null;
1632
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
1633
+ actionTakenAt: Date | null;
1634
+ actionNotes: string | null;
1635
+ generatedAlertId: string | null;
1636
+ relatedTaskId: string | null;
1637
+ analysisProvider: string | null;
1638
+ processingTime: number | null;
1639
+ modelVersion: string | null;
1640
+ phase: string | null;
1641
+ };
1642
+ relationships?: Record<string, unknown> | undefined;
1643
+ links?: Record<string, string> | undefined;
1644
+ meta?: Record<string, unknown> | undefined;
1645
+ }[];
1646
+ links?: Record<string, string> | undefined;
1647
+ meta?: Record<string, unknown> | undefined;
1648
+ included?: {
1649
+ type: string;
1650
+ id: string;
1651
+ attributes?: Record<string, unknown> | undefined;
1652
+ relationships?: Record<string, unknown> | undefined;
1653
+ links?: Record<string, string> | undefined;
1654
+ meta?: Record<string, unknown> | undefined;
1655
+ }[] | undefined;
1656
+ }, {
1657
+ data: {
1658
+ type: string;
1659
+ id: string;
1660
+ attributes: {
1661
+ createdAt: string;
1662
+ updatedAt: string;
1663
+ location: {
1664
+ lat: number;
1665
+ lng: number;
1666
+ accuracy?: number | undefined;
1667
+ } | null;
1668
+ farmId: string;
1669
+ fieldId: string | null;
1670
+ estimatedCost: number | null;
1671
+ recommendations: {
1672
+ priority: number;
1673
+ action: string;
1674
+ details: string;
1675
+ timing: string;
1676
+ materials?: {
1677
+ name: string;
1678
+ unit: string;
1679
+ quantity: number;
1680
+ inventoryItemId?: string | undefined;
1681
+ totalCost?: number | undefined;
1682
+ costPerUnit?: number | undefined;
1683
+ availability?: string | undefined;
1684
+ }[] | undefined;
1685
+ applicationMethod?: string | undefined;
1686
+ expectedOutcome?: string | undefined;
1687
+ preventiveMeasures?: string[] | undefined;
1688
+ estimatedTime?: string | undefined;
1689
+ riskLevel?: string | undefined;
1690
+ }[] | null;
1691
+ severity: "critical" | "high" | "medium" | "low" | null;
1692
+ uploadedBy: string;
1693
+ photoUrl: string;
1694
+ photoThumbnail: string | null;
1695
+ capturedAt: Date;
1696
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
1697
+ userNotes: string | null;
1698
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
1699
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
1700
+ analysisCompletedAt: Date | null;
1701
+ identifiedCrop: string | null;
1702
+ identifiedCropConfidence: number | null;
1703
+ diagnosisType: string | null;
1704
+ diagnosisConfidence: number | null;
1705
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
1706
+ healthScore: number | null;
1707
+ analysisDetails: {
1708
+ plantIdentification?: {
1709
+ confidence: number;
1710
+ scientificName: string;
1711
+ commonNames: string[];
1712
+ provider: string;
1713
+ } | undefined;
1714
+ primaryIssue?: {
1715
+ name: string;
1716
+ category: string;
1717
+ confidence: number;
1718
+ provider: string;
1719
+ visualIndicators: string[];
1720
+ } | undefined;
1721
+ secondaryIssues?: {
1722
+ name: string;
1723
+ confidence: number;
1724
+ reasoning: string;
1725
+ }[] | undefined;
1726
+ environmentalFactors?: Record<string, string> | undefined;
1727
+ satelliteCorrelation?: Record<string, any> | undefined;
1728
+ historicalMatches?: any[] | undefined;
1729
+ } | null;
1730
+ urgencyScore: number | null;
1731
+ similarCasesCount: number | null;
1732
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
1733
+ actionTakenAt: Date | null;
1734
+ actionNotes: string | null;
1735
+ generatedAlertId: string | null;
1736
+ relatedTaskId: string | null;
1737
+ analysisProvider: string | null;
1738
+ processingTime: number | null;
1739
+ modelVersion: string | null;
1740
+ phase: string | null;
1741
+ };
1742
+ relationships?: Record<string, unknown> | undefined;
1743
+ links?: Record<string, string> | undefined;
1744
+ meta?: Record<string, unknown> | undefined;
1745
+ }[];
1746
+ links?: Record<string, string> | undefined;
1747
+ meta?: Record<string, unknown> | undefined;
1748
+ included?: {
1749
+ type: string;
1750
+ id: string;
1751
+ attributes?: Record<string, unknown> | undefined;
1752
+ relationships?: Record<string, unknown> | undefined;
1753
+ links?: Record<string, string> | undefined;
1754
+ meta?: Record<string, unknown> | undefined;
1755
+ }[] | undefined;
1756
+ }>;
1757
+ 404: z.ZodObject<{
1758
+ message: z.ZodString;
1759
+ code: z.ZodString;
1760
+ }, "strip", z.ZodTypeAny, {
1761
+ code: string;
1762
+ message: string;
1763
+ }, {
1764
+ code: string;
1765
+ message: string;
1766
+ }>;
1767
+ };
1768
+ };
1769
+ listFarmObservations: {
1770
+ query: z.ZodObject<{
1771
+ fieldId: z.ZodOptional<z.ZodString>;
1772
+ status: z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "failed"]>>;
1773
+ observationType: z.ZodOptional<z.ZodString>;
1774
+ severity: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
1775
+ startDate: z.ZodOptional<z.ZodString>;
1776
+ endDate: z.ZodOptional<z.ZodString>;
1777
+ page: z.ZodDefault<z.ZodString>;
1778
+ pageSize: z.ZodDefault<z.ZodString>;
1779
+ }, "strip", z.ZodTypeAny, {
1780
+ pageSize: string;
1781
+ page: string;
1782
+ status?: "pending" | "completed" | "processing" | "failed" | undefined;
1783
+ fieldId?: string | undefined;
1784
+ severity?: "critical" | "high" | "medium" | "low" | undefined;
1785
+ startDate?: string | undefined;
1786
+ endDate?: string | undefined;
1787
+ observationType?: string | undefined;
1788
+ }, {
1789
+ status?: "pending" | "completed" | "processing" | "failed" | undefined;
1790
+ pageSize?: string | undefined;
1791
+ fieldId?: string | undefined;
1792
+ severity?: "critical" | "high" | "medium" | "low" | undefined;
1793
+ startDate?: string | undefined;
1794
+ endDate?: string | undefined;
1795
+ observationType?: string | undefined;
1796
+ page?: string | undefined;
1797
+ }>;
1798
+ summary: "List all observations across all farm fields";
1799
+ method: "GET";
1800
+ path: "/farms/:farmId/observations";
1801
+ responses: {
1802
+ 200: z.ZodObject<{
1803
+ data: z.ZodArray<z.ZodObject<{
1804
+ type: z.ZodLiteral<string>;
1805
+ id: z.ZodString;
1806
+ attributes: z.ZodObject<{
1807
+ fieldId: z.ZodNullable<z.ZodString>;
1808
+ farmId: z.ZodString;
1809
+ uploadedBy: z.ZodString;
1810
+ photoUrl: z.ZodString;
1811
+ photoThumbnail: z.ZodNullable<z.ZodString>;
1812
+ location: z.ZodNullable<z.ZodObject<{
1813
+ lat: z.ZodNumber;
1814
+ lng: z.ZodNumber;
1815
+ accuracy: z.ZodOptional<z.ZodNumber>;
1816
+ }, "strip", z.ZodTypeAny, {
1817
+ lat: number;
1818
+ lng: number;
1819
+ accuracy?: number | undefined;
1820
+ }, {
1821
+ lat: number;
1822
+ lng: number;
1823
+ accuracy?: number | undefined;
1824
+ }>>;
1825
+ capturedAt: z.ZodDate;
1826
+ observationType: z.ZodEnum<["disease", "pest", "nutrient", "weed", "general", "health_check"]>;
1827
+ userNotes: z.ZodNullable<z.ZodString>;
1828
+ cropStageAtTime: z.ZodNullable<z.ZodEnum<["planted", "germination", "vegetative", "flowering", "fruiting", "mature", "harvested"]>>;
1829
+ analysisStatus: z.ZodEnum<["pending", "processing", "completed", "failed"]>;
1830
+ analysisCompletedAt: z.ZodNullable<z.ZodDate>;
1831
+ identifiedCrop: z.ZodNullable<z.ZodString>;
1832
+ identifiedCropConfidence: z.ZodNullable<z.ZodNumber>;
1833
+ diagnosisType: z.ZodNullable<z.ZodString>;
1834
+ diagnosisConfidence: z.ZodNullable<z.ZodNumber>;
1835
+ severity: z.ZodNullable<z.ZodEnum<["low", "medium", "high", "critical"]>>;
1836
+ affectedArea: z.ZodNullable<z.ZodEnum<["localized", "widespread", "entire_field"]>>;
1837
+ healthScore: z.ZodNullable<z.ZodNumber>;
1838
+ analysisDetails: z.ZodNullable<z.ZodObject<{
1839
+ plantIdentification: z.ZodOptional<z.ZodObject<{
1840
+ scientificName: z.ZodString;
1841
+ commonNames: z.ZodArray<z.ZodString, "many">;
1842
+ confidence: z.ZodNumber;
1843
+ provider: z.ZodString;
1844
+ }, "strip", z.ZodTypeAny, {
1845
+ confidence: number;
1846
+ scientificName: string;
1847
+ commonNames: string[];
1848
+ provider: string;
1849
+ }, {
1850
+ confidence: number;
1851
+ scientificName: string;
1852
+ commonNames: string[];
1853
+ provider: string;
1854
+ }>>;
1855
+ primaryIssue: z.ZodOptional<z.ZodObject<{
1856
+ name: z.ZodString;
1857
+ category: z.ZodString;
1858
+ confidence: z.ZodNumber;
1859
+ provider: z.ZodString;
1860
+ visualIndicators: z.ZodArray<z.ZodString, "many">;
1861
+ }, "strip", z.ZodTypeAny, {
1862
+ name: string;
1863
+ category: string;
1864
+ confidence: number;
1865
+ provider: string;
1866
+ visualIndicators: string[];
1867
+ }, {
1868
+ name: string;
1869
+ category: string;
1870
+ confidence: number;
1871
+ provider: string;
1872
+ visualIndicators: string[];
1873
+ }>>;
1874
+ secondaryIssues: z.ZodOptional<z.ZodArray<z.ZodObject<{
1875
+ name: z.ZodString;
1876
+ confidence: z.ZodNumber;
1877
+ reasoning: z.ZodString;
1878
+ }, "strip", z.ZodTypeAny, {
1879
+ name: string;
1880
+ confidence: number;
1881
+ reasoning: string;
1882
+ }, {
1883
+ name: string;
1884
+ confidence: number;
1885
+ reasoning: string;
1886
+ }>, "many">>;
1887
+ environmentalFactors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1888
+ satelliteCorrelation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1889
+ historicalMatches: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
1890
+ }, "strip", z.ZodTypeAny, {
1891
+ plantIdentification?: {
1892
+ confidence: number;
1893
+ scientificName: string;
1894
+ commonNames: string[];
1895
+ provider: string;
1896
+ } | undefined;
1897
+ primaryIssue?: {
1898
+ name: string;
1899
+ category: string;
1900
+ confidence: number;
1901
+ provider: string;
1902
+ visualIndicators: string[];
1903
+ } | undefined;
1904
+ secondaryIssues?: {
1905
+ name: string;
1906
+ confidence: number;
1907
+ reasoning: string;
1908
+ }[] | undefined;
1909
+ environmentalFactors?: Record<string, string> | undefined;
1910
+ satelliteCorrelation?: Record<string, any> | undefined;
1911
+ historicalMatches?: any[] | undefined;
1912
+ }, {
1913
+ plantIdentification?: {
1914
+ confidence: number;
1915
+ scientificName: string;
1916
+ commonNames: string[];
1917
+ provider: string;
1918
+ } | undefined;
1919
+ primaryIssue?: {
1920
+ name: string;
1921
+ category: string;
1922
+ confidence: number;
1923
+ provider: string;
1924
+ visualIndicators: string[];
1925
+ } | undefined;
1926
+ secondaryIssues?: {
1927
+ name: string;
1928
+ confidence: number;
1929
+ reasoning: string;
1930
+ }[] | undefined;
1931
+ environmentalFactors?: Record<string, string> | undefined;
1932
+ satelliteCorrelation?: Record<string, any> | undefined;
1933
+ historicalMatches?: any[] | undefined;
1934
+ }>>;
1935
+ recommendations: z.ZodNullable<z.ZodArray<z.ZodObject<{
1936
+ priority: z.ZodNumber;
1937
+ action: z.ZodString;
1938
+ details: z.ZodString;
1939
+ timing: z.ZodString;
1940
+ materials: z.ZodOptional<z.ZodArray<z.ZodObject<{
1941
+ inventoryItemId: z.ZodOptional<z.ZodString>;
1942
+ name: z.ZodString;
1943
+ quantity: z.ZodNumber;
1944
+ unit: z.ZodString;
1945
+ costPerUnit: z.ZodOptional<z.ZodNumber>;
1946
+ totalCost: z.ZodOptional<z.ZodNumber>;
1947
+ availability: z.ZodOptional<z.ZodString>;
1948
+ }, "strip", z.ZodTypeAny, {
1949
+ name: string;
1950
+ unit: string;
1951
+ quantity: number;
1952
+ inventoryItemId?: string | undefined;
1953
+ totalCost?: number | undefined;
1954
+ costPerUnit?: number | undefined;
1955
+ availability?: string | undefined;
1956
+ }, {
1957
+ name: string;
1958
+ unit: string;
1959
+ quantity: number;
1960
+ inventoryItemId?: string | undefined;
1961
+ totalCost?: number | undefined;
1962
+ costPerUnit?: number | undefined;
1963
+ availability?: string | undefined;
1964
+ }>, "many">>;
1965
+ applicationMethod: z.ZodOptional<z.ZodString>;
1966
+ expectedOutcome: z.ZodOptional<z.ZodString>;
1967
+ preventiveMeasures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1968
+ estimatedTime: z.ZodOptional<z.ZodString>;
1969
+ riskLevel: z.ZodOptional<z.ZodString>;
1970
+ }, "strip", z.ZodTypeAny, {
1971
+ priority: number;
1972
+ action: string;
1973
+ details: string;
1974
+ timing: string;
1975
+ materials?: {
1976
+ name: string;
1977
+ unit: string;
1978
+ quantity: number;
1979
+ inventoryItemId?: string | undefined;
1980
+ totalCost?: number | undefined;
1981
+ costPerUnit?: number | undefined;
1982
+ availability?: string | undefined;
1983
+ }[] | undefined;
1984
+ applicationMethod?: string | undefined;
1985
+ expectedOutcome?: string | undefined;
1986
+ preventiveMeasures?: string[] | undefined;
1987
+ estimatedTime?: string | undefined;
1988
+ riskLevel?: string | undefined;
1989
+ }, {
1990
+ priority: number;
1991
+ action: string;
1992
+ details: string;
1993
+ timing: string;
1994
+ materials?: {
1995
+ name: string;
1996
+ unit: string;
1997
+ quantity: number;
1998
+ inventoryItemId?: string | undefined;
1999
+ totalCost?: number | undefined;
2000
+ costPerUnit?: number | undefined;
2001
+ availability?: string | undefined;
2002
+ }[] | undefined;
2003
+ applicationMethod?: string | undefined;
2004
+ expectedOutcome?: string | undefined;
2005
+ preventiveMeasures?: string[] | undefined;
2006
+ estimatedTime?: string | undefined;
2007
+ riskLevel?: string | undefined;
2008
+ }>, "many">>;
2009
+ estimatedCost: z.ZodNullable<z.ZodNumber>;
2010
+ urgencyScore: z.ZodNullable<z.ZodNumber>;
2011
+ similarCasesCount: z.ZodNullable<z.ZodNumber>;
2012
+ actionStatus: z.ZodEnum<["pending", "in_progress", "completed", "dismissed"]>;
2013
+ actionTakenAt: z.ZodNullable<z.ZodDate>;
2014
+ actionNotes: z.ZodNullable<z.ZodString>;
2015
+ generatedAlertId: z.ZodNullable<z.ZodString>;
2016
+ relatedTaskId: z.ZodNullable<z.ZodString>;
2017
+ analysisProvider: z.ZodNullable<z.ZodString>;
2018
+ processingTime: z.ZodNullable<z.ZodNumber>;
2019
+ modelVersion: z.ZodNullable<z.ZodString>;
2020
+ phase: z.ZodNullable<z.ZodString>;
2021
+ } & {
2022
+ createdAt: z.ZodString;
2023
+ updatedAt: z.ZodString;
2024
+ }, "strip", z.ZodTypeAny, {
2025
+ createdAt: string;
2026
+ updatedAt: string;
2027
+ location: {
2028
+ lat: number;
2029
+ lng: number;
2030
+ accuracy?: number | undefined;
2031
+ } | null;
2032
+ farmId: string;
2033
+ fieldId: string | null;
2034
+ estimatedCost: number | null;
2035
+ recommendations: {
2036
+ priority: number;
2037
+ action: string;
2038
+ details: string;
2039
+ timing: string;
2040
+ materials?: {
2041
+ name: string;
2042
+ unit: string;
2043
+ quantity: number;
2044
+ inventoryItemId?: string | undefined;
2045
+ totalCost?: number | undefined;
2046
+ costPerUnit?: number | undefined;
2047
+ availability?: string | undefined;
2048
+ }[] | undefined;
2049
+ applicationMethod?: string | undefined;
2050
+ expectedOutcome?: string | undefined;
2051
+ preventiveMeasures?: string[] | undefined;
2052
+ estimatedTime?: string | undefined;
2053
+ riskLevel?: string | undefined;
2054
+ }[] | null;
2055
+ severity: "critical" | "high" | "medium" | "low" | null;
2056
+ uploadedBy: string;
2057
+ photoUrl: string;
2058
+ photoThumbnail: string | null;
2059
+ capturedAt: Date;
2060
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
2061
+ userNotes: string | null;
2062
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
2063
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
2064
+ analysisCompletedAt: Date | null;
2065
+ identifiedCrop: string | null;
2066
+ identifiedCropConfidence: number | null;
2067
+ diagnosisType: string | null;
2068
+ diagnosisConfidence: number | null;
2069
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
2070
+ healthScore: number | null;
2071
+ analysisDetails: {
2072
+ plantIdentification?: {
2073
+ confidence: number;
2074
+ scientificName: string;
2075
+ commonNames: string[];
2076
+ provider: string;
2077
+ } | undefined;
2078
+ primaryIssue?: {
2079
+ name: string;
2080
+ category: string;
2081
+ confidence: number;
2082
+ provider: string;
2083
+ visualIndicators: string[];
2084
+ } | undefined;
2085
+ secondaryIssues?: {
2086
+ name: string;
2087
+ confidence: number;
2088
+ reasoning: string;
2089
+ }[] | undefined;
2090
+ environmentalFactors?: Record<string, string> | undefined;
2091
+ satelliteCorrelation?: Record<string, any> | undefined;
2092
+ historicalMatches?: any[] | undefined;
2093
+ } | null;
2094
+ urgencyScore: number | null;
2095
+ similarCasesCount: number | null;
2096
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
2097
+ actionTakenAt: Date | null;
2098
+ actionNotes: string | null;
2099
+ generatedAlertId: string | null;
2100
+ relatedTaskId: string | null;
2101
+ analysisProvider: string | null;
2102
+ processingTime: number | null;
2103
+ modelVersion: string | null;
2104
+ phase: string | null;
2105
+ }, {
2106
+ createdAt: string;
2107
+ updatedAt: string;
2108
+ location: {
2109
+ lat: number;
2110
+ lng: number;
2111
+ accuracy?: number | undefined;
2112
+ } | null;
2113
+ farmId: string;
2114
+ fieldId: string | null;
2115
+ estimatedCost: number | null;
2116
+ recommendations: {
2117
+ priority: number;
2118
+ action: string;
2119
+ details: string;
2120
+ timing: string;
2121
+ materials?: {
2122
+ name: string;
2123
+ unit: string;
2124
+ quantity: number;
2125
+ inventoryItemId?: string | undefined;
2126
+ totalCost?: number | undefined;
2127
+ costPerUnit?: number | undefined;
2128
+ availability?: string | undefined;
2129
+ }[] | undefined;
2130
+ applicationMethod?: string | undefined;
2131
+ expectedOutcome?: string | undefined;
2132
+ preventiveMeasures?: string[] | undefined;
2133
+ estimatedTime?: string | undefined;
2134
+ riskLevel?: string | undefined;
2135
+ }[] | null;
2136
+ severity: "critical" | "high" | "medium" | "low" | null;
2137
+ uploadedBy: string;
2138
+ photoUrl: string;
2139
+ photoThumbnail: string | null;
2140
+ capturedAt: Date;
2141
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
2142
+ userNotes: string | null;
2143
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
2144
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
2145
+ analysisCompletedAt: Date | null;
2146
+ identifiedCrop: string | null;
2147
+ identifiedCropConfidence: number | null;
2148
+ diagnosisType: string | null;
2149
+ diagnosisConfidence: number | null;
2150
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
2151
+ healthScore: number | null;
2152
+ analysisDetails: {
2153
+ plantIdentification?: {
2154
+ confidence: number;
2155
+ scientificName: string;
2156
+ commonNames: string[];
2157
+ provider: string;
2158
+ } | undefined;
2159
+ primaryIssue?: {
2160
+ name: string;
2161
+ category: string;
2162
+ confidence: number;
2163
+ provider: string;
2164
+ visualIndicators: string[];
2165
+ } | undefined;
2166
+ secondaryIssues?: {
2167
+ name: string;
2168
+ confidence: number;
2169
+ reasoning: string;
2170
+ }[] | undefined;
2171
+ environmentalFactors?: Record<string, string> | undefined;
2172
+ satelliteCorrelation?: Record<string, any> | undefined;
2173
+ historicalMatches?: any[] | undefined;
2174
+ } | null;
2175
+ urgencyScore: number | null;
2176
+ similarCasesCount: number | null;
2177
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
2178
+ actionTakenAt: Date | null;
2179
+ actionNotes: string | null;
2180
+ generatedAlertId: string | null;
2181
+ relatedTaskId: string | null;
2182
+ analysisProvider: string | null;
2183
+ processingTime: number | null;
2184
+ modelVersion: string | null;
2185
+ phase: string | null;
2186
+ }>;
2187
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2188
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2189
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2190
+ }, "strip", z.ZodTypeAny, {
2191
+ type: string;
2192
+ id: string;
2193
+ attributes: {
2194
+ createdAt: string;
2195
+ updatedAt: string;
2196
+ location: {
2197
+ lat: number;
2198
+ lng: number;
2199
+ accuracy?: number | undefined;
2200
+ } | null;
2201
+ farmId: string;
2202
+ fieldId: string | null;
2203
+ estimatedCost: number | null;
2204
+ recommendations: {
2205
+ priority: number;
2206
+ action: string;
2207
+ details: string;
2208
+ timing: string;
2209
+ materials?: {
2210
+ name: string;
2211
+ unit: string;
2212
+ quantity: number;
2213
+ inventoryItemId?: string | undefined;
2214
+ totalCost?: number | undefined;
2215
+ costPerUnit?: number | undefined;
2216
+ availability?: string | undefined;
2217
+ }[] | undefined;
2218
+ applicationMethod?: string | undefined;
2219
+ expectedOutcome?: string | undefined;
2220
+ preventiveMeasures?: string[] | undefined;
2221
+ estimatedTime?: string | undefined;
2222
+ riskLevel?: string | undefined;
2223
+ }[] | null;
2224
+ severity: "critical" | "high" | "medium" | "low" | null;
2225
+ uploadedBy: string;
2226
+ photoUrl: string;
2227
+ photoThumbnail: string | null;
2228
+ capturedAt: Date;
2229
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
2230
+ userNotes: string | null;
2231
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
2232
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
2233
+ analysisCompletedAt: Date | null;
2234
+ identifiedCrop: string | null;
2235
+ identifiedCropConfidence: number | null;
2236
+ diagnosisType: string | null;
2237
+ diagnosisConfidence: number | null;
2238
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
2239
+ healthScore: number | null;
2240
+ analysisDetails: {
2241
+ plantIdentification?: {
2242
+ confidence: number;
2243
+ scientificName: string;
2244
+ commonNames: string[];
2245
+ provider: string;
2246
+ } | undefined;
2247
+ primaryIssue?: {
2248
+ name: string;
2249
+ category: string;
2250
+ confidence: number;
2251
+ provider: string;
2252
+ visualIndicators: string[];
2253
+ } | undefined;
2254
+ secondaryIssues?: {
2255
+ name: string;
2256
+ confidence: number;
2257
+ reasoning: string;
2258
+ }[] | undefined;
2259
+ environmentalFactors?: Record<string, string> | undefined;
2260
+ satelliteCorrelation?: Record<string, any> | undefined;
2261
+ historicalMatches?: any[] | undefined;
2262
+ } | null;
2263
+ urgencyScore: number | null;
2264
+ similarCasesCount: number | null;
2265
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
2266
+ actionTakenAt: Date | null;
2267
+ actionNotes: string | null;
2268
+ generatedAlertId: string | null;
2269
+ relatedTaskId: string | null;
2270
+ analysisProvider: string | null;
2271
+ processingTime: number | null;
2272
+ modelVersion: string | null;
2273
+ phase: string | null;
2274
+ };
2275
+ relationships?: Record<string, unknown> | undefined;
2276
+ links?: Record<string, string> | undefined;
2277
+ meta?: Record<string, unknown> | undefined;
2278
+ }, {
2279
+ type: string;
2280
+ id: string;
2281
+ attributes: {
2282
+ createdAt: string;
2283
+ updatedAt: string;
2284
+ location: {
2285
+ lat: number;
2286
+ lng: number;
2287
+ accuracy?: number | undefined;
2288
+ } | null;
2289
+ farmId: string;
2290
+ fieldId: string | null;
2291
+ estimatedCost: number | null;
2292
+ recommendations: {
2293
+ priority: number;
2294
+ action: string;
2295
+ details: string;
2296
+ timing: string;
2297
+ materials?: {
2298
+ name: string;
2299
+ unit: string;
2300
+ quantity: number;
2301
+ inventoryItemId?: string | undefined;
2302
+ totalCost?: number | undefined;
2303
+ costPerUnit?: number | undefined;
2304
+ availability?: string | undefined;
2305
+ }[] | undefined;
2306
+ applicationMethod?: string | undefined;
2307
+ expectedOutcome?: string | undefined;
2308
+ preventiveMeasures?: string[] | undefined;
2309
+ estimatedTime?: string | undefined;
2310
+ riskLevel?: string | undefined;
2311
+ }[] | null;
2312
+ severity: "critical" | "high" | "medium" | "low" | null;
2313
+ uploadedBy: string;
2314
+ photoUrl: string;
2315
+ photoThumbnail: string | null;
2316
+ capturedAt: Date;
2317
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
2318
+ userNotes: string | null;
2319
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
2320
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
2321
+ analysisCompletedAt: Date | null;
2322
+ identifiedCrop: string | null;
2323
+ identifiedCropConfidence: number | null;
2324
+ diagnosisType: string | null;
2325
+ diagnosisConfidence: number | null;
2326
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
2327
+ healthScore: number | null;
2328
+ analysisDetails: {
2329
+ plantIdentification?: {
2330
+ confidence: number;
2331
+ scientificName: string;
2332
+ commonNames: string[];
2333
+ provider: string;
2334
+ } | undefined;
2335
+ primaryIssue?: {
2336
+ name: string;
2337
+ category: string;
2338
+ confidence: number;
2339
+ provider: string;
2340
+ visualIndicators: string[];
2341
+ } | undefined;
2342
+ secondaryIssues?: {
2343
+ name: string;
2344
+ confidence: number;
2345
+ reasoning: string;
2346
+ }[] | undefined;
2347
+ environmentalFactors?: Record<string, string> | undefined;
2348
+ satelliteCorrelation?: Record<string, any> | undefined;
2349
+ historicalMatches?: any[] | undefined;
2350
+ } | null;
2351
+ urgencyScore: number | null;
2352
+ similarCasesCount: number | null;
2353
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
2354
+ actionTakenAt: Date | null;
2355
+ actionNotes: string | null;
2356
+ generatedAlertId: string | null;
2357
+ relatedTaskId: string | null;
2358
+ analysisProvider: string | null;
2359
+ processingTime: number | null;
2360
+ modelVersion: string | null;
2361
+ phase: string | null;
2362
+ };
2363
+ relationships?: Record<string, unknown> | undefined;
2364
+ links?: Record<string, string> | undefined;
2365
+ meta?: Record<string, unknown> | undefined;
2366
+ }>, "many">;
2367
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
2368
+ type: z.ZodString;
2369
+ id: z.ZodString;
2370
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2371
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2372
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2373
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2374
+ }, "strip", z.ZodTypeAny, {
2375
+ type: string;
2376
+ id: string;
2377
+ attributes?: Record<string, unknown> | undefined;
2378
+ relationships?: Record<string, unknown> | undefined;
2379
+ links?: Record<string, string> | undefined;
2380
+ meta?: Record<string, unknown> | undefined;
2381
+ }, {
2382
+ type: string;
2383
+ id: string;
2384
+ attributes?: Record<string, unknown> | undefined;
2385
+ relationships?: Record<string, unknown> | undefined;
2386
+ links?: Record<string, string> | undefined;
2387
+ meta?: Record<string, unknown> | undefined;
2388
+ }>, "many">>;
2389
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2390
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2391
+ }, "strip", z.ZodTypeAny, {
2392
+ data: {
2393
+ type: string;
2394
+ id: string;
2395
+ attributes: {
2396
+ createdAt: string;
2397
+ updatedAt: string;
2398
+ location: {
2399
+ lat: number;
2400
+ lng: number;
2401
+ accuracy?: number | undefined;
2402
+ } | null;
2403
+ farmId: string;
2404
+ fieldId: string | null;
2405
+ estimatedCost: number | null;
2406
+ recommendations: {
2407
+ priority: number;
2408
+ action: string;
2409
+ details: string;
2410
+ timing: string;
2411
+ materials?: {
2412
+ name: string;
2413
+ unit: string;
2414
+ quantity: number;
2415
+ inventoryItemId?: string | undefined;
2416
+ totalCost?: number | undefined;
2417
+ costPerUnit?: number | undefined;
2418
+ availability?: string | undefined;
2419
+ }[] | undefined;
2420
+ applicationMethod?: string | undefined;
2421
+ expectedOutcome?: string | undefined;
2422
+ preventiveMeasures?: string[] | undefined;
2423
+ estimatedTime?: string | undefined;
2424
+ riskLevel?: string | undefined;
2425
+ }[] | null;
2426
+ severity: "critical" | "high" | "medium" | "low" | null;
2427
+ uploadedBy: string;
2428
+ photoUrl: string;
2429
+ photoThumbnail: string | null;
2430
+ capturedAt: Date;
2431
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
2432
+ userNotes: string | null;
2433
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
2434
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
2435
+ analysisCompletedAt: Date | null;
2436
+ identifiedCrop: string | null;
2437
+ identifiedCropConfidence: number | null;
2438
+ diagnosisType: string | null;
2439
+ diagnosisConfidence: number | null;
2440
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
2441
+ healthScore: number | null;
2442
+ analysisDetails: {
2443
+ plantIdentification?: {
2444
+ confidence: number;
2445
+ scientificName: string;
2446
+ commonNames: string[];
2447
+ provider: string;
2448
+ } | undefined;
2449
+ primaryIssue?: {
2450
+ name: string;
2451
+ category: string;
2452
+ confidence: number;
2453
+ provider: string;
2454
+ visualIndicators: string[];
2455
+ } | undefined;
2456
+ secondaryIssues?: {
2457
+ name: string;
2458
+ confidence: number;
2459
+ reasoning: string;
2460
+ }[] | undefined;
2461
+ environmentalFactors?: Record<string, string> | undefined;
2462
+ satelliteCorrelation?: Record<string, any> | undefined;
2463
+ historicalMatches?: any[] | undefined;
2464
+ } | null;
2465
+ urgencyScore: number | null;
2466
+ similarCasesCount: number | null;
2467
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
2468
+ actionTakenAt: Date | null;
2469
+ actionNotes: string | null;
2470
+ generatedAlertId: string | null;
2471
+ relatedTaskId: string | null;
2472
+ analysisProvider: string | null;
2473
+ processingTime: number | null;
2474
+ modelVersion: string | null;
2475
+ phase: string | null;
2476
+ };
2477
+ relationships?: Record<string, unknown> | undefined;
2478
+ links?: Record<string, string> | undefined;
2479
+ meta?: Record<string, unknown> | undefined;
2480
+ }[];
2481
+ links?: Record<string, string> | undefined;
2482
+ meta?: Record<string, unknown> | undefined;
2483
+ included?: {
2484
+ type: string;
2485
+ id: string;
2486
+ attributes?: Record<string, unknown> | undefined;
2487
+ relationships?: Record<string, unknown> | undefined;
2488
+ links?: Record<string, string> | undefined;
2489
+ meta?: Record<string, unknown> | undefined;
2490
+ }[] | undefined;
2491
+ }, {
2492
+ data: {
2493
+ type: string;
2494
+ id: string;
2495
+ attributes: {
2496
+ createdAt: string;
2497
+ updatedAt: string;
2498
+ location: {
2499
+ lat: number;
2500
+ lng: number;
2501
+ accuracy?: number | undefined;
2502
+ } | null;
2503
+ farmId: string;
2504
+ fieldId: string | null;
2505
+ estimatedCost: number | null;
2506
+ recommendations: {
2507
+ priority: number;
2508
+ action: string;
2509
+ details: string;
2510
+ timing: string;
2511
+ materials?: {
2512
+ name: string;
2513
+ unit: string;
2514
+ quantity: number;
2515
+ inventoryItemId?: string | undefined;
2516
+ totalCost?: number | undefined;
2517
+ costPerUnit?: number | undefined;
2518
+ availability?: string | undefined;
2519
+ }[] | undefined;
2520
+ applicationMethod?: string | undefined;
2521
+ expectedOutcome?: string | undefined;
2522
+ preventiveMeasures?: string[] | undefined;
2523
+ estimatedTime?: string | undefined;
2524
+ riskLevel?: string | undefined;
2525
+ }[] | null;
2526
+ severity: "critical" | "high" | "medium" | "low" | null;
2527
+ uploadedBy: string;
2528
+ photoUrl: string;
2529
+ photoThumbnail: string | null;
2530
+ capturedAt: Date;
2531
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
2532
+ userNotes: string | null;
2533
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
2534
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
2535
+ analysisCompletedAt: Date | null;
2536
+ identifiedCrop: string | null;
2537
+ identifiedCropConfidence: number | null;
2538
+ diagnosisType: string | null;
2539
+ diagnosisConfidence: number | null;
2540
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
2541
+ healthScore: number | null;
2542
+ analysisDetails: {
2543
+ plantIdentification?: {
2544
+ confidence: number;
2545
+ scientificName: string;
2546
+ commonNames: string[];
2547
+ provider: string;
2548
+ } | undefined;
2549
+ primaryIssue?: {
2550
+ name: string;
2551
+ category: string;
2552
+ confidence: number;
2553
+ provider: string;
2554
+ visualIndicators: string[];
2555
+ } | undefined;
2556
+ secondaryIssues?: {
2557
+ name: string;
2558
+ confidence: number;
2559
+ reasoning: string;
2560
+ }[] | undefined;
2561
+ environmentalFactors?: Record<string, string> | undefined;
2562
+ satelliteCorrelation?: Record<string, any> | undefined;
2563
+ historicalMatches?: any[] | undefined;
2564
+ } | null;
2565
+ urgencyScore: number | null;
2566
+ similarCasesCount: number | null;
2567
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
2568
+ actionTakenAt: Date | null;
2569
+ actionNotes: string | null;
2570
+ generatedAlertId: string | null;
2571
+ relatedTaskId: string | null;
2572
+ analysisProvider: string | null;
2573
+ processingTime: number | null;
2574
+ modelVersion: string | null;
2575
+ phase: string | null;
2576
+ };
2577
+ relationships?: Record<string, unknown> | undefined;
2578
+ links?: Record<string, string> | undefined;
2579
+ meta?: Record<string, unknown> | undefined;
2580
+ }[];
2581
+ links?: Record<string, string> | undefined;
2582
+ meta?: Record<string, unknown> | undefined;
2583
+ included?: {
2584
+ type: string;
2585
+ id: string;
2586
+ attributes?: Record<string, unknown> | undefined;
2587
+ relationships?: Record<string, unknown> | undefined;
2588
+ links?: Record<string, string> | undefined;
2589
+ meta?: Record<string, unknown> | undefined;
2590
+ }[] | undefined;
2591
+ }>;
2592
+ };
2593
+ };
2594
+ updateObservationAction: {
2595
+ summary: "Update action status for observation";
2596
+ method: "PATCH";
2597
+ body: z.ZodObject<{
2598
+ type: z.ZodLiteral<string>;
2599
+ id: z.ZodString;
2600
+ attributes: z.ZodObject<{
2601
+ actionStatus: z.ZodEnum<["in_progress", "completed", "dismissed"]>;
2602
+ actionNotes: z.ZodOptional<z.ZodString>;
2603
+ relatedTaskId: z.ZodOptional<z.ZodString>;
2604
+ }, "strip", z.ZodTypeAny, {
2605
+ actionStatus: "completed" | "in_progress" | "dismissed";
2606
+ actionNotes?: string | undefined;
2607
+ relatedTaskId?: string | undefined;
2608
+ }, {
2609
+ actionStatus: "completed" | "in_progress" | "dismissed";
2610
+ actionNotes?: string | undefined;
2611
+ relatedTaskId?: string | undefined;
2612
+ }>;
2613
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2614
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2615
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2616
+ }, "strip", z.ZodTypeAny, {
2617
+ type: string;
2618
+ id: string;
2619
+ attributes: {
2620
+ actionStatus: "completed" | "in_progress" | "dismissed";
2621
+ actionNotes?: string | undefined;
2622
+ relatedTaskId?: string | undefined;
2623
+ };
2624
+ relationships?: Record<string, unknown> | undefined;
2625
+ links?: Record<string, string> | undefined;
2626
+ meta?: Record<string, unknown> | undefined;
2627
+ }, {
2628
+ type: string;
2629
+ id: string;
2630
+ attributes: {
2631
+ actionStatus: "completed" | "in_progress" | "dismissed";
2632
+ actionNotes?: string | undefined;
2633
+ relatedTaskId?: string | undefined;
2634
+ };
2635
+ relationships?: Record<string, unknown> | undefined;
2636
+ links?: Record<string, string> | undefined;
2637
+ meta?: Record<string, unknown> | undefined;
2638
+ }>;
2639
+ path: "/observations/:id/action";
2640
+ responses: {
2641
+ 200: z.ZodObject<{
2642
+ data: z.ZodObject<{
2643
+ type: z.ZodLiteral<string>;
2644
+ id: z.ZodString;
2645
+ attributes: z.ZodObject<{
2646
+ fieldId: z.ZodNullable<z.ZodString>;
2647
+ farmId: z.ZodString;
2648
+ uploadedBy: z.ZodString;
2649
+ photoUrl: z.ZodString;
2650
+ photoThumbnail: z.ZodNullable<z.ZodString>;
2651
+ location: z.ZodNullable<z.ZodObject<{
2652
+ lat: z.ZodNumber;
2653
+ lng: z.ZodNumber;
2654
+ accuracy: z.ZodOptional<z.ZodNumber>;
2655
+ }, "strip", z.ZodTypeAny, {
2656
+ lat: number;
2657
+ lng: number;
2658
+ accuracy?: number | undefined;
2659
+ }, {
2660
+ lat: number;
2661
+ lng: number;
2662
+ accuracy?: number | undefined;
2663
+ }>>;
2664
+ capturedAt: z.ZodDate;
2665
+ observationType: z.ZodEnum<["disease", "pest", "nutrient", "weed", "general", "health_check"]>;
2666
+ userNotes: z.ZodNullable<z.ZodString>;
2667
+ cropStageAtTime: z.ZodNullable<z.ZodEnum<["planted", "germination", "vegetative", "flowering", "fruiting", "mature", "harvested"]>>;
2668
+ analysisStatus: z.ZodEnum<["pending", "processing", "completed", "failed"]>;
2669
+ analysisCompletedAt: z.ZodNullable<z.ZodDate>;
2670
+ identifiedCrop: z.ZodNullable<z.ZodString>;
2671
+ identifiedCropConfidence: z.ZodNullable<z.ZodNumber>;
2672
+ diagnosisType: z.ZodNullable<z.ZodString>;
2673
+ diagnosisConfidence: z.ZodNullable<z.ZodNumber>;
2674
+ severity: z.ZodNullable<z.ZodEnum<["low", "medium", "high", "critical"]>>;
2675
+ affectedArea: z.ZodNullable<z.ZodEnum<["localized", "widespread", "entire_field"]>>;
2676
+ healthScore: z.ZodNullable<z.ZodNumber>;
2677
+ analysisDetails: z.ZodNullable<z.ZodObject<{
2678
+ plantIdentification: z.ZodOptional<z.ZodObject<{
2679
+ scientificName: z.ZodString;
2680
+ commonNames: z.ZodArray<z.ZodString, "many">;
2681
+ confidence: z.ZodNumber;
2682
+ provider: z.ZodString;
2683
+ }, "strip", z.ZodTypeAny, {
2684
+ confidence: number;
2685
+ scientificName: string;
2686
+ commonNames: string[];
2687
+ provider: string;
2688
+ }, {
2689
+ confidence: number;
2690
+ scientificName: string;
2691
+ commonNames: string[];
2692
+ provider: string;
2693
+ }>>;
2694
+ primaryIssue: z.ZodOptional<z.ZodObject<{
2695
+ name: z.ZodString;
2696
+ category: z.ZodString;
2697
+ confidence: z.ZodNumber;
2698
+ provider: z.ZodString;
2699
+ visualIndicators: z.ZodArray<z.ZodString, "many">;
2700
+ }, "strip", z.ZodTypeAny, {
2701
+ name: string;
2702
+ category: string;
2703
+ confidence: number;
2704
+ provider: string;
2705
+ visualIndicators: string[];
2706
+ }, {
2707
+ name: string;
2708
+ category: string;
2709
+ confidence: number;
2710
+ provider: string;
2711
+ visualIndicators: string[];
2712
+ }>>;
2713
+ secondaryIssues: z.ZodOptional<z.ZodArray<z.ZodObject<{
2714
+ name: z.ZodString;
2715
+ confidence: z.ZodNumber;
2716
+ reasoning: z.ZodString;
2717
+ }, "strip", z.ZodTypeAny, {
2718
+ name: string;
2719
+ confidence: number;
2720
+ reasoning: string;
2721
+ }, {
2722
+ name: string;
2723
+ confidence: number;
2724
+ reasoning: string;
2725
+ }>, "many">>;
2726
+ environmentalFactors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2727
+ satelliteCorrelation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2728
+ historicalMatches: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
2729
+ }, "strip", z.ZodTypeAny, {
2730
+ plantIdentification?: {
2731
+ confidence: number;
2732
+ scientificName: string;
2733
+ commonNames: string[];
2734
+ provider: string;
2735
+ } | undefined;
2736
+ primaryIssue?: {
2737
+ name: string;
2738
+ category: string;
2739
+ confidence: number;
2740
+ provider: string;
2741
+ visualIndicators: string[];
2742
+ } | undefined;
2743
+ secondaryIssues?: {
2744
+ name: string;
2745
+ confidence: number;
2746
+ reasoning: string;
2747
+ }[] | undefined;
2748
+ environmentalFactors?: Record<string, string> | undefined;
2749
+ satelliteCorrelation?: Record<string, any> | undefined;
2750
+ historicalMatches?: any[] | undefined;
2751
+ }, {
2752
+ plantIdentification?: {
2753
+ confidence: number;
2754
+ scientificName: string;
2755
+ commonNames: string[];
2756
+ provider: string;
2757
+ } | undefined;
2758
+ primaryIssue?: {
2759
+ name: string;
2760
+ category: string;
2761
+ confidence: number;
2762
+ provider: string;
2763
+ visualIndicators: string[];
2764
+ } | undefined;
2765
+ secondaryIssues?: {
2766
+ name: string;
2767
+ confidence: number;
2768
+ reasoning: string;
2769
+ }[] | undefined;
2770
+ environmentalFactors?: Record<string, string> | undefined;
2771
+ satelliteCorrelation?: Record<string, any> | undefined;
2772
+ historicalMatches?: any[] | undefined;
2773
+ }>>;
2774
+ recommendations: z.ZodNullable<z.ZodArray<z.ZodObject<{
2775
+ priority: z.ZodNumber;
2776
+ action: z.ZodString;
2777
+ details: z.ZodString;
2778
+ timing: z.ZodString;
2779
+ materials: z.ZodOptional<z.ZodArray<z.ZodObject<{
2780
+ inventoryItemId: z.ZodOptional<z.ZodString>;
2781
+ name: z.ZodString;
2782
+ quantity: z.ZodNumber;
2783
+ unit: z.ZodString;
2784
+ costPerUnit: z.ZodOptional<z.ZodNumber>;
2785
+ totalCost: z.ZodOptional<z.ZodNumber>;
2786
+ availability: z.ZodOptional<z.ZodString>;
2787
+ }, "strip", z.ZodTypeAny, {
2788
+ name: string;
2789
+ unit: string;
2790
+ quantity: number;
2791
+ inventoryItemId?: string | undefined;
2792
+ totalCost?: number | undefined;
2793
+ costPerUnit?: number | undefined;
2794
+ availability?: string | undefined;
2795
+ }, {
2796
+ name: string;
2797
+ unit: string;
2798
+ quantity: number;
2799
+ inventoryItemId?: string | undefined;
2800
+ totalCost?: number | undefined;
2801
+ costPerUnit?: number | undefined;
2802
+ availability?: string | undefined;
2803
+ }>, "many">>;
2804
+ applicationMethod: z.ZodOptional<z.ZodString>;
2805
+ expectedOutcome: z.ZodOptional<z.ZodString>;
2806
+ preventiveMeasures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2807
+ estimatedTime: z.ZodOptional<z.ZodString>;
2808
+ riskLevel: z.ZodOptional<z.ZodString>;
2809
+ }, "strip", z.ZodTypeAny, {
2810
+ priority: number;
2811
+ action: string;
2812
+ details: string;
2813
+ timing: string;
2814
+ materials?: {
2815
+ name: string;
2816
+ unit: string;
2817
+ quantity: number;
2818
+ inventoryItemId?: string | undefined;
2819
+ totalCost?: number | undefined;
2820
+ costPerUnit?: number | undefined;
2821
+ availability?: string | undefined;
2822
+ }[] | undefined;
2823
+ applicationMethod?: string | undefined;
2824
+ expectedOutcome?: string | undefined;
2825
+ preventiveMeasures?: string[] | undefined;
2826
+ estimatedTime?: string | undefined;
2827
+ riskLevel?: string | undefined;
2828
+ }, {
2829
+ priority: number;
2830
+ action: string;
2831
+ details: string;
2832
+ timing: string;
2833
+ materials?: {
2834
+ name: string;
2835
+ unit: string;
2836
+ quantity: number;
2837
+ inventoryItemId?: string | undefined;
2838
+ totalCost?: number | undefined;
2839
+ costPerUnit?: number | undefined;
2840
+ availability?: string | undefined;
2841
+ }[] | undefined;
2842
+ applicationMethod?: string | undefined;
2843
+ expectedOutcome?: string | undefined;
2844
+ preventiveMeasures?: string[] | undefined;
2845
+ estimatedTime?: string | undefined;
2846
+ riskLevel?: string | undefined;
2847
+ }>, "many">>;
2848
+ estimatedCost: z.ZodNullable<z.ZodNumber>;
2849
+ urgencyScore: z.ZodNullable<z.ZodNumber>;
2850
+ similarCasesCount: z.ZodNullable<z.ZodNumber>;
2851
+ actionStatus: z.ZodEnum<["pending", "in_progress", "completed", "dismissed"]>;
2852
+ actionTakenAt: z.ZodNullable<z.ZodDate>;
2853
+ actionNotes: z.ZodNullable<z.ZodString>;
2854
+ generatedAlertId: z.ZodNullable<z.ZodString>;
2855
+ relatedTaskId: z.ZodNullable<z.ZodString>;
2856
+ analysisProvider: z.ZodNullable<z.ZodString>;
2857
+ processingTime: z.ZodNullable<z.ZodNumber>;
2858
+ modelVersion: z.ZodNullable<z.ZodString>;
2859
+ phase: z.ZodNullable<z.ZodString>;
2860
+ } & {
2861
+ createdAt: z.ZodString;
2862
+ updatedAt: z.ZodString;
2863
+ }, "strip", z.ZodTypeAny, {
2864
+ createdAt: string;
2865
+ updatedAt: string;
2866
+ location: {
2867
+ lat: number;
2868
+ lng: number;
2869
+ accuracy?: number | undefined;
2870
+ } | null;
2871
+ farmId: string;
2872
+ fieldId: string | null;
2873
+ estimatedCost: number | null;
2874
+ recommendations: {
2875
+ priority: number;
2876
+ action: string;
2877
+ details: string;
2878
+ timing: string;
2879
+ materials?: {
2880
+ name: string;
2881
+ unit: string;
2882
+ quantity: number;
2883
+ inventoryItemId?: string | undefined;
2884
+ totalCost?: number | undefined;
2885
+ costPerUnit?: number | undefined;
2886
+ availability?: string | undefined;
2887
+ }[] | undefined;
2888
+ applicationMethod?: string | undefined;
2889
+ expectedOutcome?: string | undefined;
2890
+ preventiveMeasures?: string[] | undefined;
2891
+ estimatedTime?: string | undefined;
2892
+ riskLevel?: string | undefined;
2893
+ }[] | null;
2894
+ severity: "critical" | "high" | "medium" | "low" | null;
2895
+ uploadedBy: string;
2896
+ photoUrl: string;
2897
+ photoThumbnail: string | null;
2898
+ capturedAt: Date;
2899
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
2900
+ userNotes: string | null;
2901
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
2902
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
2903
+ analysisCompletedAt: Date | null;
2904
+ identifiedCrop: string | null;
2905
+ identifiedCropConfidence: number | null;
2906
+ diagnosisType: string | null;
2907
+ diagnosisConfidence: number | null;
2908
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
2909
+ healthScore: number | null;
2910
+ analysisDetails: {
2911
+ plantIdentification?: {
2912
+ confidence: number;
2913
+ scientificName: string;
2914
+ commonNames: string[];
2915
+ provider: string;
2916
+ } | undefined;
2917
+ primaryIssue?: {
2918
+ name: string;
2919
+ category: string;
2920
+ confidence: number;
2921
+ provider: string;
2922
+ visualIndicators: string[];
2923
+ } | undefined;
2924
+ secondaryIssues?: {
2925
+ name: string;
2926
+ confidence: number;
2927
+ reasoning: string;
2928
+ }[] | undefined;
2929
+ environmentalFactors?: Record<string, string> | undefined;
2930
+ satelliteCorrelation?: Record<string, any> | undefined;
2931
+ historicalMatches?: any[] | undefined;
2932
+ } | null;
2933
+ urgencyScore: number | null;
2934
+ similarCasesCount: number | null;
2935
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
2936
+ actionTakenAt: Date | null;
2937
+ actionNotes: string | null;
2938
+ generatedAlertId: string | null;
2939
+ relatedTaskId: string | null;
2940
+ analysisProvider: string | null;
2941
+ processingTime: number | null;
2942
+ modelVersion: string | null;
2943
+ phase: string | null;
2944
+ }, {
2945
+ createdAt: string;
2946
+ updatedAt: string;
2947
+ location: {
2948
+ lat: number;
2949
+ lng: number;
2950
+ accuracy?: number | undefined;
2951
+ } | null;
2952
+ farmId: string;
2953
+ fieldId: string | null;
2954
+ estimatedCost: number | null;
2955
+ recommendations: {
2956
+ priority: number;
2957
+ action: string;
2958
+ details: string;
2959
+ timing: string;
2960
+ materials?: {
2961
+ name: string;
2962
+ unit: string;
2963
+ quantity: number;
2964
+ inventoryItemId?: string | undefined;
2965
+ totalCost?: number | undefined;
2966
+ costPerUnit?: number | undefined;
2967
+ availability?: string | undefined;
2968
+ }[] | undefined;
2969
+ applicationMethod?: string | undefined;
2970
+ expectedOutcome?: string | undefined;
2971
+ preventiveMeasures?: string[] | undefined;
2972
+ estimatedTime?: string | undefined;
2973
+ riskLevel?: string | undefined;
2974
+ }[] | null;
2975
+ severity: "critical" | "high" | "medium" | "low" | null;
2976
+ uploadedBy: string;
2977
+ photoUrl: string;
2978
+ photoThumbnail: string | null;
2979
+ capturedAt: Date;
2980
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
2981
+ userNotes: string | null;
2982
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
2983
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
2984
+ analysisCompletedAt: Date | null;
2985
+ identifiedCrop: string | null;
2986
+ identifiedCropConfidence: number | null;
2987
+ diagnosisType: string | null;
2988
+ diagnosisConfidence: number | null;
2989
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
2990
+ healthScore: number | null;
2991
+ analysisDetails: {
2992
+ plantIdentification?: {
2993
+ confidence: number;
2994
+ scientificName: string;
2995
+ commonNames: string[];
2996
+ provider: string;
2997
+ } | undefined;
2998
+ primaryIssue?: {
2999
+ name: string;
3000
+ category: string;
3001
+ confidence: number;
3002
+ provider: string;
3003
+ visualIndicators: string[];
3004
+ } | undefined;
3005
+ secondaryIssues?: {
3006
+ name: string;
3007
+ confidence: number;
3008
+ reasoning: string;
3009
+ }[] | undefined;
3010
+ environmentalFactors?: Record<string, string> | undefined;
3011
+ satelliteCorrelation?: Record<string, any> | undefined;
3012
+ historicalMatches?: any[] | undefined;
3013
+ } | null;
3014
+ urgencyScore: number | null;
3015
+ similarCasesCount: number | null;
3016
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
3017
+ actionTakenAt: Date | null;
3018
+ actionNotes: string | null;
3019
+ generatedAlertId: string | null;
3020
+ relatedTaskId: string | null;
3021
+ analysisProvider: string | null;
3022
+ processingTime: number | null;
3023
+ modelVersion: string | null;
3024
+ phase: string | null;
3025
+ }>;
3026
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3027
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3028
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3029
+ }, "strip", z.ZodTypeAny, {
3030
+ type: string;
3031
+ id: string;
3032
+ attributes: {
3033
+ createdAt: string;
3034
+ updatedAt: string;
3035
+ location: {
3036
+ lat: number;
3037
+ lng: number;
3038
+ accuracy?: number | undefined;
3039
+ } | null;
3040
+ farmId: string;
3041
+ fieldId: string | null;
3042
+ estimatedCost: number | null;
3043
+ recommendations: {
3044
+ priority: number;
3045
+ action: string;
3046
+ details: string;
3047
+ timing: string;
3048
+ materials?: {
3049
+ name: string;
3050
+ unit: string;
3051
+ quantity: number;
3052
+ inventoryItemId?: string | undefined;
3053
+ totalCost?: number | undefined;
3054
+ costPerUnit?: number | undefined;
3055
+ availability?: string | undefined;
3056
+ }[] | undefined;
3057
+ applicationMethod?: string | undefined;
3058
+ expectedOutcome?: string | undefined;
3059
+ preventiveMeasures?: string[] | undefined;
3060
+ estimatedTime?: string | undefined;
3061
+ riskLevel?: string | undefined;
3062
+ }[] | null;
3063
+ severity: "critical" | "high" | "medium" | "low" | null;
3064
+ uploadedBy: string;
3065
+ photoUrl: string;
3066
+ photoThumbnail: string | null;
3067
+ capturedAt: Date;
3068
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
3069
+ userNotes: string | null;
3070
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
3071
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
3072
+ analysisCompletedAt: Date | null;
3073
+ identifiedCrop: string | null;
3074
+ identifiedCropConfidence: number | null;
3075
+ diagnosisType: string | null;
3076
+ diagnosisConfidence: number | null;
3077
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
3078
+ healthScore: number | null;
3079
+ analysisDetails: {
3080
+ plantIdentification?: {
3081
+ confidence: number;
3082
+ scientificName: string;
3083
+ commonNames: string[];
3084
+ provider: string;
3085
+ } | undefined;
3086
+ primaryIssue?: {
3087
+ name: string;
3088
+ category: string;
3089
+ confidence: number;
3090
+ provider: string;
3091
+ visualIndicators: string[];
3092
+ } | undefined;
3093
+ secondaryIssues?: {
3094
+ name: string;
3095
+ confidence: number;
3096
+ reasoning: string;
3097
+ }[] | undefined;
3098
+ environmentalFactors?: Record<string, string> | undefined;
3099
+ satelliteCorrelation?: Record<string, any> | undefined;
3100
+ historicalMatches?: any[] | undefined;
3101
+ } | null;
3102
+ urgencyScore: number | null;
3103
+ similarCasesCount: number | null;
3104
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
3105
+ actionTakenAt: Date | null;
3106
+ actionNotes: string | null;
3107
+ generatedAlertId: string | null;
3108
+ relatedTaskId: string | null;
3109
+ analysisProvider: string | null;
3110
+ processingTime: number | null;
3111
+ modelVersion: string | null;
3112
+ phase: string | null;
3113
+ };
3114
+ relationships?: Record<string, unknown> | undefined;
3115
+ links?: Record<string, string> | undefined;
3116
+ meta?: Record<string, unknown> | undefined;
3117
+ }, {
3118
+ type: string;
3119
+ id: string;
3120
+ attributes: {
3121
+ createdAt: string;
3122
+ updatedAt: string;
3123
+ location: {
3124
+ lat: number;
3125
+ lng: number;
3126
+ accuracy?: number | undefined;
3127
+ } | null;
3128
+ farmId: string;
3129
+ fieldId: string | null;
3130
+ estimatedCost: number | null;
3131
+ recommendations: {
3132
+ priority: number;
3133
+ action: string;
3134
+ details: string;
3135
+ timing: string;
3136
+ materials?: {
3137
+ name: string;
3138
+ unit: string;
3139
+ quantity: number;
3140
+ inventoryItemId?: string | undefined;
3141
+ totalCost?: number | undefined;
3142
+ costPerUnit?: number | undefined;
3143
+ availability?: string | undefined;
3144
+ }[] | undefined;
3145
+ applicationMethod?: string | undefined;
3146
+ expectedOutcome?: string | undefined;
3147
+ preventiveMeasures?: string[] | undefined;
3148
+ estimatedTime?: string | undefined;
3149
+ riskLevel?: string | undefined;
3150
+ }[] | null;
3151
+ severity: "critical" | "high" | "medium" | "low" | null;
3152
+ uploadedBy: string;
3153
+ photoUrl: string;
3154
+ photoThumbnail: string | null;
3155
+ capturedAt: Date;
3156
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
3157
+ userNotes: string | null;
3158
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
3159
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
3160
+ analysisCompletedAt: Date | null;
3161
+ identifiedCrop: string | null;
3162
+ identifiedCropConfidence: number | null;
3163
+ diagnosisType: string | null;
3164
+ diagnosisConfidence: number | null;
3165
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
3166
+ healthScore: number | null;
3167
+ analysisDetails: {
3168
+ plantIdentification?: {
3169
+ confidence: number;
3170
+ scientificName: string;
3171
+ commonNames: string[];
3172
+ provider: string;
3173
+ } | undefined;
3174
+ primaryIssue?: {
3175
+ name: string;
3176
+ category: string;
3177
+ confidence: number;
3178
+ provider: string;
3179
+ visualIndicators: string[];
3180
+ } | undefined;
3181
+ secondaryIssues?: {
3182
+ name: string;
3183
+ confidence: number;
3184
+ reasoning: string;
3185
+ }[] | undefined;
3186
+ environmentalFactors?: Record<string, string> | undefined;
3187
+ satelliteCorrelation?: Record<string, any> | undefined;
3188
+ historicalMatches?: any[] | undefined;
3189
+ } | null;
3190
+ urgencyScore: number | null;
3191
+ similarCasesCount: number | null;
3192
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
3193
+ actionTakenAt: Date | null;
3194
+ actionNotes: string | null;
3195
+ generatedAlertId: string | null;
3196
+ relatedTaskId: string | null;
3197
+ analysisProvider: string | null;
3198
+ processingTime: number | null;
3199
+ modelVersion: string | null;
3200
+ phase: string | null;
3201
+ };
3202
+ relationships?: Record<string, unknown> | undefined;
3203
+ links?: Record<string, string> | undefined;
3204
+ meta?: Record<string, unknown> | undefined;
3205
+ }>;
3206
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
3207
+ type: z.ZodString;
3208
+ id: z.ZodString;
3209
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3210
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3211
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3212
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3213
+ }, "strip", z.ZodTypeAny, {
3214
+ type: string;
3215
+ id: string;
3216
+ attributes?: Record<string, unknown> | undefined;
3217
+ relationships?: Record<string, unknown> | undefined;
3218
+ links?: Record<string, string> | undefined;
3219
+ meta?: Record<string, unknown> | undefined;
3220
+ }, {
3221
+ type: string;
3222
+ id: string;
3223
+ attributes?: Record<string, unknown> | undefined;
3224
+ relationships?: Record<string, unknown> | undefined;
3225
+ links?: Record<string, string> | undefined;
3226
+ meta?: Record<string, unknown> | undefined;
3227
+ }>, "many">>;
3228
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3229
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3230
+ }, "strip", z.ZodTypeAny, {
3231
+ data: {
3232
+ type: string;
3233
+ id: string;
3234
+ attributes: {
3235
+ createdAt: string;
3236
+ updatedAt: string;
3237
+ location: {
3238
+ lat: number;
3239
+ lng: number;
3240
+ accuracy?: number | undefined;
3241
+ } | null;
3242
+ farmId: string;
3243
+ fieldId: string | null;
3244
+ estimatedCost: number | null;
3245
+ recommendations: {
3246
+ priority: number;
3247
+ action: string;
3248
+ details: string;
3249
+ timing: string;
3250
+ materials?: {
3251
+ name: string;
3252
+ unit: string;
3253
+ quantity: number;
3254
+ inventoryItemId?: string | undefined;
3255
+ totalCost?: number | undefined;
3256
+ costPerUnit?: number | undefined;
3257
+ availability?: string | undefined;
3258
+ }[] | undefined;
3259
+ applicationMethod?: string | undefined;
3260
+ expectedOutcome?: string | undefined;
3261
+ preventiveMeasures?: string[] | undefined;
3262
+ estimatedTime?: string | undefined;
3263
+ riskLevel?: string | undefined;
3264
+ }[] | null;
3265
+ severity: "critical" | "high" | "medium" | "low" | null;
3266
+ uploadedBy: string;
3267
+ photoUrl: string;
3268
+ photoThumbnail: string | null;
3269
+ capturedAt: Date;
3270
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
3271
+ userNotes: string | null;
3272
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
3273
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
3274
+ analysisCompletedAt: Date | null;
3275
+ identifiedCrop: string | null;
3276
+ identifiedCropConfidence: number | null;
3277
+ diagnosisType: string | null;
3278
+ diagnosisConfidence: number | null;
3279
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
3280
+ healthScore: number | null;
3281
+ analysisDetails: {
3282
+ plantIdentification?: {
3283
+ confidence: number;
3284
+ scientificName: string;
3285
+ commonNames: string[];
3286
+ provider: string;
3287
+ } | undefined;
3288
+ primaryIssue?: {
3289
+ name: string;
3290
+ category: string;
3291
+ confidence: number;
3292
+ provider: string;
3293
+ visualIndicators: string[];
3294
+ } | undefined;
3295
+ secondaryIssues?: {
3296
+ name: string;
3297
+ confidence: number;
3298
+ reasoning: string;
3299
+ }[] | undefined;
3300
+ environmentalFactors?: Record<string, string> | undefined;
3301
+ satelliteCorrelation?: Record<string, any> | undefined;
3302
+ historicalMatches?: any[] | undefined;
3303
+ } | null;
3304
+ urgencyScore: number | null;
3305
+ similarCasesCount: number | null;
3306
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
3307
+ actionTakenAt: Date | null;
3308
+ actionNotes: string | null;
3309
+ generatedAlertId: string | null;
3310
+ relatedTaskId: string | null;
3311
+ analysisProvider: string | null;
3312
+ processingTime: number | null;
3313
+ modelVersion: string | null;
3314
+ phase: string | null;
3315
+ };
3316
+ relationships?: Record<string, unknown> | undefined;
3317
+ links?: Record<string, string> | undefined;
3318
+ meta?: Record<string, unknown> | undefined;
3319
+ };
3320
+ links?: Record<string, string> | undefined;
3321
+ meta?: Record<string, unknown> | undefined;
3322
+ included?: {
3323
+ type: string;
3324
+ id: string;
3325
+ attributes?: Record<string, unknown> | undefined;
3326
+ relationships?: Record<string, unknown> | undefined;
3327
+ links?: Record<string, string> | undefined;
3328
+ meta?: Record<string, unknown> | undefined;
3329
+ }[] | undefined;
3330
+ }, {
3331
+ data: {
3332
+ type: string;
3333
+ id: string;
3334
+ attributes: {
3335
+ createdAt: string;
3336
+ updatedAt: string;
3337
+ location: {
3338
+ lat: number;
3339
+ lng: number;
3340
+ accuracy?: number | undefined;
3341
+ } | null;
3342
+ farmId: string;
3343
+ fieldId: string | null;
3344
+ estimatedCost: number | null;
3345
+ recommendations: {
3346
+ priority: number;
3347
+ action: string;
3348
+ details: string;
3349
+ timing: string;
3350
+ materials?: {
3351
+ name: string;
3352
+ unit: string;
3353
+ quantity: number;
3354
+ inventoryItemId?: string | undefined;
3355
+ totalCost?: number | undefined;
3356
+ costPerUnit?: number | undefined;
3357
+ availability?: string | undefined;
3358
+ }[] | undefined;
3359
+ applicationMethod?: string | undefined;
3360
+ expectedOutcome?: string | undefined;
3361
+ preventiveMeasures?: string[] | undefined;
3362
+ estimatedTime?: string | undefined;
3363
+ riskLevel?: string | undefined;
3364
+ }[] | null;
3365
+ severity: "critical" | "high" | "medium" | "low" | null;
3366
+ uploadedBy: string;
3367
+ photoUrl: string;
3368
+ photoThumbnail: string | null;
3369
+ capturedAt: Date;
3370
+ observationType: "general" | "disease" | "pest" | "nutrient" | "weed" | "health_check";
3371
+ userNotes: string | null;
3372
+ cropStageAtTime: "planted" | "flowering" | "mature" | "harvested" | "germination" | "vegetative" | "fruiting" | null;
3373
+ analysisStatus: "pending" | "completed" | "processing" | "failed";
3374
+ analysisCompletedAt: Date | null;
3375
+ identifiedCrop: string | null;
3376
+ identifiedCropConfidence: number | null;
3377
+ diagnosisType: string | null;
3378
+ diagnosisConfidence: number | null;
3379
+ affectedArea: "localized" | "widespread" | "entire_field" | null;
3380
+ healthScore: number | null;
3381
+ analysisDetails: {
3382
+ plantIdentification?: {
3383
+ confidence: number;
3384
+ scientificName: string;
3385
+ commonNames: string[];
3386
+ provider: string;
3387
+ } | undefined;
3388
+ primaryIssue?: {
3389
+ name: string;
3390
+ category: string;
3391
+ confidence: number;
3392
+ provider: string;
3393
+ visualIndicators: string[];
3394
+ } | undefined;
3395
+ secondaryIssues?: {
3396
+ name: string;
3397
+ confidence: number;
3398
+ reasoning: string;
3399
+ }[] | undefined;
3400
+ environmentalFactors?: Record<string, string> | undefined;
3401
+ satelliteCorrelation?: Record<string, any> | undefined;
3402
+ historicalMatches?: any[] | undefined;
3403
+ } | null;
3404
+ urgencyScore: number | null;
3405
+ similarCasesCount: number | null;
3406
+ actionStatus: "pending" | "completed" | "in_progress" | "dismissed";
3407
+ actionTakenAt: Date | null;
3408
+ actionNotes: string | null;
3409
+ generatedAlertId: string | null;
3410
+ relatedTaskId: string | null;
3411
+ analysisProvider: string | null;
3412
+ processingTime: number | null;
3413
+ modelVersion: string | null;
3414
+ phase: string | null;
3415
+ };
3416
+ relationships?: Record<string, unknown> | undefined;
3417
+ links?: Record<string, string> | undefined;
3418
+ meta?: Record<string, unknown> | undefined;
3419
+ };
3420
+ links?: Record<string, string> | undefined;
3421
+ meta?: Record<string, unknown> | undefined;
3422
+ included?: {
3423
+ type: string;
3424
+ id: string;
3425
+ attributes?: Record<string, unknown> | undefined;
3426
+ relationships?: Record<string, unknown> | undefined;
3427
+ links?: Record<string, string> | undefined;
3428
+ meta?: Record<string, unknown> | undefined;
3429
+ }[] | undefined;
3430
+ }>;
3431
+ 404: z.ZodObject<{
3432
+ message: z.ZodString;
3433
+ code: z.ZodString;
3434
+ }, "strip", z.ZodTypeAny, {
3435
+ code: string;
3436
+ message: string;
3437
+ }, {
3438
+ code: string;
3439
+ message: string;
3440
+ }>;
3441
+ };
3442
+ };
3443
+ deleteObservation: {
3444
+ summary: "Delete observation and associated photo";
3445
+ method: "DELETE";
3446
+ body: typeof import("@ts-rest/core").ContractNoBody;
3447
+ path: "/observations/:id";
3448
+ responses: {
3449
+ 204: typeof import("@ts-rest/core").ContractNoBody;
3450
+ 404: z.ZodObject<{
3451
+ message: z.ZodString;
3452
+ code: z.ZodString;
3453
+ }, "strip", z.ZodTypeAny, {
3454
+ code: string;
3455
+ message: string;
3456
+ }, {
3457
+ code: string;
3458
+ message: string;
3459
+ }>;
3460
+ };
3461
+ };
3462
+ getObservationStats: {
3463
+ query: z.ZodObject<{
3464
+ startDate: z.ZodOptional<z.ZodString>;
3465
+ endDate: z.ZodOptional<z.ZodString>;
3466
+ }, "strip", z.ZodTypeAny, {
3467
+ startDate?: string | undefined;
3468
+ endDate?: string | undefined;
3469
+ }, {
3470
+ startDate?: string | undefined;
3471
+ endDate?: string | undefined;
3472
+ }>;
3473
+ summary: "Get observation statistics for a field";
3474
+ method: "GET";
3475
+ path: "/fields/:fieldId/observations/stats";
3476
+ responses: {
3477
+ 200: z.ZodObject<{
3478
+ total: z.ZodNumber;
3479
+ byType: z.ZodRecord<z.ZodString, z.ZodNumber>;
3480
+ bySeverity: z.ZodRecord<z.ZodString, z.ZodNumber>;
3481
+ avgConfidence: z.ZodNumber;
3482
+ mostCommonIssues: z.ZodArray<z.ZodObject<{
3483
+ name: z.ZodString;
3484
+ count: z.ZodNumber;
3485
+ avgSeverity: z.ZodString;
3486
+ }, "strip", z.ZodTypeAny, {
3487
+ name: string;
3488
+ count: number;
3489
+ avgSeverity: string;
3490
+ }, {
3491
+ name: string;
3492
+ count: number;
3493
+ avgSeverity: string;
3494
+ }>, "many">;
3495
+ }, "strip", z.ZodTypeAny, {
3496
+ total: number;
3497
+ byType: Record<string, number>;
3498
+ bySeverity: Record<string, number>;
3499
+ avgConfidence: number;
3500
+ mostCommonIssues: {
3501
+ name: string;
3502
+ count: number;
3503
+ avgSeverity: string;
3504
+ }[];
3505
+ }, {
3506
+ total: number;
3507
+ byType: Record<string, number>;
3508
+ bySeverity: Record<string, number>;
3509
+ avgConfidence: number;
3510
+ mostCommonIssues: {
3511
+ name: string;
3512
+ count: number;
3513
+ avgSeverity: string;
3514
+ }[];
3515
+ }>;
3516
+ };
3517
+ };
3518
+ };
3519
+ //# sourceMappingURL=field-observations.routes.d.ts.map