@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.
Files changed (34) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -0
  4. package/dist/routes/farm-enterprises.routes.d.ts +1909 -0
  5. package/dist/routes/farm-enterprises.routes.d.ts.map +1 -0
  6. package/dist/routes/farm-enterprises.routes.js +64 -0
  7. package/dist/routes/finance.routes.d.ts +188 -44
  8. package/dist/routes/finance.routes.d.ts.map +1 -1
  9. package/dist/routes/geofences.routes.d.ts +4 -4
  10. package/dist/routes/index.d.ts +2 -0
  11. package/dist/routes/index.d.ts.map +1 -1
  12. package/dist/routes/index.js +2 -0
  13. package/dist/routes/livestock-groups.routes.d.ts +398 -90
  14. package/dist/routes/livestock-groups.routes.d.ts.map +1 -1
  15. package/dist/routes/livestock-map.routes.d.ts +6 -6
  16. package/dist/routes/livestock.routes.d.ts +78 -78
  17. package/dist/routes/staff.routes.d.ts +84 -0
  18. package/dist/routes/staff.routes.d.ts.map +1 -1
  19. package/dist/schemas/farm-enterprises.schemas.d.ts +435 -0
  20. package/dist/schemas/farm-enterprises.schemas.d.ts.map +1 -0
  21. package/dist/schemas/farm-enterprises.schemas.js +39 -0
  22. package/dist/schemas/finance.schemas.d.ts +231 -55
  23. package/dist/schemas/finance.schemas.d.ts.map +1 -1
  24. package/dist/schemas/finance.schemas.js +18 -2
  25. package/dist/schemas/geofences.schemas.d.ts +8 -8
  26. package/dist/schemas/livestock-groups.schemas.d.ts +368 -66
  27. package/dist/schemas/livestock-groups.schemas.d.ts.map +1 -1
  28. package/dist/schemas/livestock-groups.schemas.js +22 -0
  29. package/dist/schemas/livestock-map.schemas.d.ts +4 -4
  30. package/dist/schemas/livestock.schemas.d.ts +66 -66
  31. package/dist/schemas/staff.schemas.d.ts +76 -0
  32. package/dist/schemas/staff.schemas.d.ts.map +1 -1
  33. package/dist/schemas/staff.schemas.js +6 -0
  34. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"farm-enterprises.routes.d.ts","sourceRoot":"","sources":["../../src/routes/farm-enterprises.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DhC,CAAC"}
@@ -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
+ });