@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.
- package/dist/routes/geofences.routes.d.ts +1913 -0
- package/dist/routes/geofences.routes.d.ts.map +1 -0
- package/dist/routes/geofences.routes.js +105 -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/livestock-map.routes.d.ts +1319 -0
- package/dist/routes/livestock-map.routes.d.ts.map +1 -0
- package/dist/routes/livestock-map.routes.js +83 -0
- package/dist/routes/prescription-maps.routes.d.ts +1521 -0
- package/dist/routes/prescription-maps.routes.d.ts.map +1 -0
- package/dist/routes/prescription-maps.routes.js +69 -0
- package/dist/schemas/geofences.schemas.d.ts +358 -0
- package/dist/schemas/geofences.schemas.d.ts.map +1 -0
- package/dist/schemas/geofences.schemas.js +44 -0
- package/dist/schemas/livestock-map.schemas.d.ts +328 -0
- package/dist/schemas/livestock-map.schemas.d.ts.map +1 -0
- package/dist/schemas/livestock-map.schemas.js +52 -0
- package/dist/schemas/prescription-maps.schemas.d.ts +615 -0
- package/dist/schemas/prescription-maps.schemas.d.ts.map +1 -0
- package/dist/schemas/prescription-maps.schemas.js +39 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"livestock-map.routes.d.ts","sourceRoot":"","sources":["../../src/routes/livestock-map.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6E7B,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { initContract } from '@ts-rest/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { livestockLocationListResponseSchema, livestockLocationSchema, movementTrailListResponseSchema, heatmapResponseSchema, grazingZoneListResponseSchema, updateLocationBodySchema, } from '../schemas/livestock-map.schemas';
|
|
4
|
+
import { jsonApiErrorResponseSchema } from '../schemas/common.schemas';
|
|
5
|
+
const c = initContract();
|
|
6
|
+
export const livestockMapRouter = c.router({
|
|
7
|
+
getLocations: {
|
|
8
|
+
method: 'GET',
|
|
9
|
+
path: '/farms/:farmId/livestock-map/locations',
|
|
10
|
+
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
11
|
+
query: z.object({
|
|
12
|
+
groupId: z.string().uuid().optional(),
|
|
13
|
+
category: z.string().optional(),
|
|
14
|
+
since: z.string().datetime().optional(),
|
|
15
|
+
}),
|
|
16
|
+
responses: {
|
|
17
|
+
200: livestockLocationListResponseSchema,
|
|
18
|
+
403: jsonApiErrorResponseSchema,
|
|
19
|
+
404: jsonApiErrorResponseSchema,
|
|
20
|
+
},
|
|
21
|
+
summary: 'Get livestock GPS locations',
|
|
22
|
+
},
|
|
23
|
+
getMovementTrails: {
|
|
24
|
+
method: 'GET',
|
|
25
|
+
path: '/farms/:farmId/livestock-map/movement-trails',
|
|
26
|
+
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
27
|
+
query: z.object({
|
|
28
|
+
livestockIds: z.string().optional(), // comma-separated UUIDs
|
|
29
|
+
dateStart: z.string().datetime(),
|
|
30
|
+
dateEnd: z.string().datetime(),
|
|
31
|
+
}),
|
|
32
|
+
responses: {
|
|
33
|
+
200: movementTrailListResponseSchema,
|
|
34
|
+
403: jsonApiErrorResponseSchema,
|
|
35
|
+
404: jsonApiErrorResponseSchema,
|
|
36
|
+
},
|
|
37
|
+
summary: 'Get movement trails',
|
|
38
|
+
},
|
|
39
|
+
getGrazingHeatmap: {
|
|
40
|
+
method: 'GET',
|
|
41
|
+
path: '/farms/:farmId/livestock-map/grazing-heatmap',
|
|
42
|
+
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
43
|
+
query: z.object({
|
|
44
|
+
groupId: z.string().uuid().optional(),
|
|
45
|
+
dateStart: z.string().datetime(),
|
|
46
|
+
dateEnd: z.string().datetime(),
|
|
47
|
+
resolution: z.coerce.number().positive().optional(),
|
|
48
|
+
}),
|
|
49
|
+
responses: {
|
|
50
|
+
200: heatmapResponseSchema,
|
|
51
|
+
403: jsonApiErrorResponseSchema,
|
|
52
|
+
404: jsonApiErrorResponseSchema,
|
|
53
|
+
},
|
|
54
|
+
summary: 'Get grazing heatmap points',
|
|
55
|
+
},
|
|
56
|
+
getGrazingZones: {
|
|
57
|
+
method: 'GET',
|
|
58
|
+
path: '/farms/:farmId/livestock-map/grazing-zones',
|
|
59
|
+
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
60
|
+
responses: {
|
|
61
|
+
200: grazingZoneListResponseSchema,
|
|
62
|
+
403: jsonApiErrorResponseSchema,
|
|
63
|
+
404: jsonApiErrorResponseSchema,
|
|
64
|
+
},
|
|
65
|
+
summary: 'Get grazing zones',
|
|
66
|
+
},
|
|
67
|
+
updateLocation: {
|
|
68
|
+
method: 'POST',
|
|
69
|
+
path: '/farms/:farmId/livestock-map/livestock/:livestockId/location',
|
|
70
|
+
pathParams: z.object({
|
|
71
|
+
farmId: z.string().uuid(),
|
|
72
|
+
livestockId: z.string().uuid(),
|
|
73
|
+
}),
|
|
74
|
+
body: updateLocationBodySchema,
|
|
75
|
+
responses: {
|
|
76
|
+
200: livestockLocationSchema,
|
|
77
|
+
400: jsonApiErrorResponseSchema,
|
|
78
|
+
403: jsonApiErrorResponseSchema,
|
|
79
|
+
404: jsonApiErrorResponseSchema,
|
|
80
|
+
},
|
|
81
|
+
summary: 'Update manual livestock location',
|
|
82
|
+
},
|
|
83
|
+
});
|