@deepintel-ltd/farmpro-contracts 1.3.0 → 1.3.3

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