@deepintel-ltd/farmpro-contracts 1.10.1 → 1.11.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/routes/admin.routes.d.ts +90 -0
- package/dist/routes/admin.routes.d.ts.map +1 -1
- package/dist/routes/admin.routes.js +1 -0
- package/dist/routes/commodity-deals.routes.d.ts +3641 -22
- package/dist/routes/commodity-deals.routes.d.ts.map +1 -1
- package/dist/routes/commodity-deals.routes.js +70 -1
- package/dist/routes/organizations.routes.d.ts +1753 -0
- package/dist/routes/organizations.routes.d.ts.map +1 -1
- package/dist/routes/organizations.routes.js +49 -1
- package/dist/schemas/commodity-deals.schemas.d.ts +662 -0
- package/dist/schemas/commodity-deals.schemas.d.ts.map +1 -1
- package/dist/schemas/commodity-deals.schemas.js +50 -0
- package/dist/schemas/organizations.schemas.d.ts +541 -0
- package/dist/schemas/organizations.schemas.d.ts.map +1 -1
- package/dist/schemas/organizations.schemas.js +38 -0
- package/package.json +1 -1
|
@@ -1 +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;
|
|
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;AAoBxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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|
import { initContract } from '@ts-rest/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { createCommodityDealSchema, updateCommodityDealSchema, commodityDealResponseSchema, commodityDealListResponseSchema, commodityDealSummaryResponseSchema, commodityDealStatusSchema, } from '../schemas/commodity-deals.schemas';
|
|
3
|
+
import { createCommodityDealSchema, updateCommodityDealSchema, commodityDealResponseSchema, commodityDealListResponseSchema, commodityDealSummaryResponseSchema, commodityDealStatusSchema, createDealParticipantSchema, updateDealParticipantSchema, myEarningsResponseSchema, } from '../schemas/commodity-deals.schemas';
|
|
4
4
|
import { jsonApiErrorResponseSchema, jsonApiPaginationQuerySchema, jsonApiSortQuerySchema, } from '../schemas/common.schemas';
|
|
5
5
|
const c = initContract();
|
|
6
6
|
export const commodityDealsRouter = c.router({
|
|
@@ -33,6 +33,19 @@ export const commodityDealsRouter = c.router({
|
|
|
33
33
|
},
|
|
34
34
|
summary: 'Get commodity deal profitability summary KPIs',
|
|
35
35
|
},
|
|
36
|
+
getMyEarnings: {
|
|
37
|
+
method: 'GET',
|
|
38
|
+
path: '/organizations/:organizationId/commodity-deals/my-earnings',
|
|
39
|
+
pathParams: z.object({
|
|
40
|
+
organizationId: z.string().uuid(),
|
|
41
|
+
}),
|
|
42
|
+
responses: {
|
|
43
|
+
200: myEarningsResponseSchema,
|
|
44
|
+
401: jsonApiErrorResponseSchema,
|
|
45
|
+
404: jsonApiErrorResponseSchema,
|
|
46
|
+
},
|
|
47
|
+
summary: 'Get investor earnings for the current user in an organization',
|
|
48
|
+
},
|
|
36
49
|
getCommodityDeal: {
|
|
37
50
|
method: 'GET',
|
|
38
51
|
path: '/organizations/:organizationId/commodity-deals/:id',
|
|
@@ -58,6 +71,7 @@ export const commodityDealsRouter = c.router({
|
|
|
58
71
|
201: commodityDealResponseSchema,
|
|
59
72
|
400: jsonApiErrorResponseSchema,
|
|
60
73
|
401: jsonApiErrorResponseSchema,
|
|
74
|
+
403: jsonApiErrorResponseSchema,
|
|
61
75
|
404: jsonApiErrorResponseSchema,
|
|
62
76
|
422: jsonApiErrorResponseSchema,
|
|
63
77
|
},
|
|
@@ -74,10 +88,65 @@ export const commodityDealsRouter = c.router({
|
|
|
74
88
|
responses: {
|
|
75
89
|
200: commodityDealResponseSchema,
|
|
76
90
|
400: jsonApiErrorResponseSchema,
|
|
91
|
+
403: jsonApiErrorResponseSchema,
|
|
77
92
|
404: jsonApiErrorResponseSchema,
|
|
78
93
|
401: jsonApiErrorResponseSchema,
|
|
79
94
|
422: jsonApiErrorResponseSchema,
|
|
80
95
|
},
|
|
81
96
|
summary: 'Update commodity deal costs or status',
|
|
82
97
|
},
|
|
98
|
+
addDealParticipant: {
|
|
99
|
+
method: 'POST',
|
|
100
|
+
path: '/organizations/:organizationId/commodity-deals/:id/participants',
|
|
101
|
+
pathParams: z.object({
|
|
102
|
+
organizationId: z.string().uuid(),
|
|
103
|
+
id: z.string().uuid(),
|
|
104
|
+
}),
|
|
105
|
+
body: z.object({ data: createDealParticipantSchema }),
|
|
106
|
+
responses: {
|
|
107
|
+
201: commodityDealResponseSchema,
|
|
108
|
+
400: jsonApiErrorResponseSchema,
|
|
109
|
+
401: jsonApiErrorResponseSchema,
|
|
110
|
+
403: jsonApiErrorResponseSchema,
|
|
111
|
+
404: jsonApiErrorResponseSchema,
|
|
112
|
+
422: jsonApiErrorResponseSchema,
|
|
113
|
+
},
|
|
114
|
+
summary: 'Add an investor participant to a commodity deal',
|
|
115
|
+
},
|
|
116
|
+
updateDealParticipant: {
|
|
117
|
+
method: 'PATCH',
|
|
118
|
+
path: '/organizations/:organizationId/commodity-deals/:id/participants/:participantId',
|
|
119
|
+
pathParams: z.object({
|
|
120
|
+
organizationId: z.string().uuid(),
|
|
121
|
+
id: z.string().uuid(),
|
|
122
|
+
participantId: z.string().uuid(),
|
|
123
|
+
}),
|
|
124
|
+
body: z.object({ data: updateDealParticipantSchema }),
|
|
125
|
+
responses: {
|
|
126
|
+
200: commodityDealResponseSchema,
|
|
127
|
+
400: jsonApiErrorResponseSchema,
|
|
128
|
+
401: jsonApiErrorResponseSchema,
|
|
129
|
+
403: jsonApiErrorResponseSchema,
|
|
130
|
+
404: jsonApiErrorResponseSchema,
|
|
131
|
+
422: jsonApiErrorResponseSchema,
|
|
132
|
+
},
|
|
133
|
+
summary: 'Update capital contributed for a deal participant',
|
|
134
|
+
},
|
|
135
|
+
removeDealParticipant: {
|
|
136
|
+
method: 'DELETE',
|
|
137
|
+
path: '/organizations/:organizationId/commodity-deals/:id/participants/:participantId',
|
|
138
|
+
pathParams: z.object({
|
|
139
|
+
organizationId: z.string().uuid(),
|
|
140
|
+
id: z.string().uuid(),
|
|
141
|
+
participantId: z.string().uuid(),
|
|
142
|
+
}),
|
|
143
|
+
responses: {
|
|
144
|
+
200: commodityDealResponseSchema,
|
|
145
|
+
400: jsonApiErrorResponseSchema,
|
|
146
|
+
401: jsonApiErrorResponseSchema,
|
|
147
|
+
403: jsonApiErrorResponseSchema,
|
|
148
|
+
404: jsonApiErrorResponseSchema,
|
|
149
|
+
},
|
|
150
|
+
summary: 'Remove a participant from a commodity deal',
|
|
151
|
+
},
|
|
83
152
|
});
|