@deepintel-ltd/farmpro-contracts 1.3.1 → 1.3.4
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 +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/routes/admin.routes.d.ts +747 -0
- package/dist/routes/admin.routes.d.ts.map +1 -0
- package/dist/routes/admin.routes.js +26 -0
- package/dist/routes/agent-workflows.routes.d.ts +2900 -0
- package/dist/routes/agent-workflows.routes.d.ts.map +1 -0
- package/dist/routes/agent-workflows.routes.js +160 -0
- package/dist/routes/documents.routes.d.ts +417 -0
- package/dist/routes/documents.routes.d.ts.map +1 -1
- package/dist/routes/documents.routes.js +16 -0
- package/dist/routes/field-monitoring.routes.d.ts +568 -23
- package/dist/routes/field-monitoring.routes.d.ts.map +1 -1
- package/dist/routes/field-monitoring.routes.js +64 -0
- package/dist/routes/field-observations.routes.d.ts +130 -58
- package/dist/routes/field-observations.routes.d.ts.map +1 -1
- package/dist/routes/health.routes.d.ts +317 -0
- package/dist/routes/health.routes.d.ts.map +1 -0
- package/dist/routes/health.routes.js +18 -0
- package/dist/routes/index.d.ts +9 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +6 -0
- package/dist/routes/tasks.routes.d.ts +408 -0
- package/dist/routes/tasks.routes.d.ts.map +1 -1
- package/dist/routes/weather.routes.d.ts +264 -17
- package/dist/routes/weather.routes.d.ts.map +1 -1
- package/dist/schemas/admin.schemas.d.ts +1063 -0
- package/dist/schemas/admin.schemas.d.ts.map +1 -0
- package/dist/schemas/admin.schemas.js +63 -0
- package/dist/schemas/agent-workflows.schemas.d.ts +2399 -0
- package/dist/schemas/agent-workflows.schemas.d.ts.map +1 -0
- package/dist/schemas/agent-workflows.schemas.js +70 -0
- package/dist/schemas/documents.schemas.d.ts +202 -0
- package/dist/schemas/documents.schemas.d.ts.map +1 -1
- package/dist/schemas/documents.schemas.js +10 -1
- package/dist/schemas/field-monitoring.schemas.d.ts +215 -9
- package/dist/schemas/field-monitoring.schemas.d.ts.map +1 -1
- package/dist/schemas/field-monitoring.schemas.js +26 -2
- package/dist/schemas/field-observations.schemas.d.ts +100 -40
- package/dist/schemas/field-observations.schemas.d.ts.map +1 -1
- package/dist/schemas/field-observations.schemas.js +2 -24
- package/dist/schemas/health.schemas.d.ts +176 -0
- package/dist/schemas/health.schemas.d.ts.map +1 -0
- package/dist/schemas/health.schemas.js +26 -0
- package/dist/schemas/recommendations.schemas.d.ts +112 -0
- package/dist/schemas/recommendations.schemas.d.ts.map +1 -0
- package/dist/schemas/recommendations.schemas.js +32 -0
- package/dist/schemas/tasks.schemas.d.ts +344 -0
- package/dist/schemas/tasks.schemas.d.ts.map +1 -1
- package/dist/schemas/tasks.schemas.js +9 -0
- package/dist/schemas/weather.schemas.d.ts +780 -44
- package/dist/schemas/weather.schemas.d.ts.map +1 -1
- package/dist/schemas/weather.schemas.js +2 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.observationStatsQuerySchema = exports.observationListQuerySchema = exports.observationListResponseSchema = exports.observationResponseSchema = exports.updateObservationActionInputSchema = exports.createObservationInputSchema = exports.observationResourceSchema = exports.updateObservationActionAttributesSchema = exports.createObservationAttributesSchema = exports.observationAttributesSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const common_schemas_1 = require("./common.schemas");
|
|
6
|
+
const recommendations_schemas_1 = require("./recommendations.schemas");
|
|
6
7
|
/**
|
|
7
8
|
* Field Observation schemas - JSON:API compliant
|
|
8
9
|
*/
|
|
@@ -83,30 +84,7 @@ exports.observationAttributesSchema = zod_1.z.object({
|
|
|
83
84
|
historicalMatches: zod_1.z.array(zod_1.z.any()).optional(),
|
|
84
85
|
})
|
|
85
86
|
.nullable(),
|
|
86
|
-
recommendations: zod_1.z
|
|
87
|
-
.array(zod_1.z.object({
|
|
88
|
-
priority: zod_1.z.number(),
|
|
89
|
-
action: zod_1.z.string(),
|
|
90
|
-
details: zod_1.z.string(),
|
|
91
|
-
timing: zod_1.z.string(),
|
|
92
|
-
materials: zod_1.z
|
|
93
|
-
.array(zod_1.z.object({
|
|
94
|
-
inventoryItemId: zod_1.z.string().uuid().optional(),
|
|
95
|
-
name: zod_1.z.string(),
|
|
96
|
-
quantity: zod_1.z.number(),
|
|
97
|
-
unit: zod_1.z.string(),
|
|
98
|
-
costPerUnit: zod_1.z.number().optional(),
|
|
99
|
-
totalCost: zod_1.z.number().optional(),
|
|
100
|
-
availability: zod_1.z.string().optional(),
|
|
101
|
-
}))
|
|
102
|
-
.optional(),
|
|
103
|
-
applicationMethod: zod_1.z.string().optional(),
|
|
104
|
-
expectedOutcome: zod_1.z.string().optional(),
|
|
105
|
-
preventiveMeasures: zod_1.z.array(zod_1.z.string()).optional(),
|
|
106
|
-
estimatedTime: zod_1.z.string().optional(),
|
|
107
|
-
riskLevel: zod_1.z.string().optional(),
|
|
108
|
-
}))
|
|
109
|
-
.nullable(),
|
|
87
|
+
recommendations: zod_1.z.array(recommendations_schemas_1.recommendationSchema).nullable(),
|
|
110
88
|
estimatedCost: zod_1.z.number().nullable(),
|
|
111
89
|
urgencyScore: zod_1.z.number().min(1).max(10).nullable(),
|
|
112
90
|
similarCasesCount: zod_1.z.number().nullable(),
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Health status for individual services
|
|
4
|
+
*/
|
|
5
|
+
export declare const serviceHealthSchema: z.ZodObject<{
|
|
6
|
+
status: z.ZodEnum<["healthy", "unhealthy", "degraded"]>;
|
|
7
|
+
message: z.ZodOptional<z.ZodString>;
|
|
8
|
+
responseTime: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
11
|
+
message?: string | undefined;
|
|
12
|
+
responseTime?: number | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
15
|
+
message?: string | undefined;
|
|
16
|
+
responseTime?: number | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Overall health check response
|
|
20
|
+
*/
|
|
21
|
+
export declare const healthCheckResponseSchema: z.ZodObject<{
|
|
22
|
+
status: z.ZodEnum<["healthy", "unhealthy", "degraded"]>;
|
|
23
|
+
timestamp: z.ZodString;
|
|
24
|
+
uptime: z.ZodNumber;
|
|
25
|
+
services: z.ZodObject<{
|
|
26
|
+
database: z.ZodObject<{
|
|
27
|
+
status: z.ZodEnum<["healthy", "unhealthy", "degraded"]>;
|
|
28
|
+
message: z.ZodOptional<z.ZodString>;
|
|
29
|
+
responseTime: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
32
|
+
message?: string | undefined;
|
|
33
|
+
responseTime?: number | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
36
|
+
message?: string | undefined;
|
|
37
|
+
responseTime?: number | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
redis: z.ZodObject<{
|
|
40
|
+
status: z.ZodEnum<["healthy", "unhealthy", "degraded"]>;
|
|
41
|
+
message: z.ZodOptional<z.ZodString>;
|
|
42
|
+
responseTime: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
45
|
+
message?: string | undefined;
|
|
46
|
+
responseTime?: number | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
49
|
+
message?: string | undefined;
|
|
50
|
+
responseTime?: number | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
storage: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
status: z.ZodEnum<["healthy", "unhealthy", "degraded"]>;
|
|
54
|
+
message: z.ZodOptional<z.ZodString>;
|
|
55
|
+
responseTime: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
58
|
+
message?: string | undefined;
|
|
59
|
+
responseTime?: number | undefined;
|
|
60
|
+
}, {
|
|
61
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
62
|
+
message?: string | undefined;
|
|
63
|
+
responseTime?: number | undefined;
|
|
64
|
+
}>>;
|
|
65
|
+
timescale: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
status: z.ZodEnum<["healthy", "unhealthy", "degraded"]>;
|
|
67
|
+
message: z.ZodOptional<z.ZodString>;
|
|
68
|
+
responseTime: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
71
|
+
message?: string | undefined;
|
|
72
|
+
responseTime?: number | undefined;
|
|
73
|
+
}, {
|
|
74
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
75
|
+
message?: string | undefined;
|
|
76
|
+
responseTime?: number | undefined;
|
|
77
|
+
}>>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
database: {
|
|
80
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
81
|
+
message?: string | undefined;
|
|
82
|
+
responseTime?: number | undefined;
|
|
83
|
+
};
|
|
84
|
+
redis: {
|
|
85
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
86
|
+
message?: string | undefined;
|
|
87
|
+
responseTime?: number | undefined;
|
|
88
|
+
};
|
|
89
|
+
storage?: {
|
|
90
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
91
|
+
message?: string | undefined;
|
|
92
|
+
responseTime?: number | undefined;
|
|
93
|
+
} | undefined;
|
|
94
|
+
timescale?: {
|
|
95
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
96
|
+
message?: string | undefined;
|
|
97
|
+
responseTime?: number | undefined;
|
|
98
|
+
} | undefined;
|
|
99
|
+
}, {
|
|
100
|
+
database: {
|
|
101
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
102
|
+
message?: string | undefined;
|
|
103
|
+
responseTime?: number | undefined;
|
|
104
|
+
};
|
|
105
|
+
redis: {
|
|
106
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
107
|
+
message?: string | undefined;
|
|
108
|
+
responseTime?: number | undefined;
|
|
109
|
+
};
|
|
110
|
+
storage?: {
|
|
111
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
112
|
+
message?: string | undefined;
|
|
113
|
+
responseTime?: number | undefined;
|
|
114
|
+
} | undefined;
|
|
115
|
+
timescale?: {
|
|
116
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
117
|
+
message?: string | undefined;
|
|
118
|
+
responseTime?: number | undefined;
|
|
119
|
+
} | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
122
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
123
|
+
timestamp: string;
|
|
124
|
+
uptime: number;
|
|
125
|
+
services: {
|
|
126
|
+
database: {
|
|
127
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
128
|
+
message?: string | undefined;
|
|
129
|
+
responseTime?: number | undefined;
|
|
130
|
+
};
|
|
131
|
+
redis: {
|
|
132
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
133
|
+
message?: string | undefined;
|
|
134
|
+
responseTime?: number | undefined;
|
|
135
|
+
};
|
|
136
|
+
storage?: {
|
|
137
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
138
|
+
message?: string | undefined;
|
|
139
|
+
responseTime?: number | undefined;
|
|
140
|
+
} | undefined;
|
|
141
|
+
timescale?: {
|
|
142
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
143
|
+
message?: string | undefined;
|
|
144
|
+
responseTime?: number | undefined;
|
|
145
|
+
} | undefined;
|
|
146
|
+
};
|
|
147
|
+
}, {
|
|
148
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
149
|
+
timestamp: string;
|
|
150
|
+
uptime: number;
|
|
151
|
+
services: {
|
|
152
|
+
database: {
|
|
153
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
154
|
+
message?: string | undefined;
|
|
155
|
+
responseTime?: number | undefined;
|
|
156
|
+
};
|
|
157
|
+
redis: {
|
|
158
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
159
|
+
message?: string | undefined;
|
|
160
|
+
responseTime?: number | undefined;
|
|
161
|
+
};
|
|
162
|
+
storage?: {
|
|
163
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
164
|
+
message?: string | undefined;
|
|
165
|
+
responseTime?: number | undefined;
|
|
166
|
+
} | undefined;
|
|
167
|
+
timescale?: {
|
|
168
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
169
|
+
message?: string | undefined;
|
|
170
|
+
responseTime?: number | undefined;
|
|
171
|
+
} | undefined;
|
|
172
|
+
};
|
|
173
|
+
}>;
|
|
174
|
+
export type ServiceHealth = z.infer<typeof serviceHealthSchema>;
|
|
175
|
+
export type HealthCheckResponse = z.infer<typeof healthCheckResponseSchema>;
|
|
176
|
+
//# sourceMappingURL=health.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/health.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUpC,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.healthCheckResponseSchema = exports.serviceHealthSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Health status for individual services
|
|
7
|
+
*/
|
|
8
|
+
exports.serviceHealthSchema = zod_1.z.object({
|
|
9
|
+
status: zod_1.z.enum(['healthy', 'unhealthy', 'degraded']),
|
|
10
|
+
message: zod_1.z.string().optional(),
|
|
11
|
+
responseTime: zod_1.z.number().optional(), // in milliseconds
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Overall health check response
|
|
15
|
+
*/
|
|
16
|
+
exports.healthCheckResponseSchema = zod_1.z.object({
|
|
17
|
+
status: zod_1.z.enum(['healthy', 'unhealthy', 'degraded']),
|
|
18
|
+
timestamp: zod_1.z.string().datetime(),
|
|
19
|
+
uptime: zod_1.z.number(), // in seconds
|
|
20
|
+
services: zod_1.z.object({
|
|
21
|
+
database: exports.serviceHealthSchema,
|
|
22
|
+
redis: exports.serviceHealthSchema,
|
|
23
|
+
storage: exports.serviceHealthSchema.optional(),
|
|
24
|
+
timescale: exports.serviceHealthSchema.optional(),
|
|
25
|
+
}),
|
|
26
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Centralized Recommendation Schemas
|
|
4
|
+
*/
|
|
5
|
+
export declare const recommendationMaterialSchema: z.ZodObject<{
|
|
6
|
+
inventoryItemId: z.ZodOptional<z.ZodString>;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
quantity: z.ZodNumber;
|
|
9
|
+
unit: z.ZodString;
|
|
10
|
+
costPerUnit: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
totalCost: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
availability: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
name: string;
|
|
15
|
+
unit: string;
|
|
16
|
+
quantity: number;
|
|
17
|
+
inventoryItemId?: string | undefined;
|
|
18
|
+
totalCost?: number | undefined;
|
|
19
|
+
costPerUnit?: number | undefined;
|
|
20
|
+
availability?: string | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
name: string;
|
|
23
|
+
unit: string;
|
|
24
|
+
quantity: number;
|
|
25
|
+
inventoryItemId?: string | undefined;
|
|
26
|
+
totalCost?: number | undefined;
|
|
27
|
+
costPerUnit?: number | undefined;
|
|
28
|
+
availability?: string | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const recommendationSchema: z.ZodObject<{
|
|
31
|
+
priority: z.ZodNumber;
|
|
32
|
+
action: z.ZodString;
|
|
33
|
+
details: z.ZodString;
|
|
34
|
+
timing: z.ZodString;
|
|
35
|
+
severity: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
|
|
36
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
materials: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
38
|
+
inventoryItemId: z.ZodOptional<z.ZodString>;
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
quantity: z.ZodNumber;
|
|
41
|
+
unit: z.ZodString;
|
|
42
|
+
costPerUnit: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
totalCost: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
availability: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
name: string;
|
|
47
|
+
unit: string;
|
|
48
|
+
quantity: number;
|
|
49
|
+
inventoryItemId?: string | undefined;
|
|
50
|
+
totalCost?: number | undefined;
|
|
51
|
+
costPerUnit?: number | undefined;
|
|
52
|
+
availability?: string | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
name: string;
|
|
55
|
+
unit: string;
|
|
56
|
+
quantity: number;
|
|
57
|
+
inventoryItemId?: string | undefined;
|
|
58
|
+
totalCost?: number | undefined;
|
|
59
|
+
costPerUnit?: number | undefined;
|
|
60
|
+
availability?: string | undefined;
|
|
61
|
+
}>, "many">>;
|
|
62
|
+
applicationMethod: z.ZodOptional<z.ZodString>;
|
|
63
|
+
expectedOutcome: z.ZodOptional<z.ZodString>;
|
|
64
|
+
preventiveMeasures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
65
|
+
estimatedTime: z.ZodOptional<z.ZodString>;
|
|
66
|
+
riskLevel: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
priority: number;
|
|
69
|
+
action: string;
|
|
70
|
+
details: string;
|
|
71
|
+
timing: string;
|
|
72
|
+
severity?: "critical" | "low" | "medium" | "high" | undefined;
|
|
73
|
+
confidence?: number | undefined;
|
|
74
|
+
materials?: {
|
|
75
|
+
name: string;
|
|
76
|
+
unit: string;
|
|
77
|
+
quantity: number;
|
|
78
|
+
inventoryItemId?: string | undefined;
|
|
79
|
+
totalCost?: number | undefined;
|
|
80
|
+
costPerUnit?: number | undefined;
|
|
81
|
+
availability?: string | undefined;
|
|
82
|
+
}[] | undefined;
|
|
83
|
+
applicationMethod?: string | undefined;
|
|
84
|
+
expectedOutcome?: string | undefined;
|
|
85
|
+
preventiveMeasures?: string[] | undefined;
|
|
86
|
+
estimatedTime?: string | undefined;
|
|
87
|
+
riskLevel?: string | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
priority: number;
|
|
90
|
+
action: string;
|
|
91
|
+
details: string;
|
|
92
|
+
timing: string;
|
|
93
|
+
severity?: "critical" | "low" | "medium" | "high" | undefined;
|
|
94
|
+
confidence?: number | undefined;
|
|
95
|
+
materials?: {
|
|
96
|
+
name: string;
|
|
97
|
+
unit: string;
|
|
98
|
+
quantity: number;
|
|
99
|
+
inventoryItemId?: string | undefined;
|
|
100
|
+
totalCost?: number | undefined;
|
|
101
|
+
costPerUnit?: number | undefined;
|
|
102
|
+
availability?: string | undefined;
|
|
103
|
+
}[] | undefined;
|
|
104
|
+
applicationMethod?: string | undefined;
|
|
105
|
+
expectedOutcome?: string | undefined;
|
|
106
|
+
preventiveMeasures?: string[] | undefined;
|
|
107
|
+
estimatedTime?: string | undefined;
|
|
108
|
+
riskLevel?: string | undefined;
|
|
109
|
+
}>;
|
|
110
|
+
export type RecommendationMaterial = z.infer<typeof recommendationMaterialSchema>;
|
|
111
|
+
export type Recommendation = z.infer<typeof recommendationSchema>;
|
|
112
|
+
//# sourceMappingURL=recommendations.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recommendations.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/recommendations.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAGH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;EAQvC,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa/B,CAAC;AAGH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.recommendationSchema = exports.recommendationMaterialSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Centralized Recommendation Schemas
|
|
7
|
+
*/
|
|
8
|
+
// Schema for materials suggested in a recommendation
|
|
9
|
+
exports.recommendationMaterialSchema = zod_1.z.object({
|
|
10
|
+
inventoryItemId: zod_1.z.string().uuid().optional(),
|
|
11
|
+
name: zod_1.z.string(),
|
|
12
|
+
quantity: zod_1.z.number(),
|
|
13
|
+
unit: zod_1.z.string(),
|
|
14
|
+
costPerUnit: zod_1.z.number().optional(),
|
|
15
|
+
totalCost: zod_1.z.number().optional(),
|
|
16
|
+
availability: zod_1.z.string().optional(),
|
|
17
|
+
});
|
|
18
|
+
// The core, reusable recommendation schema
|
|
19
|
+
exports.recommendationSchema = zod_1.z.object({
|
|
20
|
+
priority: zod_1.z.number().min(1).max(5),
|
|
21
|
+
action: zod_1.z.string(),
|
|
22
|
+
details: zod_1.z.string(),
|
|
23
|
+
timing: zod_1.z.string(),
|
|
24
|
+
severity: zod_1.z.enum(['low', 'medium', 'high', 'critical']).optional(),
|
|
25
|
+
confidence: zod_1.z.number().min(0).max(1).optional(),
|
|
26
|
+
materials: zod_1.z.array(exports.recommendationMaterialSchema).optional(),
|
|
27
|
+
applicationMethod: zod_1.z.string().optional(),
|
|
28
|
+
expectedOutcome: zod_1.z.string().optional(),
|
|
29
|
+
preventiveMeasures: zod_1.z.array(zod_1.z.string()).optional(),
|
|
30
|
+
estimatedTime: zod_1.z.string().optional(),
|
|
31
|
+
riskLevel: zod_1.z.string().optional(),
|
|
32
|
+
});
|