@deepintel-ltd/farmpro-contracts 1.22.4 → 1.23.1
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 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/routes/categories.routes.d.ts +26 -26
- package/dist/routes/commodity-deals.routes.d.ts +217 -42
- package/dist/routes/commodity-deals.routes.d.ts.map +1 -1
- package/dist/routes/crop-profile.routes.d.ts +8 -8
- package/dist/routes/farm-enterprises.routes.d.ts +395 -0
- package/dist/routes/farm-enterprises.routes.d.ts.map +1 -1
- package/dist/routes/farm-enterprises.routes.js +14 -1
- package/dist/routes/farms.routes.d.ts +73 -20
- package/dist/routes/farms.routes.d.ts.map +1 -1
- package/dist/routes/fertigation.routes.d.ts +96 -96
- package/dist/routes/field-monitoring.routes.d.ts +2 -2
- package/dist/routes/finance.routes.d.ts +8 -8
- 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 +210 -60
- package/dist/routes/invoices.routes.d.ts.map +1 -1
- package/dist/routes/invoices.routes.js +4 -1
- package/dist/routes/monitoring-visualization.routes.d.ts +2 -2
- package/dist/routes/notifications.routes.d.ts +12 -12
- package/dist/routes/organization-capabilities.routes.d.ts +1671 -0
- package/dist/routes/organization-capabilities.routes.d.ts.map +1 -0
- package/dist/routes/organization-capabilities.routes.js +74 -0
- package/dist/routes/organizations.routes.d.ts +90 -47
- package/dist/routes/organizations.routes.d.ts.map +1 -1
- package/dist/routes/purchase-orders.routes.d.ts +2061 -0
- package/dist/routes/purchase-orders.routes.d.ts.map +1 -0
- package/dist/routes/purchase-orders.routes.js +55 -0
- package/dist/routes/suppliers.routes.d.ts +96 -96
- package/dist/routes/team-payments.routes.d.ts +105 -105
- package/dist/routes/team.routes.d.ts +125 -25
- package/dist/routes/team.routes.d.ts.map +1 -1
- package/dist/routes/trade-cash-events.routes.d.ts +3837 -0
- package/dist/routes/trade-cash-events.routes.d.ts.map +1 -0
- package/dist/routes/trade-cash-events.routes.js +126 -0
- package/dist/routes/waybills.routes.d.ts +229 -15
- package/dist/routes/waybills.routes.d.ts.map +1 -1
- package/dist/routes/waybills.routes.js +4 -1
- package/dist/schemas/categories.schemas.d.ts +21 -21
- package/dist/schemas/commodity-deals.schemas.d.ts +116 -18
- package/dist/schemas/commodity-deals.schemas.d.ts.map +1 -1
- package/dist/schemas/commodity-deals.schemas.js +7 -0
- package/dist/schemas/crop-profile.schemas.d.ts +12 -12
- package/dist/schemas/farm-enterprises.schemas.d.ts +185 -0
- package/dist/schemas/farm-enterprises.schemas.d.ts.map +1 -1
- package/dist/schemas/farm-enterprises.schemas.js +21 -0
- package/dist/schemas/farms.schemas.d.ts +121 -19
- package/dist/schemas/farms.schemas.d.ts.map +1 -1
- package/dist/schemas/farms.schemas.js +15 -1
- package/dist/schemas/fertigation.schemas.d.ts +36 -36
- package/dist/schemas/field-monitoring.schemas.d.ts +2 -2
- package/dist/schemas/finance.schemas.d.ts +8 -8
- package/dist/schemas/invoices.schemas.d.ts +153 -39
- package/dist/schemas/invoices.schemas.d.ts.map +1 -1
- package/dist/schemas/invoices.schemas.js +8 -2
- package/dist/schemas/notifications.schemas.d.ts +18 -18
- package/dist/schemas/organization-capabilities.schemas.d.ts +355 -0
- package/dist/schemas/organization-capabilities.schemas.d.ts.map +1 -0
- package/dist/schemas/organization-capabilities.schemas.js +19 -0
- package/dist/schemas/organizations.schemas.d.ts +105 -46
- package/dist/schemas/organizations.schemas.d.ts.map +1 -1
- package/dist/schemas/organizations.schemas.js +8 -1
- package/dist/schemas/purchase-orders.schemas.d.ts +1031 -0
- package/dist/schemas/purchase-orders.schemas.d.ts.map +1 -0
- package/dist/schemas/purchase-orders.schemas.js +49 -0
- package/dist/schemas/suppliers.schemas.d.ts +96 -96
- package/dist/schemas/team-payments.schemas.d.ts +87 -87
- package/dist/schemas/team.schemas.d.ts +137 -20
- package/dist/schemas/team.schemas.d.ts.map +1 -1
- package/dist/schemas/team.schemas.js +29 -1
- package/dist/schemas/trade-cash-events.schemas.d.ts +1524 -0
- package/dist/schemas/trade-cash-events.schemas.d.ts.map +1 -0
- package/dist/schemas/trade-cash-events.schemas.js +131 -0
- package/dist/schemas/waybills.schemas.d.ts +177 -9
- package/dist/schemas/waybills.schemas.d.ts.map +1 -1
- package/dist/schemas/waybills.schemas.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trade-cash-events.routes.d.ts","sourceRoot":"","sources":["../../src/routes/trade-cash-events.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4HhC,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { initContract } from '@ts-rest/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { createInvoicePaymentSchema, createTradeCashEventSchema, investorBalancesResponseSchema, invoicePaymentListResponseSchema, invoicePaymentResponseSchema, tradeCashEventListResponseSchema, tradeCashEventResponseSchema, tradeCashEventTypeSchema, tradeControlBoardResponseSchema, } from '../schemas/trade-cash-events.schemas';
|
|
4
|
+
import { jsonApiErrorResponseSchema, idParamSchema } from '../schemas/common.schemas';
|
|
5
|
+
const c = initContract();
|
|
6
|
+
const organizationIdParamSchema = z.object({
|
|
7
|
+
organizationId: z.string().uuid(),
|
|
8
|
+
});
|
|
9
|
+
export const tradeCashEventsRouter = c.router({
|
|
10
|
+
listTradeCashEvents: {
|
|
11
|
+
method: 'GET',
|
|
12
|
+
path: '/organizations/:organizationId/trade-cash-events',
|
|
13
|
+
pathParams: organizationIdParamSchema,
|
|
14
|
+
query: z.object({
|
|
15
|
+
type: tradeCashEventTypeSchema.optional(),
|
|
16
|
+
dealId: z.string().uuid().optional(),
|
|
17
|
+
invoiceId: z.string().uuid().optional(),
|
|
18
|
+
partyId: z.string().optional(),
|
|
19
|
+
page: z.coerce.number().int().positive().optional(),
|
|
20
|
+
pageSize: z.coerce.number().int().positive().max(100).optional(),
|
|
21
|
+
}),
|
|
22
|
+
responses: {
|
|
23
|
+
200: tradeCashEventListResponseSchema,
|
|
24
|
+
401: jsonApiErrorResponseSchema,
|
|
25
|
+
403: jsonApiErrorResponseSchema,
|
|
26
|
+
404: jsonApiErrorResponseSchema,
|
|
27
|
+
},
|
|
28
|
+
summary: 'List trade cash events (requires COMMODITY_TRADE pack)',
|
|
29
|
+
},
|
|
30
|
+
createTradeCashEvent: {
|
|
31
|
+
method: 'POST',
|
|
32
|
+
path: '/organizations/:organizationId/trade-cash-events',
|
|
33
|
+
pathParams: organizationIdParamSchema,
|
|
34
|
+
body: z.object({ data: createTradeCashEventSchema }),
|
|
35
|
+
responses: {
|
|
36
|
+
201: tradeCashEventResponseSchema,
|
|
37
|
+
400: jsonApiErrorResponseSchema,
|
|
38
|
+
401: jsonApiErrorResponseSchema,
|
|
39
|
+
403: jsonApiErrorResponseSchema,
|
|
40
|
+
404: jsonApiErrorResponseSchema,
|
|
41
|
+
},
|
|
42
|
+
summary: 'Record a trade cash event',
|
|
43
|
+
},
|
|
44
|
+
deleteTradeCashEvent: {
|
|
45
|
+
method: 'DELETE',
|
|
46
|
+
path: '/organizations/:organizationId/trade-cash-events/:id',
|
|
47
|
+
pathParams: organizationIdParamSchema.merge(idParamSchema),
|
|
48
|
+
responses: {
|
|
49
|
+
204: z.undefined(),
|
|
50
|
+
401: jsonApiErrorResponseSchema,
|
|
51
|
+
403: jsonApiErrorResponseSchema,
|
|
52
|
+
404: jsonApiErrorResponseSchema,
|
|
53
|
+
},
|
|
54
|
+
summary: 'Delete a trade cash event',
|
|
55
|
+
},
|
|
56
|
+
getInvestorBalances: {
|
|
57
|
+
method: 'GET',
|
|
58
|
+
path: '/organizations/:organizationId/trade-cash-events/investor-balances',
|
|
59
|
+
pathParams: organizationIdParamSchema,
|
|
60
|
+
responses: {
|
|
61
|
+
200: investorBalancesResponseSchema,
|
|
62
|
+
401: jsonApiErrorResponseSchema,
|
|
63
|
+
403: jsonApiErrorResponseSchema,
|
|
64
|
+
404: jsonApiErrorResponseSchema,
|
|
65
|
+
},
|
|
66
|
+
summary: 'Investor capital in/out running balances',
|
|
67
|
+
},
|
|
68
|
+
getMyInvestorCash: {
|
|
69
|
+
method: 'GET',
|
|
70
|
+
path: '/organizations/:organizationId/trade-cash-events/my-investor-cash',
|
|
71
|
+
pathParams: organizationIdParamSchema,
|
|
72
|
+
responses: {
|
|
73
|
+
200: investorBalancesResponseSchema,
|
|
74
|
+
401: jsonApiErrorResponseSchema,
|
|
75
|
+
403: jsonApiErrorResponseSchema,
|
|
76
|
+
404: jsonApiErrorResponseSchema,
|
|
77
|
+
},
|
|
78
|
+
summary: 'Current user investor cash ledger summary',
|
|
79
|
+
},
|
|
80
|
+
getTradeControlBoard: {
|
|
81
|
+
method: 'GET',
|
|
82
|
+
path: '/organizations/:organizationId/trade-control-board',
|
|
83
|
+
pathParams: organizationIdParamSchema,
|
|
84
|
+
query: z.object({
|
|
85
|
+
from: z.string().datetime().optional(),
|
|
86
|
+
to: z.string().datetime().optional(),
|
|
87
|
+
}),
|
|
88
|
+
responses: {
|
|
89
|
+
200: tradeControlBoardResponseSchema,
|
|
90
|
+
401: jsonApiErrorResponseSchema,
|
|
91
|
+
403: jsonApiErrorResponseSchema,
|
|
92
|
+
404: jsonApiErrorResponseSchema,
|
|
93
|
+
},
|
|
94
|
+
summary: 'Trade desk control board (qty/money in/out)',
|
|
95
|
+
},
|
|
96
|
+
listInvoicePayments: {
|
|
97
|
+
method: 'GET',
|
|
98
|
+
path: '/organizations/:organizationId/invoices/:invoiceId/payments',
|
|
99
|
+
pathParams: organizationIdParamSchema.extend({
|
|
100
|
+
invoiceId: z.string().uuid(),
|
|
101
|
+
}),
|
|
102
|
+
responses: {
|
|
103
|
+
200: invoicePaymentListResponseSchema,
|
|
104
|
+
401: jsonApiErrorResponseSchema,
|
|
105
|
+
403: jsonApiErrorResponseSchema,
|
|
106
|
+
404: jsonApiErrorResponseSchema,
|
|
107
|
+
},
|
|
108
|
+
summary: 'List payments on an invoice',
|
|
109
|
+
},
|
|
110
|
+
createInvoicePayment: {
|
|
111
|
+
method: 'POST',
|
|
112
|
+
path: '/organizations/:organizationId/invoices/:invoiceId/payments',
|
|
113
|
+
pathParams: organizationIdParamSchema.extend({
|
|
114
|
+
invoiceId: z.string().uuid(),
|
|
115
|
+
}),
|
|
116
|
+
body: z.object({ data: createInvoicePaymentSchema }),
|
|
117
|
+
responses: {
|
|
118
|
+
201: invoicePaymentResponseSchema,
|
|
119
|
+
400: jsonApiErrorResponseSchema,
|
|
120
|
+
401: jsonApiErrorResponseSchema,
|
|
121
|
+
403: jsonApiErrorResponseSchema,
|
|
122
|
+
404: jsonApiErrorResponseSchema,
|
|
123
|
+
},
|
|
124
|
+
summary: 'Record a (partial) buyer payment on an invoice',
|
|
125
|
+
},
|
|
126
|
+
});
|