@deepintel-ltd/farmpro-contracts 1.22.4 → 1.23.1

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