@deepintel-ltd/farmpro-contracts 1.5.19 → 1.5.20
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 +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/routes/agents.routes.d.ts +192 -18
- package/dist/routes/agents.routes.d.ts.map +1 -1
- 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/invoices.routes.d.ts +3608 -0
- package/dist/routes/invoices.routes.d.ts.map +1 -0
- package/dist/routes/invoices.routes.js +98 -0
- package/dist/routes/organizations.routes.d.ts +1669 -0
- package/dist/routes/organizations.routes.d.ts.map +1 -0
- package/dist/routes/organizations.routes.js +63 -0
- package/dist/routes/waybills.routes.d.ts +3225 -0
- package/dist/routes/waybills.routes.d.ts.map +1 -0
- package/dist/routes/waybills.routes.js +95 -0
- package/dist/schemas/agents.schemas.d.ts +760 -49
- package/dist/schemas/agents.schemas.d.ts.map +1 -1
- package/dist/schemas/agents.schemas.js +21 -1
- package/dist/schemas/invoices.schemas.d.ts +1533 -0
- package/dist/schemas/invoices.schemas.d.ts.map +1 -0
- package/dist/schemas/invoices.schemas.js +85 -0
- package/dist/schemas/organizations.schemas.d.ts +509 -0
- package/dist/schemas/organizations.schemas.d.ts.map +1 -0
- package/dist/schemas/organizations.schemas.js +39 -0
- package/dist/schemas/waybills.schemas.d.ts +1261 -0
- package/dist/schemas/waybills.schemas.d.ts.map +1 -0
- package/dist/schemas/waybills.schemas.js +70 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.routes.d.ts","sourceRoot":"","sources":["../../src/routes/organizations.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4D9B,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { initContract } from '@ts-rest/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { createOrganizationSchema, updateOrganizationSchema, organizationResponseSchema, organizationListResponseSchema, } from '../schemas/organizations.schemas';
|
|
4
|
+
import { jsonApiErrorResponseSchema, idParamSchema, jsonApiPaginationQuerySchema, jsonApiSortQuerySchema, } from '../schemas/common.schemas';
|
|
5
|
+
const c = initContract();
|
|
6
|
+
export const organizationsRouter = c.router({
|
|
7
|
+
// List all organizations for the authenticated user
|
|
8
|
+
listOrganizations: {
|
|
9
|
+
method: 'GET',
|
|
10
|
+
path: '/organizations',
|
|
11
|
+
query: jsonApiPaginationQuerySchema
|
|
12
|
+
.merge(jsonApiSortQuerySchema),
|
|
13
|
+
responses: {
|
|
14
|
+
200: organizationListResponseSchema,
|
|
15
|
+
401: jsonApiErrorResponseSchema,
|
|
16
|
+
},
|
|
17
|
+
summary: 'List all organizations',
|
|
18
|
+
description: 'Get a paginated list of organizations for the authenticated user',
|
|
19
|
+
},
|
|
20
|
+
// Create a new organization
|
|
21
|
+
createOrganization: {
|
|
22
|
+
method: 'POST',
|
|
23
|
+
path: '/organizations',
|
|
24
|
+
body: z.object({ data: createOrganizationSchema }),
|
|
25
|
+
responses: {
|
|
26
|
+
201: organizationResponseSchema,
|
|
27
|
+
400: jsonApiErrorResponseSchema,
|
|
28
|
+
401: jsonApiErrorResponseSchema,
|
|
29
|
+
422: jsonApiErrorResponseSchema,
|
|
30
|
+
},
|
|
31
|
+
summary: 'Create a new organization',
|
|
32
|
+
description: 'Create a new organization. The creator automatically becomes the primary contact person.',
|
|
33
|
+
},
|
|
34
|
+
// Get organization by ID
|
|
35
|
+
getOrganization: {
|
|
36
|
+
method: 'GET',
|
|
37
|
+
path: '/organizations/:id',
|
|
38
|
+
pathParams: idParamSchema,
|
|
39
|
+
responses: {
|
|
40
|
+
200: organizationResponseSchema,
|
|
41
|
+
404: jsonApiErrorResponseSchema,
|
|
42
|
+
401: jsonApiErrorResponseSchema,
|
|
43
|
+
},
|
|
44
|
+
summary: 'Get organization by ID',
|
|
45
|
+
description: 'Get detailed information about a specific organization',
|
|
46
|
+
},
|
|
47
|
+
// Update organization
|
|
48
|
+
updateOrganization: {
|
|
49
|
+
method: 'PATCH',
|
|
50
|
+
path: '/organizations/:id',
|
|
51
|
+
pathParams: idParamSchema,
|
|
52
|
+
body: z.object({ data: updateOrganizationSchema }),
|
|
53
|
+
responses: {
|
|
54
|
+
200: organizationResponseSchema,
|
|
55
|
+
400: jsonApiErrorResponseSchema,
|
|
56
|
+
404: jsonApiErrorResponseSchema,
|
|
57
|
+
401: jsonApiErrorResponseSchema,
|
|
58
|
+
422: jsonApiErrorResponseSchema,
|
|
59
|
+
},
|
|
60
|
+
summary: 'Update organization',
|
|
61
|
+
description: 'Update organization information',
|
|
62
|
+
},
|
|
63
|
+
});
|