@deepintel-ltd/farmpro-contracts 1.7.6 → 1.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prescription-maps.routes.d.ts","sourceRoot":"","sources":["../../src/routes/prescription-maps.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+DjC,CAAC"}
@@ -0,0 +1,69 @@
1
+ import { initContract } from '@ts-rest/core';
2
+ import { z } from 'zod';
3
+ import { prescriptionMapListResponseSchema, prescriptionMapSingleResponseSchema, createPrescriptionMapBodySchema, updatePrescriptionStatusBodySchema, } from '../schemas/prescription-maps.schemas';
4
+ import { jsonApiErrorResponseSchema } from '../schemas/common.schemas';
5
+ const c = initContract();
6
+ export const prescriptionMapsRouter = c.router({
7
+ list: {
8
+ method: 'GET',
9
+ path: '/farms/:farmId/fields/:fieldId/prescription-maps',
10
+ pathParams: z.object({
11
+ farmId: z.string().uuid(),
12
+ fieldId: z.string().uuid(),
13
+ }),
14
+ responses: {
15
+ 200: prescriptionMapListResponseSchema,
16
+ 403: jsonApiErrorResponseSchema,
17
+ 404: jsonApiErrorResponseSchema,
18
+ },
19
+ summary: 'List prescription maps for a field',
20
+ },
21
+ getOne: {
22
+ method: 'GET',
23
+ path: '/farms/:farmId/fields/:fieldId/prescription-maps/:prescriptionId',
24
+ pathParams: z.object({
25
+ farmId: z.string().uuid(),
26
+ fieldId: z.string().uuid(),
27
+ prescriptionId: z.string().uuid(),
28
+ }),
29
+ responses: {
30
+ 200: prescriptionMapSingleResponseSchema,
31
+ 403: jsonApiErrorResponseSchema,
32
+ 404: jsonApiErrorResponseSchema,
33
+ },
34
+ summary: 'Get prescription map by ID',
35
+ },
36
+ create: {
37
+ method: 'POST',
38
+ path: '/farms/:farmId/fields/:fieldId/prescription-maps',
39
+ pathParams: z.object({
40
+ farmId: z.string().uuid(),
41
+ fieldId: z.string().uuid(),
42
+ }),
43
+ body: createPrescriptionMapBodySchema,
44
+ responses: {
45
+ 201: prescriptionMapSingleResponseSchema,
46
+ 400: jsonApiErrorResponseSchema,
47
+ 403: jsonApiErrorResponseSchema,
48
+ 404: jsonApiErrorResponseSchema,
49
+ },
50
+ summary: 'Create prescription map',
51
+ },
52
+ updateStatus: {
53
+ method: 'PATCH',
54
+ path: '/farms/:farmId/fields/:fieldId/prescription-maps/:prescriptionId/status',
55
+ pathParams: z.object({
56
+ farmId: z.string().uuid(),
57
+ fieldId: z.string().uuid(),
58
+ prescriptionId: z.string().uuid(),
59
+ }),
60
+ body: updatePrescriptionStatusBodySchema,
61
+ responses: {
62
+ 204: z.object({}),
63
+ 400: jsonApiErrorResponseSchema,
64
+ 403: jsonApiErrorResponseSchema,
65
+ 404: jsonApiErrorResponseSchema,
66
+ },
67
+ summary: 'Update prescription map status',
68
+ },
69
+ });
@@ -0,0 +1,358 @@
1
+ import { z } from 'zod';
2
+ export declare const geofenceSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ farmId: z.ZodString;
5
+ name: z.ZodString;
6
+ geometry: z.ZodObject<{
7
+ type: z.ZodEnum<["Polygon", "MultiPolygon", "Point", "LineString"]>;
8
+ coordinates: z.ZodUnion<[z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">, "many">, z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">, "many">, "many">, z.ZodArray<z.ZodNumber, "many">, z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">]>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
11
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
12
+ }, {
13
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
14
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
15
+ }>;
16
+ alertType: z.ZodEnum<["entry", "exit", "both"]>;
17
+ isActive: z.ZodBoolean;
18
+ color: z.ZodOptional<z.ZodString>;
19
+ linkedGroupIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
20
+ linkedLivestockIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
21
+ createdAt: z.ZodString;
22
+ updatedAt: z.ZodOptional<z.ZodString>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ id: string;
25
+ createdAt: string;
26
+ name: string;
27
+ geometry: {
28
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
29
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
30
+ };
31
+ farmId: string;
32
+ alertType: "both" | "entry" | "exit";
33
+ isActive: boolean;
34
+ updatedAt?: string | undefined;
35
+ color?: string | undefined;
36
+ linkedGroupIds?: string[] | undefined;
37
+ linkedLivestockIds?: string[] | undefined;
38
+ }, {
39
+ id: string;
40
+ createdAt: string;
41
+ name: string;
42
+ geometry: {
43
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
44
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
45
+ };
46
+ farmId: string;
47
+ alertType: "both" | "entry" | "exit";
48
+ isActive: boolean;
49
+ updatedAt?: string | undefined;
50
+ color?: string | undefined;
51
+ linkedGroupIds?: string[] | undefined;
52
+ linkedLivestockIds?: string[] | undefined;
53
+ }>;
54
+ export declare const createGeofenceBodySchema: z.ZodObject<{
55
+ name: z.ZodString;
56
+ geometry: z.ZodObject<{
57
+ type: z.ZodEnum<["Polygon", "MultiPolygon", "Point", "LineString"]>;
58
+ coordinates: z.ZodUnion<[z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">, "many">, z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">, "many">, "many">, z.ZodArray<z.ZodNumber, "many">, z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">]>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
61
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
62
+ }, {
63
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
64
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
65
+ }>;
66
+ alertType: z.ZodEnum<["entry", "exit", "both"]>;
67
+ isActive: z.ZodOptional<z.ZodBoolean>;
68
+ color: z.ZodOptional<z.ZodString>;
69
+ linkedGroupIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
70
+ linkedLivestockIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
71
+ }, "strip", z.ZodTypeAny, {
72
+ name: string;
73
+ geometry: {
74
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
75
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
76
+ };
77
+ alertType: "both" | "entry" | "exit";
78
+ color?: string | undefined;
79
+ isActive?: boolean | undefined;
80
+ linkedGroupIds?: string[] | undefined;
81
+ linkedLivestockIds?: string[] | undefined;
82
+ }, {
83
+ name: string;
84
+ geometry: {
85
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
86
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
87
+ };
88
+ alertType: "both" | "entry" | "exit";
89
+ color?: string | undefined;
90
+ isActive?: boolean | undefined;
91
+ linkedGroupIds?: string[] | undefined;
92
+ linkedLivestockIds?: string[] | undefined;
93
+ }>;
94
+ export declare const updateGeofenceBodySchema: z.ZodObject<{
95
+ name: z.ZodOptional<z.ZodString>;
96
+ geometry: z.ZodOptional<z.ZodObject<{
97
+ type: z.ZodEnum<["Polygon", "MultiPolygon", "Point", "LineString"]>;
98
+ coordinates: z.ZodUnion<[z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">, "many">, z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">, "many">, "many">, z.ZodArray<z.ZodNumber, "many">, z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">]>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
101
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
102
+ }, {
103
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
104
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
105
+ }>>;
106
+ alertType: z.ZodOptional<z.ZodEnum<["entry", "exit", "both"]>>;
107
+ isActive: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
108
+ color: z.ZodOptional<z.ZodOptional<z.ZodString>>;
109
+ linkedGroupIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
110
+ linkedLivestockIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
111
+ }, "strip", z.ZodTypeAny, {
112
+ name?: string | undefined;
113
+ geometry?: {
114
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
115
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
116
+ } | undefined;
117
+ color?: string | undefined;
118
+ alertType?: "both" | "entry" | "exit" | undefined;
119
+ isActive?: boolean | undefined;
120
+ linkedGroupIds?: string[] | undefined;
121
+ linkedLivestockIds?: string[] | undefined;
122
+ }, {
123
+ name?: string | undefined;
124
+ geometry?: {
125
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
126
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
127
+ } | undefined;
128
+ color?: string | undefined;
129
+ alertType?: "both" | "entry" | "exit" | undefined;
130
+ isActive?: boolean | undefined;
131
+ linkedGroupIds?: string[] | undefined;
132
+ linkedLivestockIds?: string[] | undefined;
133
+ }>;
134
+ export declare const geofenceAlertSchema: z.ZodObject<{
135
+ id: z.ZodString;
136
+ geofenceId: z.ZodString;
137
+ geofenceName: z.ZodOptional<z.ZodString>;
138
+ livestockId: z.ZodOptional<z.ZodString>;
139
+ livestockTagId: z.ZodOptional<z.ZodString>;
140
+ groupId: z.ZodOptional<z.ZodString>;
141
+ groupName: z.ZodOptional<z.ZodString>;
142
+ alertType: z.ZodEnum<["entry", "exit"]>;
143
+ timestamp: z.ZodString;
144
+ coordinates: z.ZodObject<{
145
+ lat: z.ZodNumber;
146
+ lng: z.ZodNumber;
147
+ }, "strip", z.ZodTypeAny, {
148
+ lat: number;
149
+ lng: number;
150
+ }, {
151
+ lat: number;
152
+ lng: number;
153
+ }>;
154
+ acknowledged: z.ZodBoolean;
155
+ acknowledgedAt: z.ZodOptional<z.ZodString>;
156
+ acknowledgedBy: z.ZodOptional<z.ZodString>;
157
+ }, "strip", z.ZodTypeAny, {
158
+ coordinates: {
159
+ lat: number;
160
+ lng: number;
161
+ };
162
+ id: string;
163
+ timestamp: string;
164
+ acknowledged: boolean;
165
+ alertType: "entry" | "exit";
166
+ geofenceId: string;
167
+ acknowledgedAt?: string | undefined;
168
+ acknowledgedBy?: string | undefined;
169
+ groupId?: string | undefined;
170
+ geofenceName?: string | undefined;
171
+ livestockId?: string | undefined;
172
+ livestockTagId?: string | undefined;
173
+ groupName?: string | undefined;
174
+ }, {
175
+ coordinates: {
176
+ lat: number;
177
+ lng: number;
178
+ };
179
+ id: string;
180
+ timestamp: string;
181
+ acknowledged: boolean;
182
+ alertType: "entry" | "exit";
183
+ geofenceId: string;
184
+ acknowledgedAt?: string | undefined;
185
+ acknowledgedBy?: string | undefined;
186
+ groupId?: string | undefined;
187
+ geofenceName?: string | undefined;
188
+ livestockId?: string | undefined;
189
+ livestockTagId?: string | undefined;
190
+ groupName?: string | undefined;
191
+ }>;
192
+ export declare const geofenceListResponseSchema: z.ZodArray<z.ZodObject<{
193
+ id: z.ZodString;
194
+ farmId: z.ZodString;
195
+ name: z.ZodString;
196
+ geometry: z.ZodObject<{
197
+ type: z.ZodEnum<["Polygon", "MultiPolygon", "Point", "LineString"]>;
198
+ coordinates: z.ZodUnion<[z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">, "many">, z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">, "many">, "many">, z.ZodArray<z.ZodNumber, "many">, z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">]>;
199
+ }, "strip", z.ZodTypeAny, {
200
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
201
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
202
+ }, {
203
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
204
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
205
+ }>;
206
+ alertType: z.ZodEnum<["entry", "exit", "both"]>;
207
+ isActive: z.ZodBoolean;
208
+ color: z.ZodOptional<z.ZodString>;
209
+ linkedGroupIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
210
+ linkedLivestockIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
211
+ createdAt: z.ZodString;
212
+ updatedAt: z.ZodOptional<z.ZodString>;
213
+ }, "strip", z.ZodTypeAny, {
214
+ id: string;
215
+ createdAt: string;
216
+ name: string;
217
+ geometry: {
218
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
219
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
220
+ };
221
+ farmId: string;
222
+ alertType: "both" | "entry" | "exit";
223
+ isActive: boolean;
224
+ updatedAt?: string | undefined;
225
+ color?: string | undefined;
226
+ linkedGroupIds?: string[] | undefined;
227
+ linkedLivestockIds?: string[] | undefined;
228
+ }, {
229
+ id: string;
230
+ createdAt: string;
231
+ name: string;
232
+ geometry: {
233
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
234
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
235
+ };
236
+ farmId: string;
237
+ alertType: "both" | "entry" | "exit";
238
+ isActive: boolean;
239
+ updatedAt?: string | undefined;
240
+ color?: string | undefined;
241
+ linkedGroupIds?: string[] | undefined;
242
+ linkedLivestockIds?: string[] | undefined;
243
+ }>, "many">;
244
+ export declare const geofenceSingleResponseSchema: z.ZodObject<{
245
+ id: z.ZodString;
246
+ farmId: z.ZodString;
247
+ name: z.ZodString;
248
+ geometry: z.ZodObject<{
249
+ type: z.ZodEnum<["Polygon", "MultiPolygon", "Point", "LineString"]>;
250
+ coordinates: z.ZodUnion<[z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">, "many">, z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">, "many">, "many">, z.ZodArray<z.ZodNumber, "many">, z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">]>;
251
+ }, "strip", z.ZodTypeAny, {
252
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
253
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
254
+ }, {
255
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
256
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
257
+ }>;
258
+ alertType: z.ZodEnum<["entry", "exit", "both"]>;
259
+ isActive: z.ZodBoolean;
260
+ color: z.ZodOptional<z.ZodString>;
261
+ linkedGroupIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
262
+ linkedLivestockIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
263
+ createdAt: z.ZodString;
264
+ updatedAt: z.ZodOptional<z.ZodString>;
265
+ }, "strip", z.ZodTypeAny, {
266
+ id: string;
267
+ createdAt: string;
268
+ name: string;
269
+ geometry: {
270
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
271
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
272
+ };
273
+ farmId: string;
274
+ alertType: "both" | "entry" | "exit";
275
+ isActive: boolean;
276
+ updatedAt?: string | undefined;
277
+ color?: string | undefined;
278
+ linkedGroupIds?: string[] | undefined;
279
+ linkedLivestockIds?: string[] | undefined;
280
+ }, {
281
+ id: string;
282
+ createdAt: string;
283
+ name: string;
284
+ geometry: {
285
+ type: "Polygon" | "MultiPolygon" | "Point" | "LineString";
286
+ coordinates: number[] | number[][] | number[][][] | number[][][][];
287
+ };
288
+ farmId: string;
289
+ alertType: "both" | "entry" | "exit";
290
+ isActive: boolean;
291
+ updatedAt?: string | undefined;
292
+ color?: string | undefined;
293
+ linkedGroupIds?: string[] | undefined;
294
+ linkedLivestockIds?: string[] | undefined;
295
+ }>;
296
+ export declare const geofenceAlertListResponseSchema: z.ZodArray<z.ZodObject<{
297
+ id: z.ZodString;
298
+ geofenceId: z.ZodString;
299
+ geofenceName: z.ZodOptional<z.ZodString>;
300
+ livestockId: z.ZodOptional<z.ZodString>;
301
+ livestockTagId: z.ZodOptional<z.ZodString>;
302
+ groupId: z.ZodOptional<z.ZodString>;
303
+ groupName: z.ZodOptional<z.ZodString>;
304
+ alertType: z.ZodEnum<["entry", "exit"]>;
305
+ timestamp: z.ZodString;
306
+ coordinates: z.ZodObject<{
307
+ lat: z.ZodNumber;
308
+ lng: z.ZodNumber;
309
+ }, "strip", z.ZodTypeAny, {
310
+ lat: number;
311
+ lng: number;
312
+ }, {
313
+ lat: number;
314
+ lng: number;
315
+ }>;
316
+ acknowledged: z.ZodBoolean;
317
+ acknowledgedAt: z.ZodOptional<z.ZodString>;
318
+ acknowledgedBy: z.ZodOptional<z.ZodString>;
319
+ }, "strip", z.ZodTypeAny, {
320
+ coordinates: {
321
+ lat: number;
322
+ lng: number;
323
+ };
324
+ id: string;
325
+ timestamp: string;
326
+ acknowledged: boolean;
327
+ alertType: "entry" | "exit";
328
+ geofenceId: string;
329
+ acknowledgedAt?: string | undefined;
330
+ acknowledgedBy?: string | undefined;
331
+ groupId?: string | undefined;
332
+ geofenceName?: string | undefined;
333
+ livestockId?: string | undefined;
334
+ livestockTagId?: string | undefined;
335
+ groupName?: string | undefined;
336
+ }, {
337
+ coordinates: {
338
+ lat: number;
339
+ lng: number;
340
+ };
341
+ id: string;
342
+ timestamp: string;
343
+ acknowledged: boolean;
344
+ alertType: "entry" | "exit";
345
+ geofenceId: string;
346
+ acknowledgedAt?: string | undefined;
347
+ acknowledgedBy?: string | undefined;
348
+ groupId?: string | undefined;
349
+ geofenceName?: string | undefined;
350
+ livestockId?: string | undefined;
351
+ livestockTagId?: string | undefined;
352
+ groupName?: string | undefined;
353
+ }>, "many">;
354
+ export type GeofenceResponse = z.infer<typeof geofenceSchema>;
355
+ export type CreateGeofenceBody = z.infer<typeof createGeofenceBodySchema>;
356
+ export type UpdateGeofenceBody = z.infer<typeof updateGeofenceBodySchema>;
357
+ export type GeofenceAlertResponse = z.infer<typeof geofenceAlertSchema>;
358
+ //# sourceMappingURL=geofences.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geofences.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/geofences.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYzB,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQnC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAqC,CAAC;AAE3E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc9B,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAA0B,CAAC;AAClE,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAiB,CAAC;AAC3D,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAA+B,CAAC;AAE5E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { z } from 'zod';
2
+ import { geoJSONGeometrySchema } from './common.schemas';
3
+ const alertTypeSchema = z.enum(['entry', 'exit', 'both']);
4
+ export const geofenceSchema = z.object({
5
+ id: z.string().uuid(),
6
+ farmId: z.string().uuid(),
7
+ name: z.string(),
8
+ geometry: geoJSONGeometrySchema,
9
+ alertType: alertTypeSchema,
10
+ isActive: z.boolean(),
11
+ color: z.string().optional(),
12
+ linkedGroupIds: z.array(z.string().uuid()).optional(),
13
+ linkedLivestockIds: z.array(z.string().uuid()).optional(),
14
+ createdAt: z.string().datetime(),
15
+ updatedAt: z.string().datetime().optional(),
16
+ });
17
+ export const createGeofenceBodySchema = z.object({
18
+ name: z.string().min(1).max(200),
19
+ geometry: geoJSONGeometrySchema,
20
+ alertType: alertTypeSchema,
21
+ isActive: z.boolean().optional(),
22
+ color: z.string().max(20).optional(),
23
+ linkedGroupIds: z.array(z.string().uuid()).optional(),
24
+ linkedLivestockIds: z.array(z.string().uuid()).optional(),
25
+ });
26
+ export const updateGeofenceBodySchema = createGeofenceBodySchema.partial();
27
+ export const geofenceAlertSchema = z.object({
28
+ id: z.string().uuid(),
29
+ geofenceId: z.string().uuid(),
30
+ geofenceName: z.string().optional(),
31
+ livestockId: z.string().uuid().optional(),
32
+ livestockTagId: z.string().optional(),
33
+ groupId: z.string().uuid().optional(),
34
+ groupName: z.string().optional(),
35
+ alertType: z.enum(['entry', 'exit']),
36
+ timestamp: z.string().datetime(),
37
+ coordinates: z.object({ lat: z.number(), lng: z.number() }),
38
+ acknowledged: z.boolean(),
39
+ acknowledgedAt: z.string().datetime().optional(),
40
+ acknowledgedBy: z.string().optional(),
41
+ });
42
+ export const geofenceListResponseSchema = z.array(geofenceSchema);
43
+ export const geofenceSingleResponseSchema = geofenceSchema;
44
+ export const geofenceAlertListResponseSchema = z.array(geofenceAlertSchema);