@deepintel-ltd/farmpro-contracts 1.34.0 → 1.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/routes/crop-care.routes.d.ts +2555 -0
- package/dist/routes/crop-care.routes.d.ts.map +1 -0
- package/dist/routes/crop-care.routes.js +26 -0
- package/dist/routes/index.d.ts +3 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +2 -0
- package/dist/schemas/crop-care.schemas.d.ts +3457 -0
- package/dist/schemas/crop-care.schemas.d.ts.map +1 -0
- package/dist/schemas/crop-care.schemas.js +63 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crop-care.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/crop-care.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAWZ,CAAC;AAEjB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAMZ,CAAC;AAEjB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;gCASf,CAAC;AAEjB,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const careStageSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
id: z.string(),
|
|
5
|
+
label: z.string(),
|
|
6
|
+
railLabel: z.string(),
|
|
7
|
+
dayStart: z.number(),
|
|
8
|
+
dayEnd: z.number(),
|
|
9
|
+
summary: z.string(),
|
|
10
|
+
tasks: z.array(z.string()),
|
|
11
|
+
checks: z.array(z.string()),
|
|
12
|
+
})
|
|
13
|
+
.passthrough();
|
|
14
|
+
export const carePhaseSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
dayZero: z.string(),
|
|
17
|
+
dayOrigin: z.union([z.literal(0), z.literal(1)]),
|
|
18
|
+
stages: z.array(careStageSchema),
|
|
19
|
+
})
|
|
20
|
+
.passthrough();
|
|
21
|
+
export const carePlanSchema = z
|
|
22
|
+
.object({
|
|
23
|
+
id: z.string(),
|
|
24
|
+
cropIds: z.array(z.string()),
|
|
25
|
+
depth: z.enum(['pepper', 'stage-card', 'generic']),
|
|
26
|
+
oneLineRule: z.string(),
|
|
27
|
+
source: z.string(),
|
|
28
|
+
seasonLengthDays: z.number(),
|
|
29
|
+
aliases: z.array(z.string()).optional(),
|
|
30
|
+
nursery: carePhaseSchema.optional(),
|
|
31
|
+
field: carePhaseSchema,
|
|
32
|
+
weekPlan: z
|
|
33
|
+
.object({
|
|
34
|
+
kind: z.string(),
|
|
35
|
+
stripLabel: z.string(),
|
|
36
|
+
note: z.string().optional(),
|
|
37
|
+
generator: z.string().optional(),
|
|
38
|
+
actions: z
|
|
39
|
+
.array(z
|
|
40
|
+
.object({
|
|
41
|
+
id: z.string(),
|
|
42
|
+
label: z.string(),
|
|
43
|
+
dayStart: z.number(),
|
|
44
|
+
dayEnd: z.number(),
|
|
45
|
+
detail: z.string(),
|
|
46
|
+
})
|
|
47
|
+
.passthrough())
|
|
48
|
+
.optional(),
|
|
49
|
+
})
|
|
50
|
+
.passthrough()
|
|
51
|
+
.optional(),
|
|
52
|
+
})
|
|
53
|
+
.passthrough();
|
|
54
|
+
export const resolvedCareSchema = z
|
|
55
|
+
.object({
|
|
56
|
+
origin: z.enum(['file', 'database', 'generic']),
|
|
57
|
+
plan: carePlanSchema,
|
|
58
|
+
phase: z.enum(['nursery', 'field']),
|
|
59
|
+
day: z.number().nullable(),
|
|
60
|
+
stage: careStageSchema,
|
|
61
|
+
needsDate: z.boolean(),
|
|
62
|
+
})
|
|
63
|
+
.passthrough();
|