@deepintel-ltd/farmpro-contracts 1.22.1 → 1.22.3

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":"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
+ });