@deepintel-ltd/farmpro-contracts 1.7.19 → 1.7.21

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.
Files changed (84) hide show
  1. package/dist/index.d.ts +18 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +17 -0
  4. package/dist/routes/agents.routes.d.ts +6 -6
  5. package/dist/routes/commodity-deals.routes.d.ts +2702 -0
  6. package/dist/routes/commodity-deals.routes.d.ts.map +1 -0
  7. package/dist/routes/commodity-deals.routes.js +83 -0
  8. package/dist/routes/cooperative.routes.d.ts +1327 -0
  9. package/dist/routes/cooperative.routes.d.ts.map +1 -0
  10. package/dist/routes/cooperative.routes.js +47 -0
  11. package/dist/routes/extension.routes.d.ts +2431 -0
  12. package/dist/routes/extension.routes.d.ts.map +1 -0
  13. package/dist/routes/extension.routes.js +75 -0
  14. package/dist/routes/farms.routes.d.ts +775 -0
  15. package/dist/routes/farms.routes.d.ts.map +1 -1
  16. package/dist/routes/farms.routes.js +15 -1
  17. package/dist/routes/field-monitoring.routes.d.ts +505 -0
  18. package/dist/routes/field-monitoring.routes.d.ts.map +1 -1
  19. package/dist/routes/field-monitoring.routes.js +23 -1
  20. package/dist/routes/fields.routes.d.ts +156 -155
  21. package/dist/routes/fields.routes.d.ts.map +1 -1
  22. package/dist/routes/index.d.ts +18 -0
  23. package/dist/routes/index.d.ts.map +1 -1
  24. package/dist/routes/index.js +12 -0
  25. package/dist/routes/invoices.routes.d.ts +49 -0
  26. package/dist/routes/invoices.routes.d.ts.map +1 -1
  27. package/dist/routes/live-monitor.routes.d.ts +513 -0
  28. package/dist/routes/live-monitor.routes.d.ts.map +1 -0
  29. package/dist/routes/live-monitor.routes.js +81 -0
  30. package/dist/routes/livestock-map.routes.d.ts +4 -4
  31. package/dist/routes/monitoring-visualization.routes.d.ts +4 -4
  32. package/dist/routes/notifications.routes.d.ts +1350 -0
  33. package/dist/routes/notifications.routes.d.ts.map +1 -0
  34. package/dist/routes/notifications.routes.js +66 -0
  35. package/dist/routes/organizations.routes.d.ts +49 -0
  36. package/dist/routes/organizations.routes.d.ts.map +1 -1
  37. package/dist/routes/team-payments.routes.d.ts +9571 -0
  38. package/dist/routes/team-payments.routes.d.ts.map +1 -0
  39. package/dist/routes/team-payments.routes.js +262 -0
  40. package/dist/routes/waybills.routes.d.ts +42 -0
  41. package/dist/routes/waybills.routes.d.ts.map +1 -1
  42. package/dist/schemas/agents.schemas.d.ts +1 -0
  43. package/dist/schemas/agents.schemas.d.ts.map +1 -1
  44. package/dist/schemas/commodity-deals.schemas.d.ts +1109 -0
  45. package/dist/schemas/commodity-deals.schemas.d.ts.map +1 -0
  46. package/dist/schemas/commodity-deals.schemas.js +82 -0
  47. package/dist/schemas/cooperative.schemas.d.ts +560 -0
  48. package/dist/schemas/cooperative.schemas.d.ts.map +1 -0
  49. package/dist/schemas/cooperative.schemas.js +71 -0
  50. package/dist/schemas/extension.schemas.d.ts +1204 -0
  51. package/dist/schemas/extension.schemas.d.ts.map +1 -0
  52. package/dist/schemas/extension.schemas.js +68 -0
  53. package/dist/schemas/farms.schemas.d.ts +591 -0
  54. package/dist/schemas/farms.schemas.d.ts.map +1 -1
  55. package/dist/schemas/farms.schemas.js +44 -0
  56. package/dist/schemas/field-monitoring.schemas.d.ts +276 -0
  57. package/dist/schemas/field-monitoring.schemas.d.ts.map +1 -1
  58. package/dist/schemas/field-monitoring.schemas.js +9 -0
  59. package/dist/schemas/field-observations.schemas.d.ts +1 -0
  60. package/dist/schemas/field-observations.schemas.d.ts.map +1 -1
  61. package/dist/schemas/fields.schemas.d.ts +188 -186
  62. package/dist/schemas/fields.schemas.d.ts.map +1 -1
  63. package/dist/schemas/fields.schemas.js +10 -2
  64. package/dist/schemas/invoices.schemas.d.ts +38 -0
  65. package/dist/schemas/invoices.schemas.d.ts.map +1 -1
  66. package/dist/schemas/invoices.schemas.js +2 -0
  67. package/dist/schemas/live-monitor.schemas.d.ts +596 -0
  68. package/dist/schemas/live-monitor.schemas.d.ts.map +1 -0
  69. package/dist/schemas/live-monitor.schemas.js +107 -0
  70. package/dist/schemas/livestock-map.schemas.d.ts +10 -10
  71. package/dist/schemas/monitoring-visualization.schemas.d.ts +4 -4
  72. package/dist/schemas/notifications.schemas.d.ts +464 -0
  73. package/dist/schemas/notifications.schemas.d.ts.map +1 -0
  74. package/dist/schemas/notifications.schemas.js +40 -0
  75. package/dist/schemas/organizations.schemas.d.ts +38 -0
  76. package/dist/schemas/organizations.schemas.d.ts.map +1 -1
  77. package/dist/schemas/organizations.schemas.js +2 -0
  78. package/dist/schemas/team-payments.schemas.d.ts +2604 -0
  79. package/dist/schemas/team-payments.schemas.d.ts.map +1 -0
  80. package/dist/schemas/team-payments.schemas.js +151 -0
  81. package/dist/schemas/waybills.schemas.d.ts +48 -0
  82. package/dist/schemas/waybills.schemas.d.ts.map +1 -1
  83. package/dist/schemas/waybills.schemas.js +3 -0
  84. package/package.json +1 -1
@@ -0,0 +1,2702 @@
1
+ import { z } from 'zod';
2
+ export declare const commodityDealsRouter: {
3
+ listCommodityDeals: {
4
+ pathParams: z.ZodObject<{
5
+ organizationId: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ organizationId: string;
8
+ }, {
9
+ organizationId: string;
10
+ }>;
11
+ query: z.ZodObject<{
12
+ 'page[number]': z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
13
+ 'page[size]': z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
14
+ } & {
15
+ sort: z.ZodOptional<z.ZodString>;
16
+ } & {
17
+ 'filter[status]': z.ZodOptional<z.ZodEnum<["draft", "in_transit", "invoiced", "paid", "cancelled"]>>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ sort?: string | undefined;
20
+ 'page[number]'?: number | undefined;
21
+ 'page[size]'?: number | undefined;
22
+ 'filter[status]'?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
23
+ }, {
24
+ sort?: string | undefined;
25
+ 'page[number]'?: number | undefined;
26
+ 'page[size]'?: number | undefined;
27
+ 'filter[status]'?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
28
+ }>;
29
+ summary: "List commodity deals for an organization";
30
+ method: "GET";
31
+ path: "/organizations/:organizationId/commodity-deals";
32
+ responses: {
33
+ 200: z.ZodObject<{
34
+ data: z.ZodArray<z.ZodObject<{
35
+ type: z.ZodLiteral<string>;
36
+ id: z.ZodString;
37
+ attributes: z.ZodObject<{
38
+ organizationId: z.ZodString;
39
+ waybillId: z.ZodString;
40
+ invoiceId: z.ZodNullable<z.ZodString>;
41
+ handlerUserId: z.ZodNullable<z.ZodString>;
42
+ waybillNumber: z.ZodNullable<z.ZodString>;
43
+ invoiceNumber: z.ZodNullable<z.ZodString>;
44
+ buyerName: z.ZodNullable<z.ZodString>;
45
+ purchaseCost: z.ZodNumber;
46
+ transportCost: z.ZodNumber;
47
+ miscellaneousCost: z.ZodNumber;
48
+ currency: z.ZodDefault<z.ZodString>;
49
+ status: z.ZodEnum<["draft", "in_transit", "invoiced", "paid", "cancelled"]>;
50
+ notes: z.ZodNullable<z.ZodString>;
51
+ computed: z.ZodObject<{
52
+ totalCost: z.ZodNumber;
53
+ saleAmount: z.ZodNullable<z.ZodNumber>;
54
+ grossProfit: z.ZodNullable<z.ZodNumber>;
55
+ commissionRate: z.ZodNullable<z.ZodNumber>;
56
+ commissionAmount: z.ZodNullable<z.ZodNumber>;
57
+ companyNet: z.ZodNullable<z.ZodNumber>;
58
+ isRealized: z.ZodBoolean;
59
+ }, "strip", z.ZodTypeAny, {
60
+ totalCost: number;
61
+ saleAmount: number | null;
62
+ grossProfit: number | null;
63
+ commissionRate: number | null;
64
+ commissionAmount: number | null;
65
+ companyNet: number | null;
66
+ isRealized: boolean;
67
+ }, {
68
+ totalCost: number;
69
+ saleAmount: number | null;
70
+ grossProfit: number | null;
71
+ commissionRate: number | null;
72
+ commissionAmount: number | null;
73
+ companyNet: number | null;
74
+ isRealized: boolean;
75
+ }>;
76
+ } & {
77
+ createdAt: z.ZodString;
78
+ updatedAt: z.ZodString;
79
+ }, "strip", z.ZodTypeAny, {
80
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
81
+ createdAt: string;
82
+ updatedAt: string;
83
+ currency: string;
84
+ notes: string | null;
85
+ buyerName: string | null;
86
+ transportCost: number;
87
+ organizationId: string;
88
+ waybillNumber: string | null;
89
+ purchaseCost: number;
90
+ miscellaneousCost: number;
91
+ invoiceNumber: string | null;
92
+ waybillId: string;
93
+ invoiceId: string | null;
94
+ handlerUserId: string | null;
95
+ computed: {
96
+ totalCost: number;
97
+ saleAmount: number | null;
98
+ grossProfit: number | null;
99
+ commissionRate: number | null;
100
+ commissionAmount: number | null;
101
+ companyNet: number | null;
102
+ isRealized: boolean;
103
+ };
104
+ }, {
105
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
106
+ createdAt: string;
107
+ updatedAt: string;
108
+ notes: string | null;
109
+ buyerName: string | null;
110
+ transportCost: number;
111
+ organizationId: string;
112
+ waybillNumber: string | null;
113
+ purchaseCost: number;
114
+ miscellaneousCost: number;
115
+ invoiceNumber: string | null;
116
+ waybillId: string;
117
+ invoiceId: string | null;
118
+ handlerUserId: string | null;
119
+ computed: {
120
+ totalCost: number;
121
+ saleAmount: number | null;
122
+ grossProfit: number | null;
123
+ commissionRate: number | null;
124
+ commissionAmount: number | null;
125
+ companyNet: number | null;
126
+ isRealized: boolean;
127
+ };
128
+ currency?: string | undefined;
129
+ }>;
130
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
131
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
132
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
133
+ }, "strip", z.ZodTypeAny, {
134
+ type: string;
135
+ id: string;
136
+ attributes: {
137
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
138
+ createdAt: string;
139
+ updatedAt: string;
140
+ currency: string;
141
+ notes: string | null;
142
+ buyerName: string | null;
143
+ transportCost: number;
144
+ organizationId: string;
145
+ waybillNumber: string | null;
146
+ purchaseCost: number;
147
+ miscellaneousCost: number;
148
+ invoiceNumber: string | null;
149
+ waybillId: string;
150
+ invoiceId: string | null;
151
+ handlerUserId: string | null;
152
+ computed: {
153
+ totalCost: number;
154
+ saleAmount: number | null;
155
+ grossProfit: number | null;
156
+ commissionRate: number | null;
157
+ commissionAmount: number | null;
158
+ companyNet: number | null;
159
+ isRealized: boolean;
160
+ };
161
+ };
162
+ relationships?: Record<string, unknown> | undefined;
163
+ links?: Record<string, string> | undefined;
164
+ meta?: Record<string, unknown> | undefined;
165
+ }, {
166
+ type: string;
167
+ id: string;
168
+ attributes: {
169
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
170
+ createdAt: string;
171
+ updatedAt: string;
172
+ notes: string | null;
173
+ buyerName: string | null;
174
+ transportCost: number;
175
+ organizationId: string;
176
+ waybillNumber: string | null;
177
+ purchaseCost: number;
178
+ miscellaneousCost: number;
179
+ invoiceNumber: string | null;
180
+ waybillId: string;
181
+ invoiceId: string | null;
182
+ handlerUserId: string | null;
183
+ computed: {
184
+ totalCost: number;
185
+ saleAmount: number | null;
186
+ grossProfit: number | null;
187
+ commissionRate: number | null;
188
+ commissionAmount: number | null;
189
+ companyNet: number | null;
190
+ isRealized: boolean;
191
+ };
192
+ currency?: string | undefined;
193
+ };
194
+ relationships?: Record<string, unknown> | undefined;
195
+ links?: Record<string, string> | undefined;
196
+ meta?: Record<string, unknown> | undefined;
197
+ }>, "many">;
198
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
199
+ type: z.ZodString;
200
+ id: z.ZodString;
201
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
202
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
203
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
204
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
205
+ }, "strip", z.ZodTypeAny, {
206
+ type: string;
207
+ id: string;
208
+ attributes?: Record<string, unknown> | undefined;
209
+ relationships?: Record<string, unknown> | undefined;
210
+ links?: Record<string, string> | undefined;
211
+ meta?: Record<string, unknown> | undefined;
212
+ }, {
213
+ type: string;
214
+ id: string;
215
+ attributes?: Record<string, unknown> | undefined;
216
+ relationships?: Record<string, unknown> | undefined;
217
+ links?: Record<string, string> | undefined;
218
+ meta?: Record<string, unknown> | undefined;
219
+ }>, "many">>;
220
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
221
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
222
+ }, "strip", z.ZodTypeAny, {
223
+ data: {
224
+ type: string;
225
+ id: string;
226
+ attributes: {
227
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
228
+ createdAt: string;
229
+ updatedAt: string;
230
+ currency: string;
231
+ notes: string | null;
232
+ buyerName: string | null;
233
+ transportCost: number;
234
+ organizationId: string;
235
+ waybillNumber: string | null;
236
+ purchaseCost: number;
237
+ miscellaneousCost: number;
238
+ invoiceNumber: string | null;
239
+ waybillId: string;
240
+ invoiceId: string | null;
241
+ handlerUserId: string | null;
242
+ computed: {
243
+ totalCost: number;
244
+ saleAmount: number | null;
245
+ grossProfit: number | null;
246
+ commissionRate: number | null;
247
+ commissionAmount: number | null;
248
+ companyNet: number | null;
249
+ isRealized: boolean;
250
+ };
251
+ };
252
+ relationships?: Record<string, unknown> | undefined;
253
+ links?: Record<string, string> | undefined;
254
+ meta?: Record<string, unknown> | undefined;
255
+ }[];
256
+ links?: Record<string, string> | undefined;
257
+ meta?: Record<string, unknown> | undefined;
258
+ included?: {
259
+ type: string;
260
+ id: string;
261
+ attributes?: Record<string, unknown> | undefined;
262
+ relationships?: Record<string, unknown> | undefined;
263
+ links?: Record<string, string> | undefined;
264
+ meta?: Record<string, unknown> | undefined;
265
+ }[] | undefined;
266
+ }, {
267
+ data: {
268
+ type: string;
269
+ id: string;
270
+ attributes: {
271
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
272
+ createdAt: string;
273
+ updatedAt: string;
274
+ notes: string | null;
275
+ buyerName: string | null;
276
+ transportCost: number;
277
+ organizationId: string;
278
+ waybillNumber: string | null;
279
+ purchaseCost: number;
280
+ miscellaneousCost: number;
281
+ invoiceNumber: string | null;
282
+ waybillId: string;
283
+ invoiceId: string | null;
284
+ handlerUserId: string | null;
285
+ computed: {
286
+ totalCost: number;
287
+ saleAmount: number | null;
288
+ grossProfit: number | null;
289
+ commissionRate: number | null;
290
+ commissionAmount: number | null;
291
+ companyNet: number | null;
292
+ isRealized: boolean;
293
+ };
294
+ currency?: string | undefined;
295
+ };
296
+ relationships?: Record<string, unknown> | undefined;
297
+ links?: Record<string, string> | undefined;
298
+ meta?: Record<string, unknown> | undefined;
299
+ }[];
300
+ links?: Record<string, string> | undefined;
301
+ meta?: Record<string, unknown> | undefined;
302
+ included?: {
303
+ type: string;
304
+ id: string;
305
+ attributes?: Record<string, unknown> | undefined;
306
+ relationships?: Record<string, unknown> | undefined;
307
+ links?: Record<string, string> | undefined;
308
+ meta?: Record<string, unknown> | undefined;
309
+ }[] | undefined;
310
+ }>;
311
+ 401: z.ZodObject<{
312
+ errors: z.ZodArray<z.ZodObject<{
313
+ id: z.ZodOptional<z.ZodString>;
314
+ links: z.ZodOptional<z.ZodObject<{
315
+ about: z.ZodOptional<z.ZodString>;
316
+ }, "strip", z.ZodTypeAny, {
317
+ about?: string | undefined;
318
+ }, {
319
+ about?: string | undefined;
320
+ }>>;
321
+ status: z.ZodOptional<z.ZodString>;
322
+ code: z.ZodOptional<z.ZodString>;
323
+ title: z.ZodOptional<z.ZodString>;
324
+ detail: z.ZodOptional<z.ZodString>;
325
+ source: z.ZodOptional<z.ZodObject<{
326
+ pointer: z.ZodOptional<z.ZodString>;
327
+ parameter: z.ZodOptional<z.ZodString>;
328
+ }, "strip", z.ZodTypeAny, {
329
+ pointer?: string | undefined;
330
+ parameter?: string | undefined;
331
+ }, {
332
+ pointer?: string | undefined;
333
+ parameter?: string | undefined;
334
+ }>>;
335
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
336
+ }, "strip", z.ZodTypeAny, {
337
+ status?: string | undefined;
338
+ code?: string | undefined;
339
+ id?: string | undefined;
340
+ links?: {
341
+ about?: string | undefined;
342
+ } | undefined;
343
+ meta?: Record<string, unknown> | undefined;
344
+ title?: string | undefined;
345
+ detail?: string | undefined;
346
+ source?: {
347
+ pointer?: string | undefined;
348
+ parameter?: string | undefined;
349
+ } | undefined;
350
+ }, {
351
+ status?: string | undefined;
352
+ code?: string | undefined;
353
+ id?: string | undefined;
354
+ links?: {
355
+ about?: string | undefined;
356
+ } | undefined;
357
+ meta?: Record<string, unknown> | undefined;
358
+ title?: string | undefined;
359
+ detail?: string | undefined;
360
+ source?: {
361
+ pointer?: string | undefined;
362
+ parameter?: string | undefined;
363
+ } | undefined;
364
+ }>, "many">;
365
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
366
+ }, "strip", z.ZodTypeAny, {
367
+ errors: {
368
+ status?: string | undefined;
369
+ code?: string | undefined;
370
+ id?: string | undefined;
371
+ links?: {
372
+ about?: string | undefined;
373
+ } | undefined;
374
+ meta?: Record<string, unknown> | undefined;
375
+ title?: string | undefined;
376
+ detail?: string | undefined;
377
+ source?: {
378
+ pointer?: string | undefined;
379
+ parameter?: string | undefined;
380
+ } | undefined;
381
+ }[];
382
+ meta?: Record<string, unknown> | undefined;
383
+ }, {
384
+ errors: {
385
+ status?: string | undefined;
386
+ code?: string | undefined;
387
+ id?: string | undefined;
388
+ links?: {
389
+ about?: string | undefined;
390
+ } | undefined;
391
+ meta?: Record<string, unknown> | undefined;
392
+ title?: string | undefined;
393
+ detail?: string | undefined;
394
+ source?: {
395
+ pointer?: string | undefined;
396
+ parameter?: string | undefined;
397
+ } | undefined;
398
+ }[];
399
+ meta?: Record<string, unknown> | undefined;
400
+ }>;
401
+ 404: z.ZodObject<{
402
+ errors: z.ZodArray<z.ZodObject<{
403
+ id: z.ZodOptional<z.ZodString>;
404
+ links: z.ZodOptional<z.ZodObject<{
405
+ about: z.ZodOptional<z.ZodString>;
406
+ }, "strip", z.ZodTypeAny, {
407
+ about?: string | undefined;
408
+ }, {
409
+ about?: string | undefined;
410
+ }>>;
411
+ status: z.ZodOptional<z.ZodString>;
412
+ code: z.ZodOptional<z.ZodString>;
413
+ title: z.ZodOptional<z.ZodString>;
414
+ detail: z.ZodOptional<z.ZodString>;
415
+ source: z.ZodOptional<z.ZodObject<{
416
+ pointer: z.ZodOptional<z.ZodString>;
417
+ parameter: z.ZodOptional<z.ZodString>;
418
+ }, "strip", z.ZodTypeAny, {
419
+ pointer?: string | undefined;
420
+ parameter?: string | undefined;
421
+ }, {
422
+ pointer?: string | undefined;
423
+ parameter?: string | undefined;
424
+ }>>;
425
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
426
+ }, "strip", z.ZodTypeAny, {
427
+ status?: string | undefined;
428
+ code?: string | undefined;
429
+ id?: string | undefined;
430
+ links?: {
431
+ about?: string | undefined;
432
+ } | undefined;
433
+ meta?: Record<string, unknown> | undefined;
434
+ title?: string | undefined;
435
+ detail?: string | undefined;
436
+ source?: {
437
+ pointer?: string | undefined;
438
+ parameter?: string | undefined;
439
+ } | undefined;
440
+ }, {
441
+ status?: string | undefined;
442
+ code?: string | undefined;
443
+ id?: string | undefined;
444
+ links?: {
445
+ about?: string | undefined;
446
+ } | undefined;
447
+ meta?: Record<string, unknown> | undefined;
448
+ title?: string | undefined;
449
+ detail?: string | undefined;
450
+ source?: {
451
+ pointer?: string | undefined;
452
+ parameter?: string | undefined;
453
+ } | undefined;
454
+ }>, "many">;
455
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
456
+ }, "strip", z.ZodTypeAny, {
457
+ errors: {
458
+ status?: string | undefined;
459
+ code?: string | undefined;
460
+ id?: string | undefined;
461
+ links?: {
462
+ about?: string | undefined;
463
+ } | undefined;
464
+ meta?: Record<string, unknown> | undefined;
465
+ title?: string | undefined;
466
+ detail?: string | undefined;
467
+ source?: {
468
+ pointer?: string | undefined;
469
+ parameter?: string | undefined;
470
+ } | undefined;
471
+ }[];
472
+ meta?: Record<string, unknown> | undefined;
473
+ }, {
474
+ errors: {
475
+ status?: string | undefined;
476
+ code?: string | undefined;
477
+ id?: string | undefined;
478
+ links?: {
479
+ about?: string | undefined;
480
+ } | undefined;
481
+ meta?: Record<string, unknown> | undefined;
482
+ title?: string | undefined;
483
+ detail?: string | undefined;
484
+ source?: {
485
+ pointer?: string | undefined;
486
+ parameter?: string | undefined;
487
+ } | undefined;
488
+ }[];
489
+ meta?: Record<string, unknown> | undefined;
490
+ }>;
491
+ };
492
+ };
493
+ getCommodityDealSummary: {
494
+ pathParams: z.ZodObject<{
495
+ organizationId: z.ZodString;
496
+ }, "strip", z.ZodTypeAny, {
497
+ organizationId: string;
498
+ }, {
499
+ organizationId: string;
500
+ }>;
501
+ summary: "Get commodity deal profitability summary KPIs";
502
+ method: "GET";
503
+ path: "/organizations/:organizationId/commodity-deals/summary";
504
+ responses: {
505
+ 200: z.ZodObject<{
506
+ data: z.ZodObject<{
507
+ paidDealCount: z.ZodNumber;
508
+ invoicedUnpaidCount: z.ZodNumber;
509
+ totalPaidRevenue: z.ZodNumber;
510
+ totalCostsOnPaidDeals: z.ZodNumber;
511
+ grossProfitOnPaidDeals: z.ZodNumber;
512
+ totalCommissionOnPaidDeals: z.ZodNumber;
513
+ companyNetOnPaidDeals: z.ZodNumber;
514
+ unrealizedGrossProfit: z.ZodNumber;
515
+ currency: z.ZodDefault<z.ZodString>;
516
+ }, "strip", z.ZodTypeAny, {
517
+ currency: string;
518
+ paidDealCount: number;
519
+ invoicedUnpaidCount: number;
520
+ totalPaidRevenue: number;
521
+ totalCostsOnPaidDeals: number;
522
+ grossProfitOnPaidDeals: number;
523
+ totalCommissionOnPaidDeals: number;
524
+ companyNetOnPaidDeals: number;
525
+ unrealizedGrossProfit: number;
526
+ }, {
527
+ paidDealCount: number;
528
+ invoicedUnpaidCount: number;
529
+ totalPaidRevenue: number;
530
+ totalCostsOnPaidDeals: number;
531
+ grossProfitOnPaidDeals: number;
532
+ totalCommissionOnPaidDeals: number;
533
+ companyNetOnPaidDeals: number;
534
+ unrealizedGrossProfit: number;
535
+ currency?: string | undefined;
536
+ }>;
537
+ }, "strip", z.ZodTypeAny, {
538
+ data: {
539
+ currency: string;
540
+ paidDealCount: number;
541
+ invoicedUnpaidCount: number;
542
+ totalPaidRevenue: number;
543
+ totalCostsOnPaidDeals: number;
544
+ grossProfitOnPaidDeals: number;
545
+ totalCommissionOnPaidDeals: number;
546
+ companyNetOnPaidDeals: number;
547
+ unrealizedGrossProfit: number;
548
+ };
549
+ }, {
550
+ data: {
551
+ paidDealCount: number;
552
+ invoicedUnpaidCount: number;
553
+ totalPaidRevenue: number;
554
+ totalCostsOnPaidDeals: number;
555
+ grossProfitOnPaidDeals: number;
556
+ totalCommissionOnPaidDeals: number;
557
+ companyNetOnPaidDeals: number;
558
+ unrealizedGrossProfit: number;
559
+ currency?: string | undefined;
560
+ };
561
+ }>;
562
+ 401: z.ZodObject<{
563
+ errors: z.ZodArray<z.ZodObject<{
564
+ id: z.ZodOptional<z.ZodString>;
565
+ links: z.ZodOptional<z.ZodObject<{
566
+ about: z.ZodOptional<z.ZodString>;
567
+ }, "strip", z.ZodTypeAny, {
568
+ about?: string | undefined;
569
+ }, {
570
+ about?: string | undefined;
571
+ }>>;
572
+ status: z.ZodOptional<z.ZodString>;
573
+ code: z.ZodOptional<z.ZodString>;
574
+ title: z.ZodOptional<z.ZodString>;
575
+ detail: z.ZodOptional<z.ZodString>;
576
+ source: z.ZodOptional<z.ZodObject<{
577
+ pointer: z.ZodOptional<z.ZodString>;
578
+ parameter: z.ZodOptional<z.ZodString>;
579
+ }, "strip", z.ZodTypeAny, {
580
+ pointer?: string | undefined;
581
+ parameter?: string | undefined;
582
+ }, {
583
+ pointer?: string | undefined;
584
+ parameter?: string | undefined;
585
+ }>>;
586
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
587
+ }, "strip", z.ZodTypeAny, {
588
+ status?: string | undefined;
589
+ code?: string | undefined;
590
+ id?: string | undefined;
591
+ links?: {
592
+ about?: string | undefined;
593
+ } | undefined;
594
+ meta?: Record<string, unknown> | undefined;
595
+ title?: string | undefined;
596
+ detail?: string | undefined;
597
+ source?: {
598
+ pointer?: string | undefined;
599
+ parameter?: string | undefined;
600
+ } | undefined;
601
+ }, {
602
+ status?: string | undefined;
603
+ code?: string | undefined;
604
+ id?: string | undefined;
605
+ links?: {
606
+ about?: string | undefined;
607
+ } | undefined;
608
+ meta?: Record<string, unknown> | undefined;
609
+ title?: string | undefined;
610
+ detail?: string | undefined;
611
+ source?: {
612
+ pointer?: string | undefined;
613
+ parameter?: string | undefined;
614
+ } | undefined;
615
+ }>, "many">;
616
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
617
+ }, "strip", z.ZodTypeAny, {
618
+ errors: {
619
+ status?: string | undefined;
620
+ code?: string | undefined;
621
+ id?: string | undefined;
622
+ links?: {
623
+ about?: string | undefined;
624
+ } | undefined;
625
+ meta?: Record<string, unknown> | undefined;
626
+ title?: string | undefined;
627
+ detail?: string | undefined;
628
+ source?: {
629
+ pointer?: string | undefined;
630
+ parameter?: string | undefined;
631
+ } | undefined;
632
+ }[];
633
+ meta?: Record<string, unknown> | undefined;
634
+ }, {
635
+ errors: {
636
+ status?: string | undefined;
637
+ code?: string | undefined;
638
+ id?: string | undefined;
639
+ links?: {
640
+ about?: string | undefined;
641
+ } | undefined;
642
+ meta?: Record<string, unknown> | undefined;
643
+ title?: string | undefined;
644
+ detail?: string | undefined;
645
+ source?: {
646
+ pointer?: string | undefined;
647
+ parameter?: string | undefined;
648
+ } | undefined;
649
+ }[];
650
+ meta?: Record<string, unknown> | undefined;
651
+ }>;
652
+ 404: z.ZodObject<{
653
+ errors: z.ZodArray<z.ZodObject<{
654
+ id: z.ZodOptional<z.ZodString>;
655
+ links: z.ZodOptional<z.ZodObject<{
656
+ about: z.ZodOptional<z.ZodString>;
657
+ }, "strip", z.ZodTypeAny, {
658
+ about?: string | undefined;
659
+ }, {
660
+ about?: string | undefined;
661
+ }>>;
662
+ status: z.ZodOptional<z.ZodString>;
663
+ code: z.ZodOptional<z.ZodString>;
664
+ title: z.ZodOptional<z.ZodString>;
665
+ detail: z.ZodOptional<z.ZodString>;
666
+ source: z.ZodOptional<z.ZodObject<{
667
+ pointer: z.ZodOptional<z.ZodString>;
668
+ parameter: z.ZodOptional<z.ZodString>;
669
+ }, "strip", z.ZodTypeAny, {
670
+ pointer?: string | undefined;
671
+ parameter?: string | undefined;
672
+ }, {
673
+ pointer?: string | undefined;
674
+ parameter?: string | undefined;
675
+ }>>;
676
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
677
+ }, "strip", z.ZodTypeAny, {
678
+ status?: string | undefined;
679
+ code?: string | undefined;
680
+ id?: string | undefined;
681
+ links?: {
682
+ about?: string | undefined;
683
+ } | undefined;
684
+ meta?: Record<string, unknown> | undefined;
685
+ title?: string | undefined;
686
+ detail?: string | undefined;
687
+ source?: {
688
+ pointer?: string | undefined;
689
+ parameter?: string | undefined;
690
+ } | undefined;
691
+ }, {
692
+ status?: string | undefined;
693
+ code?: string | undefined;
694
+ id?: string | undefined;
695
+ links?: {
696
+ about?: string | undefined;
697
+ } | undefined;
698
+ meta?: Record<string, unknown> | undefined;
699
+ title?: string | undefined;
700
+ detail?: string | undefined;
701
+ source?: {
702
+ pointer?: string | undefined;
703
+ parameter?: string | undefined;
704
+ } | undefined;
705
+ }>, "many">;
706
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
707
+ }, "strip", z.ZodTypeAny, {
708
+ errors: {
709
+ status?: string | undefined;
710
+ code?: string | undefined;
711
+ id?: string | undefined;
712
+ links?: {
713
+ about?: string | undefined;
714
+ } | undefined;
715
+ meta?: Record<string, unknown> | undefined;
716
+ title?: string | undefined;
717
+ detail?: string | undefined;
718
+ source?: {
719
+ pointer?: string | undefined;
720
+ parameter?: string | undefined;
721
+ } | undefined;
722
+ }[];
723
+ meta?: Record<string, unknown> | undefined;
724
+ }, {
725
+ errors: {
726
+ status?: string | undefined;
727
+ code?: string | undefined;
728
+ id?: string | undefined;
729
+ links?: {
730
+ about?: string | undefined;
731
+ } | undefined;
732
+ meta?: Record<string, unknown> | undefined;
733
+ title?: string | undefined;
734
+ detail?: string | undefined;
735
+ source?: {
736
+ pointer?: string | undefined;
737
+ parameter?: string | undefined;
738
+ } | undefined;
739
+ }[];
740
+ meta?: Record<string, unknown> | undefined;
741
+ }>;
742
+ };
743
+ };
744
+ getCommodityDeal: {
745
+ pathParams: z.ZodObject<{
746
+ organizationId: z.ZodString;
747
+ id: z.ZodString;
748
+ }, "strip", z.ZodTypeAny, {
749
+ id: string;
750
+ organizationId: string;
751
+ }, {
752
+ id: string;
753
+ organizationId: string;
754
+ }>;
755
+ summary: "Get commodity deal by ID";
756
+ method: "GET";
757
+ path: "/organizations/:organizationId/commodity-deals/:id";
758
+ responses: {
759
+ 200: z.ZodObject<{
760
+ data: z.ZodObject<{
761
+ type: z.ZodLiteral<string>;
762
+ id: z.ZodString;
763
+ attributes: z.ZodObject<{
764
+ organizationId: z.ZodString;
765
+ waybillId: z.ZodString;
766
+ invoiceId: z.ZodNullable<z.ZodString>;
767
+ handlerUserId: z.ZodNullable<z.ZodString>;
768
+ waybillNumber: z.ZodNullable<z.ZodString>;
769
+ invoiceNumber: z.ZodNullable<z.ZodString>;
770
+ buyerName: z.ZodNullable<z.ZodString>;
771
+ purchaseCost: z.ZodNumber;
772
+ transportCost: z.ZodNumber;
773
+ miscellaneousCost: z.ZodNumber;
774
+ currency: z.ZodDefault<z.ZodString>;
775
+ status: z.ZodEnum<["draft", "in_transit", "invoiced", "paid", "cancelled"]>;
776
+ notes: z.ZodNullable<z.ZodString>;
777
+ computed: z.ZodObject<{
778
+ totalCost: z.ZodNumber;
779
+ saleAmount: z.ZodNullable<z.ZodNumber>;
780
+ grossProfit: z.ZodNullable<z.ZodNumber>;
781
+ commissionRate: z.ZodNullable<z.ZodNumber>;
782
+ commissionAmount: z.ZodNullable<z.ZodNumber>;
783
+ companyNet: z.ZodNullable<z.ZodNumber>;
784
+ isRealized: z.ZodBoolean;
785
+ }, "strip", z.ZodTypeAny, {
786
+ totalCost: number;
787
+ saleAmount: number | null;
788
+ grossProfit: number | null;
789
+ commissionRate: number | null;
790
+ commissionAmount: number | null;
791
+ companyNet: number | null;
792
+ isRealized: boolean;
793
+ }, {
794
+ totalCost: number;
795
+ saleAmount: number | null;
796
+ grossProfit: number | null;
797
+ commissionRate: number | null;
798
+ commissionAmount: number | null;
799
+ companyNet: number | null;
800
+ isRealized: boolean;
801
+ }>;
802
+ } & {
803
+ createdAt: z.ZodString;
804
+ updatedAt: z.ZodString;
805
+ }, "strip", z.ZodTypeAny, {
806
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
807
+ createdAt: string;
808
+ updatedAt: string;
809
+ currency: string;
810
+ notes: string | null;
811
+ buyerName: string | null;
812
+ transportCost: number;
813
+ organizationId: string;
814
+ waybillNumber: string | null;
815
+ purchaseCost: number;
816
+ miscellaneousCost: number;
817
+ invoiceNumber: string | null;
818
+ waybillId: string;
819
+ invoiceId: string | null;
820
+ handlerUserId: string | null;
821
+ computed: {
822
+ totalCost: number;
823
+ saleAmount: number | null;
824
+ grossProfit: number | null;
825
+ commissionRate: number | null;
826
+ commissionAmount: number | null;
827
+ companyNet: number | null;
828
+ isRealized: boolean;
829
+ };
830
+ }, {
831
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
832
+ createdAt: string;
833
+ updatedAt: string;
834
+ notes: string | null;
835
+ buyerName: string | null;
836
+ transportCost: number;
837
+ organizationId: string;
838
+ waybillNumber: string | null;
839
+ purchaseCost: number;
840
+ miscellaneousCost: number;
841
+ invoiceNumber: string | null;
842
+ waybillId: string;
843
+ invoiceId: string | null;
844
+ handlerUserId: string | null;
845
+ computed: {
846
+ totalCost: number;
847
+ saleAmount: number | null;
848
+ grossProfit: number | null;
849
+ commissionRate: number | null;
850
+ commissionAmount: number | null;
851
+ companyNet: number | null;
852
+ isRealized: boolean;
853
+ };
854
+ currency?: string | undefined;
855
+ }>;
856
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
857
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
858
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
859
+ }, "strip", z.ZodTypeAny, {
860
+ type: string;
861
+ id: string;
862
+ attributes: {
863
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
864
+ createdAt: string;
865
+ updatedAt: string;
866
+ currency: string;
867
+ notes: string | null;
868
+ buyerName: string | null;
869
+ transportCost: number;
870
+ organizationId: string;
871
+ waybillNumber: string | null;
872
+ purchaseCost: number;
873
+ miscellaneousCost: number;
874
+ invoiceNumber: string | null;
875
+ waybillId: string;
876
+ invoiceId: string | null;
877
+ handlerUserId: string | null;
878
+ computed: {
879
+ totalCost: number;
880
+ saleAmount: number | null;
881
+ grossProfit: number | null;
882
+ commissionRate: number | null;
883
+ commissionAmount: number | null;
884
+ companyNet: number | null;
885
+ isRealized: boolean;
886
+ };
887
+ };
888
+ relationships?: Record<string, unknown> | undefined;
889
+ links?: Record<string, string> | undefined;
890
+ meta?: Record<string, unknown> | undefined;
891
+ }, {
892
+ type: string;
893
+ id: string;
894
+ attributes: {
895
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
896
+ createdAt: string;
897
+ updatedAt: string;
898
+ notes: string | null;
899
+ buyerName: string | null;
900
+ transportCost: number;
901
+ organizationId: string;
902
+ waybillNumber: string | null;
903
+ purchaseCost: number;
904
+ miscellaneousCost: number;
905
+ invoiceNumber: string | null;
906
+ waybillId: string;
907
+ invoiceId: string | null;
908
+ handlerUserId: string | null;
909
+ computed: {
910
+ totalCost: number;
911
+ saleAmount: number | null;
912
+ grossProfit: number | null;
913
+ commissionRate: number | null;
914
+ commissionAmount: number | null;
915
+ companyNet: number | null;
916
+ isRealized: boolean;
917
+ };
918
+ currency?: string | undefined;
919
+ };
920
+ relationships?: Record<string, unknown> | undefined;
921
+ links?: Record<string, string> | undefined;
922
+ meta?: Record<string, unknown> | undefined;
923
+ }>;
924
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
925
+ type: z.ZodString;
926
+ id: z.ZodString;
927
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
928
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
929
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
930
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
931
+ }, "strip", z.ZodTypeAny, {
932
+ type: string;
933
+ id: string;
934
+ attributes?: Record<string, unknown> | undefined;
935
+ relationships?: Record<string, unknown> | undefined;
936
+ links?: Record<string, string> | undefined;
937
+ meta?: Record<string, unknown> | undefined;
938
+ }, {
939
+ type: string;
940
+ id: string;
941
+ attributes?: Record<string, unknown> | undefined;
942
+ relationships?: Record<string, unknown> | undefined;
943
+ links?: Record<string, string> | undefined;
944
+ meta?: Record<string, unknown> | undefined;
945
+ }>, "many">>;
946
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
947
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
948
+ }, "strip", z.ZodTypeAny, {
949
+ data: {
950
+ type: string;
951
+ id: string;
952
+ attributes: {
953
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
954
+ createdAt: string;
955
+ updatedAt: string;
956
+ currency: string;
957
+ notes: string | null;
958
+ buyerName: string | null;
959
+ transportCost: number;
960
+ organizationId: string;
961
+ waybillNumber: string | null;
962
+ purchaseCost: number;
963
+ miscellaneousCost: number;
964
+ invoiceNumber: string | null;
965
+ waybillId: string;
966
+ invoiceId: string | null;
967
+ handlerUserId: string | null;
968
+ computed: {
969
+ totalCost: number;
970
+ saleAmount: number | null;
971
+ grossProfit: number | null;
972
+ commissionRate: number | null;
973
+ commissionAmount: number | null;
974
+ companyNet: number | null;
975
+ isRealized: boolean;
976
+ };
977
+ };
978
+ relationships?: Record<string, unknown> | undefined;
979
+ links?: Record<string, string> | undefined;
980
+ meta?: Record<string, unknown> | undefined;
981
+ };
982
+ links?: Record<string, string> | undefined;
983
+ meta?: Record<string, unknown> | undefined;
984
+ included?: {
985
+ type: string;
986
+ id: string;
987
+ attributes?: Record<string, unknown> | undefined;
988
+ relationships?: Record<string, unknown> | undefined;
989
+ links?: Record<string, string> | undefined;
990
+ meta?: Record<string, unknown> | undefined;
991
+ }[] | undefined;
992
+ }, {
993
+ data: {
994
+ type: string;
995
+ id: string;
996
+ attributes: {
997
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
998
+ createdAt: string;
999
+ updatedAt: string;
1000
+ notes: string | null;
1001
+ buyerName: string | null;
1002
+ transportCost: number;
1003
+ organizationId: string;
1004
+ waybillNumber: string | null;
1005
+ purchaseCost: number;
1006
+ miscellaneousCost: number;
1007
+ invoiceNumber: string | null;
1008
+ waybillId: string;
1009
+ invoiceId: string | null;
1010
+ handlerUserId: string | null;
1011
+ computed: {
1012
+ totalCost: number;
1013
+ saleAmount: number | null;
1014
+ grossProfit: number | null;
1015
+ commissionRate: number | null;
1016
+ commissionAmount: number | null;
1017
+ companyNet: number | null;
1018
+ isRealized: boolean;
1019
+ };
1020
+ currency?: string | undefined;
1021
+ };
1022
+ relationships?: Record<string, unknown> | undefined;
1023
+ links?: Record<string, string> | undefined;
1024
+ meta?: Record<string, unknown> | undefined;
1025
+ };
1026
+ links?: Record<string, string> | undefined;
1027
+ meta?: Record<string, unknown> | undefined;
1028
+ included?: {
1029
+ type: string;
1030
+ id: string;
1031
+ attributes?: Record<string, unknown> | undefined;
1032
+ relationships?: Record<string, unknown> | undefined;
1033
+ links?: Record<string, string> | undefined;
1034
+ meta?: Record<string, unknown> | undefined;
1035
+ }[] | undefined;
1036
+ }>;
1037
+ 404: z.ZodObject<{
1038
+ errors: z.ZodArray<z.ZodObject<{
1039
+ id: z.ZodOptional<z.ZodString>;
1040
+ links: z.ZodOptional<z.ZodObject<{
1041
+ about: z.ZodOptional<z.ZodString>;
1042
+ }, "strip", z.ZodTypeAny, {
1043
+ about?: string | undefined;
1044
+ }, {
1045
+ about?: string | undefined;
1046
+ }>>;
1047
+ status: z.ZodOptional<z.ZodString>;
1048
+ code: z.ZodOptional<z.ZodString>;
1049
+ title: z.ZodOptional<z.ZodString>;
1050
+ detail: z.ZodOptional<z.ZodString>;
1051
+ source: z.ZodOptional<z.ZodObject<{
1052
+ pointer: z.ZodOptional<z.ZodString>;
1053
+ parameter: z.ZodOptional<z.ZodString>;
1054
+ }, "strip", z.ZodTypeAny, {
1055
+ pointer?: string | undefined;
1056
+ parameter?: string | undefined;
1057
+ }, {
1058
+ pointer?: string | undefined;
1059
+ parameter?: string | undefined;
1060
+ }>>;
1061
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1062
+ }, "strip", z.ZodTypeAny, {
1063
+ status?: string | undefined;
1064
+ code?: string | undefined;
1065
+ id?: string | undefined;
1066
+ links?: {
1067
+ about?: string | undefined;
1068
+ } | undefined;
1069
+ meta?: Record<string, unknown> | undefined;
1070
+ title?: string | undefined;
1071
+ detail?: string | undefined;
1072
+ source?: {
1073
+ pointer?: string | undefined;
1074
+ parameter?: string | undefined;
1075
+ } | undefined;
1076
+ }, {
1077
+ status?: string | undefined;
1078
+ code?: string | undefined;
1079
+ id?: string | undefined;
1080
+ links?: {
1081
+ about?: string | undefined;
1082
+ } | undefined;
1083
+ meta?: Record<string, unknown> | undefined;
1084
+ title?: string | undefined;
1085
+ detail?: string | undefined;
1086
+ source?: {
1087
+ pointer?: string | undefined;
1088
+ parameter?: string | undefined;
1089
+ } | undefined;
1090
+ }>, "many">;
1091
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1092
+ }, "strip", z.ZodTypeAny, {
1093
+ errors: {
1094
+ status?: string | undefined;
1095
+ code?: string | undefined;
1096
+ id?: string | undefined;
1097
+ links?: {
1098
+ about?: string | undefined;
1099
+ } | undefined;
1100
+ meta?: Record<string, unknown> | undefined;
1101
+ title?: string | undefined;
1102
+ detail?: string | undefined;
1103
+ source?: {
1104
+ pointer?: string | undefined;
1105
+ parameter?: string | undefined;
1106
+ } | undefined;
1107
+ }[];
1108
+ meta?: Record<string, unknown> | undefined;
1109
+ }, {
1110
+ errors: {
1111
+ status?: string | undefined;
1112
+ code?: string | undefined;
1113
+ id?: string | undefined;
1114
+ links?: {
1115
+ about?: string | undefined;
1116
+ } | undefined;
1117
+ meta?: Record<string, unknown> | undefined;
1118
+ title?: string | undefined;
1119
+ detail?: string | undefined;
1120
+ source?: {
1121
+ pointer?: string | undefined;
1122
+ parameter?: string | undefined;
1123
+ } | undefined;
1124
+ }[];
1125
+ meta?: Record<string, unknown> | undefined;
1126
+ }>;
1127
+ 401: z.ZodObject<{
1128
+ errors: z.ZodArray<z.ZodObject<{
1129
+ id: z.ZodOptional<z.ZodString>;
1130
+ links: z.ZodOptional<z.ZodObject<{
1131
+ about: z.ZodOptional<z.ZodString>;
1132
+ }, "strip", z.ZodTypeAny, {
1133
+ about?: string | undefined;
1134
+ }, {
1135
+ about?: string | undefined;
1136
+ }>>;
1137
+ status: z.ZodOptional<z.ZodString>;
1138
+ code: z.ZodOptional<z.ZodString>;
1139
+ title: z.ZodOptional<z.ZodString>;
1140
+ detail: z.ZodOptional<z.ZodString>;
1141
+ source: z.ZodOptional<z.ZodObject<{
1142
+ pointer: z.ZodOptional<z.ZodString>;
1143
+ parameter: z.ZodOptional<z.ZodString>;
1144
+ }, "strip", z.ZodTypeAny, {
1145
+ pointer?: string | undefined;
1146
+ parameter?: string | undefined;
1147
+ }, {
1148
+ pointer?: string | undefined;
1149
+ parameter?: string | undefined;
1150
+ }>>;
1151
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1152
+ }, "strip", z.ZodTypeAny, {
1153
+ status?: string | undefined;
1154
+ code?: string | undefined;
1155
+ id?: string | undefined;
1156
+ links?: {
1157
+ about?: string | undefined;
1158
+ } | undefined;
1159
+ meta?: Record<string, unknown> | undefined;
1160
+ title?: string | undefined;
1161
+ detail?: string | undefined;
1162
+ source?: {
1163
+ pointer?: string | undefined;
1164
+ parameter?: string | undefined;
1165
+ } | undefined;
1166
+ }, {
1167
+ status?: string | undefined;
1168
+ code?: string | undefined;
1169
+ id?: string | undefined;
1170
+ links?: {
1171
+ about?: string | undefined;
1172
+ } | undefined;
1173
+ meta?: Record<string, unknown> | undefined;
1174
+ title?: string | undefined;
1175
+ detail?: string | undefined;
1176
+ source?: {
1177
+ pointer?: string | undefined;
1178
+ parameter?: string | undefined;
1179
+ } | undefined;
1180
+ }>, "many">;
1181
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1182
+ }, "strip", z.ZodTypeAny, {
1183
+ errors: {
1184
+ status?: string | undefined;
1185
+ code?: string | undefined;
1186
+ id?: string | undefined;
1187
+ links?: {
1188
+ about?: string | undefined;
1189
+ } | undefined;
1190
+ meta?: Record<string, unknown> | undefined;
1191
+ title?: string | undefined;
1192
+ detail?: string | undefined;
1193
+ source?: {
1194
+ pointer?: string | undefined;
1195
+ parameter?: string | undefined;
1196
+ } | undefined;
1197
+ }[];
1198
+ meta?: Record<string, unknown> | undefined;
1199
+ }, {
1200
+ errors: {
1201
+ status?: string | undefined;
1202
+ code?: string | undefined;
1203
+ id?: string | undefined;
1204
+ links?: {
1205
+ about?: string | undefined;
1206
+ } | undefined;
1207
+ meta?: Record<string, unknown> | undefined;
1208
+ title?: string | undefined;
1209
+ detail?: string | undefined;
1210
+ source?: {
1211
+ pointer?: string | undefined;
1212
+ parameter?: string | undefined;
1213
+ } | undefined;
1214
+ }[];
1215
+ meta?: Record<string, unknown> | undefined;
1216
+ }>;
1217
+ };
1218
+ };
1219
+ createCommodityDeal: {
1220
+ pathParams: z.ZodObject<{
1221
+ organizationId: z.ZodString;
1222
+ }, "strip", z.ZodTypeAny, {
1223
+ organizationId: string;
1224
+ }, {
1225
+ organizationId: string;
1226
+ }>;
1227
+ summary: "Create a commodity deal linked to a waybill";
1228
+ method: "POST";
1229
+ body: z.ZodObject<{
1230
+ data: z.ZodObject<{
1231
+ type: z.ZodLiteral<"commodity-deals">;
1232
+ attributes: z.ZodObject<{
1233
+ waybillId: z.ZodString;
1234
+ purchaseCost: z.ZodNumber;
1235
+ transportCost: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1236
+ miscellaneousCost: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1237
+ currency: z.ZodDefault<z.ZodOptional<z.ZodString>>;
1238
+ status: z.ZodOptional<z.ZodEnum<["draft", "in_transit", "invoiced", "paid", "cancelled"]>>;
1239
+ notes: z.ZodOptional<z.ZodString>;
1240
+ handlerUserId: z.ZodOptional<z.ZodString>;
1241
+ }, "strip", z.ZodTypeAny, {
1242
+ currency: string;
1243
+ transportCost: number;
1244
+ purchaseCost: number;
1245
+ miscellaneousCost: number;
1246
+ waybillId: string;
1247
+ status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
1248
+ notes?: string | undefined;
1249
+ handlerUserId?: string | undefined;
1250
+ }, {
1251
+ purchaseCost: number;
1252
+ waybillId: string;
1253
+ status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
1254
+ currency?: string | undefined;
1255
+ notes?: string | undefined;
1256
+ transportCost?: number | undefined;
1257
+ miscellaneousCost?: number | undefined;
1258
+ handlerUserId?: string | undefined;
1259
+ }>;
1260
+ }, "strip", z.ZodTypeAny, {
1261
+ type: "commodity-deals";
1262
+ attributes: {
1263
+ currency: string;
1264
+ transportCost: number;
1265
+ purchaseCost: number;
1266
+ miscellaneousCost: number;
1267
+ waybillId: string;
1268
+ status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
1269
+ notes?: string | undefined;
1270
+ handlerUserId?: string | undefined;
1271
+ };
1272
+ }, {
1273
+ type: "commodity-deals";
1274
+ attributes: {
1275
+ purchaseCost: number;
1276
+ waybillId: string;
1277
+ status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
1278
+ currency?: string | undefined;
1279
+ notes?: string | undefined;
1280
+ transportCost?: number | undefined;
1281
+ miscellaneousCost?: number | undefined;
1282
+ handlerUserId?: string | undefined;
1283
+ };
1284
+ }>;
1285
+ }, "strip", z.ZodTypeAny, {
1286
+ data: {
1287
+ type: "commodity-deals";
1288
+ attributes: {
1289
+ currency: string;
1290
+ transportCost: number;
1291
+ purchaseCost: number;
1292
+ miscellaneousCost: number;
1293
+ waybillId: string;
1294
+ status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
1295
+ notes?: string | undefined;
1296
+ handlerUserId?: string | undefined;
1297
+ };
1298
+ };
1299
+ }, {
1300
+ data: {
1301
+ type: "commodity-deals";
1302
+ attributes: {
1303
+ purchaseCost: number;
1304
+ waybillId: string;
1305
+ status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
1306
+ currency?: string | undefined;
1307
+ notes?: string | undefined;
1308
+ transportCost?: number | undefined;
1309
+ miscellaneousCost?: number | undefined;
1310
+ handlerUserId?: string | undefined;
1311
+ };
1312
+ };
1313
+ }>;
1314
+ path: "/organizations/:organizationId/commodity-deals";
1315
+ responses: {
1316
+ 201: z.ZodObject<{
1317
+ data: z.ZodObject<{
1318
+ type: z.ZodLiteral<string>;
1319
+ id: z.ZodString;
1320
+ attributes: z.ZodObject<{
1321
+ organizationId: z.ZodString;
1322
+ waybillId: z.ZodString;
1323
+ invoiceId: z.ZodNullable<z.ZodString>;
1324
+ handlerUserId: z.ZodNullable<z.ZodString>;
1325
+ waybillNumber: z.ZodNullable<z.ZodString>;
1326
+ invoiceNumber: z.ZodNullable<z.ZodString>;
1327
+ buyerName: z.ZodNullable<z.ZodString>;
1328
+ purchaseCost: z.ZodNumber;
1329
+ transportCost: z.ZodNumber;
1330
+ miscellaneousCost: z.ZodNumber;
1331
+ currency: z.ZodDefault<z.ZodString>;
1332
+ status: z.ZodEnum<["draft", "in_transit", "invoiced", "paid", "cancelled"]>;
1333
+ notes: z.ZodNullable<z.ZodString>;
1334
+ computed: z.ZodObject<{
1335
+ totalCost: z.ZodNumber;
1336
+ saleAmount: z.ZodNullable<z.ZodNumber>;
1337
+ grossProfit: z.ZodNullable<z.ZodNumber>;
1338
+ commissionRate: z.ZodNullable<z.ZodNumber>;
1339
+ commissionAmount: z.ZodNullable<z.ZodNumber>;
1340
+ companyNet: z.ZodNullable<z.ZodNumber>;
1341
+ isRealized: z.ZodBoolean;
1342
+ }, "strip", z.ZodTypeAny, {
1343
+ totalCost: number;
1344
+ saleAmount: number | null;
1345
+ grossProfit: number | null;
1346
+ commissionRate: number | null;
1347
+ commissionAmount: number | null;
1348
+ companyNet: number | null;
1349
+ isRealized: boolean;
1350
+ }, {
1351
+ totalCost: number;
1352
+ saleAmount: number | null;
1353
+ grossProfit: number | null;
1354
+ commissionRate: number | null;
1355
+ commissionAmount: number | null;
1356
+ companyNet: number | null;
1357
+ isRealized: boolean;
1358
+ }>;
1359
+ } & {
1360
+ createdAt: z.ZodString;
1361
+ updatedAt: z.ZodString;
1362
+ }, "strip", z.ZodTypeAny, {
1363
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
1364
+ createdAt: string;
1365
+ updatedAt: string;
1366
+ currency: string;
1367
+ notes: string | null;
1368
+ buyerName: string | null;
1369
+ transportCost: number;
1370
+ organizationId: string;
1371
+ waybillNumber: string | null;
1372
+ purchaseCost: number;
1373
+ miscellaneousCost: number;
1374
+ invoiceNumber: string | null;
1375
+ waybillId: string;
1376
+ invoiceId: string | null;
1377
+ handlerUserId: string | null;
1378
+ computed: {
1379
+ totalCost: number;
1380
+ saleAmount: number | null;
1381
+ grossProfit: number | null;
1382
+ commissionRate: number | null;
1383
+ commissionAmount: number | null;
1384
+ companyNet: number | null;
1385
+ isRealized: boolean;
1386
+ };
1387
+ }, {
1388
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
1389
+ createdAt: string;
1390
+ updatedAt: string;
1391
+ notes: string | null;
1392
+ buyerName: string | null;
1393
+ transportCost: number;
1394
+ organizationId: string;
1395
+ waybillNumber: string | null;
1396
+ purchaseCost: number;
1397
+ miscellaneousCost: number;
1398
+ invoiceNumber: string | null;
1399
+ waybillId: string;
1400
+ invoiceId: string | null;
1401
+ handlerUserId: string | null;
1402
+ computed: {
1403
+ totalCost: number;
1404
+ saleAmount: number | null;
1405
+ grossProfit: number | null;
1406
+ commissionRate: number | null;
1407
+ commissionAmount: number | null;
1408
+ companyNet: number | null;
1409
+ isRealized: boolean;
1410
+ };
1411
+ currency?: string | undefined;
1412
+ }>;
1413
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1414
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1415
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1416
+ }, "strip", z.ZodTypeAny, {
1417
+ type: string;
1418
+ id: string;
1419
+ attributes: {
1420
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
1421
+ createdAt: string;
1422
+ updatedAt: string;
1423
+ currency: string;
1424
+ notes: string | null;
1425
+ buyerName: string | null;
1426
+ transportCost: number;
1427
+ organizationId: string;
1428
+ waybillNumber: string | null;
1429
+ purchaseCost: number;
1430
+ miscellaneousCost: number;
1431
+ invoiceNumber: string | null;
1432
+ waybillId: string;
1433
+ invoiceId: string | null;
1434
+ handlerUserId: string | null;
1435
+ computed: {
1436
+ totalCost: number;
1437
+ saleAmount: number | null;
1438
+ grossProfit: number | null;
1439
+ commissionRate: number | null;
1440
+ commissionAmount: number | null;
1441
+ companyNet: number | null;
1442
+ isRealized: boolean;
1443
+ };
1444
+ };
1445
+ relationships?: Record<string, unknown> | undefined;
1446
+ links?: Record<string, string> | undefined;
1447
+ meta?: Record<string, unknown> | undefined;
1448
+ }, {
1449
+ type: string;
1450
+ id: string;
1451
+ attributes: {
1452
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
1453
+ createdAt: string;
1454
+ updatedAt: string;
1455
+ notes: string | null;
1456
+ buyerName: string | null;
1457
+ transportCost: number;
1458
+ organizationId: string;
1459
+ waybillNumber: string | null;
1460
+ purchaseCost: number;
1461
+ miscellaneousCost: number;
1462
+ invoiceNumber: string | null;
1463
+ waybillId: string;
1464
+ invoiceId: string | null;
1465
+ handlerUserId: string | null;
1466
+ computed: {
1467
+ totalCost: number;
1468
+ saleAmount: number | null;
1469
+ grossProfit: number | null;
1470
+ commissionRate: number | null;
1471
+ commissionAmount: number | null;
1472
+ companyNet: number | null;
1473
+ isRealized: boolean;
1474
+ };
1475
+ currency?: string | undefined;
1476
+ };
1477
+ relationships?: Record<string, unknown> | undefined;
1478
+ links?: Record<string, string> | undefined;
1479
+ meta?: Record<string, unknown> | undefined;
1480
+ }>;
1481
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
1482
+ type: z.ZodString;
1483
+ id: z.ZodString;
1484
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1485
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1486
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1487
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1488
+ }, "strip", z.ZodTypeAny, {
1489
+ type: string;
1490
+ id: string;
1491
+ attributes?: Record<string, unknown> | undefined;
1492
+ relationships?: Record<string, unknown> | undefined;
1493
+ links?: Record<string, string> | undefined;
1494
+ meta?: Record<string, unknown> | undefined;
1495
+ }, {
1496
+ type: string;
1497
+ id: string;
1498
+ attributes?: Record<string, unknown> | undefined;
1499
+ relationships?: Record<string, unknown> | undefined;
1500
+ links?: Record<string, string> | undefined;
1501
+ meta?: Record<string, unknown> | undefined;
1502
+ }>, "many">>;
1503
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1504
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1505
+ }, "strip", z.ZodTypeAny, {
1506
+ data: {
1507
+ type: string;
1508
+ id: string;
1509
+ attributes: {
1510
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
1511
+ createdAt: string;
1512
+ updatedAt: string;
1513
+ currency: string;
1514
+ notes: string | null;
1515
+ buyerName: string | null;
1516
+ transportCost: number;
1517
+ organizationId: string;
1518
+ waybillNumber: string | null;
1519
+ purchaseCost: number;
1520
+ miscellaneousCost: number;
1521
+ invoiceNumber: string | null;
1522
+ waybillId: string;
1523
+ invoiceId: string | null;
1524
+ handlerUserId: string | null;
1525
+ computed: {
1526
+ totalCost: number;
1527
+ saleAmount: number | null;
1528
+ grossProfit: number | null;
1529
+ commissionRate: number | null;
1530
+ commissionAmount: number | null;
1531
+ companyNet: number | null;
1532
+ isRealized: boolean;
1533
+ };
1534
+ };
1535
+ relationships?: Record<string, unknown> | undefined;
1536
+ links?: Record<string, string> | undefined;
1537
+ meta?: Record<string, unknown> | undefined;
1538
+ };
1539
+ links?: Record<string, string> | undefined;
1540
+ meta?: Record<string, unknown> | undefined;
1541
+ included?: {
1542
+ type: string;
1543
+ id: string;
1544
+ attributes?: Record<string, unknown> | undefined;
1545
+ relationships?: Record<string, unknown> | undefined;
1546
+ links?: Record<string, string> | undefined;
1547
+ meta?: Record<string, unknown> | undefined;
1548
+ }[] | undefined;
1549
+ }, {
1550
+ data: {
1551
+ type: string;
1552
+ id: string;
1553
+ attributes: {
1554
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
1555
+ createdAt: string;
1556
+ updatedAt: string;
1557
+ notes: string | null;
1558
+ buyerName: string | null;
1559
+ transportCost: number;
1560
+ organizationId: string;
1561
+ waybillNumber: string | null;
1562
+ purchaseCost: number;
1563
+ miscellaneousCost: number;
1564
+ invoiceNumber: string | null;
1565
+ waybillId: string;
1566
+ invoiceId: string | null;
1567
+ handlerUserId: string | null;
1568
+ computed: {
1569
+ totalCost: number;
1570
+ saleAmount: number | null;
1571
+ grossProfit: number | null;
1572
+ commissionRate: number | null;
1573
+ commissionAmount: number | null;
1574
+ companyNet: number | null;
1575
+ isRealized: boolean;
1576
+ };
1577
+ currency?: string | undefined;
1578
+ };
1579
+ relationships?: Record<string, unknown> | undefined;
1580
+ links?: Record<string, string> | undefined;
1581
+ meta?: Record<string, unknown> | undefined;
1582
+ };
1583
+ links?: Record<string, string> | undefined;
1584
+ meta?: Record<string, unknown> | undefined;
1585
+ included?: {
1586
+ type: string;
1587
+ id: string;
1588
+ attributes?: Record<string, unknown> | undefined;
1589
+ relationships?: Record<string, unknown> | undefined;
1590
+ links?: Record<string, string> | undefined;
1591
+ meta?: Record<string, unknown> | undefined;
1592
+ }[] | undefined;
1593
+ }>;
1594
+ 400: z.ZodObject<{
1595
+ errors: z.ZodArray<z.ZodObject<{
1596
+ id: z.ZodOptional<z.ZodString>;
1597
+ links: z.ZodOptional<z.ZodObject<{
1598
+ about: z.ZodOptional<z.ZodString>;
1599
+ }, "strip", z.ZodTypeAny, {
1600
+ about?: string | undefined;
1601
+ }, {
1602
+ about?: string | undefined;
1603
+ }>>;
1604
+ status: z.ZodOptional<z.ZodString>;
1605
+ code: z.ZodOptional<z.ZodString>;
1606
+ title: z.ZodOptional<z.ZodString>;
1607
+ detail: z.ZodOptional<z.ZodString>;
1608
+ source: z.ZodOptional<z.ZodObject<{
1609
+ pointer: z.ZodOptional<z.ZodString>;
1610
+ parameter: z.ZodOptional<z.ZodString>;
1611
+ }, "strip", z.ZodTypeAny, {
1612
+ pointer?: string | undefined;
1613
+ parameter?: string | undefined;
1614
+ }, {
1615
+ pointer?: string | undefined;
1616
+ parameter?: string | undefined;
1617
+ }>>;
1618
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1619
+ }, "strip", z.ZodTypeAny, {
1620
+ status?: string | undefined;
1621
+ code?: string | undefined;
1622
+ id?: string | undefined;
1623
+ links?: {
1624
+ about?: string | undefined;
1625
+ } | undefined;
1626
+ meta?: Record<string, unknown> | undefined;
1627
+ title?: string | undefined;
1628
+ detail?: string | undefined;
1629
+ source?: {
1630
+ pointer?: string | undefined;
1631
+ parameter?: string | undefined;
1632
+ } | undefined;
1633
+ }, {
1634
+ status?: string | undefined;
1635
+ code?: string | undefined;
1636
+ id?: string | undefined;
1637
+ links?: {
1638
+ about?: string | undefined;
1639
+ } | undefined;
1640
+ meta?: Record<string, unknown> | undefined;
1641
+ title?: string | undefined;
1642
+ detail?: string | undefined;
1643
+ source?: {
1644
+ pointer?: string | undefined;
1645
+ parameter?: string | undefined;
1646
+ } | undefined;
1647
+ }>, "many">;
1648
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1649
+ }, "strip", z.ZodTypeAny, {
1650
+ errors: {
1651
+ status?: string | undefined;
1652
+ code?: string | undefined;
1653
+ id?: string | undefined;
1654
+ links?: {
1655
+ about?: string | undefined;
1656
+ } | undefined;
1657
+ meta?: Record<string, unknown> | undefined;
1658
+ title?: string | undefined;
1659
+ detail?: string | undefined;
1660
+ source?: {
1661
+ pointer?: string | undefined;
1662
+ parameter?: string | undefined;
1663
+ } | undefined;
1664
+ }[];
1665
+ meta?: Record<string, unknown> | undefined;
1666
+ }, {
1667
+ errors: {
1668
+ status?: string | undefined;
1669
+ code?: string | undefined;
1670
+ id?: string | undefined;
1671
+ links?: {
1672
+ about?: string | undefined;
1673
+ } | undefined;
1674
+ meta?: Record<string, unknown> | undefined;
1675
+ title?: string | undefined;
1676
+ detail?: string | undefined;
1677
+ source?: {
1678
+ pointer?: string | undefined;
1679
+ parameter?: string | undefined;
1680
+ } | undefined;
1681
+ }[];
1682
+ meta?: Record<string, unknown> | undefined;
1683
+ }>;
1684
+ 401: z.ZodObject<{
1685
+ errors: z.ZodArray<z.ZodObject<{
1686
+ id: z.ZodOptional<z.ZodString>;
1687
+ links: z.ZodOptional<z.ZodObject<{
1688
+ about: z.ZodOptional<z.ZodString>;
1689
+ }, "strip", z.ZodTypeAny, {
1690
+ about?: string | undefined;
1691
+ }, {
1692
+ about?: string | undefined;
1693
+ }>>;
1694
+ status: z.ZodOptional<z.ZodString>;
1695
+ code: z.ZodOptional<z.ZodString>;
1696
+ title: z.ZodOptional<z.ZodString>;
1697
+ detail: z.ZodOptional<z.ZodString>;
1698
+ source: z.ZodOptional<z.ZodObject<{
1699
+ pointer: z.ZodOptional<z.ZodString>;
1700
+ parameter: z.ZodOptional<z.ZodString>;
1701
+ }, "strip", z.ZodTypeAny, {
1702
+ pointer?: string | undefined;
1703
+ parameter?: string | undefined;
1704
+ }, {
1705
+ pointer?: string | undefined;
1706
+ parameter?: string | undefined;
1707
+ }>>;
1708
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1709
+ }, "strip", z.ZodTypeAny, {
1710
+ status?: string | undefined;
1711
+ code?: string | undefined;
1712
+ id?: string | undefined;
1713
+ links?: {
1714
+ about?: string | undefined;
1715
+ } | undefined;
1716
+ meta?: Record<string, unknown> | undefined;
1717
+ title?: string | undefined;
1718
+ detail?: string | undefined;
1719
+ source?: {
1720
+ pointer?: string | undefined;
1721
+ parameter?: string | undefined;
1722
+ } | undefined;
1723
+ }, {
1724
+ status?: string | undefined;
1725
+ code?: string | undefined;
1726
+ id?: string | undefined;
1727
+ links?: {
1728
+ about?: string | undefined;
1729
+ } | undefined;
1730
+ meta?: Record<string, unknown> | undefined;
1731
+ title?: string | undefined;
1732
+ detail?: string | undefined;
1733
+ source?: {
1734
+ pointer?: string | undefined;
1735
+ parameter?: string | undefined;
1736
+ } | undefined;
1737
+ }>, "many">;
1738
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1739
+ }, "strip", z.ZodTypeAny, {
1740
+ errors: {
1741
+ status?: string | undefined;
1742
+ code?: string | undefined;
1743
+ id?: string | undefined;
1744
+ links?: {
1745
+ about?: string | undefined;
1746
+ } | undefined;
1747
+ meta?: Record<string, unknown> | undefined;
1748
+ title?: string | undefined;
1749
+ detail?: string | undefined;
1750
+ source?: {
1751
+ pointer?: string | undefined;
1752
+ parameter?: string | undefined;
1753
+ } | undefined;
1754
+ }[];
1755
+ meta?: Record<string, unknown> | undefined;
1756
+ }, {
1757
+ errors: {
1758
+ status?: string | undefined;
1759
+ code?: string | undefined;
1760
+ id?: string | undefined;
1761
+ links?: {
1762
+ about?: string | undefined;
1763
+ } | undefined;
1764
+ meta?: Record<string, unknown> | undefined;
1765
+ title?: string | undefined;
1766
+ detail?: string | undefined;
1767
+ source?: {
1768
+ pointer?: string | undefined;
1769
+ parameter?: string | undefined;
1770
+ } | undefined;
1771
+ }[];
1772
+ meta?: Record<string, unknown> | undefined;
1773
+ }>;
1774
+ 404: z.ZodObject<{
1775
+ errors: z.ZodArray<z.ZodObject<{
1776
+ id: z.ZodOptional<z.ZodString>;
1777
+ links: z.ZodOptional<z.ZodObject<{
1778
+ about: z.ZodOptional<z.ZodString>;
1779
+ }, "strip", z.ZodTypeAny, {
1780
+ about?: string | undefined;
1781
+ }, {
1782
+ about?: string | undefined;
1783
+ }>>;
1784
+ status: z.ZodOptional<z.ZodString>;
1785
+ code: z.ZodOptional<z.ZodString>;
1786
+ title: z.ZodOptional<z.ZodString>;
1787
+ detail: z.ZodOptional<z.ZodString>;
1788
+ source: z.ZodOptional<z.ZodObject<{
1789
+ pointer: z.ZodOptional<z.ZodString>;
1790
+ parameter: z.ZodOptional<z.ZodString>;
1791
+ }, "strip", z.ZodTypeAny, {
1792
+ pointer?: string | undefined;
1793
+ parameter?: string | undefined;
1794
+ }, {
1795
+ pointer?: string | undefined;
1796
+ parameter?: string | undefined;
1797
+ }>>;
1798
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1799
+ }, "strip", z.ZodTypeAny, {
1800
+ status?: string | undefined;
1801
+ code?: string | undefined;
1802
+ id?: string | undefined;
1803
+ links?: {
1804
+ about?: string | undefined;
1805
+ } | undefined;
1806
+ meta?: Record<string, unknown> | undefined;
1807
+ title?: string | undefined;
1808
+ detail?: string | undefined;
1809
+ source?: {
1810
+ pointer?: string | undefined;
1811
+ parameter?: string | undefined;
1812
+ } | undefined;
1813
+ }, {
1814
+ status?: string | undefined;
1815
+ code?: string | undefined;
1816
+ id?: string | undefined;
1817
+ links?: {
1818
+ about?: string | undefined;
1819
+ } | undefined;
1820
+ meta?: Record<string, unknown> | undefined;
1821
+ title?: string | undefined;
1822
+ detail?: string | undefined;
1823
+ source?: {
1824
+ pointer?: string | undefined;
1825
+ parameter?: string | undefined;
1826
+ } | undefined;
1827
+ }>, "many">;
1828
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1829
+ }, "strip", z.ZodTypeAny, {
1830
+ errors: {
1831
+ status?: string | undefined;
1832
+ code?: string | undefined;
1833
+ id?: string | undefined;
1834
+ links?: {
1835
+ about?: string | undefined;
1836
+ } | undefined;
1837
+ meta?: Record<string, unknown> | undefined;
1838
+ title?: string | undefined;
1839
+ detail?: string | undefined;
1840
+ source?: {
1841
+ pointer?: string | undefined;
1842
+ parameter?: string | undefined;
1843
+ } | undefined;
1844
+ }[];
1845
+ meta?: Record<string, unknown> | undefined;
1846
+ }, {
1847
+ errors: {
1848
+ status?: string | undefined;
1849
+ code?: string | undefined;
1850
+ id?: string | undefined;
1851
+ links?: {
1852
+ about?: string | undefined;
1853
+ } | undefined;
1854
+ meta?: Record<string, unknown> | undefined;
1855
+ title?: string | undefined;
1856
+ detail?: string | undefined;
1857
+ source?: {
1858
+ pointer?: string | undefined;
1859
+ parameter?: string | undefined;
1860
+ } | undefined;
1861
+ }[];
1862
+ meta?: Record<string, unknown> | undefined;
1863
+ }>;
1864
+ 422: z.ZodObject<{
1865
+ errors: z.ZodArray<z.ZodObject<{
1866
+ id: z.ZodOptional<z.ZodString>;
1867
+ links: z.ZodOptional<z.ZodObject<{
1868
+ about: z.ZodOptional<z.ZodString>;
1869
+ }, "strip", z.ZodTypeAny, {
1870
+ about?: string | undefined;
1871
+ }, {
1872
+ about?: string | undefined;
1873
+ }>>;
1874
+ status: z.ZodOptional<z.ZodString>;
1875
+ code: z.ZodOptional<z.ZodString>;
1876
+ title: z.ZodOptional<z.ZodString>;
1877
+ detail: z.ZodOptional<z.ZodString>;
1878
+ source: z.ZodOptional<z.ZodObject<{
1879
+ pointer: z.ZodOptional<z.ZodString>;
1880
+ parameter: z.ZodOptional<z.ZodString>;
1881
+ }, "strip", z.ZodTypeAny, {
1882
+ pointer?: string | undefined;
1883
+ parameter?: string | undefined;
1884
+ }, {
1885
+ pointer?: string | undefined;
1886
+ parameter?: string | undefined;
1887
+ }>>;
1888
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1889
+ }, "strip", z.ZodTypeAny, {
1890
+ status?: string | undefined;
1891
+ code?: string | undefined;
1892
+ id?: string | undefined;
1893
+ links?: {
1894
+ about?: string | undefined;
1895
+ } | undefined;
1896
+ meta?: Record<string, unknown> | undefined;
1897
+ title?: string | undefined;
1898
+ detail?: string | undefined;
1899
+ source?: {
1900
+ pointer?: string | undefined;
1901
+ parameter?: string | undefined;
1902
+ } | undefined;
1903
+ }, {
1904
+ status?: string | undefined;
1905
+ code?: string | undefined;
1906
+ id?: string | undefined;
1907
+ links?: {
1908
+ about?: string | undefined;
1909
+ } | undefined;
1910
+ meta?: Record<string, unknown> | undefined;
1911
+ title?: string | undefined;
1912
+ detail?: string | undefined;
1913
+ source?: {
1914
+ pointer?: string | undefined;
1915
+ parameter?: string | undefined;
1916
+ } | undefined;
1917
+ }>, "many">;
1918
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1919
+ }, "strip", z.ZodTypeAny, {
1920
+ errors: {
1921
+ status?: string | undefined;
1922
+ code?: string | undefined;
1923
+ id?: string | undefined;
1924
+ links?: {
1925
+ about?: string | undefined;
1926
+ } | undefined;
1927
+ meta?: Record<string, unknown> | undefined;
1928
+ title?: string | undefined;
1929
+ detail?: string | undefined;
1930
+ source?: {
1931
+ pointer?: string | undefined;
1932
+ parameter?: string | undefined;
1933
+ } | undefined;
1934
+ }[];
1935
+ meta?: Record<string, unknown> | undefined;
1936
+ }, {
1937
+ errors: {
1938
+ status?: string | undefined;
1939
+ code?: string | undefined;
1940
+ id?: string | undefined;
1941
+ links?: {
1942
+ about?: string | undefined;
1943
+ } | undefined;
1944
+ meta?: Record<string, unknown> | undefined;
1945
+ title?: string | undefined;
1946
+ detail?: string | undefined;
1947
+ source?: {
1948
+ pointer?: string | undefined;
1949
+ parameter?: string | undefined;
1950
+ } | undefined;
1951
+ }[];
1952
+ meta?: Record<string, unknown> | undefined;
1953
+ }>;
1954
+ };
1955
+ };
1956
+ updateCommodityDeal: {
1957
+ pathParams: z.ZodObject<{
1958
+ organizationId: z.ZodString;
1959
+ id: z.ZodString;
1960
+ }, "strip", z.ZodTypeAny, {
1961
+ id: string;
1962
+ organizationId: string;
1963
+ }, {
1964
+ id: string;
1965
+ organizationId: string;
1966
+ }>;
1967
+ summary: "Update commodity deal costs or status";
1968
+ method: "PATCH";
1969
+ body: z.ZodObject<{
1970
+ data: z.ZodObject<{
1971
+ type: z.ZodLiteral<"commodity-deals">;
1972
+ id: z.ZodOptional<z.ZodString>;
1973
+ attributes: z.ZodObject<{
1974
+ purchaseCost: z.ZodOptional<z.ZodNumber>;
1975
+ transportCost: z.ZodOptional<z.ZodNumber>;
1976
+ miscellaneousCost: z.ZodOptional<z.ZodNumber>;
1977
+ currency: z.ZodOptional<z.ZodString>;
1978
+ status: z.ZodOptional<z.ZodEnum<["draft", "in_transit", "invoiced", "paid", "cancelled"]>>;
1979
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1980
+ invoiceId: z.ZodOptional<z.ZodString>;
1981
+ handlerUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1982
+ }, "strip", z.ZodTypeAny, {
1983
+ status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
1984
+ currency?: string | undefined;
1985
+ notes?: string | null | undefined;
1986
+ transportCost?: number | undefined;
1987
+ purchaseCost?: number | undefined;
1988
+ miscellaneousCost?: number | undefined;
1989
+ invoiceId?: string | undefined;
1990
+ handlerUserId?: string | null | undefined;
1991
+ }, {
1992
+ status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
1993
+ currency?: string | undefined;
1994
+ notes?: string | null | undefined;
1995
+ transportCost?: number | undefined;
1996
+ purchaseCost?: number | undefined;
1997
+ miscellaneousCost?: number | undefined;
1998
+ invoiceId?: string | undefined;
1999
+ handlerUserId?: string | null | undefined;
2000
+ }>;
2001
+ }, "strip", z.ZodTypeAny, {
2002
+ type: "commodity-deals";
2003
+ attributes: {
2004
+ status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
2005
+ currency?: string | undefined;
2006
+ notes?: string | null | undefined;
2007
+ transportCost?: number | undefined;
2008
+ purchaseCost?: number | undefined;
2009
+ miscellaneousCost?: number | undefined;
2010
+ invoiceId?: string | undefined;
2011
+ handlerUserId?: string | null | undefined;
2012
+ };
2013
+ id?: string | undefined;
2014
+ }, {
2015
+ type: "commodity-deals";
2016
+ attributes: {
2017
+ status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
2018
+ currency?: string | undefined;
2019
+ notes?: string | null | undefined;
2020
+ transportCost?: number | undefined;
2021
+ purchaseCost?: number | undefined;
2022
+ miscellaneousCost?: number | undefined;
2023
+ invoiceId?: string | undefined;
2024
+ handlerUserId?: string | null | undefined;
2025
+ };
2026
+ id?: string | undefined;
2027
+ }>;
2028
+ }, "strip", z.ZodTypeAny, {
2029
+ data: {
2030
+ type: "commodity-deals";
2031
+ attributes: {
2032
+ status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
2033
+ currency?: string | undefined;
2034
+ notes?: string | null | undefined;
2035
+ transportCost?: number | undefined;
2036
+ purchaseCost?: number | undefined;
2037
+ miscellaneousCost?: number | undefined;
2038
+ invoiceId?: string | undefined;
2039
+ handlerUserId?: string | null | undefined;
2040
+ };
2041
+ id?: string | undefined;
2042
+ };
2043
+ }, {
2044
+ data: {
2045
+ type: "commodity-deals";
2046
+ attributes: {
2047
+ status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
2048
+ currency?: string | undefined;
2049
+ notes?: string | null | undefined;
2050
+ transportCost?: number | undefined;
2051
+ purchaseCost?: number | undefined;
2052
+ miscellaneousCost?: number | undefined;
2053
+ invoiceId?: string | undefined;
2054
+ handlerUserId?: string | null | undefined;
2055
+ };
2056
+ id?: string | undefined;
2057
+ };
2058
+ }>;
2059
+ path: "/organizations/:organizationId/commodity-deals/:id";
2060
+ responses: {
2061
+ 200: z.ZodObject<{
2062
+ data: z.ZodObject<{
2063
+ type: z.ZodLiteral<string>;
2064
+ id: z.ZodString;
2065
+ attributes: z.ZodObject<{
2066
+ organizationId: z.ZodString;
2067
+ waybillId: z.ZodString;
2068
+ invoiceId: z.ZodNullable<z.ZodString>;
2069
+ handlerUserId: z.ZodNullable<z.ZodString>;
2070
+ waybillNumber: z.ZodNullable<z.ZodString>;
2071
+ invoiceNumber: z.ZodNullable<z.ZodString>;
2072
+ buyerName: z.ZodNullable<z.ZodString>;
2073
+ purchaseCost: z.ZodNumber;
2074
+ transportCost: z.ZodNumber;
2075
+ miscellaneousCost: z.ZodNumber;
2076
+ currency: z.ZodDefault<z.ZodString>;
2077
+ status: z.ZodEnum<["draft", "in_transit", "invoiced", "paid", "cancelled"]>;
2078
+ notes: z.ZodNullable<z.ZodString>;
2079
+ computed: z.ZodObject<{
2080
+ totalCost: z.ZodNumber;
2081
+ saleAmount: z.ZodNullable<z.ZodNumber>;
2082
+ grossProfit: z.ZodNullable<z.ZodNumber>;
2083
+ commissionRate: z.ZodNullable<z.ZodNumber>;
2084
+ commissionAmount: z.ZodNullable<z.ZodNumber>;
2085
+ companyNet: z.ZodNullable<z.ZodNumber>;
2086
+ isRealized: z.ZodBoolean;
2087
+ }, "strip", z.ZodTypeAny, {
2088
+ totalCost: number;
2089
+ saleAmount: number | null;
2090
+ grossProfit: number | null;
2091
+ commissionRate: number | null;
2092
+ commissionAmount: number | null;
2093
+ companyNet: number | null;
2094
+ isRealized: boolean;
2095
+ }, {
2096
+ totalCost: number;
2097
+ saleAmount: number | null;
2098
+ grossProfit: number | null;
2099
+ commissionRate: number | null;
2100
+ commissionAmount: number | null;
2101
+ companyNet: number | null;
2102
+ isRealized: boolean;
2103
+ }>;
2104
+ } & {
2105
+ createdAt: z.ZodString;
2106
+ updatedAt: z.ZodString;
2107
+ }, "strip", z.ZodTypeAny, {
2108
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
2109
+ createdAt: string;
2110
+ updatedAt: string;
2111
+ currency: string;
2112
+ notes: string | null;
2113
+ buyerName: string | null;
2114
+ transportCost: number;
2115
+ organizationId: string;
2116
+ waybillNumber: string | null;
2117
+ purchaseCost: number;
2118
+ miscellaneousCost: number;
2119
+ invoiceNumber: string | null;
2120
+ waybillId: string;
2121
+ invoiceId: string | null;
2122
+ handlerUserId: string | null;
2123
+ computed: {
2124
+ totalCost: number;
2125
+ saleAmount: number | null;
2126
+ grossProfit: number | null;
2127
+ commissionRate: number | null;
2128
+ commissionAmount: number | null;
2129
+ companyNet: number | null;
2130
+ isRealized: boolean;
2131
+ };
2132
+ }, {
2133
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
2134
+ createdAt: string;
2135
+ updatedAt: string;
2136
+ notes: string | null;
2137
+ buyerName: string | null;
2138
+ transportCost: number;
2139
+ organizationId: string;
2140
+ waybillNumber: string | null;
2141
+ purchaseCost: number;
2142
+ miscellaneousCost: number;
2143
+ invoiceNumber: string | null;
2144
+ waybillId: string;
2145
+ invoiceId: string | null;
2146
+ handlerUserId: string | null;
2147
+ computed: {
2148
+ totalCost: number;
2149
+ saleAmount: number | null;
2150
+ grossProfit: number | null;
2151
+ commissionRate: number | null;
2152
+ commissionAmount: number | null;
2153
+ companyNet: number | null;
2154
+ isRealized: boolean;
2155
+ };
2156
+ currency?: string | undefined;
2157
+ }>;
2158
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2159
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2160
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2161
+ }, "strip", z.ZodTypeAny, {
2162
+ type: string;
2163
+ id: string;
2164
+ attributes: {
2165
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
2166
+ createdAt: string;
2167
+ updatedAt: string;
2168
+ currency: string;
2169
+ notes: string | null;
2170
+ buyerName: string | null;
2171
+ transportCost: number;
2172
+ organizationId: string;
2173
+ waybillNumber: string | null;
2174
+ purchaseCost: number;
2175
+ miscellaneousCost: number;
2176
+ invoiceNumber: string | null;
2177
+ waybillId: string;
2178
+ invoiceId: string | null;
2179
+ handlerUserId: string | null;
2180
+ computed: {
2181
+ totalCost: number;
2182
+ saleAmount: number | null;
2183
+ grossProfit: number | null;
2184
+ commissionRate: number | null;
2185
+ commissionAmount: number | null;
2186
+ companyNet: number | null;
2187
+ isRealized: boolean;
2188
+ };
2189
+ };
2190
+ relationships?: Record<string, unknown> | undefined;
2191
+ links?: Record<string, string> | undefined;
2192
+ meta?: Record<string, unknown> | undefined;
2193
+ }, {
2194
+ type: string;
2195
+ id: string;
2196
+ attributes: {
2197
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
2198
+ createdAt: string;
2199
+ updatedAt: string;
2200
+ notes: string | null;
2201
+ buyerName: string | null;
2202
+ transportCost: number;
2203
+ organizationId: string;
2204
+ waybillNumber: string | null;
2205
+ purchaseCost: number;
2206
+ miscellaneousCost: number;
2207
+ invoiceNumber: string | null;
2208
+ waybillId: string;
2209
+ invoiceId: string | null;
2210
+ handlerUserId: string | null;
2211
+ computed: {
2212
+ totalCost: number;
2213
+ saleAmount: number | null;
2214
+ grossProfit: number | null;
2215
+ commissionRate: number | null;
2216
+ commissionAmount: number | null;
2217
+ companyNet: number | null;
2218
+ isRealized: boolean;
2219
+ };
2220
+ currency?: string | undefined;
2221
+ };
2222
+ relationships?: Record<string, unknown> | undefined;
2223
+ links?: Record<string, string> | undefined;
2224
+ meta?: Record<string, unknown> | undefined;
2225
+ }>;
2226
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
2227
+ type: z.ZodString;
2228
+ id: z.ZodString;
2229
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2230
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2231
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2232
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2233
+ }, "strip", z.ZodTypeAny, {
2234
+ type: string;
2235
+ id: string;
2236
+ attributes?: Record<string, unknown> | undefined;
2237
+ relationships?: Record<string, unknown> | undefined;
2238
+ links?: Record<string, string> | undefined;
2239
+ meta?: Record<string, unknown> | undefined;
2240
+ }, {
2241
+ type: string;
2242
+ id: string;
2243
+ attributes?: Record<string, unknown> | undefined;
2244
+ relationships?: Record<string, unknown> | undefined;
2245
+ links?: Record<string, string> | undefined;
2246
+ meta?: Record<string, unknown> | undefined;
2247
+ }>, "many">>;
2248
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2249
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2250
+ }, "strip", z.ZodTypeAny, {
2251
+ data: {
2252
+ type: string;
2253
+ id: string;
2254
+ attributes: {
2255
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
2256
+ createdAt: string;
2257
+ updatedAt: string;
2258
+ currency: string;
2259
+ notes: string | null;
2260
+ buyerName: string | null;
2261
+ transportCost: number;
2262
+ organizationId: string;
2263
+ waybillNumber: string | null;
2264
+ purchaseCost: number;
2265
+ miscellaneousCost: number;
2266
+ invoiceNumber: string | null;
2267
+ waybillId: string;
2268
+ invoiceId: string | null;
2269
+ handlerUserId: string | null;
2270
+ computed: {
2271
+ totalCost: number;
2272
+ saleAmount: number | null;
2273
+ grossProfit: number | null;
2274
+ commissionRate: number | null;
2275
+ commissionAmount: number | null;
2276
+ companyNet: number | null;
2277
+ isRealized: boolean;
2278
+ };
2279
+ };
2280
+ relationships?: Record<string, unknown> | undefined;
2281
+ links?: Record<string, string> | undefined;
2282
+ meta?: Record<string, unknown> | undefined;
2283
+ };
2284
+ links?: Record<string, string> | undefined;
2285
+ meta?: Record<string, unknown> | undefined;
2286
+ included?: {
2287
+ type: string;
2288
+ id: string;
2289
+ attributes?: Record<string, unknown> | undefined;
2290
+ relationships?: Record<string, unknown> | undefined;
2291
+ links?: Record<string, string> | undefined;
2292
+ meta?: Record<string, unknown> | undefined;
2293
+ }[] | undefined;
2294
+ }, {
2295
+ data: {
2296
+ type: string;
2297
+ id: string;
2298
+ attributes: {
2299
+ status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
2300
+ createdAt: string;
2301
+ updatedAt: string;
2302
+ notes: string | null;
2303
+ buyerName: string | null;
2304
+ transportCost: number;
2305
+ organizationId: string;
2306
+ waybillNumber: string | null;
2307
+ purchaseCost: number;
2308
+ miscellaneousCost: number;
2309
+ invoiceNumber: string | null;
2310
+ waybillId: string;
2311
+ invoiceId: string | null;
2312
+ handlerUserId: string | null;
2313
+ computed: {
2314
+ totalCost: number;
2315
+ saleAmount: number | null;
2316
+ grossProfit: number | null;
2317
+ commissionRate: number | null;
2318
+ commissionAmount: number | null;
2319
+ companyNet: number | null;
2320
+ isRealized: boolean;
2321
+ };
2322
+ currency?: string | undefined;
2323
+ };
2324
+ relationships?: Record<string, unknown> | undefined;
2325
+ links?: Record<string, string> | undefined;
2326
+ meta?: Record<string, unknown> | undefined;
2327
+ };
2328
+ links?: Record<string, string> | undefined;
2329
+ meta?: Record<string, unknown> | undefined;
2330
+ included?: {
2331
+ type: string;
2332
+ id: string;
2333
+ attributes?: Record<string, unknown> | undefined;
2334
+ relationships?: Record<string, unknown> | undefined;
2335
+ links?: Record<string, string> | undefined;
2336
+ meta?: Record<string, unknown> | undefined;
2337
+ }[] | undefined;
2338
+ }>;
2339
+ 400: z.ZodObject<{
2340
+ errors: z.ZodArray<z.ZodObject<{
2341
+ id: z.ZodOptional<z.ZodString>;
2342
+ links: z.ZodOptional<z.ZodObject<{
2343
+ about: z.ZodOptional<z.ZodString>;
2344
+ }, "strip", z.ZodTypeAny, {
2345
+ about?: string | undefined;
2346
+ }, {
2347
+ about?: string | undefined;
2348
+ }>>;
2349
+ status: z.ZodOptional<z.ZodString>;
2350
+ code: z.ZodOptional<z.ZodString>;
2351
+ title: z.ZodOptional<z.ZodString>;
2352
+ detail: z.ZodOptional<z.ZodString>;
2353
+ source: z.ZodOptional<z.ZodObject<{
2354
+ pointer: z.ZodOptional<z.ZodString>;
2355
+ parameter: z.ZodOptional<z.ZodString>;
2356
+ }, "strip", z.ZodTypeAny, {
2357
+ pointer?: string | undefined;
2358
+ parameter?: string | undefined;
2359
+ }, {
2360
+ pointer?: string | undefined;
2361
+ parameter?: string | undefined;
2362
+ }>>;
2363
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2364
+ }, "strip", z.ZodTypeAny, {
2365
+ status?: string | undefined;
2366
+ code?: string | undefined;
2367
+ id?: string | undefined;
2368
+ links?: {
2369
+ about?: string | undefined;
2370
+ } | undefined;
2371
+ meta?: Record<string, unknown> | undefined;
2372
+ title?: string | undefined;
2373
+ detail?: string | undefined;
2374
+ source?: {
2375
+ pointer?: string | undefined;
2376
+ parameter?: string | undefined;
2377
+ } | undefined;
2378
+ }, {
2379
+ status?: string | undefined;
2380
+ code?: string | undefined;
2381
+ id?: string | undefined;
2382
+ links?: {
2383
+ about?: string | undefined;
2384
+ } | undefined;
2385
+ meta?: Record<string, unknown> | undefined;
2386
+ title?: string | undefined;
2387
+ detail?: string | undefined;
2388
+ source?: {
2389
+ pointer?: string | undefined;
2390
+ parameter?: string | undefined;
2391
+ } | undefined;
2392
+ }>, "many">;
2393
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2394
+ }, "strip", z.ZodTypeAny, {
2395
+ errors: {
2396
+ status?: string | undefined;
2397
+ code?: string | undefined;
2398
+ id?: string | undefined;
2399
+ links?: {
2400
+ about?: string | undefined;
2401
+ } | undefined;
2402
+ meta?: Record<string, unknown> | undefined;
2403
+ title?: string | undefined;
2404
+ detail?: string | undefined;
2405
+ source?: {
2406
+ pointer?: string | undefined;
2407
+ parameter?: string | undefined;
2408
+ } | undefined;
2409
+ }[];
2410
+ meta?: Record<string, unknown> | undefined;
2411
+ }, {
2412
+ errors: {
2413
+ status?: string | undefined;
2414
+ code?: string | undefined;
2415
+ id?: string | undefined;
2416
+ links?: {
2417
+ about?: string | undefined;
2418
+ } | undefined;
2419
+ meta?: Record<string, unknown> | undefined;
2420
+ title?: string | undefined;
2421
+ detail?: string | undefined;
2422
+ source?: {
2423
+ pointer?: string | undefined;
2424
+ parameter?: string | undefined;
2425
+ } | undefined;
2426
+ }[];
2427
+ meta?: Record<string, unknown> | undefined;
2428
+ }>;
2429
+ 404: z.ZodObject<{
2430
+ errors: z.ZodArray<z.ZodObject<{
2431
+ id: z.ZodOptional<z.ZodString>;
2432
+ links: z.ZodOptional<z.ZodObject<{
2433
+ about: z.ZodOptional<z.ZodString>;
2434
+ }, "strip", z.ZodTypeAny, {
2435
+ about?: string | undefined;
2436
+ }, {
2437
+ about?: string | undefined;
2438
+ }>>;
2439
+ status: z.ZodOptional<z.ZodString>;
2440
+ code: z.ZodOptional<z.ZodString>;
2441
+ title: z.ZodOptional<z.ZodString>;
2442
+ detail: z.ZodOptional<z.ZodString>;
2443
+ source: z.ZodOptional<z.ZodObject<{
2444
+ pointer: z.ZodOptional<z.ZodString>;
2445
+ parameter: z.ZodOptional<z.ZodString>;
2446
+ }, "strip", z.ZodTypeAny, {
2447
+ pointer?: string | undefined;
2448
+ parameter?: string | undefined;
2449
+ }, {
2450
+ pointer?: string | undefined;
2451
+ parameter?: string | undefined;
2452
+ }>>;
2453
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2454
+ }, "strip", z.ZodTypeAny, {
2455
+ status?: string | undefined;
2456
+ code?: string | undefined;
2457
+ id?: string | undefined;
2458
+ links?: {
2459
+ about?: string | undefined;
2460
+ } | undefined;
2461
+ meta?: Record<string, unknown> | undefined;
2462
+ title?: string | undefined;
2463
+ detail?: string | undefined;
2464
+ source?: {
2465
+ pointer?: string | undefined;
2466
+ parameter?: string | undefined;
2467
+ } | undefined;
2468
+ }, {
2469
+ status?: string | undefined;
2470
+ code?: string | undefined;
2471
+ id?: string | undefined;
2472
+ links?: {
2473
+ about?: string | undefined;
2474
+ } | undefined;
2475
+ meta?: Record<string, unknown> | undefined;
2476
+ title?: string | undefined;
2477
+ detail?: string | undefined;
2478
+ source?: {
2479
+ pointer?: string | undefined;
2480
+ parameter?: string | undefined;
2481
+ } | undefined;
2482
+ }>, "many">;
2483
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2484
+ }, "strip", z.ZodTypeAny, {
2485
+ errors: {
2486
+ status?: string | undefined;
2487
+ code?: string | undefined;
2488
+ id?: string | undefined;
2489
+ links?: {
2490
+ about?: string | undefined;
2491
+ } | undefined;
2492
+ meta?: Record<string, unknown> | undefined;
2493
+ title?: string | undefined;
2494
+ detail?: string | undefined;
2495
+ source?: {
2496
+ pointer?: string | undefined;
2497
+ parameter?: string | undefined;
2498
+ } | undefined;
2499
+ }[];
2500
+ meta?: Record<string, unknown> | undefined;
2501
+ }, {
2502
+ errors: {
2503
+ status?: string | undefined;
2504
+ code?: string | undefined;
2505
+ id?: string | undefined;
2506
+ links?: {
2507
+ about?: string | undefined;
2508
+ } | undefined;
2509
+ meta?: Record<string, unknown> | undefined;
2510
+ title?: string | undefined;
2511
+ detail?: string | undefined;
2512
+ source?: {
2513
+ pointer?: string | undefined;
2514
+ parameter?: string | undefined;
2515
+ } | undefined;
2516
+ }[];
2517
+ meta?: Record<string, unknown> | undefined;
2518
+ }>;
2519
+ 401: z.ZodObject<{
2520
+ errors: z.ZodArray<z.ZodObject<{
2521
+ id: z.ZodOptional<z.ZodString>;
2522
+ links: z.ZodOptional<z.ZodObject<{
2523
+ about: z.ZodOptional<z.ZodString>;
2524
+ }, "strip", z.ZodTypeAny, {
2525
+ about?: string | undefined;
2526
+ }, {
2527
+ about?: string | undefined;
2528
+ }>>;
2529
+ status: z.ZodOptional<z.ZodString>;
2530
+ code: z.ZodOptional<z.ZodString>;
2531
+ title: z.ZodOptional<z.ZodString>;
2532
+ detail: z.ZodOptional<z.ZodString>;
2533
+ source: z.ZodOptional<z.ZodObject<{
2534
+ pointer: z.ZodOptional<z.ZodString>;
2535
+ parameter: z.ZodOptional<z.ZodString>;
2536
+ }, "strip", z.ZodTypeAny, {
2537
+ pointer?: string | undefined;
2538
+ parameter?: string | undefined;
2539
+ }, {
2540
+ pointer?: string | undefined;
2541
+ parameter?: string | undefined;
2542
+ }>>;
2543
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2544
+ }, "strip", z.ZodTypeAny, {
2545
+ status?: string | undefined;
2546
+ code?: string | undefined;
2547
+ id?: string | undefined;
2548
+ links?: {
2549
+ about?: string | undefined;
2550
+ } | undefined;
2551
+ meta?: Record<string, unknown> | undefined;
2552
+ title?: string | undefined;
2553
+ detail?: string | undefined;
2554
+ source?: {
2555
+ pointer?: string | undefined;
2556
+ parameter?: string | undefined;
2557
+ } | undefined;
2558
+ }, {
2559
+ status?: string | undefined;
2560
+ code?: string | undefined;
2561
+ id?: string | undefined;
2562
+ links?: {
2563
+ about?: string | undefined;
2564
+ } | undefined;
2565
+ meta?: Record<string, unknown> | undefined;
2566
+ title?: string | undefined;
2567
+ detail?: string | undefined;
2568
+ source?: {
2569
+ pointer?: string | undefined;
2570
+ parameter?: string | undefined;
2571
+ } | undefined;
2572
+ }>, "many">;
2573
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2574
+ }, "strip", z.ZodTypeAny, {
2575
+ errors: {
2576
+ status?: string | undefined;
2577
+ code?: string | undefined;
2578
+ id?: string | undefined;
2579
+ links?: {
2580
+ about?: string | undefined;
2581
+ } | undefined;
2582
+ meta?: Record<string, unknown> | undefined;
2583
+ title?: string | undefined;
2584
+ detail?: string | undefined;
2585
+ source?: {
2586
+ pointer?: string | undefined;
2587
+ parameter?: string | undefined;
2588
+ } | undefined;
2589
+ }[];
2590
+ meta?: Record<string, unknown> | undefined;
2591
+ }, {
2592
+ errors: {
2593
+ status?: string | undefined;
2594
+ code?: string | undefined;
2595
+ id?: string | undefined;
2596
+ links?: {
2597
+ about?: string | undefined;
2598
+ } | undefined;
2599
+ meta?: Record<string, unknown> | undefined;
2600
+ title?: string | undefined;
2601
+ detail?: string | undefined;
2602
+ source?: {
2603
+ pointer?: string | undefined;
2604
+ parameter?: string | undefined;
2605
+ } | undefined;
2606
+ }[];
2607
+ meta?: Record<string, unknown> | undefined;
2608
+ }>;
2609
+ 422: z.ZodObject<{
2610
+ errors: z.ZodArray<z.ZodObject<{
2611
+ id: z.ZodOptional<z.ZodString>;
2612
+ links: z.ZodOptional<z.ZodObject<{
2613
+ about: z.ZodOptional<z.ZodString>;
2614
+ }, "strip", z.ZodTypeAny, {
2615
+ about?: string | undefined;
2616
+ }, {
2617
+ about?: string | undefined;
2618
+ }>>;
2619
+ status: z.ZodOptional<z.ZodString>;
2620
+ code: z.ZodOptional<z.ZodString>;
2621
+ title: z.ZodOptional<z.ZodString>;
2622
+ detail: z.ZodOptional<z.ZodString>;
2623
+ source: z.ZodOptional<z.ZodObject<{
2624
+ pointer: z.ZodOptional<z.ZodString>;
2625
+ parameter: z.ZodOptional<z.ZodString>;
2626
+ }, "strip", z.ZodTypeAny, {
2627
+ pointer?: string | undefined;
2628
+ parameter?: string | undefined;
2629
+ }, {
2630
+ pointer?: string | undefined;
2631
+ parameter?: string | undefined;
2632
+ }>>;
2633
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2634
+ }, "strip", z.ZodTypeAny, {
2635
+ status?: string | undefined;
2636
+ code?: string | undefined;
2637
+ id?: string | undefined;
2638
+ links?: {
2639
+ about?: string | undefined;
2640
+ } | undefined;
2641
+ meta?: Record<string, unknown> | undefined;
2642
+ title?: string | undefined;
2643
+ detail?: string | undefined;
2644
+ source?: {
2645
+ pointer?: string | undefined;
2646
+ parameter?: string | undefined;
2647
+ } | undefined;
2648
+ }, {
2649
+ status?: string | undefined;
2650
+ code?: string | undefined;
2651
+ id?: string | undefined;
2652
+ links?: {
2653
+ about?: string | undefined;
2654
+ } | undefined;
2655
+ meta?: Record<string, unknown> | undefined;
2656
+ title?: string | undefined;
2657
+ detail?: string | undefined;
2658
+ source?: {
2659
+ pointer?: string | undefined;
2660
+ parameter?: string | undefined;
2661
+ } | undefined;
2662
+ }>, "many">;
2663
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2664
+ }, "strip", z.ZodTypeAny, {
2665
+ errors: {
2666
+ status?: string | undefined;
2667
+ code?: string | undefined;
2668
+ id?: string | undefined;
2669
+ links?: {
2670
+ about?: string | undefined;
2671
+ } | undefined;
2672
+ meta?: Record<string, unknown> | undefined;
2673
+ title?: string | undefined;
2674
+ detail?: string | undefined;
2675
+ source?: {
2676
+ pointer?: string | undefined;
2677
+ parameter?: string | undefined;
2678
+ } | undefined;
2679
+ }[];
2680
+ meta?: Record<string, unknown> | undefined;
2681
+ }, {
2682
+ errors: {
2683
+ status?: string | undefined;
2684
+ code?: string | undefined;
2685
+ id?: string | undefined;
2686
+ links?: {
2687
+ about?: string | undefined;
2688
+ } | undefined;
2689
+ meta?: Record<string, unknown> | undefined;
2690
+ title?: string | undefined;
2691
+ detail?: string | undefined;
2692
+ source?: {
2693
+ pointer?: string | undefined;
2694
+ parameter?: string | undefined;
2695
+ } | undefined;
2696
+ }[];
2697
+ meta?: Record<string, unknown> | undefined;
2698
+ }>;
2699
+ };
2700
+ };
2701
+ };
2702
+ //# sourceMappingURL=commodity-deals.routes.d.ts.map