@deepintel-ltd/farmpro-contracts 1.7.5 → 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.
Files changed (31) hide show
  1. package/dist/index.d.ts +3 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -0
  4. package/dist/routes/geofences.routes.d.ts +1913 -0
  5. package/dist/routes/geofences.routes.d.ts.map +1 -0
  6. package/dist/routes/geofences.routes.js +105 -0
  7. package/dist/routes/index.d.ts +12 -0
  8. package/dist/routes/index.d.ts.map +1 -1
  9. package/dist/routes/index.js +8 -0
  10. package/dist/routes/livestock-groups.routes.d.ts +8343 -0
  11. package/dist/routes/livestock-groups.routes.d.ts.map +1 -0
  12. package/dist/routes/livestock-groups.routes.js +287 -0
  13. package/dist/routes/livestock-map.routes.d.ts +1319 -0
  14. package/dist/routes/livestock-map.routes.d.ts.map +1 -0
  15. package/dist/routes/livestock-map.routes.js +83 -0
  16. package/dist/routes/prescription-maps.routes.d.ts +1521 -0
  17. package/dist/routes/prescription-maps.routes.d.ts.map +1 -0
  18. package/dist/routes/prescription-maps.routes.js +69 -0
  19. package/dist/schemas/geofences.schemas.d.ts +358 -0
  20. package/dist/schemas/geofences.schemas.d.ts.map +1 -0
  21. package/dist/schemas/geofences.schemas.js +44 -0
  22. package/dist/schemas/livestock-groups.schemas.d.ts +2637 -0
  23. package/dist/schemas/livestock-groups.schemas.d.ts.map +1 -0
  24. package/dist/schemas/livestock-groups.schemas.js +297 -0
  25. package/dist/schemas/livestock-map.schemas.d.ts +328 -0
  26. package/dist/schemas/livestock-map.schemas.d.ts.map +1 -0
  27. package/dist/schemas/livestock-map.schemas.js +52 -0
  28. package/dist/schemas/prescription-maps.schemas.d.ts +615 -0
  29. package/dist/schemas/prescription-maps.schemas.d.ts.map +1 -0
  30. package/dist/schemas/prescription-maps.schemas.js +39 -0
  31. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liv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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8ShC,CAAC"}
@@ -0,0 +1,287 @@
1
+ import { initContract } from '@ts-rest/core';
2
+ import { z } from 'zod';
3
+ import { createLivestockGroupSchema, updateLivestockGroupSchema, createBatchRecordSchema, livestockGroupResponseSchema, livestockGroupListResponseSchema, batchRecordResponseSchema, batchRecordListResponseSchema, groupStatsResponseSchema, bulkAddMembersSchema, bulkRemoveMembersSchema, bulkCreateLivestockSchema, bulkHealthRecordSchema, bulkOperationResponseSchema, livestockGroupTypeSchema, trackingModeSchema, groupStatusSchema, batchRecordTypeSchema, } from '../schemas/livestock-groups.schemas';
4
+ import { livestockCategorySchema, livestockListResponseSchema } from '../schemas/livestock.schemas';
5
+ import { jsonApiErrorResponseSchema, jsonApiSuccessResponseSchema, jsonApiPaginationQuerySchema, jsonApiSortQuerySchema, } from '../schemas/common.schemas';
6
+ const c = initContract();
7
+ export const livestockGroupsRouter = c.router({
8
+ // ============================================================================
9
+ // Livestock Group CRUD
10
+ // ============================================================================
11
+ // List groups for a farm
12
+ listGroups: {
13
+ method: 'GET',
14
+ path: '/farms/:farmId/livestock-groups',
15
+ pathParams: z.object({ farmId: z.string().uuid() }),
16
+ query: jsonApiPaginationQuerySchema
17
+ .merge(jsonApiSortQuerySchema)
18
+ .merge(z.object({
19
+ 'filter[category]': livestockCategorySchema.optional(),
20
+ 'filter[groupType]': livestockGroupTypeSchema.optional(),
21
+ 'filter[trackingMode]': trackingModeSchema.optional(),
22
+ 'filter[status]': groupStatusSchema.optional(),
23
+ search: z.string().optional(),
24
+ })),
25
+ responses: {
26
+ 200: livestockGroupListResponseSchema,
27
+ 404: jsonApiErrorResponseSchema,
28
+ 401: jsonApiErrorResponseSchema,
29
+ },
30
+ summary: 'List livestock groups',
31
+ description: 'Get all livestock groups/batches for a farm with optional filtering',
32
+ },
33
+ // Get group statistics
34
+ getGroupStats: {
35
+ method: 'GET',
36
+ path: '/farms/:farmId/livestock-groups/stats',
37
+ pathParams: z.object({ farmId: z.string().uuid() }),
38
+ responses: {
39
+ 200: groupStatsResponseSchema,
40
+ 404: jsonApiErrorResponseSchema,
41
+ 401: jsonApiErrorResponseSchema,
42
+ },
43
+ summary: 'Get group statistics',
44
+ description: 'Get summary statistics for all livestock groups on the farm',
45
+ },
46
+ // Create group
47
+ createGroup: {
48
+ method: 'POST',
49
+ path: '/farms/:farmId/livestock-groups',
50
+ pathParams: z.object({ farmId: z.string().uuid() }),
51
+ body: z.object({ data: createLivestockGroupSchema }),
52
+ responses: {
53
+ 201: livestockGroupResponseSchema,
54
+ 400: jsonApiErrorResponseSchema,
55
+ 404: jsonApiErrorResponseSchema,
56
+ 401: jsonApiErrorResponseSchema,
57
+ 409: jsonApiErrorResponseSchema, // Duplicate groupCode
58
+ 422: jsonApiErrorResponseSchema,
59
+ },
60
+ summary: 'Create livestock group',
61
+ description: 'Create a new livestock group/batch (flock, herd, pond, etc.)',
62
+ },
63
+ // Get group by ID
64
+ getGroup: {
65
+ method: 'GET',
66
+ path: '/farms/:farmId/livestock-groups/:groupId',
67
+ pathParams: z.object({
68
+ farmId: z.string().uuid(),
69
+ groupId: z.string().uuid(),
70
+ }),
71
+ responses: {
72
+ 200: livestockGroupResponseSchema,
73
+ 404: jsonApiErrorResponseSchema,
74
+ 401: jsonApiErrorResponseSchema,
75
+ },
76
+ summary: 'Get livestock group by ID',
77
+ description: 'Get detailed information about a livestock group',
78
+ },
79
+ // Update group
80
+ updateGroup: {
81
+ method: 'PATCH',
82
+ path: '/farms/:farmId/livestock-groups/:groupId',
83
+ pathParams: z.object({
84
+ farmId: z.string().uuid(),
85
+ groupId: z.string().uuid(),
86
+ }),
87
+ body: z.object({ data: updateLivestockGroupSchema }),
88
+ responses: {
89
+ 200: livestockGroupResponseSchema,
90
+ 400: jsonApiErrorResponseSchema,
91
+ 404: jsonApiErrorResponseSchema,
92
+ 401: jsonApiErrorResponseSchema,
93
+ 409: jsonApiErrorResponseSchema,
94
+ 422: jsonApiErrorResponseSchema,
95
+ },
96
+ summary: 'Update livestock group',
97
+ description: 'Update livestock group information',
98
+ },
99
+ // Delete group
100
+ deleteGroup: {
101
+ method: 'DELETE',
102
+ path: '/farms/:farmId/livestock-groups/:groupId',
103
+ pathParams: z.object({
104
+ farmId: z.string().uuid(),
105
+ groupId: z.string().uuid(),
106
+ }),
107
+ responses: {
108
+ 204: jsonApiSuccessResponseSchema,
109
+ 404: jsonApiErrorResponseSchema,
110
+ 401: jsonApiErrorResponseSchema,
111
+ },
112
+ summary: 'Delete livestock group',
113
+ description: 'Delete a livestock group (does not delete member animals)',
114
+ },
115
+ // ============================================================================
116
+ // Group Members Management
117
+ // ============================================================================
118
+ // List group members (individual animals in the group)
119
+ listGroupMembers: {
120
+ method: 'GET',
121
+ path: '/farms/:farmId/livestock-groups/:groupId/members',
122
+ pathParams: z.object({
123
+ farmId: z.string().uuid(),
124
+ groupId: z.string().uuid(),
125
+ }),
126
+ query: jsonApiPaginationQuerySchema.merge(jsonApiSortQuerySchema),
127
+ responses: {
128
+ 200: livestockListResponseSchema,
129
+ 404: jsonApiErrorResponseSchema,
130
+ 401: jsonApiErrorResponseSchema,
131
+ },
132
+ summary: 'List group members',
133
+ description: 'Get all individual animals in a livestock group',
134
+ },
135
+ // Add animals to group
136
+ addGroupMembers: {
137
+ method: 'POST',
138
+ path: '/farms/:farmId/livestock-groups/:groupId/members',
139
+ pathParams: z.object({
140
+ farmId: z.string().uuid(),
141
+ groupId: z.string().uuid(),
142
+ }),
143
+ body: z.object({ data: bulkAddMembersSchema }),
144
+ responses: {
145
+ 200: bulkOperationResponseSchema,
146
+ 400: jsonApiErrorResponseSchema,
147
+ 404: jsonApiErrorResponseSchema,
148
+ 401: jsonApiErrorResponseSchema,
149
+ 422: jsonApiErrorResponseSchema,
150
+ },
151
+ summary: 'Add animals to group',
152
+ description: 'Add existing livestock to a group',
153
+ },
154
+ // Remove animals from group
155
+ removeGroupMembers: {
156
+ method: 'DELETE',
157
+ path: '/farms/:farmId/livestock-groups/:groupId/members',
158
+ pathParams: z.object({
159
+ farmId: z.string().uuid(),
160
+ groupId: z.string().uuid(),
161
+ }),
162
+ body: z.object({ data: bulkRemoveMembersSchema }),
163
+ responses: {
164
+ 200: bulkOperationResponseSchema,
165
+ 400: jsonApiErrorResponseSchema,
166
+ 404: jsonApiErrorResponseSchema,
167
+ 401: jsonApiErrorResponseSchema,
168
+ 422: jsonApiErrorResponseSchema,
169
+ },
170
+ summary: 'Remove animals from group',
171
+ description: 'Remove animals from a group (does not delete the animals)',
172
+ },
173
+ // ============================================================================
174
+ // Batch Records (for BATCH tracking mode)
175
+ // ============================================================================
176
+ // List batch records for a group
177
+ listBatchRecords: {
178
+ method: 'GET',
179
+ path: '/farms/:farmId/livestock-groups/:groupId/records',
180
+ pathParams: z.object({
181
+ farmId: z.string().uuid(),
182
+ groupId: z.string().uuid(),
183
+ }),
184
+ query: jsonApiPaginationQuerySchema
185
+ .merge(jsonApiSortQuerySchema)
186
+ .merge(z.object({
187
+ 'filter[recordType]': batchRecordTypeSchema.optional(),
188
+ 'filter[startDate]': z.string().datetime().optional(),
189
+ 'filter[endDate]': z.string().datetime().optional(),
190
+ })),
191
+ responses: {
192
+ 200: batchRecordListResponseSchema,
193
+ 404: jsonApiErrorResponseSchema,
194
+ 401: jsonApiErrorResponseSchema,
195
+ },
196
+ summary: 'List batch records',
197
+ description: 'Get all batch-level records for a group (mortality, feeding, egg collection, etc.)',
198
+ },
199
+ // Create batch record
200
+ createBatchRecord: {
201
+ method: 'POST',
202
+ path: '/farms/:farmId/livestock-groups/:groupId/records',
203
+ pathParams: z.object({
204
+ farmId: z.string().uuid(),
205
+ groupId: z.string().uuid(),
206
+ }),
207
+ body: z.object({ data: createBatchRecordSchema }),
208
+ responses: {
209
+ 201: batchRecordResponseSchema,
210
+ 400: jsonApiErrorResponseSchema,
211
+ 404: jsonApiErrorResponseSchema,
212
+ 401: jsonApiErrorResponseSchema,
213
+ 422: jsonApiErrorResponseSchema,
214
+ },
215
+ summary: 'Create batch record',
216
+ description: 'Record a batch-level event (stocking, mortality, feeding, egg collection, etc.)',
217
+ },
218
+ // Get batch record by ID
219
+ getBatchRecord: {
220
+ method: 'GET',
221
+ path: '/farms/:farmId/livestock-groups/:groupId/records/:recordId',
222
+ pathParams: z.object({
223
+ farmId: z.string().uuid(),
224
+ groupId: z.string().uuid(),
225
+ recordId: z.string().uuid(),
226
+ }),
227
+ responses: {
228
+ 200: batchRecordResponseSchema,
229
+ 404: jsonApiErrorResponseSchema,
230
+ 401: jsonApiErrorResponseSchema,
231
+ },
232
+ summary: 'Get batch record by ID',
233
+ description: 'Get detailed information about a batch record',
234
+ },
235
+ // Delete batch record
236
+ deleteBatchRecord: {
237
+ method: 'DELETE',
238
+ path: '/farms/:farmId/livestock-groups/:groupId/records/:recordId',
239
+ pathParams: z.object({
240
+ farmId: z.string().uuid(),
241
+ groupId: z.string().uuid(),
242
+ recordId: z.string().uuid(),
243
+ }),
244
+ responses: {
245
+ 204: jsonApiSuccessResponseSchema,
246
+ 404: jsonApiErrorResponseSchema,
247
+ 401: jsonApiErrorResponseSchema,
248
+ },
249
+ summary: 'Delete batch record',
250
+ description: 'Delete a batch record',
251
+ },
252
+ // ============================================================================
253
+ // Bulk Operations
254
+ // ============================================================================
255
+ // Bulk create livestock
256
+ bulkCreateLivestock: {
257
+ method: 'POST',
258
+ path: '/farms/:farmId/livestock/bulk',
259
+ pathParams: z.object({ farmId: z.string().uuid() }),
260
+ body: z.object({ data: bulkCreateLivestockSchema }),
261
+ responses: {
262
+ 201: bulkOperationResponseSchema,
263
+ 400: jsonApiErrorResponseSchema,
264
+ 404: jsonApiErrorResponseSchema,
265
+ 401: jsonApiErrorResponseSchema,
266
+ 422: jsonApiErrorResponseSchema,
267
+ },
268
+ summary: 'Bulk create livestock',
269
+ description: 'Create multiple livestock at once with auto-generated tags or explicit entries',
270
+ },
271
+ // Bulk health record (apply to group or list of animals)
272
+ bulkHealthRecord: {
273
+ method: 'POST',
274
+ path: '/farms/:farmId/livestock/bulk/health-records',
275
+ pathParams: z.object({ farmId: z.string().uuid() }),
276
+ body: z.object({ data: bulkHealthRecordSchema }),
277
+ responses: {
278
+ 201: bulkOperationResponseSchema,
279
+ 400: jsonApiErrorResponseSchema,
280
+ 404: jsonApiErrorResponseSchema,
281
+ 401: jsonApiErrorResponseSchema,
282
+ 422: jsonApiErrorResponseSchema,
283
+ },
284
+ summary: 'Bulk health record',
285
+ description: 'Apply a health record (vaccination, treatment) to a group or list of animals',
286
+ },
287
+ });