@deepintel-ltd/farmpro-contracts 1.22.2 → 1.22.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 +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/routes/farm-enterprises.routes.d.ts +1909 -0
- package/dist/routes/farm-enterprises.routes.d.ts.map +1 -0
- package/dist/routes/farm-enterprises.routes.js +64 -0
- package/dist/routes/finance.routes.d.ts +188 -44
- package/dist/routes/finance.routes.d.ts.map +1 -1
- package/dist/routes/geofences.routes.d.ts +4 -4
- package/dist/routes/index.d.ts +2 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +2 -0
- package/dist/routes/livestock-groups.routes.d.ts +398 -90
- package/dist/routes/livestock-groups.routes.d.ts.map +1 -1
- package/dist/routes/livestock-map.routes.d.ts +6 -6
- package/dist/routes/livestock.routes.d.ts +78 -78
- package/dist/routes/staff.routes.d.ts +84 -0
- package/dist/routes/staff.routes.d.ts.map +1 -1
- package/dist/schemas/farm-enterprises.schemas.d.ts +435 -0
- package/dist/schemas/farm-enterprises.schemas.d.ts.map +1 -0
- package/dist/schemas/farm-enterprises.schemas.js +39 -0
- package/dist/schemas/finance.schemas.d.ts +231 -55
- package/dist/schemas/finance.schemas.d.ts.map +1 -1
- package/dist/schemas/finance.schemas.js +18 -2
- package/dist/schemas/geofences.schemas.d.ts +8 -8
- package/dist/schemas/livestock-groups.schemas.d.ts +368 -66
- package/dist/schemas/livestock-groups.schemas.d.ts.map +1 -1
- package/dist/schemas/livestock-groups.schemas.js +22 -0
- package/dist/schemas/livestock-map.schemas.d.ts +4 -4
- package/dist/schemas/livestock.schemas.d.ts +66 -66
- package/dist/schemas/staff.schemas.d.ts +76 -0
- package/dist/schemas/staff.schemas.d.ts.map +1 -1
- package/dist/schemas/staff.schemas.js +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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AAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { initContract } from '@ts-rest/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { createFarmEnterpriseSchema, farmEnterpriseListResponseSchema, farmEnterpriseResponseSchema, replaceFarmEnterprisesSchema, } from '../schemas/farm-enterprises.schemas';
|
|
4
|
+
import { jsonApiErrorResponseSchema, idParamSchema, } from '../schemas/common.schemas';
|
|
5
|
+
const c = initContract();
|
|
6
|
+
const farmIdParamSchema = z.object({
|
|
7
|
+
farmId: z.string().uuid(),
|
|
8
|
+
});
|
|
9
|
+
export const farmEnterprisesRouter = c.router({
|
|
10
|
+
listFarmEnterprises: {
|
|
11
|
+
method: 'GET',
|
|
12
|
+
path: '/farms/:farmId/enterprises',
|
|
13
|
+
pathParams: farmIdParamSchema,
|
|
14
|
+
responses: {
|
|
15
|
+
200: farmEnterpriseListResponseSchema,
|
|
16
|
+
401: jsonApiErrorResponseSchema,
|
|
17
|
+
403: jsonApiErrorResponseSchema,
|
|
18
|
+
404: jsonApiErrorResponseSchema,
|
|
19
|
+
},
|
|
20
|
+
summary: 'List enabled enterprise packs for a farm',
|
|
21
|
+
},
|
|
22
|
+
replaceFarmEnterprises: {
|
|
23
|
+
method: 'PUT',
|
|
24
|
+
path: '/farms/:farmId/enterprises',
|
|
25
|
+
pathParams: farmIdParamSchema,
|
|
26
|
+
body: z.object({ data: replaceFarmEnterprisesSchema }),
|
|
27
|
+
responses: {
|
|
28
|
+
200: farmEnterpriseListResponseSchema,
|
|
29
|
+
400: jsonApiErrorResponseSchema,
|
|
30
|
+
401: jsonApiErrorResponseSchema,
|
|
31
|
+
403: jsonApiErrorResponseSchema,
|
|
32
|
+
404: jsonApiErrorResponseSchema,
|
|
33
|
+
},
|
|
34
|
+
summary: 'Replace farm enterprise packs (multi-select)',
|
|
35
|
+
description: 'Manager/Owner only. Replaces the full set of enabled packs.',
|
|
36
|
+
},
|
|
37
|
+
addFarmEnterprise: {
|
|
38
|
+
method: 'POST',
|
|
39
|
+
path: '/farms/:farmId/enterprises',
|
|
40
|
+
pathParams: farmIdParamSchema,
|
|
41
|
+
body: z.object({ data: createFarmEnterpriseSchema }),
|
|
42
|
+
responses: {
|
|
43
|
+
201: farmEnterpriseResponseSchema,
|
|
44
|
+
400: jsonApiErrorResponseSchema,
|
|
45
|
+
401: jsonApiErrorResponseSchema,
|
|
46
|
+
403: jsonApiErrorResponseSchema,
|
|
47
|
+
404: jsonApiErrorResponseSchema,
|
|
48
|
+
409: jsonApiErrorResponseSchema,
|
|
49
|
+
},
|
|
50
|
+
summary: 'Enable one enterprise pack (add-on)',
|
|
51
|
+
},
|
|
52
|
+
removeFarmEnterprise: {
|
|
53
|
+
method: 'DELETE',
|
|
54
|
+
path: '/farms/:farmId/enterprises/:id',
|
|
55
|
+
pathParams: farmIdParamSchema.merge(idParamSchema),
|
|
56
|
+
responses: {
|
|
57
|
+
204: z.undefined(),
|
|
58
|
+
401: jsonApiErrorResponseSchema,
|
|
59
|
+
403: jsonApiErrorResponseSchema,
|
|
60
|
+
404: jsonApiErrorResponseSchema,
|
|
61
|
+
},
|
|
62
|
+
summary: 'Disable an enterprise pack',
|
|
63
|
+
},
|
|
64
|
+
});
|