@deepintel-ltd/farmpro-contracts 1.7.20 → 1.8.0
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 +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/routes/commodity-deals.routes.d.ts +2702 -0
- package/dist/routes/commodity-deals.routes.d.ts.map +1 -0
- package/dist/routes/commodity-deals.routes.js +83 -0
- package/dist/routes/device-gateway-admin.routes.d.ts +1135 -0
- package/dist/routes/device-gateway-admin.routes.d.ts.map +1 -0
- package/dist/routes/device-gateway-admin.routes.js +105 -0
- package/dist/routes/device-gateway.routes.d.ts +457 -0
- package/dist/routes/device-gateway.routes.d.ts.map +1 -0
- package/dist/routes/device-gateway.routes.js +63 -0
- 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 +49 -0
- package/dist/routes/invoices.routes.d.ts.map +1 -1
- package/dist/routes/organizations.routes.d.ts +49 -0
- package/dist/routes/organizations.routes.d.ts.map +1 -1
- package/dist/routes/waybills.routes.d.ts +42 -0
- package/dist/routes/waybills.routes.d.ts.map +1 -1
- package/dist/schemas/commodity-deals.schemas.d.ts +1109 -0
- package/dist/schemas/commodity-deals.schemas.d.ts.map +1 -0
- package/dist/schemas/commodity-deals.schemas.js +82 -0
- package/dist/schemas/device-gateway.schemas.d.ts +1407 -0
- package/dist/schemas/device-gateway.schemas.d.ts.map +1 -0
- package/dist/schemas/device-gateway.schemas.js +165 -0
- package/dist/schemas/invoices.schemas.d.ts +38 -0
- package/dist/schemas/invoices.schemas.d.ts.map +1 -1
- package/dist/schemas/invoices.schemas.js +2 -0
- package/dist/schemas/organizations.schemas.d.ts +38 -0
- package/dist/schemas/organizations.schemas.d.ts.map +1 -1
- package/dist/schemas/organizations.schemas.js +2 -0
- package/dist/schemas/waybills.schemas.d.ts +48 -0
- package/dist/schemas/waybills.schemas.d.ts.map +1 -1
- package/dist/schemas/waybills.schemas.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commodity-deals.routes.d.ts","sourceRoot":"","sources":["../../src/routes/commodity-deals.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiF/B,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { initContract } from '@ts-rest/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { createCommodityDealSchema, updateCommodityDealSchema, commodityDealResponseSchema, commodityDealListResponseSchema, commodityDealSummaryResponseSchema, commodityDealStatusSchema, } from '../schemas/commodity-deals.schemas';
|
|
4
|
+
import { jsonApiErrorResponseSchema, jsonApiPaginationQuerySchema, jsonApiSortQuerySchema, } from '../schemas/common.schemas';
|
|
5
|
+
const c = initContract();
|
|
6
|
+
export const commodityDealsRouter = c.router({
|
|
7
|
+
listCommodityDeals: {
|
|
8
|
+
method: 'GET',
|
|
9
|
+
path: '/organizations/:organizationId/commodity-deals',
|
|
10
|
+
pathParams: z.object({
|
|
11
|
+
organizationId: z.string().uuid(),
|
|
12
|
+
}),
|
|
13
|
+
query: jsonApiPaginationQuerySchema.merge(jsonApiSortQuerySchema).extend({
|
|
14
|
+
'filter[status]': commodityDealStatusSchema.optional(),
|
|
15
|
+
}),
|
|
16
|
+
responses: {
|
|
17
|
+
200: commodityDealListResponseSchema,
|
|
18
|
+
401: jsonApiErrorResponseSchema,
|
|
19
|
+
404: jsonApiErrorResponseSchema,
|
|
20
|
+
},
|
|
21
|
+
summary: 'List commodity deals for an organization',
|
|
22
|
+
},
|
|
23
|
+
getCommodityDealSummary: {
|
|
24
|
+
method: 'GET',
|
|
25
|
+
path: '/organizations/:organizationId/commodity-deals/summary',
|
|
26
|
+
pathParams: z.object({
|
|
27
|
+
organizationId: z.string().uuid(),
|
|
28
|
+
}),
|
|
29
|
+
responses: {
|
|
30
|
+
200: commodityDealSummaryResponseSchema,
|
|
31
|
+
401: jsonApiErrorResponseSchema,
|
|
32
|
+
404: jsonApiErrorResponseSchema,
|
|
33
|
+
},
|
|
34
|
+
summary: 'Get commodity deal profitability summary KPIs',
|
|
35
|
+
},
|
|
36
|
+
getCommodityDeal: {
|
|
37
|
+
method: 'GET',
|
|
38
|
+
path: '/organizations/:organizationId/commodity-deals/:id',
|
|
39
|
+
pathParams: z.object({
|
|
40
|
+
organizationId: z.string().uuid(),
|
|
41
|
+
id: z.string().uuid(),
|
|
42
|
+
}),
|
|
43
|
+
responses: {
|
|
44
|
+
200: commodityDealResponseSchema,
|
|
45
|
+
404: jsonApiErrorResponseSchema,
|
|
46
|
+
401: jsonApiErrorResponseSchema,
|
|
47
|
+
},
|
|
48
|
+
summary: 'Get commodity deal by ID',
|
|
49
|
+
},
|
|
50
|
+
createCommodityDeal: {
|
|
51
|
+
method: 'POST',
|
|
52
|
+
path: '/organizations/:organizationId/commodity-deals',
|
|
53
|
+
pathParams: z.object({
|
|
54
|
+
organizationId: z.string().uuid(),
|
|
55
|
+
}),
|
|
56
|
+
body: z.object({ data: createCommodityDealSchema }),
|
|
57
|
+
responses: {
|
|
58
|
+
201: commodityDealResponseSchema,
|
|
59
|
+
400: jsonApiErrorResponseSchema,
|
|
60
|
+
401: jsonApiErrorResponseSchema,
|
|
61
|
+
404: jsonApiErrorResponseSchema,
|
|
62
|
+
422: jsonApiErrorResponseSchema,
|
|
63
|
+
},
|
|
64
|
+
summary: 'Create a commodity deal linked to a waybill',
|
|
65
|
+
},
|
|
66
|
+
updateCommodityDeal: {
|
|
67
|
+
method: 'PATCH',
|
|
68
|
+
path: '/organizations/:organizationId/commodity-deals/:id',
|
|
69
|
+
pathParams: z.object({
|
|
70
|
+
organizationId: z.string().uuid(),
|
|
71
|
+
id: z.string().uuid(),
|
|
72
|
+
}),
|
|
73
|
+
body: z.object({ data: updateCommodityDealSchema }),
|
|
74
|
+
responses: {
|
|
75
|
+
200: commodityDealResponseSchema,
|
|
76
|
+
400: jsonApiErrorResponseSchema,
|
|
77
|
+
404: jsonApiErrorResponseSchema,
|
|
78
|
+
401: jsonApiErrorResponseSchema,
|
|
79
|
+
422: jsonApiErrorResponseSchema,
|
|
80
|
+
},
|
|
81
|
+
summary: 'Update commodity deal costs or status',
|
|
82
|
+
},
|
|
83
|
+
});
|