@deepintel-ltd/farmpro-contracts 1.5.20 → 1.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/routes/invoices.routes.d.ts +366 -30
- package/dist/routes/invoices.routes.d.ts.map +1 -1
- package/dist/routes/organizations.routes.d.ts +2120 -0
- package/dist/routes/organizations.routes.d.ts.map +1 -1
- package/dist/routes/organizations.routes.js +86 -1
- package/dist/routes/waybills.routes.d.ts +485 -30
- package/dist/routes/waybills.routes.d.ts.map +1 -1
- package/dist/schemas/invoices.schemas.d.ts +303 -18
- package/dist/schemas/invoices.schemas.d.ts.map +1 -1
- package/dist/schemas/invoices.schemas.js +11 -0
- package/dist/schemas/organizations.schemas.d.ts +466 -0
- package/dist/schemas/organizations.schemas.d.ts.map +1 -1
- package/dist/schemas/organizations.schemas.js +40 -0
- package/dist/schemas/waybills.schemas.d.ts +379 -18
- package/dist/schemas/waybills.schemas.d.ts.map +1 -1
- package/dist/schemas/waybills.schemas.js +19 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizations.routes.d.ts","sourceRoot":"","sources":["../../src/routes/organizations.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"organizations.routes.d.ts","sourceRoot":"","sources":["../../src/routes/organizations.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuJ9B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { initContract } from '@ts-rest/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { createOrganizationSchema, updateOrganizationSchema, organizationResponseSchema, organizationListResponseSchema, } from '../schemas/organizations.schemas';
|
|
3
|
+
import { createOrganizationSchema, updateOrganizationSchema, organizationResponseSchema, organizationListResponseSchema, createBankAccountSchema, updateBankAccountSchema, bankAccountResponseSchema, bankAccountListResponseSchema, } from '../schemas/organizations.schemas';
|
|
4
4
|
import { jsonApiErrorResponseSchema, idParamSchema, jsonApiPaginationQuerySchema, jsonApiSortQuerySchema, } from '../schemas/common.schemas';
|
|
5
5
|
const c = initContract();
|
|
6
6
|
export const organizationsRouter = c.router({
|
|
@@ -60,4 +60,89 @@ export const organizationsRouter = c.router({
|
|
|
60
60
|
summary: 'Update organization',
|
|
61
61
|
description: 'Update organization information',
|
|
62
62
|
},
|
|
63
|
+
// ============================================================================
|
|
64
|
+
// Bank Account Routes
|
|
65
|
+
// ============================================================================
|
|
66
|
+
// List all bank accounts for an organization
|
|
67
|
+
listBankAccounts: {
|
|
68
|
+
method: 'GET',
|
|
69
|
+
path: '/organizations/:organizationId/bank-accounts',
|
|
70
|
+
pathParams: idParamSchema.extend({ organizationId: z.string().uuid() }),
|
|
71
|
+
query: jsonApiPaginationQuerySchema.merge(jsonApiSortQuerySchema),
|
|
72
|
+
responses: {
|
|
73
|
+
200: bankAccountListResponseSchema,
|
|
74
|
+
401: jsonApiErrorResponseSchema,
|
|
75
|
+
404: jsonApiErrorResponseSchema,
|
|
76
|
+
},
|
|
77
|
+
summary: 'List bank accounts for an organization',
|
|
78
|
+
description: 'Get a paginated list of bank accounts for a specific organization',
|
|
79
|
+
},
|
|
80
|
+
// Create a new bank account
|
|
81
|
+
createBankAccount: {
|
|
82
|
+
method: 'POST',
|
|
83
|
+
path: '/organizations/:organizationId/bank-accounts',
|
|
84
|
+
pathParams: idParamSchema.extend({ organizationId: z.string().uuid() }),
|
|
85
|
+
body: z.object({ data: createBankAccountSchema }),
|
|
86
|
+
responses: {
|
|
87
|
+
201: bankAccountResponseSchema,
|
|
88
|
+
400: jsonApiErrorResponseSchema,
|
|
89
|
+
401: jsonApiErrorResponseSchema,
|
|
90
|
+
404: jsonApiErrorResponseSchema,
|
|
91
|
+
422: jsonApiErrorResponseSchema,
|
|
92
|
+
},
|
|
93
|
+
summary: 'Create a new bank account',
|
|
94
|
+
description: 'Create a new bank account for an organization. If isDefault is true, this account becomes the default.',
|
|
95
|
+
},
|
|
96
|
+
// Get bank account by ID
|
|
97
|
+
getBankAccount: {
|
|
98
|
+
method: 'GET',
|
|
99
|
+
path: '/organizations/:organizationId/bank-accounts/:id',
|
|
100
|
+
pathParams: idParamSchema.extend({
|
|
101
|
+
organizationId: z.string().uuid(),
|
|
102
|
+
id: z.string().uuid(),
|
|
103
|
+
}),
|
|
104
|
+
responses: {
|
|
105
|
+
200: bankAccountResponseSchema,
|
|
106
|
+
404: jsonApiErrorResponseSchema,
|
|
107
|
+
401: jsonApiErrorResponseSchema,
|
|
108
|
+
},
|
|
109
|
+
summary: 'Get bank account by ID',
|
|
110
|
+
description: 'Get detailed information about a specific bank account',
|
|
111
|
+
},
|
|
112
|
+
// Update bank account
|
|
113
|
+
updateBankAccount: {
|
|
114
|
+
method: 'PATCH',
|
|
115
|
+
path: '/organizations/:organizationId/bank-accounts/:id',
|
|
116
|
+
pathParams: idParamSchema.extend({
|
|
117
|
+
organizationId: z.string().uuid(),
|
|
118
|
+
id: z.string().uuid(),
|
|
119
|
+
}),
|
|
120
|
+
body: z.object({ data: updateBankAccountSchema }),
|
|
121
|
+
responses: {
|
|
122
|
+
200: bankAccountResponseSchema,
|
|
123
|
+
400: jsonApiErrorResponseSchema,
|
|
124
|
+
404: jsonApiErrorResponseSchema,
|
|
125
|
+
401: jsonApiErrorResponseSchema,
|
|
126
|
+
422: jsonApiErrorResponseSchema,
|
|
127
|
+
},
|
|
128
|
+
summary: 'Update bank account',
|
|
129
|
+
description: 'Update bank account information. Setting isDefault to true will make this the default account.',
|
|
130
|
+
},
|
|
131
|
+
// Delete bank account
|
|
132
|
+
deleteBankAccount: {
|
|
133
|
+
method: 'DELETE',
|
|
134
|
+
path: '/organizations/:organizationId/bank-accounts/:id',
|
|
135
|
+
pathParams: idParamSchema.extend({
|
|
136
|
+
organizationId: z.string().uuid(),
|
|
137
|
+
id: z.string().uuid(),
|
|
138
|
+
}),
|
|
139
|
+
responses: {
|
|
140
|
+
204: z.object({}),
|
|
141
|
+
400: jsonApiErrorResponseSchema,
|
|
142
|
+
404: jsonApiErrorResponseSchema,
|
|
143
|
+
401: jsonApiErrorResponseSchema,
|
|
144
|
+
},
|
|
145
|
+
summary: 'Delete bank account',
|
|
146
|
+
description: 'Delete a bank account. Cannot delete if it is the default account or has associated invoices.',
|
|
147
|
+
},
|
|
63
148
|
});
|