@deepintel-ltd/farmpro-contracts 1.36.8 → 1.36.9

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.
@@ -1,5 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  export declare const fieldActivityTypeSchema: z.ZodEnum<["weeding", "fertilizer", "scouting", "spray", "biocontrol", "sanitation", "irrigation", "pruning", "staking"]>;
3
+ /** What a spray or biocontrol record applied, so the harvest checks can read it without parsing a note. */
4
+ export declare const treatmentProductClassSchema: z.ZodEnum<["fungicide", "insecticide", "miticide", "biopesticide", "herbicide"]>;
5
+ export declare const resistanceSystemSchema: z.ZodEnum<["IRAC", "FRAC", "HRAC"]>;
3
6
  export declare const fieldActivitySourceSchema: z.ZodEnum<["manual", "agent", "whatsapp"]>;
4
7
  export declare const fieldActivityAttributesSchema: z.ZodObject<{
5
8
  fieldId: z.ZodString;
@@ -13,6 +16,13 @@ export declare const fieldActivityAttributesSchema: z.ZodObject<{
13
16
  quantity: z.ZodNullable<z.ZodNumber>;
14
17
  unit: z.ZodNullable<z.ZodString>;
15
18
  notes: z.ZodNullable<z.ZodString>;
19
+ productClass: z.ZodOptional<z.ZodNullable<z.ZodEnum<["fungicide", "insecticide", "miticide", "biopesticide", "herbicide"]>>>;
20
+ activeIngredient: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
+ resistanceSystem: z.ZodOptional<z.ZodNullable<z.ZodEnum<["IRAC", "FRAC", "HRAC"]>>>;
22
+ resistanceCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ /** Null on a spray means the farmer did not know the waiting period. */
24
+ preHarvestDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
25
+ targetThreat: z.ZodOptional<z.ZodNullable<z.ZodString>>;
16
26
  createdById: z.ZodNullable<z.ZodString>;
17
27
  source: z.ZodEnum<["manual", "agent", "whatsapp"]>;
18
28
  } & {
@@ -34,6 +44,12 @@ export declare const fieldActivityAttributesSchema: z.ZodObject<{
34
44
  createdById: string | null;
35
45
  fertilizerProductId: string | null;
36
46
  fieldName?: string | undefined;
47
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
48
+ activeIngredient?: string | null | undefined;
49
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
50
+ resistanceCode?: string | null | undefined;
51
+ preHarvestDays?: number | null | undefined;
52
+ targetThreat?: string | null | undefined;
37
53
  }, {
38
54
  type: "weeding" | "fertilizer" | "irrigation" | "pruning" | "scouting" | "spray" | "biocontrol" | "sanitation" | "staking";
39
55
  source: "whatsapp" | "manual" | "agent";
@@ -50,6 +66,12 @@ export declare const fieldActivityAttributesSchema: z.ZodObject<{
50
66
  createdById: string | null;
51
67
  fertilizerProductId: string | null;
52
68
  fieldName?: string | undefined;
69
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
70
+ activeIngredient?: string | null | undefined;
71
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
72
+ resistanceCode?: string | null | undefined;
73
+ preHarvestDays?: number | null | undefined;
74
+ targetThreat?: string | null | undefined;
53
75
  }>;
54
76
  export declare const createFieldActivityAttributesSchema: z.ZodEffects<z.ZodObject<{
55
77
  fieldId: z.ZodString;
@@ -62,6 +84,12 @@ export declare const createFieldActivityAttributesSchema: z.ZodEffects<z.ZodObje
62
84
  quantity: z.ZodOptional<z.ZodNumber>;
63
85
  unit: z.ZodOptional<z.ZodString>;
64
86
  notes: z.ZodOptional<z.ZodString>;
87
+ productClass: z.ZodOptional<z.ZodEnum<["fungicide", "insecticide", "miticide", "biopesticide", "herbicide"]>>;
88
+ activeIngredient: z.ZodOptional<z.ZodString>;
89
+ resistanceSystem: z.ZodOptional<z.ZodEnum<["IRAC", "FRAC", "HRAC"]>>;
90
+ resistanceCode: z.ZodOptional<z.ZodString>;
91
+ preHarvestDays: z.ZodOptional<z.ZodNumber>;
92
+ targetThreat: z.ZodOptional<z.ZodString>;
65
93
  source: z.ZodOptional<z.ZodEnum<["manual", "agent", "whatsapp"]>>;
66
94
  }, "strip", z.ZodTypeAny, {
67
95
  type: "weeding" | "fertilizer" | "irrigation" | "pruning" | "scouting" | "spray" | "biocontrol" | "sanitation" | "staking";
@@ -75,6 +103,12 @@ export declare const createFieldActivityAttributesSchema: z.ZodEffects<z.ZodObje
75
103
  productName?: string | undefined;
76
104
  inventoryItemId?: string | undefined;
77
105
  fertilizerProductId?: string | undefined;
106
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | undefined;
107
+ activeIngredient?: string | undefined;
108
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | undefined;
109
+ resistanceCode?: string | undefined;
110
+ preHarvestDays?: number | undefined;
111
+ targetThreat?: string | undefined;
78
112
  }, {
79
113
  type: "weeding" | "fertilizer" | "irrigation" | "pruning" | "scouting" | "spray" | "biocontrol" | "sanitation" | "staking";
80
114
  occurredAt: string;
@@ -87,6 +121,12 @@ export declare const createFieldActivityAttributesSchema: z.ZodEffects<z.ZodObje
87
121
  productName?: string | undefined;
88
122
  inventoryItemId?: string | undefined;
89
123
  fertilizerProductId?: string | undefined;
124
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | undefined;
125
+ activeIngredient?: string | undefined;
126
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | undefined;
127
+ resistanceCode?: string | undefined;
128
+ preHarvestDays?: number | undefined;
129
+ targetThreat?: string | undefined;
90
130
  }>, {
91
131
  type: "weeding" | "fertilizer" | "irrigation" | "pruning" | "scouting" | "spray" | "biocontrol" | "sanitation" | "staking";
92
132
  occurredAt: string;
@@ -99,6 +139,12 @@ export declare const createFieldActivityAttributesSchema: z.ZodEffects<z.ZodObje
99
139
  productName?: string | undefined;
100
140
  inventoryItemId?: string | undefined;
101
141
  fertilizerProductId?: string | undefined;
142
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | undefined;
143
+ activeIngredient?: string | undefined;
144
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | undefined;
145
+ resistanceCode?: string | undefined;
146
+ preHarvestDays?: number | undefined;
147
+ targetThreat?: string | undefined;
102
148
  }, {
103
149
  type: "weeding" | "fertilizer" | "irrigation" | "pruning" | "scouting" | "spray" | "biocontrol" | "sanitation" | "staking";
104
150
  occurredAt: string;
@@ -111,6 +157,12 @@ export declare const createFieldActivityAttributesSchema: z.ZodEffects<z.ZodObje
111
157
  productName?: string | undefined;
112
158
  inventoryItemId?: string | undefined;
113
159
  fertilizerProductId?: string | undefined;
160
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | undefined;
161
+ activeIngredient?: string | undefined;
162
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | undefined;
163
+ resistanceCode?: string | undefined;
164
+ preHarvestDays?: number | undefined;
165
+ targetThreat?: string | undefined;
114
166
  }>;
115
167
  export declare const updateFieldActivityAttributesSchema: z.ZodObject<{
116
168
  occurredAt: z.ZodOptional<z.ZodString>;
@@ -121,6 +173,12 @@ export declare const updateFieldActivityAttributesSchema: z.ZodObject<{
121
173
  quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
122
174
  unit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
123
175
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
176
+ productClass: z.ZodOptional<z.ZodNullable<z.ZodEnum<["fungicide", "insecticide", "miticide", "biopesticide", "herbicide"]>>>;
177
+ activeIngredient: z.ZodOptional<z.ZodNullable<z.ZodString>>;
178
+ resistanceSystem: z.ZodOptional<z.ZodNullable<z.ZodEnum<["IRAC", "FRAC", "HRAC"]>>>;
179
+ resistanceCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
180
+ preHarvestDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
181
+ targetThreat: z.ZodOptional<z.ZodNullable<z.ZodString>>;
124
182
  }, "strip", z.ZodTypeAny, {
125
183
  method?: string | null | undefined;
126
184
  notes?: string | null | undefined;
@@ -130,6 +188,12 @@ export declare const updateFieldActivityAttributesSchema: z.ZodObject<{
130
188
  productName?: string | null | undefined;
131
189
  inventoryItemId?: string | null | undefined;
132
190
  fertilizerProductId?: string | null | undefined;
191
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
192
+ activeIngredient?: string | null | undefined;
193
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
194
+ resistanceCode?: string | null | undefined;
195
+ preHarvestDays?: number | null | undefined;
196
+ targetThreat?: string | null | undefined;
133
197
  }, {
134
198
  method?: string | null | undefined;
135
199
  notes?: string | null | undefined;
@@ -139,6 +203,12 @@ export declare const updateFieldActivityAttributesSchema: z.ZodObject<{
139
203
  productName?: string | null | undefined;
140
204
  inventoryItemId?: string | null | undefined;
141
205
  fertilizerProductId?: string | null | undefined;
206
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
207
+ activeIngredient?: string | null | undefined;
208
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
209
+ resistanceCode?: string | null | undefined;
210
+ preHarvestDays?: number | null | undefined;
211
+ targetThreat?: string | null | undefined;
142
212
  }>;
143
213
  export declare const createFieldActivitySchema: z.ZodObject<{
144
214
  type: z.ZodLiteral<"field-activities">;
@@ -153,6 +223,12 @@ export declare const createFieldActivitySchema: z.ZodObject<{
153
223
  quantity: z.ZodOptional<z.ZodNumber>;
154
224
  unit: z.ZodOptional<z.ZodString>;
155
225
  notes: z.ZodOptional<z.ZodString>;
226
+ productClass: z.ZodOptional<z.ZodEnum<["fungicide", "insecticide", "miticide", "biopesticide", "herbicide"]>>;
227
+ activeIngredient: z.ZodOptional<z.ZodString>;
228
+ resistanceSystem: z.ZodOptional<z.ZodEnum<["IRAC", "FRAC", "HRAC"]>>;
229
+ resistanceCode: z.ZodOptional<z.ZodString>;
230
+ preHarvestDays: z.ZodOptional<z.ZodNumber>;
231
+ targetThreat: z.ZodOptional<z.ZodString>;
156
232
  source: z.ZodOptional<z.ZodEnum<["manual", "agent", "whatsapp"]>>;
157
233
  }, "strip", z.ZodTypeAny, {
158
234
  type: "weeding" | "fertilizer" | "irrigation" | "pruning" | "scouting" | "spray" | "biocontrol" | "sanitation" | "staking";
@@ -166,6 +242,12 @@ export declare const createFieldActivitySchema: z.ZodObject<{
166
242
  productName?: string | undefined;
167
243
  inventoryItemId?: string | undefined;
168
244
  fertilizerProductId?: string | undefined;
245
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | undefined;
246
+ activeIngredient?: string | undefined;
247
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | undefined;
248
+ resistanceCode?: string | undefined;
249
+ preHarvestDays?: number | undefined;
250
+ targetThreat?: string | undefined;
169
251
  }, {
170
252
  type: "weeding" | "fertilizer" | "irrigation" | "pruning" | "scouting" | "spray" | "biocontrol" | "sanitation" | "staking";
171
253
  occurredAt: string;
@@ -178,6 +260,12 @@ export declare const createFieldActivitySchema: z.ZodObject<{
178
260
  productName?: string | undefined;
179
261
  inventoryItemId?: string | undefined;
180
262
  fertilizerProductId?: string | undefined;
263
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | undefined;
264
+ activeIngredient?: string | undefined;
265
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | undefined;
266
+ resistanceCode?: string | undefined;
267
+ preHarvestDays?: number | undefined;
268
+ targetThreat?: string | undefined;
181
269
  }>, {
182
270
  type: "weeding" | "fertilizer" | "irrigation" | "pruning" | "scouting" | "spray" | "biocontrol" | "sanitation" | "staking";
183
271
  occurredAt: string;
@@ -190,6 +278,12 @@ export declare const createFieldActivitySchema: z.ZodObject<{
190
278
  productName?: string | undefined;
191
279
  inventoryItemId?: string | undefined;
192
280
  fertilizerProductId?: string | undefined;
281
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | undefined;
282
+ activeIngredient?: string | undefined;
283
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | undefined;
284
+ resistanceCode?: string | undefined;
285
+ preHarvestDays?: number | undefined;
286
+ targetThreat?: string | undefined;
193
287
  }, {
194
288
  type: "weeding" | "fertilizer" | "irrigation" | "pruning" | "scouting" | "spray" | "biocontrol" | "sanitation" | "staking";
195
289
  occurredAt: string;
@@ -202,6 +296,12 @@ export declare const createFieldActivitySchema: z.ZodObject<{
202
296
  productName?: string | undefined;
203
297
  inventoryItemId?: string | undefined;
204
298
  fertilizerProductId?: string | undefined;
299
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | undefined;
300
+ activeIngredient?: string | undefined;
301
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | undefined;
302
+ resistanceCode?: string | undefined;
303
+ preHarvestDays?: number | undefined;
304
+ targetThreat?: string | undefined;
205
305
  }>;
206
306
  }, "strip", z.ZodTypeAny, {
207
307
  type: "field-activities";
@@ -217,6 +317,12 @@ export declare const createFieldActivitySchema: z.ZodObject<{
217
317
  productName?: string | undefined;
218
318
  inventoryItemId?: string | undefined;
219
319
  fertilizerProductId?: string | undefined;
320
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | undefined;
321
+ activeIngredient?: string | undefined;
322
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | undefined;
323
+ resistanceCode?: string | undefined;
324
+ preHarvestDays?: number | undefined;
325
+ targetThreat?: string | undefined;
220
326
  };
221
327
  }, {
222
328
  type: "field-activities";
@@ -232,6 +338,12 @@ export declare const createFieldActivitySchema: z.ZodObject<{
232
338
  productName?: string | undefined;
233
339
  inventoryItemId?: string | undefined;
234
340
  fertilizerProductId?: string | undefined;
341
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | undefined;
342
+ activeIngredient?: string | undefined;
343
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | undefined;
344
+ resistanceCode?: string | undefined;
345
+ preHarvestDays?: number | undefined;
346
+ targetThreat?: string | undefined;
235
347
  };
236
348
  }>;
237
349
  export declare const updateFieldActivitySchema: z.ZodObject<{
@@ -246,6 +358,12 @@ export declare const updateFieldActivitySchema: z.ZodObject<{
246
358
  quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
247
359
  unit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
248
360
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
361
+ productClass: z.ZodOptional<z.ZodNullable<z.ZodEnum<["fungicide", "insecticide", "miticide", "biopesticide", "herbicide"]>>>;
362
+ activeIngredient: z.ZodOptional<z.ZodNullable<z.ZodString>>;
363
+ resistanceSystem: z.ZodOptional<z.ZodNullable<z.ZodEnum<["IRAC", "FRAC", "HRAC"]>>>;
364
+ resistanceCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
365
+ preHarvestDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
366
+ targetThreat: z.ZodOptional<z.ZodNullable<z.ZodString>>;
249
367
  }, "strip", z.ZodTypeAny, {
250
368
  method?: string | null | undefined;
251
369
  notes?: string | null | undefined;
@@ -255,6 +373,12 @@ export declare const updateFieldActivitySchema: z.ZodObject<{
255
373
  productName?: string | null | undefined;
256
374
  inventoryItemId?: string | null | undefined;
257
375
  fertilizerProductId?: string | null | undefined;
376
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
377
+ activeIngredient?: string | null | undefined;
378
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
379
+ resistanceCode?: string | null | undefined;
380
+ preHarvestDays?: number | null | undefined;
381
+ targetThreat?: string | null | undefined;
258
382
  }, {
259
383
  method?: string | null | undefined;
260
384
  notes?: string | null | undefined;
@@ -264,6 +388,12 @@ export declare const updateFieldActivitySchema: z.ZodObject<{
264
388
  productName?: string | null | undefined;
265
389
  inventoryItemId?: string | null | undefined;
266
390
  fertilizerProductId?: string | null | undefined;
391
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
392
+ activeIngredient?: string | null | undefined;
393
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
394
+ resistanceCode?: string | null | undefined;
395
+ preHarvestDays?: number | null | undefined;
396
+ targetThreat?: string | null | undefined;
267
397
  }>;
268
398
  }, "strip", z.ZodTypeAny, {
269
399
  type: "field-activities";
@@ -277,6 +407,12 @@ export declare const updateFieldActivitySchema: z.ZodObject<{
277
407
  productName?: string | null | undefined;
278
408
  inventoryItemId?: string | null | undefined;
279
409
  fertilizerProductId?: string | null | undefined;
410
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
411
+ activeIngredient?: string | null | undefined;
412
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
413
+ resistanceCode?: string | null | undefined;
414
+ preHarvestDays?: number | null | undefined;
415
+ targetThreat?: string | null | undefined;
280
416
  };
281
417
  }, {
282
418
  type: "field-activities";
@@ -290,6 +426,12 @@ export declare const updateFieldActivitySchema: z.ZodObject<{
290
426
  productName?: string | null | undefined;
291
427
  inventoryItemId?: string | null | undefined;
292
428
  fertilizerProductId?: string | null | undefined;
429
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
430
+ activeIngredient?: string | null | undefined;
431
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
432
+ resistanceCode?: string | null | undefined;
433
+ preHarvestDays?: number | null | undefined;
434
+ targetThreat?: string | null | undefined;
293
435
  };
294
436
  }>;
295
437
  export declare const fieldActivityResourceSchema: z.ZodObject<{
@@ -307,6 +449,13 @@ export declare const fieldActivityResourceSchema: z.ZodObject<{
307
449
  quantity: z.ZodNullable<z.ZodNumber>;
308
450
  unit: z.ZodNullable<z.ZodString>;
309
451
  notes: z.ZodNullable<z.ZodString>;
452
+ productClass: z.ZodOptional<z.ZodNullable<z.ZodEnum<["fungicide", "insecticide", "miticide", "biopesticide", "herbicide"]>>>;
453
+ activeIngredient: z.ZodOptional<z.ZodNullable<z.ZodString>>;
454
+ resistanceSystem: z.ZodOptional<z.ZodNullable<z.ZodEnum<["IRAC", "FRAC", "HRAC"]>>>;
455
+ resistanceCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
456
+ /** Null on a spray means the farmer did not know the waiting period. */
457
+ preHarvestDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
458
+ targetThreat: z.ZodOptional<z.ZodNullable<z.ZodString>>;
310
459
  createdById: z.ZodNullable<z.ZodString>;
311
460
  source: z.ZodEnum<["manual", "agent", "whatsapp"]>;
312
461
  } & {
@@ -328,6 +477,12 @@ export declare const fieldActivityResourceSchema: z.ZodObject<{
328
477
  createdById: string | null;
329
478
  fertilizerProductId: string | null;
330
479
  fieldName?: string | undefined;
480
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
481
+ activeIngredient?: string | null | undefined;
482
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
483
+ resistanceCode?: string | null | undefined;
484
+ preHarvestDays?: number | null | undefined;
485
+ targetThreat?: string | null | undefined;
331
486
  }, {
332
487
  type: "weeding" | "fertilizer" | "irrigation" | "pruning" | "scouting" | "spray" | "biocontrol" | "sanitation" | "staking";
333
488
  source: "whatsapp" | "manual" | "agent";
@@ -344,6 +499,12 @@ export declare const fieldActivityResourceSchema: z.ZodObject<{
344
499
  createdById: string | null;
345
500
  fertilizerProductId: string | null;
346
501
  fieldName?: string | undefined;
502
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
503
+ activeIngredient?: string | null | undefined;
504
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
505
+ resistanceCode?: string | null | undefined;
506
+ preHarvestDays?: number | null | undefined;
507
+ targetThreat?: string | null | undefined;
347
508
  }>;
348
509
  relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
349
510
  links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -367,6 +528,12 @@ export declare const fieldActivityResourceSchema: z.ZodObject<{
367
528
  createdById: string | null;
368
529
  fertilizerProductId: string | null;
369
530
  fieldName?: string | undefined;
531
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
532
+ activeIngredient?: string | null | undefined;
533
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
534
+ resistanceCode?: string | null | undefined;
535
+ preHarvestDays?: number | null | undefined;
536
+ targetThreat?: string | null | undefined;
370
537
  };
371
538
  relationships?: Record<string, unknown> | undefined;
372
539
  links?: Record<string, string> | undefined;
@@ -390,6 +557,12 @@ export declare const fieldActivityResourceSchema: z.ZodObject<{
390
557
  createdById: string | null;
391
558
  fertilizerProductId: string | null;
392
559
  fieldName?: string | undefined;
560
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
561
+ activeIngredient?: string | null | undefined;
562
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
563
+ resistanceCode?: string | null | undefined;
564
+ preHarvestDays?: number | null | undefined;
565
+ targetThreat?: string | null | undefined;
393
566
  };
394
567
  relationships?: Record<string, unknown> | undefined;
395
568
  links?: Record<string, string> | undefined;
@@ -411,6 +584,13 @@ export declare const fieldActivityResponseSchema: z.ZodObject<{
411
584
  quantity: z.ZodNullable<z.ZodNumber>;
412
585
  unit: z.ZodNullable<z.ZodString>;
413
586
  notes: z.ZodNullable<z.ZodString>;
587
+ productClass: z.ZodOptional<z.ZodNullable<z.ZodEnum<["fungicide", "insecticide", "miticide", "biopesticide", "herbicide"]>>>;
588
+ activeIngredient: z.ZodOptional<z.ZodNullable<z.ZodString>>;
589
+ resistanceSystem: z.ZodOptional<z.ZodNullable<z.ZodEnum<["IRAC", "FRAC", "HRAC"]>>>;
590
+ resistanceCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
591
+ /** Null on a spray means the farmer did not know the waiting period. */
592
+ preHarvestDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
593
+ targetThreat: z.ZodOptional<z.ZodNullable<z.ZodString>>;
414
594
  createdById: z.ZodNullable<z.ZodString>;
415
595
  source: z.ZodEnum<["manual", "agent", "whatsapp"]>;
416
596
  } & {
@@ -432,6 +612,12 @@ export declare const fieldActivityResponseSchema: z.ZodObject<{
432
612
  createdById: string | null;
433
613
  fertilizerProductId: string | null;
434
614
  fieldName?: string | undefined;
615
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
616
+ activeIngredient?: string | null | undefined;
617
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
618
+ resistanceCode?: string | null | undefined;
619
+ preHarvestDays?: number | null | undefined;
620
+ targetThreat?: string | null | undefined;
435
621
  }, {
436
622
  type: "weeding" | "fertilizer" | "irrigation" | "pruning" | "scouting" | "spray" | "biocontrol" | "sanitation" | "staking";
437
623
  source: "whatsapp" | "manual" | "agent";
@@ -448,6 +634,12 @@ export declare const fieldActivityResponseSchema: z.ZodObject<{
448
634
  createdById: string | null;
449
635
  fertilizerProductId: string | null;
450
636
  fieldName?: string | undefined;
637
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
638
+ activeIngredient?: string | null | undefined;
639
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
640
+ resistanceCode?: string | null | undefined;
641
+ preHarvestDays?: number | null | undefined;
642
+ targetThreat?: string | null | undefined;
451
643
  }>;
452
644
  relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
453
645
  links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -471,6 +663,12 @@ export declare const fieldActivityResponseSchema: z.ZodObject<{
471
663
  createdById: string | null;
472
664
  fertilizerProductId: string | null;
473
665
  fieldName?: string | undefined;
666
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
667
+ activeIngredient?: string | null | undefined;
668
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
669
+ resistanceCode?: string | null | undefined;
670
+ preHarvestDays?: number | null | undefined;
671
+ targetThreat?: string | null | undefined;
474
672
  };
475
673
  relationships?: Record<string, unknown> | undefined;
476
674
  links?: Record<string, string> | undefined;
@@ -494,6 +692,12 @@ export declare const fieldActivityResponseSchema: z.ZodObject<{
494
692
  createdById: string | null;
495
693
  fertilizerProductId: string | null;
496
694
  fieldName?: string | undefined;
695
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
696
+ activeIngredient?: string | null | undefined;
697
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
698
+ resistanceCode?: string | null | undefined;
699
+ preHarvestDays?: number | null | undefined;
700
+ targetThreat?: string | null | undefined;
497
701
  };
498
702
  relationships?: Record<string, unknown> | undefined;
499
703
  links?: Record<string, string> | undefined;
@@ -543,6 +747,12 @@ export declare const fieldActivityResponseSchema: z.ZodObject<{
543
747
  createdById: string | null;
544
748
  fertilizerProductId: string | null;
545
749
  fieldName?: string | undefined;
750
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
751
+ activeIngredient?: string | null | undefined;
752
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
753
+ resistanceCode?: string | null | undefined;
754
+ preHarvestDays?: number | null | undefined;
755
+ targetThreat?: string | null | undefined;
546
756
  };
547
757
  relationships?: Record<string, unknown> | undefined;
548
758
  links?: Record<string, string> | undefined;
@@ -578,6 +788,12 @@ export declare const fieldActivityResponseSchema: z.ZodObject<{
578
788
  createdById: string | null;
579
789
  fertilizerProductId: string | null;
580
790
  fieldName?: string | undefined;
791
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
792
+ activeIngredient?: string | null | undefined;
793
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
794
+ resistanceCode?: string | null | undefined;
795
+ preHarvestDays?: number | null | undefined;
796
+ targetThreat?: string | null | undefined;
581
797
  };
582
798
  relationships?: Record<string, unknown> | undefined;
583
799
  links?: Record<string, string> | undefined;
@@ -610,6 +826,13 @@ export declare const fieldActivityListResponseSchema: z.ZodObject<{
610
826
  quantity: z.ZodNullable<z.ZodNumber>;
611
827
  unit: z.ZodNullable<z.ZodString>;
612
828
  notes: z.ZodNullable<z.ZodString>;
829
+ productClass: z.ZodOptional<z.ZodNullable<z.ZodEnum<["fungicide", "insecticide", "miticide", "biopesticide", "herbicide"]>>>;
830
+ activeIngredient: z.ZodOptional<z.ZodNullable<z.ZodString>>;
831
+ resistanceSystem: z.ZodOptional<z.ZodNullable<z.ZodEnum<["IRAC", "FRAC", "HRAC"]>>>;
832
+ resistanceCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
833
+ /** Null on a spray means the farmer did not know the waiting period. */
834
+ preHarvestDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
835
+ targetThreat: z.ZodOptional<z.ZodNullable<z.ZodString>>;
613
836
  createdById: z.ZodNullable<z.ZodString>;
614
837
  source: z.ZodEnum<["manual", "agent", "whatsapp"]>;
615
838
  } & {
@@ -631,6 +854,12 @@ export declare const fieldActivityListResponseSchema: z.ZodObject<{
631
854
  createdById: string | null;
632
855
  fertilizerProductId: string | null;
633
856
  fieldName?: string | undefined;
857
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
858
+ activeIngredient?: string | null | undefined;
859
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
860
+ resistanceCode?: string | null | undefined;
861
+ preHarvestDays?: number | null | undefined;
862
+ targetThreat?: string | null | undefined;
634
863
  }, {
635
864
  type: "weeding" | "fertilizer" | "irrigation" | "pruning" | "scouting" | "spray" | "biocontrol" | "sanitation" | "staking";
636
865
  source: "whatsapp" | "manual" | "agent";
@@ -647,6 +876,12 @@ export declare const fieldActivityListResponseSchema: z.ZodObject<{
647
876
  createdById: string | null;
648
877
  fertilizerProductId: string | null;
649
878
  fieldName?: string | undefined;
879
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
880
+ activeIngredient?: string | null | undefined;
881
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
882
+ resistanceCode?: string | null | undefined;
883
+ preHarvestDays?: number | null | undefined;
884
+ targetThreat?: string | null | undefined;
650
885
  }>;
651
886
  relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
652
887
  links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -670,6 +905,12 @@ export declare const fieldActivityListResponseSchema: z.ZodObject<{
670
905
  createdById: string | null;
671
906
  fertilizerProductId: string | null;
672
907
  fieldName?: string | undefined;
908
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
909
+ activeIngredient?: string | null | undefined;
910
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
911
+ resistanceCode?: string | null | undefined;
912
+ preHarvestDays?: number | null | undefined;
913
+ targetThreat?: string | null | undefined;
673
914
  };
674
915
  relationships?: Record<string, unknown> | undefined;
675
916
  links?: Record<string, string> | undefined;
@@ -693,6 +934,12 @@ export declare const fieldActivityListResponseSchema: z.ZodObject<{
693
934
  createdById: string | null;
694
935
  fertilizerProductId: string | null;
695
936
  fieldName?: string | undefined;
937
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
938
+ activeIngredient?: string | null | undefined;
939
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
940
+ resistanceCode?: string | null | undefined;
941
+ preHarvestDays?: number | null | undefined;
942
+ targetThreat?: string | null | undefined;
696
943
  };
697
944
  relationships?: Record<string, unknown> | undefined;
698
945
  links?: Record<string, string> | undefined;
@@ -742,6 +989,12 @@ export declare const fieldActivityListResponseSchema: z.ZodObject<{
742
989
  createdById: string | null;
743
990
  fertilizerProductId: string | null;
744
991
  fieldName?: string | undefined;
992
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
993
+ activeIngredient?: string | null | undefined;
994
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
995
+ resistanceCode?: string | null | undefined;
996
+ preHarvestDays?: number | null | undefined;
997
+ targetThreat?: string | null | undefined;
745
998
  };
746
999
  relationships?: Record<string, unknown> | undefined;
747
1000
  links?: Record<string, string> | undefined;
@@ -777,6 +1030,12 @@ export declare const fieldActivityListResponseSchema: z.ZodObject<{
777
1030
  createdById: string | null;
778
1031
  fertilizerProductId: string | null;
779
1032
  fieldName?: string | undefined;
1033
+ productClass?: "fungicide" | "insecticide" | "miticide" | "biopesticide" | "herbicide" | null | undefined;
1034
+ activeIngredient?: string | null | undefined;
1035
+ resistanceSystem?: "IRAC" | "FRAC" | "HRAC" | null | undefined;
1036
+ resistanceCode?: string | null | undefined;
1037
+ preHarvestDays?: number | null | undefined;
1038
+ targetThreat?: string | null | undefined;
780
1039
  };
781
1040
  relationships?: Record<string, unknown> | undefined;
782
1041
  links?: Record<string, string> | undefined;
@@ -794,6 +1053,8 @@ export declare const fieldActivityListResponseSchema: z.ZodObject<{
794
1053
  }[] | undefined;
795
1054
  }>;
796
1055
  export type FieldActivityType = z.infer<typeof fieldActivityTypeSchema>;
1056
+ export type TreatmentProductClass = z.infer<typeof treatmentProductClassSchema>;
1057
+ export type ResistanceSystem = z.infer<typeof resistanceSystemSchema>;
797
1058
  export type FieldActivitySource = z.infer<typeof fieldActivitySourceSchema>;
798
1059
  export type CreateFieldActivityAttributes = z.infer<typeof createFieldActivityAttributesSchema>;
799
1060
  export type UpdateFieldActivityAttributes = z.infer<typeof updateFieldActivityAttributesSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"field-activities.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/field-activities.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,uBAAuB,2HAUlC,CAAC;AACH,eAAO,MAAM,yBAAyB,4CAA0C,CAAC;AAEjF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBhB,CAAC;AAE3B,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwB5C,CAAC;AAEL,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS9C,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGpC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIpC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGvC,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACjF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
@@ -11,6 +11,13 @@ export const fieldActivityTypeSchema = z.enum([
11
11
  'pruning',
12
12
  'staking',
13
13
  ]);
14
+ /** What a spray or biocontrol record applied, so the harvest checks can read it without parsing a note. */
15
+ export const treatmentProductClassSchema = z.enum(['fungicide', 'insecticide', 'miticide', 'biopesticide', 'herbicide']);
16
+ export const resistanceSystemSchema = z.enum(['IRAC', 'FRAC', 'HRAC']);
17
+ /** Group codes as IRAC, FRAC and HRAC publish them: "5", "11A", "M01". */
18
+ const resistanceCodeSchema = z.string().regex(/^[A-Za-z0-9]{1,4}$/, 'Use the short code on the label, like 5, 11A or M01');
19
+ /** Waiting period from the label. Longest in common use is under a year. */
20
+ const preHarvestDaysSchema = z.number().int().min(1).max(365);
14
21
  export const fieldActivitySourceSchema = z.enum(['manual', 'agent', 'whatsapp']);
15
22
  export const fieldActivityAttributesSchema = z
16
23
  .object({
@@ -25,6 +32,13 @@ export const fieldActivityAttributesSchema = z
25
32
  quantity: z.number().nullable(),
26
33
  unit: z.string().nullable(),
27
34
  notes: z.string().nullable(),
35
+ productClass: treatmentProductClassSchema.nullable().optional(),
36
+ activeIngredient: z.string().nullable().optional(),
37
+ resistanceSystem: resistanceSystemSchema.nullable().optional(),
38
+ resistanceCode: z.string().nullable().optional(),
39
+ /** Null on a spray means the farmer did not know the waiting period. */
40
+ preHarvestDays: z.number().int().nullable().optional(),
41
+ targetThreat: z.string().nullable().optional(),
28
42
  createdById: z.string().uuid().nullable(),
29
43
  source: fieldActivitySourceSchema,
30
44
  })
@@ -41,9 +55,29 @@ export const createFieldActivityAttributesSchema = z
41
55
  quantity: z.number().positive().optional(),
42
56
  unit: z.string().max(50).optional(),
43
57
  notes: z.string().optional(),
58
+ productClass: treatmentProductClassSchema.optional(),
59
+ activeIngredient: z.string().max(200).optional(),
60
+ resistanceSystem: resistanceSystemSchema.optional(),
61
+ resistanceCode: resistanceCodeSchema.optional(),
62
+ preHarvestDays: preHarvestDaysSchema.optional(),
63
+ targetThreat: z.string().max(120).optional(),
44
64
  source: fieldActivitySourceSchema.optional(),
45
65
  })
46
66
  .superRefine((data, ctx) => {
67
+ if (data.type === 'spray' && !data.productName && !data.activeIngredient) {
68
+ ctx.addIssue({
69
+ code: z.ZodIssueCode.custom,
70
+ message: 'A spray needs the product name or the active ingredient',
71
+ path: ['productName'],
72
+ });
73
+ }
74
+ if (Boolean(data.resistanceSystem) !== Boolean(data.resistanceCode)) {
75
+ ctx.addIssue({
76
+ code: z.ZodIssueCode.custom,
77
+ message: 'Give the resistance system and code together, or neither',
78
+ path: ['resistanceCode'],
79
+ });
80
+ }
47
81
  if (data.type === 'fertilizer') {
48
82
  if (!data.productName && !data.fertilizerProductId && !data.inventoryItemId) {
49
83
  ctx.addIssue({
@@ -63,6 +97,12 @@ export const updateFieldActivityAttributesSchema = z.object({
63
97
  quantity: z.number().positive().nullable().optional(),
64
98
  unit: z.string().max(50).nullable().optional(),
65
99
  notes: z.string().nullable().optional(),
100
+ productClass: treatmentProductClassSchema.nullable().optional(),
101
+ activeIngredient: z.string().max(200).nullable().optional(),
102
+ resistanceSystem: resistanceSystemSchema.nullable().optional(),
103
+ resistanceCode: resistanceCodeSchema.nullable().optional(),
104
+ preHarvestDays: preHarvestDaysSchema.nullable().optional(),
105
+ targetThreat: z.string().max(120).nullable().optional(),
66
106
  });
67
107
  export const createFieldActivitySchema = z.object({
68
108
  type: z.literal('field-activities'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepintel-ltd/farmpro-contracts",
3
- "version": "1.36.8",
3
+ "version": "1.36.9",
4
4
  "description": "Type-safe API contracts for FarmPro API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",