@devizovaburza/mdm-sdk 0.0.11 → 0.0.12
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/v1/index.cjs +2094 -486
- package/dist/v1/index.d.cts +544 -568
- package/dist/v1/index.d.mts +544 -568
- package/dist/v1/index.d.ts +544 -568
- package/dist/v1/index.mjs +2166 -558
- package/package.json +1 -1
package/dist/v1/index.cjs
CHANGED
|
@@ -33,7 +33,7 @@ const AddressTypeZod$1 = [
|
|
|
33
33
|
"REGISTERED_OFFICE",
|
|
34
34
|
"CONTACT_ADDRESS"
|
|
35
35
|
];
|
|
36
|
-
const ContactTypeZod = [
|
|
36
|
+
const ContactTypeZod$1 = [
|
|
37
37
|
"EMAIL",
|
|
38
38
|
"PHONE_AUTH",
|
|
39
39
|
"PHONE_CONTACT",
|
|
@@ -46,7 +46,7 @@ const IdDocStatusZod$1 = [
|
|
|
46
46
|
"EXPIRE_SOON",
|
|
47
47
|
"REVOKED"
|
|
48
48
|
];
|
|
49
|
-
const PartyRelationshipTypeZod = [
|
|
49
|
+
const PartyRelationshipTypeZod$1 = [
|
|
50
50
|
"AUTHORIZED_SIGNATORY",
|
|
51
51
|
"POA_HOLDER",
|
|
52
52
|
"BOARD_MEMBER",
|
|
@@ -74,7 +74,7 @@ const PartyTypeZod$1 = [
|
|
|
74
74
|
"SELF_EMPLOYED",
|
|
75
75
|
"ORGANIZATION"
|
|
76
76
|
];
|
|
77
|
-
const AmlScoreTypeZod = [
|
|
77
|
+
const AmlScoreTypeZod$1 = [
|
|
78
78
|
"LOW",
|
|
79
79
|
"MEDIUM",
|
|
80
80
|
"HIGH",
|
|
@@ -87,19 +87,25 @@ const IdentificationTypeZod = [
|
|
|
87
87
|
"REMOTE_IDENTIFICATION"
|
|
88
88
|
];
|
|
89
89
|
const GenderZod$1 = ["M", "F", "OTHER"];
|
|
90
|
-
const KycStatusZod = [
|
|
90
|
+
const KycStatusZod$1 = [
|
|
91
91
|
"NOT_APPROVED",
|
|
92
92
|
"VERIFIED",
|
|
93
93
|
"UNVERIFIED",
|
|
94
94
|
"REJECTED"
|
|
95
95
|
];
|
|
96
|
-
const TRADER_TYPE = ["PERSON", "COMPANY", "OSVC"];
|
|
96
|
+
const TRADER_TYPE$1 = ["PERSON", "COMPANY", "OSVC"];
|
|
97
97
|
|
|
98
98
|
const AddressTypeZod = [
|
|
99
99
|
"PERMANENT_ADDRESS",
|
|
100
100
|
"REGISTERED_OFFICE",
|
|
101
101
|
"CONTACT_ADDRESS"
|
|
102
102
|
];
|
|
103
|
+
const ContactTypeZod = [
|
|
104
|
+
"EMAIL",
|
|
105
|
+
"PHONE_AUTH",
|
|
106
|
+
"PHONE_CONTACT",
|
|
107
|
+
"PHONE_WORK"
|
|
108
|
+
];
|
|
103
109
|
const IdDocTypeZod = ["PASSPORT", "ID", "DRIVING_LICENSE"];
|
|
104
110
|
const IdDocStatusZod = [
|
|
105
111
|
"ACTIVE",
|
|
@@ -107,6 +113,12 @@ const IdDocStatusZod = [
|
|
|
107
113
|
"EXPIRE_SOON",
|
|
108
114
|
"REVOKED"
|
|
109
115
|
];
|
|
116
|
+
const PartyRelationshipTypeZod = [
|
|
117
|
+
"AUTHORIZED_SIGNATORY",
|
|
118
|
+
"POA_HOLDER",
|
|
119
|
+
"BOARD_MEMBER",
|
|
120
|
+
"UBO"
|
|
121
|
+
];
|
|
110
122
|
const CustomerStatusZod = [
|
|
111
123
|
// 'LEAD',
|
|
112
124
|
"NEW",
|
|
@@ -121,289 +133,47 @@ const PartyTypeZod = [
|
|
|
121
133
|
"SELF_EMPLOYED",
|
|
122
134
|
"ORGANIZATION"
|
|
123
135
|
];
|
|
136
|
+
const AmlScoreTypeZod = [
|
|
137
|
+
"LOW",
|
|
138
|
+
"MEDIUM",
|
|
139
|
+
"HIGH",
|
|
140
|
+
"UNACCEPTABLE",
|
|
141
|
+
"UNVERIFIED",
|
|
142
|
+
"UNCLASSIFIED"
|
|
143
|
+
];
|
|
124
144
|
const GenderZod = ["M", "F", "OTHER"];
|
|
145
|
+
const KycStatusZod = [
|
|
146
|
+
"NOT_APPROVED",
|
|
147
|
+
"VERIFIED",
|
|
148
|
+
"UNVERIFIED",
|
|
149
|
+
"REJECTED"
|
|
150
|
+
];
|
|
151
|
+
const TRADER_TYPE = ["PERSON", "COMPANY", "OSVC"];
|
|
125
152
|
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
pin: zodOpenapi.z.string().optional(),
|
|
151
|
-
stayAbroad: zodOpenapi.z.boolean().optional(),
|
|
152
|
-
stayAbroadCountries: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional()
|
|
153
|
-
});
|
|
154
|
-
const individualUpdateSchema = zodOpenapi.z.object({
|
|
155
|
-
id: zodOpenapi.z.uuid(),
|
|
156
|
-
partyId: zodOpenapi.z.uuid(),
|
|
157
|
-
internalId: zodOpenapi.z.string().optional(),
|
|
158
|
-
name: zodOpenapi.z.string().optional(),
|
|
159
|
-
surname: zodOpenapi.z.string().optional(),
|
|
160
|
-
email: zodOpenapi.z.string().optional(),
|
|
161
|
-
phone: zodOpenapi.z.string().optional(),
|
|
162
|
-
birthDate: zodOpenapi.z.string().optional(),
|
|
163
|
-
birthPlace: zodOpenapi.z.string().optional(),
|
|
164
|
-
countryOfBirth: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
165
|
-
personalId: zodOpenapi.z.uuid().optional(),
|
|
166
|
-
gender: zodOpenapi.z.enum(GenderZod).optional(),
|
|
167
|
-
citizenship: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
168
|
-
citizenshipOther: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
169
|
-
employer: zodOpenapi.z.string().optional(),
|
|
170
|
-
employerCountry: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
171
|
-
registeredNumber: zodOpenapi.z.string().optional(),
|
|
172
|
-
isPep: zodOpenapi.z.boolean().optional(),
|
|
173
|
-
titleBefore: zodOpenapi.z.string().optional(),
|
|
174
|
-
titleAfter: zodOpenapi.z.string().optional(),
|
|
175
|
-
birthSurname: zodOpenapi.z.string().optional(),
|
|
176
|
-
vocativeTitle: zodOpenapi.z.string().optional(),
|
|
177
|
-
deathDate: zodOpenapi.z.date().optional(),
|
|
178
|
-
deathNotification: zodOpenapi.z.date().optional(),
|
|
179
|
-
pin: zodOpenapi.z.string().optional(),
|
|
180
|
-
stayAbroad: zodOpenapi.z.boolean().optional(),
|
|
181
|
-
stayAbroadCountries: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional()
|
|
182
|
-
});
|
|
183
|
-
const individualOutputSchema = zodOpenapi.z.object({
|
|
184
|
-
id: zodOpenapi.z.uuid(),
|
|
185
|
-
partyId: zodOpenapi.z.uuid().nullable(),
|
|
186
|
-
internalId: zodOpenapi.z.string().nullable(),
|
|
187
|
-
name: zodOpenapi.z.string(),
|
|
188
|
-
surname: zodOpenapi.z.string(),
|
|
189
|
-
email: zodOpenapi.z.string().nullable(),
|
|
190
|
-
phone: zodOpenapi.z.string().nullable(),
|
|
191
|
-
birthDate: zodOpenapi.z.string().nullable(),
|
|
192
|
-
birthPlace: zodOpenapi.z.string(),
|
|
193
|
-
countryOfBirth: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).nullable(),
|
|
194
|
-
personalId: zodOpenapi.z.uuid(),
|
|
195
|
-
gender: zodOpenapi.z.enum(GenderZod),
|
|
196
|
-
citizenship: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
197
|
-
citizenshipOther: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).nullable(),
|
|
198
|
-
employer: zodOpenapi.z.string().nullable(),
|
|
199
|
-
employerCountry: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).nullable(),
|
|
200
|
-
registeredNumber: zodOpenapi.z.string(),
|
|
201
|
-
isPep: zodOpenapi.z.boolean(),
|
|
202
|
-
titleBefore: zodOpenapi.z.string().nullable(),
|
|
203
|
-
titleAfter: zodOpenapi.z.string().nullable(),
|
|
204
|
-
birthSurname: zodOpenapi.z.string().nullable(),
|
|
205
|
-
vocativeTitle: zodOpenapi.z.string().nullable(),
|
|
206
|
-
deathDate: zodOpenapi.z.coerce.date().nullable(),
|
|
207
|
-
deathNotification: zodOpenapi.z.coerce.date().nullable(),
|
|
208
|
-
pin: zodOpenapi.z.string().nullable(),
|
|
209
|
-
stayAbroad: zodOpenapi.z.boolean().nullable(),
|
|
210
|
-
stayAbroadCountries: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).nullable(),
|
|
211
|
-
createdAt: zodOpenapi.z.coerce.date().nullable(),
|
|
212
|
-
updatedAt: zodOpenapi.z.coerce.date().nullable()
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
zodOpenapi.z.object({
|
|
216
|
-
partyId: zodOpenapi.z.uuid().optional(),
|
|
217
|
-
internalId: zodOpenapi.z.string().optional(),
|
|
218
|
-
businessName: zodOpenapi.z.string(),
|
|
219
|
-
email: zodOpenapi.z.email("Invalid email format").optional(),
|
|
220
|
-
phone: zodOpenapi.z.string().optional(),
|
|
221
|
-
registeredNumber: zodOpenapi.z.string(),
|
|
222
|
-
registeredIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
223
|
-
operatesIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
224
|
-
presentIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
225
|
-
monthlyVolumeIn: zodOpenapi.z.number(),
|
|
226
|
-
monthlyVolumeOut: zodOpenapi.z.number(),
|
|
227
|
-
ownedBy: zodOpenapi.z.string(),
|
|
228
|
-
companyObjects: zodOpenapi.z.string(),
|
|
229
|
-
annualTurnover: zodOpenapi.z.number(),
|
|
230
|
-
numberOfEmployees: zodOpenapi.z.number().optional(),
|
|
231
|
-
prosecuted: zodOpenapi.z.string().optional(),
|
|
232
|
-
location: zodOpenapi.z.string().optional(),
|
|
233
|
-
fileNumber: zodOpenapi.z.string().optional(),
|
|
234
|
-
websiteUrl: zodOpenapi.z.url("Invalid website URL").optional(),
|
|
235
|
-
vatPayer: zodOpenapi.z.boolean(),
|
|
236
|
-
companyObjectsDescription: zodOpenapi.z.string(),
|
|
237
|
-
turnover3years: zodOpenapi.z.number(),
|
|
238
|
-
operationCountries: zodOpenapi.z.string(),
|
|
239
|
-
riskyBusinessTypes: zodOpenapi.z.string().optional()
|
|
240
|
-
});
|
|
241
|
-
const organizationUpdateSchema = zodOpenapi.z.object({
|
|
242
|
-
id: zodOpenapi.z.uuid(),
|
|
243
|
-
partyId: zodOpenapi.z.uuid().optional(),
|
|
244
|
-
internalId: zodOpenapi.z.string().optional(),
|
|
245
|
-
businessName: zodOpenapi.z.string().optional(),
|
|
246
|
-
email: zodOpenapi.z.email("Invalid email format").optional(),
|
|
247
|
-
phone: zodOpenapi.z.string().optional(),
|
|
248
|
-
registeredNumber: zodOpenapi.z.string().optional(),
|
|
249
|
-
registeredIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
250
|
-
operatesIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
251
|
-
presentIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
252
|
-
monthlyVolumeIn: zodOpenapi.z.number().optional(),
|
|
253
|
-
monthlyVolumeOut: zodOpenapi.z.number().optional(),
|
|
254
|
-
ownedBy: zodOpenapi.z.string().optional(),
|
|
255
|
-
companyObjects: zodOpenapi.z.string().optional(),
|
|
256
|
-
annualTurnover: zodOpenapi.z.number().optional(),
|
|
257
|
-
numberOfEmployees: zodOpenapi.z.number().optional(),
|
|
258
|
-
prosecuted: zodOpenapi.z.string().optional(),
|
|
259
|
-
location: zodOpenapi.z.string().optional(),
|
|
260
|
-
fileNumber: zodOpenapi.z.string().optional(),
|
|
261
|
-
websiteUrl: zodOpenapi.z.url("Invalid website URL").optional(),
|
|
262
|
-
vatPayer: zodOpenapi.z.boolean().optional(),
|
|
263
|
-
companyObjectsDescription: zodOpenapi.z.string(),
|
|
264
|
-
turnover3years: zodOpenapi.z.number(),
|
|
265
|
-
operationCountries: zodOpenapi.z.string(),
|
|
266
|
-
riskyBusinessTypes: zodOpenapi.z.string().optional()
|
|
267
|
-
});
|
|
268
|
-
zodOpenapi.z.object({
|
|
269
|
-
id: zodOpenapi.z.uuid(),
|
|
270
|
-
partyId: zodOpenapi.z.uuid(),
|
|
271
|
-
internalId: zodOpenapi.z.string().nullable(),
|
|
272
|
-
businessName: zodOpenapi.z.string(),
|
|
273
|
-
email: zodOpenapi.z.string().nullable(),
|
|
274
|
-
phone: zodOpenapi.z.string().nullable(),
|
|
275
|
-
registeredNumber: zodOpenapi.z.string(),
|
|
276
|
-
registeredIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
277
|
-
operatesIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
278
|
-
presentIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
279
|
-
monthlyVolumeIn: zodOpenapi.z.number(),
|
|
280
|
-
monthlyVolumeOut: zodOpenapi.z.number(),
|
|
281
|
-
ownedBy: zodOpenapi.z.string(),
|
|
282
|
-
companyObjects: zodOpenapi.z.string(),
|
|
283
|
-
annualTurnover: zodOpenapi.z.number(),
|
|
284
|
-
numberOfEmployees: zodOpenapi.z.number().nullable(),
|
|
285
|
-
prosecuted: zodOpenapi.z.string().nullable(),
|
|
286
|
-
location: zodOpenapi.z.string().nullable(),
|
|
287
|
-
fileNumber: zodOpenapi.z.string().nullable(),
|
|
288
|
-
websiteUrl: zodOpenapi.z.string().nullable(),
|
|
289
|
-
vatPayer: zodOpenapi.z.boolean(),
|
|
290
|
-
companyObjectsDescription: zodOpenapi.z.string(),
|
|
291
|
-
turnover3years: zodOpenapi.z.number(),
|
|
292
|
-
operationCountries: zodOpenapi.z.string(),
|
|
293
|
-
riskyBusinessTypes: zodOpenapi.z.string().nullable(),
|
|
294
|
-
createdAt: zodOpenapi.z.coerce.date().nullable(),
|
|
295
|
-
updatedAt: zodOpenapi.z.coerce.date().nullable()
|
|
296
|
-
});
|
|
297
|
-
const createOrganizationInputSchema = zodOpenapi.z.object({
|
|
298
|
-
partyId: zodOpenapi.z.uuid().optional(),
|
|
299
|
-
internalId: zodOpenapi.z.string().optional(),
|
|
300
|
-
businessName: zodOpenapi.z.string(),
|
|
301
|
-
email: zodOpenapi.z.string().optional(),
|
|
302
|
-
phone: zodOpenapi.z.string().optional(),
|
|
303
|
-
registeredNumber: zodOpenapi.z.string(),
|
|
304
|
-
registeredIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
305
|
-
operatesIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
306
|
-
presentIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
307
|
-
monthlyVolumeIn: zodOpenapi.z.number(),
|
|
308
|
-
monthlyVolumeOut: zodOpenapi.z.number(),
|
|
309
|
-
ownedBy: zodOpenapi.z.string(),
|
|
310
|
-
companyObjects: zodOpenapi.z.string(),
|
|
311
|
-
annualTurnover: zodOpenapi.z.number(),
|
|
312
|
-
numberOfEmployees: zodOpenapi.z.number(),
|
|
313
|
-
prosecuted: zodOpenapi.z.string().optional(),
|
|
314
|
-
location: zodOpenapi.z.string().optional(),
|
|
315
|
-
fileNumber: zodOpenapi.z.string().optional(),
|
|
316
|
-
websiteUrl: zodOpenapi.z.string().optional(),
|
|
317
|
-
vatPayer: zodOpenapi.z.boolean(),
|
|
318
|
-
message: zodOpenapi.z.string(),
|
|
319
|
-
companyObjectsDescription: zodOpenapi.z.string(),
|
|
320
|
-
turnover3years: zodOpenapi.z.number(),
|
|
321
|
-
operationCountries: zodOpenapi.z.string(),
|
|
322
|
-
riskyBusinessTypes: zodOpenapi.z.string().optional()
|
|
323
|
-
});
|
|
324
|
-
const createOrganizationOutputSchema = zodOpenapi.z.object({
|
|
325
|
-
partyId: zodOpenapi.z.uuid(),
|
|
326
|
-
internalId: zodOpenapi.z.string().nullable(),
|
|
327
|
-
businessName: zodOpenapi.z.string(),
|
|
328
|
-
email: zodOpenapi.z.string().nullable(),
|
|
329
|
-
phone: zodOpenapi.z.string().nullable(),
|
|
330
|
-
registeredNumber: zodOpenapi.z.string(),
|
|
331
|
-
registeredIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
332
|
-
operatesIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
333
|
-
presentIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
334
|
-
monthlyVolumeIn: zodOpenapi.z.number(),
|
|
335
|
-
monthlyVolumeOut: zodOpenapi.z.number(),
|
|
336
|
-
ownedBy: zodOpenapi.z.string(),
|
|
337
|
-
companyObjects: zodOpenapi.z.string(),
|
|
338
|
-
annualTurnover: zodOpenapi.z.number(),
|
|
339
|
-
numberOfEmployees: zodOpenapi.z.number().nullable(),
|
|
340
|
-
prosecuted: zodOpenapi.z.string().nullable(),
|
|
341
|
-
location: zodOpenapi.z.string().nullable(),
|
|
342
|
-
fileNumber: zodOpenapi.z.string().nullable(),
|
|
343
|
-
websiteUrl: zodOpenapi.z.string().nullable(),
|
|
344
|
-
vatPayer: zodOpenapi.z.boolean(),
|
|
345
|
-
message: zodOpenapi.z.string().nullable(),
|
|
346
|
-
companyObjectsDescription: zodOpenapi.z.string(),
|
|
347
|
-
turnover3years: zodOpenapi.z.number(),
|
|
348
|
-
operationCountries: zodOpenapi.z.string(),
|
|
349
|
-
riskyBusinessTypes: zodOpenapi.z.string().nullable()
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
const disponentSchema = zodOpenapi.z.discriminatedUnion("partyType", [
|
|
353
|
-
zodOpenapi.z.object({
|
|
354
|
-
partyType: zodOpenapi.z.literal("INDIVIDUAL"),
|
|
355
|
-
data: individualInsertSchema
|
|
356
|
-
}),
|
|
357
|
-
zodOpenapi.z.object({
|
|
358
|
-
partyType: zodOpenapi.z.literal("ORGANIZATION"),
|
|
359
|
-
data: createOrganizationInputSchema
|
|
360
|
-
})
|
|
361
|
-
]);
|
|
362
|
-
const disponentUpdateSchema = zodOpenapi.z.discriminatedUnion("partyType", [
|
|
363
|
-
zodOpenapi.z.object({
|
|
364
|
-
partyType: zodOpenapi.z.literal("INDIVIDUAL"),
|
|
365
|
-
data: individualUpdateSchema
|
|
366
|
-
}),
|
|
367
|
-
zodOpenapi.z.object({
|
|
368
|
-
partyType: zodOpenapi.z.literal("ORGANIZATION"),
|
|
369
|
-
data: organizationUpdateSchema
|
|
370
|
-
})
|
|
371
|
-
]);
|
|
372
|
-
const disponentOutputSchema = zodOpenapi.z.discriminatedUnion("partyType", [
|
|
373
|
-
zodOpenapi.z.object({
|
|
374
|
-
partyType: zodOpenapi.z.literal("INDIVIDUAL"),
|
|
375
|
-
data: individualOutputSchema.nullable()
|
|
376
|
-
}),
|
|
377
|
-
zodOpenapi.z.object({
|
|
378
|
-
partyType: zodOpenapi.z.literal("ORGANIZATION"),
|
|
379
|
-
data: createOrganizationOutputSchema.nullable()
|
|
380
|
-
})
|
|
381
|
-
]);
|
|
382
|
-
|
|
383
|
-
const entityKind = Symbol.for("drizzle:entityKind");
|
|
384
|
-
function is(value, type) {
|
|
385
|
-
if (!value || typeof value !== "object") {
|
|
386
|
-
return false;
|
|
387
|
-
}
|
|
388
|
-
if (value instanceof type) {
|
|
389
|
-
return true;
|
|
390
|
-
}
|
|
391
|
-
if (!Object.prototype.hasOwnProperty.call(type, entityKind)) {
|
|
392
|
-
throw new Error(
|
|
393
|
-
`Class "${type.name ?? "<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`
|
|
394
|
-
);
|
|
395
|
-
}
|
|
396
|
-
let cls = Object.getPrototypeOf(value).constructor;
|
|
397
|
-
if (cls) {
|
|
398
|
-
while (cls) {
|
|
399
|
-
if (entityKind in cls && cls[entityKind] === type[entityKind]) {
|
|
400
|
-
return true;
|
|
401
|
-
}
|
|
402
|
-
cls = Object.getPrototypeOf(cls);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
return false;
|
|
406
|
-
}
|
|
153
|
+
const entityKind = Symbol.for("drizzle:entityKind");
|
|
154
|
+
function is(value, type) {
|
|
155
|
+
if (!value || typeof value !== "object") {
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
if (value instanceof type) {
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
if (!Object.prototype.hasOwnProperty.call(type, entityKind)) {
|
|
162
|
+
throw new Error(
|
|
163
|
+
`Class "${type.name ?? "<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
let cls = Object.getPrototypeOf(value).constructor;
|
|
167
|
+
if (cls) {
|
|
168
|
+
while (cls) {
|
|
169
|
+
if (entityKind in cls && cls[entityKind] === type[entityKind]) {
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
cls = Object.getPrototypeOf(cls);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
407
177
|
|
|
408
178
|
class Column {
|
|
409
179
|
constructor(table, config) {
|
|
@@ -560,7 +330,7 @@ class ColumnBuilder {
|
|
|
560
330
|
const TableName = Symbol.for("drizzle:Name");
|
|
561
331
|
|
|
562
332
|
const isPgEnumSym = Symbol.for("drizzle:isPgEnum");
|
|
563
|
-
function isPgEnum(obj) {
|
|
333
|
+
function isPgEnum$1(obj) {
|
|
564
334
|
return !!obj && typeof obj === "function" && isPgEnumSym in obj && obj[isPgEnumSym] === true;
|
|
565
335
|
}
|
|
566
336
|
|
|
@@ -645,6 +415,9 @@ class Table {
|
|
|
645
415
|
this[BaseName] = baseName;
|
|
646
416
|
}
|
|
647
417
|
}
|
|
418
|
+
function isTable(table) {
|
|
419
|
+
return typeof table === "object" && table !== null && IsDrizzleTable in table;
|
|
420
|
+
}
|
|
648
421
|
|
|
649
422
|
function isSQLWrapper(value) {
|
|
650
423
|
return value !== null && value !== void 0 && typeof value.getSQL === "function";
|
|
@@ -806,7 +579,7 @@ class SQL {
|
|
|
806
579
|
new Name(chunk._.alias)
|
|
807
580
|
], config);
|
|
808
581
|
}
|
|
809
|
-
if (isPgEnum(chunk)) {
|
|
582
|
+
if (isPgEnum$1(chunk)) {
|
|
810
583
|
if (chunk.schema) {
|
|
811
584
|
return { sql: escapeName(chunk.schema) + "." + escapeName(chunk.enumName), params: [] };
|
|
812
585
|
}
|
|
@@ -1006,6 +779,9 @@ class View {
|
|
|
1006
779
|
return new SQL([this]);
|
|
1007
780
|
}
|
|
1008
781
|
}
|
|
782
|
+
function isView(view) {
|
|
783
|
+
return typeof view === "object" && view !== null && IsDrizzleView in view;
|
|
784
|
+
}
|
|
1009
785
|
Column.prototype.getSQL = function() {
|
|
1010
786
|
return new SQL([this]);
|
|
1011
787
|
};
|
|
@@ -1016,13 +792,19 @@ Subquery.prototype.getSQL = function() {
|
|
|
1016
792
|
return new SQL([this]);
|
|
1017
793
|
};
|
|
1018
794
|
|
|
795
|
+
function getTableColumns(table) {
|
|
796
|
+
return table[Table.Symbol.Columns];
|
|
797
|
+
}
|
|
798
|
+
function getViewSelectedFields(view) {
|
|
799
|
+
return view[ViewBaseConfig].selectedFields;
|
|
800
|
+
}
|
|
1019
801
|
function getColumnNameAndConfig(a, b) {
|
|
1020
802
|
return {
|
|
1021
803
|
name: typeof a === "string" && a.length > 0 ? a : "",
|
|
1022
804
|
config: typeof a === "object" ? a : b
|
|
1023
805
|
};
|
|
1024
806
|
}
|
|
1025
|
-
typeof TextDecoder === "undefined" ? null : new TextDecoder();
|
|
807
|
+
const textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder();
|
|
1026
808
|
|
|
1027
809
|
class ForeignKeyBuilder {
|
|
1028
810
|
static [entityKind] = "SQLiteForeignKeyBuilder";
|
|
@@ -1134,6 +916,141 @@ class SQLiteColumn extends Column {
|
|
|
1134
916
|
static [entityKind] = "SQLiteColumn";
|
|
1135
917
|
}
|
|
1136
918
|
|
|
919
|
+
class SQLiteBigIntBuilder extends SQLiteColumnBuilder {
|
|
920
|
+
static [entityKind] = "SQLiteBigIntBuilder";
|
|
921
|
+
constructor(name) {
|
|
922
|
+
super(name, "bigint", "SQLiteBigInt");
|
|
923
|
+
}
|
|
924
|
+
/** @internal */
|
|
925
|
+
build(table) {
|
|
926
|
+
return new SQLiteBigInt(table, this.config);
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
class SQLiteBigInt extends SQLiteColumn {
|
|
930
|
+
static [entityKind] = "SQLiteBigInt";
|
|
931
|
+
getSQLType() {
|
|
932
|
+
return "blob";
|
|
933
|
+
}
|
|
934
|
+
mapFromDriverValue(value) {
|
|
935
|
+
if (typeof Buffer !== "undefined" && Buffer.from) {
|
|
936
|
+
const buf = Buffer.isBuffer(value) ? value : value instanceof ArrayBuffer ? Buffer.from(value) : value.buffer ? Buffer.from(value.buffer, value.byteOffset, value.byteLength) : Buffer.from(value);
|
|
937
|
+
return BigInt(buf.toString("utf8"));
|
|
938
|
+
}
|
|
939
|
+
return BigInt(textDecoder.decode(value));
|
|
940
|
+
}
|
|
941
|
+
mapToDriverValue(value) {
|
|
942
|
+
return Buffer.from(value.toString());
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
class SQLiteBlobJsonBuilder extends SQLiteColumnBuilder {
|
|
946
|
+
static [entityKind] = "SQLiteBlobJsonBuilder";
|
|
947
|
+
constructor(name) {
|
|
948
|
+
super(name, "json", "SQLiteBlobJson");
|
|
949
|
+
}
|
|
950
|
+
/** @internal */
|
|
951
|
+
build(table) {
|
|
952
|
+
return new SQLiteBlobJson(
|
|
953
|
+
table,
|
|
954
|
+
this.config
|
|
955
|
+
);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
class SQLiteBlobJson extends SQLiteColumn {
|
|
959
|
+
static [entityKind] = "SQLiteBlobJson";
|
|
960
|
+
getSQLType() {
|
|
961
|
+
return "blob";
|
|
962
|
+
}
|
|
963
|
+
mapFromDriverValue(value) {
|
|
964
|
+
if (typeof Buffer !== "undefined" && Buffer.from) {
|
|
965
|
+
const buf = Buffer.isBuffer(value) ? value : value instanceof ArrayBuffer ? Buffer.from(value) : value.buffer ? Buffer.from(value.buffer, value.byteOffset, value.byteLength) : Buffer.from(value);
|
|
966
|
+
return JSON.parse(buf.toString("utf8"));
|
|
967
|
+
}
|
|
968
|
+
return JSON.parse(textDecoder.decode(value));
|
|
969
|
+
}
|
|
970
|
+
mapToDriverValue(value) {
|
|
971
|
+
return Buffer.from(JSON.stringify(value));
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
class SQLiteBlobBufferBuilder extends SQLiteColumnBuilder {
|
|
975
|
+
static [entityKind] = "SQLiteBlobBufferBuilder";
|
|
976
|
+
constructor(name) {
|
|
977
|
+
super(name, "buffer", "SQLiteBlobBuffer");
|
|
978
|
+
}
|
|
979
|
+
/** @internal */
|
|
980
|
+
build(table) {
|
|
981
|
+
return new SQLiteBlobBuffer(table, this.config);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
class SQLiteBlobBuffer extends SQLiteColumn {
|
|
985
|
+
static [entityKind] = "SQLiteBlobBuffer";
|
|
986
|
+
mapFromDriverValue(value) {
|
|
987
|
+
if (Buffer.isBuffer(value)) {
|
|
988
|
+
return value;
|
|
989
|
+
}
|
|
990
|
+
return Buffer.from(value);
|
|
991
|
+
}
|
|
992
|
+
getSQLType() {
|
|
993
|
+
return "blob";
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
function blob(a, b) {
|
|
997
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
998
|
+
if (config?.mode === "json") {
|
|
999
|
+
return new SQLiteBlobJsonBuilder(name);
|
|
1000
|
+
}
|
|
1001
|
+
if (config?.mode === "bigint") {
|
|
1002
|
+
return new SQLiteBigIntBuilder(name);
|
|
1003
|
+
}
|
|
1004
|
+
return new SQLiteBlobBufferBuilder(name);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
class SQLiteCustomColumnBuilder extends SQLiteColumnBuilder {
|
|
1008
|
+
static [entityKind] = "SQLiteCustomColumnBuilder";
|
|
1009
|
+
constructor(name, fieldConfig, customTypeParams) {
|
|
1010
|
+
super(name, "custom", "SQLiteCustomColumn");
|
|
1011
|
+
this.config.fieldConfig = fieldConfig;
|
|
1012
|
+
this.config.customTypeParams = customTypeParams;
|
|
1013
|
+
}
|
|
1014
|
+
/** @internal */
|
|
1015
|
+
build(table) {
|
|
1016
|
+
return new SQLiteCustomColumn(
|
|
1017
|
+
table,
|
|
1018
|
+
this.config
|
|
1019
|
+
);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
class SQLiteCustomColumn extends SQLiteColumn {
|
|
1023
|
+
static [entityKind] = "SQLiteCustomColumn";
|
|
1024
|
+
sqlName;
|
|
1025
|
+
mapTo;
|
|
1026
|
+
mapFrom;
|
|
1027
|
+
constructor(table, config) {
|
|
1028
|
+
super(table, config);
|
|
1029
|
+
this.sqlName = config.customTypeParams.dataType(config.fieldConfig);
|
|
1030
|
+
this.mapTo = config.customTypeParams.toDriver;
|
|
1031
|
+
this.mapFrom = config.customTypeParams.fromDriver;
|
|
1032
|
+
}
|
|
1033
|
+
getSQLType() {
|
|
1034
|
+
return this.sqlName;
|
|
1035
|
+
}
|
|
1036
|
+
mapFromDriverValue(value) {
|
|
1037
|
+
return typeof this.mapFrom === "function" ? this.mapFrom(value) : value;
|
|
1038
|
+
}
|
|
1039
|
+
mapToDriverValue(value) {
|
|
1040
|
+
return typeof this.mapTo === "function" ? this.mapTo(value) : value;
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
function customType(customTypeParams) {
|
|
1044
|
+
return (a, b) => {
|
|
1045
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
1046
|
+
return new SQLiteCustomColumnBuilder(
|
|
1047
|
+
name,
|
|
1048
|
+
config,
|
|
1049
|
+
customTypeParams
|
|
1050
|
+
);
|
|
1051
|
+
};
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1137
1054
|
class SQLiteBaseIntegerBuilder extends SQLiteColumnBuilder {
|
|
1138
1055
|
static [entityKind] = "SQLiteBaseIntegerBuilder";
|
|
1139
1056
|
constructor(name, dataType, columnType) {
|
|
@@ -1242,6 +1159,100 @@ function integer(a, b) {
|
|
|
1242
1159
|
return new SQLiteIntegerBuilder(name);
|
|
1243
1160
|
}
|
|
1244
1161
|
|
|
1162
|
+
class SQLiteNumericBuilder extends SQLiteColumnBuilder {
|
|
1163
|
+
static [entityKind] = "SQLiteNumericBuilder";
|
|
1164
|
+
constructor(name) {
|
|
1165
|
+
super(name, "string", "SQLiteNumeric");
|
|
1166
|
+
}
|
|
1167
|
+
/** @internal */
|
|
1168
|
+
build(table) {
|
|
1169
|
+
return new SQLiteNumeric(
|
|
1170
|
+
table,
|
|
1171
|
+
this.config
|
|
1172
|
+
);
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
class SQLiteNumeric extends SQLiteColumn {
|
|
1176
|
+
static [entityKind] = "SQLiteNumeric";
|
|
1177
|
+
mapFromDriverValue(value) {
|
|
1178
|
+
if (typeof value === "string") return value;
|
|
1179
|
+
return String(value);
|
|
1180
|
+
}
|
|
1181
|
+
getSQLType() {
|
|
1182
|
+
return "numeric";
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
class SQLiteNumericNumberBuilder extends SQLiteColumnBuilder {
|
|
1186
|
+
static [entityKind] = "SQLiteNumericNumberBuilder";
|
|
1187
|
+
constructor(name) {
|
|
1188
|
+
super(name, "number", "SQLiteNumericNumber");
|
|
1189
|
+
}
|
|
1190
|
+
/** @internal */
|
|
1191
|
+
build(table) {
|
|
1192
|
+
return new SQLiteNumericNumber(
|
|
1193
|
+
table,
|
|
1194
|
+
this.config
|
|
1195
|
+
);
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
class SQLiteNumericNumber extends SQLiteColumn {
|
|
1199
|
+
static [entityKind] = "SQLiteNumericNumber";
|
|
1200
|
+
mapFromDriverValue(value) {
|
|
1201
|
+
if (typeof value === "number") return value;
|
|
1202
|
+
return Number(value);
|
|
1203
|
+
}
|
|
1204
|
+
mapToDriverValue = String;
|
|
1205
|
+
getSQLType() {
|
|
1206
|
+
return "numeric";
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
class SQLiteNumericBigIntBuilder extends SQLiteColumnBuilder {
|
|
1210
|
+
static [entityKind] = "SQLiteNumericBigIntBuilder";
|
|
1211
|
+
constructor(name) {
|
|
1212
|
+
super(name, "bigint", "SQLiteNumericBigInt");
|
|
1213
|
+
}
|
|
1214
|
+
/** @internal */
|
|
1215
|
+
build(table) {
|
|
1216
|
+
return new SQLiteNumericBigInt(
|
|
1217
|
+
table,
|
|
1218
|
+
this.config
|
|
1219
|
+
);
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
class SQLiteNumericBigInt extends SQLiteColumn {
|
|
1223
|
+
static [entityKind] = "SQLiteNumericBigInt";
|
|
1224
|
+
mapFromDriverValue = BigInt;
|
|
1225
|
+
mapToDriverValue = String;
|
|
1226
|
+
getSQLType() {
|
|
1227
|
+
return "numeric";
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
function numeric(a, b) {
|
|
1231
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
1232
|
+
const mode = config?.mode;
|
|
1233
|
+
return mode === "number" ? new SQLiteNumericNumberBuilder(name) : mode === "bigint" ? new SQLiteNumericBigIntBuilder(name) : new SQLiteNumericBuilder(name);
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
class SQLiteRealBuilder extends SQLiteColumnBuilder {
|
|
1237
|
+
static [entityKind] = "SQLiteRealBuilder";
|
|
1238
|
+
constructor(name) {
|
|
1239
|
+
super(name, "number", "SQLiteReal");
|
|
1240
|
+
}
|
|
1241
|
+
/** @internal */
|
|
1242
|
+
build(table) {
|
|
1243
|
+
return new SQLiteReal(table, this.config);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
class SQLiteReal extends SQLiteColumn {
|
|
1247
|
+
static [entityKind] = "SQLiteReal";
|
|
1248
|
+
getSQLType() {
|
|
1249
|
+
return "real";
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
function real(name) {
|
|
1253
|
+
return new SQLiteRealBuilder(name ?? "");
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1245
1256
|
class SQLiteTextBuilder extends SQLiteColumnBuilder {
|
|
1246
1257
|
static [entityKind] = "SQLiteTextBuilder";
|
|
1247
1258
|
constructor(name, config) {
|
|
@@ -1301,54 +1312,399 @@ function text(a, b = {}) {
|
|
|
1301
1312
|
return new SQLiteTextBuilder(name, config);
|
|
1302
1313
|
}
|
|
1303
1314
|
|
|
1315
|
+
function getSQLiteColumnBuilders() {
|
|
1316
|
+
return {
|
|
1317
|
+
blob,
|
|
1318
|
+
customType,
|
|
1319
|
+
integer,
|
|
1320
|
+
numeric,
|
|
1321
|
+
real,
|
|
1322
|
+
text
|
|
1323
|
+
};
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
const InlineForeignKeys = Symbol.for("drizzle:SQLiteInlineForeignKeys");
|
|
1327
|
+
class SQLiteTable extends Table {
|
|
1328
|
+
static [entityKind] = "SQLiteTable";
|
|
1329
|
+
/** @internal */
|
|
1330
|
+
static Symbol = Object.assign({}, Table.Symbol, {
|
|
1331
|
+
InlineForeignKeys
|
|
1332
|
+
});
|
|
1333
|
+
/** @internal */
|
|
1334
|
+
[Table.Symbol.Columns];
|
|
1335
|
+
/** @internal */
|
|
1336
|
+
[InlineForeignKeys] = [];
|
|
1337
|
+
/** @internal */
|
|
1338
|
+
[Table.Symbol.ExtraConfigBuilder] = void 0;
|
|
1339
|
+
}
|
|
1340
|
+
function sqliteTableBase(name, columns, extraConfig, schema, baseName = name) {
|
|
1341
|
+
const rawTable = new SQLiteTable(name, schema, baseName);
|
|
1342
|
+
const parsedColumns = typeof columns === "function" ? columns(getSQLiteColumnBuilders()) : columns;
|
|
1343
|
+
const builtColumns = Object.fromEntries(
|
|
1344
|
+
Object.entries(parsedColumns).map(([name2, colBuilderBase]) => {
|
|
1345
|
+
const colBuilder = colBuilderBase;
|
|
1346
|
+
colBuilder.setName(name2);
|
|
1347
|
+
const column = colBuilder.build(rawTable);
|
|
1348
|
+
rawTable[InlineForeignKeys].push(...colBuilder.buildForeignKeys(column, rawTable));
|
|
1349
|
+
return [name2, column];
|
|
1350
|
+
})
|
|
1351
|
+
);
|
|
1352
|
+
const table = Object.assign(rawTable, builtColumns);
|
|
1353
|
+
table[Table.Symbol.Columns] = builtColumns;
|
|
1354
|
+
table[Table.Symbol.ExtraConfigColumns] = builtColumns;
|
|
1355
|
+
return table;
|
|
1356
|
+
}
|
|
1357
|
+
const sqliteTable = (name, columns, extraConfig) => {
|
|
1358
|
+
return sqliteTableBase(name, columns);
|
|
1359
|
+
};
|
|
1360
|
+
|
|
1361
|
+
const CONSTANTS = {
|
|
1362
|
+
INT8_MIN: -128,
|
|
1363
|
+
INT8_MAX: 127,
|
|
1364
|
+
INT8_UNSIGNED_MAX: 255,
|
|
1365
|
+
INT16_MIN: -32768,
|
|
1366
|
+
INT16_MAX: 32767,
|
|
1367
|
+
INT16_UNSIGNED_MAX: 65535,
|
|
1368
|
+
INT24_MIN: -8388608,
|
|
1369
|
+
INT24_MAX: 8388607,
|
|
1370
|
+
INT24_UNSIGNED_MAX: 16777215,
|
|
1371
|
+
INT32_MIN: -2147483648,
|
|
1372
|
+
INT32_MAX: 2147483647,
|
|
1373
|
+
INT32_UNSIGNED_MAX: 4294967295,
|
|
1374
|
+
INT48_MIN: -140737488355328,
|
|
1375
|
+
INT48_MAX: 140737488355327,
|
|
1376
|
+
INT48_UNSIGNED_MAX: 281474976710655,
|
|
1377
|
+
INT64_MIN: -9223372036854775808n,
|
|
1378
|
+
INT64_MAX: 9223372036854775807n,
|
|
1379
|
+
INT64_UNSIGNED_MAX: 18446744073709551615n,
|
|
1380
|
+
};
|
|
1381
|
+
|
|
1382
|
+
function isColumnType(column, columnTypes) {
|
|
1383
|
+
return columnTypes.includes(column.columnType);
|
|
1384
|
+
}
|
|
1385
|
+
function isWithEnum(column) {
|
|
1386
|
+
return 'enumValues' in column && Array.isArray(column.enumValues) && column.enumValues.length > 0;
|
|
1387
|
+
}
|
|
1388
|
+
const isPgEnum = isWithEnum;
|
|
1389
|
+
|
|
1304
1390
|
const literalSchema = v4.z.union([v4.z.string(), v4.z.number(), v4.z.boolean(), v4.z.null()]);
|
|
1305
|
-
v4.z.union([
|
|
1391
|
+
const jsonSchema = v4.z.union([
|
|
1306
1392
|
literalSchema,
|
|
1307
1393
|
v4.z.record(v4.z.string(), v4.z.any()),
|
|
1308
1394
|
v4.z.array(v4.z.any()),
|
|
1309
1395
|
]);
|
|
1310
|
-
v4.z.custom((v) => v instanceof Buffer); // eslint-disable-line no-instanceof/no-instanceof
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1396
|
+
const bufferSchema = v4.z.custom((v) => v instanceof Buffer); // eslint-disable-line no-instanceof/no-instanceof
|
|
1397
|
+
function columnToSchema(column, factory) {
|
|
1398
|
+
const z$1 = v4.z;
|
|
1399
|
+
const coerce = {};
|
|
1400
|
+
let schema;
|
|
1401
|
+
if (isWithEnum(column)) {
|
|
1402
|
+
schema = column.enumValues.length ? z$1.enum(column.enumValues) : z$1.string();
|
|
1403
|
+
}
|
|
1404
|
+
if (!schema) {
|
|
1405
|
+
// Handle specific types
|
|
1406
|
+
if (isColumnType(column, ['PgGeometry', 'PgPointTuple'])) {
|
|
1407
|
+
schema = z$1.tuple([z$1.number(), z$1.number()]);
|
|
1408
|
+
}
|
|
1409
|
+
else if (isColumnType(column, ['PgGeometryObject', 'PgPointObject'])) {
|
|
1410
|
+
schema = z$1.object({ x: z$1.number(), y: z$1.number() });
|
|
1411
|
+
}
|
|
1412
|
+
else if (isColumnType(column, ['PgHalfVector', 'PgVector'])) {
|
|
1413
|
+
schema = z$1.array(z$1.number());
|
|
1414
|
+
schema = column.dimensions ? schema.length(column.dimensions) : schema;
|
|
1415
|
+
}
|
|
1416
|
+
else if (isColumnType(column, ['PgLine'])) {
|
|
1417
|
+
schema = z$1.tuple([z$1.number(), z$1.number(), z$1.number()]);
|
|
1418
|
+
}
|
|
1419
|
+
else if (isColumnType(column, ['PgLineABC'])) {
|
|
1420
|
+
schema = z$1.object({
|
|
1421
|
+
a: z$1.number(),
|
|
1422
|
+
b: z$1.number(),
|
|
1423
|
+
c: z$1.number(),
|
|
1424
|
+
});
|
|
1425
|
+
} // Handle other types
|
|
1426
|
+
else if (isColumnType(column, ['PgArray'])) {
|
|
1427
|
+
schema = z$1.array(columnToSchema(column.baseColumn));
|
|
1428
|
+
schema = column.size ? schema.length(column.size) : schema;
|
|
1429
|
+
}
|
|
1430
|
+
else if (column.dataType === 'array') {
|
|
1431
|
+
schema = z$1.array(z$1.any());
|
|
1432
|
+
}
|
|
1433
|
+
else if (column.dataType === 'number') {
|
|
1434
|
+
schema = numberColumnToSchema(column, z$1, coerce);
|
|
1435
|
+
}
|
|
1436
|
+
else if (column.dataType === 'bigint') {
|
|
1437
|
+
schema = bigintColumnToSchema(column, z$1, coerce);
|
|
1438
|
+
}
|
|
1439
|
+
else if (column.dataType === 'boolean') {
|
|
1440
|
+
schema = coerce === true || coerce.boolean ? z$1.coerce.boolean() : z$1.boolean();
|
|
1441
|
+
}
|
|
1442
|
+
else if (column.dataType === 'date') {
|
|
1443
|
+
schema = coerce === true || coerce.date ? z$1.coerce.date() : z$1.date();
|
|
1444
|
+
}
|
|
1445
|
+
else if (column.dataType === 'string') {
|
|
1446
|
+
schema = stringColumnToSchema(column, z$1, coerce);
|
|
1447
|
+
}
|
|
1448
|
+
else if (column.dataType === 'json') {
|
|
1449
|
+
schema = jsonSchema;
|
|
1450
|
+
}
|
|
1451
|
+
else if (column.dataType === 'custom') {
|
|
1452
|
+
schema = z$1.any();
|
|
1453
|
+
}
|
|
1454
|
+
else if (column.dataType === 'buffer') {
|
|
1455
|
+
schema = bufferSchema;
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
if (!schema) {
|
|
1459
|
+
schema = z$1.any();
|
|
1460
|
+
}
|
|
1461
|
+
return schema;
|
|
1462
|
+
}
|
|
1463
|
+
function numberColumnToSchema(column, z, coerce) {
|
|
1464
|
+
let unsigned = column.getSQLType().includes('unsigned');
|
|
1465
|
+
let min;
|
|
1466
|
+
let max;
|
|
1467
|
+
let integer = false;
|
|
1468
|
+
if (isColumnType(column, ['MySqlTinyInt', 'SingleStoreTinyInt'])) {
|
|
1469
|
+
min = unsigned ? 0 : CONSTANTS.INT8_MIN;
|
|
1470
|
+
max = unsigned ? CONSTANTS.INT8_UNSIGNED_MAX : CONSTANTS.INT8_MAX;
|
|
1471
|
+
integer = true;
|
|
1472
|
+
}
|
|
1473
|
+
else if (isColumnType(column, [
|
|
1474
|
+
'PgSmallInt',
|
|
1475
|
+
'PgSmallSerial',
|
|
1476
|
+
'MySqlSmallInt',
|
|
1477
|
+
'SingleStoreSmallInt',
|
|
1478
|
+
])) {
|
|
1479
|
+
min = unsigned ? 0 : CONSTANTS.INT16_MIN;
|
|
1480
|
+
max = unsigned ? CONSTANTS.INT16_UNSIGNED_MAX : CONSTANTS.INT16_MAX;
|
|
1481
|
+
integer = true;
|
|
1482
|
+
}
|
|
1483
|
+
else if (isColumnType(column, [
|
|
1484
|
+
'PgReal',
|
|
1485
|
+
'MySqlFloat',
|
|
1486
|
+
'MySqlMediumInt',
|
|
1487
|
+
'SingleStoreMediumInt',
|
|
1488
|
+
'SingleStoreFloat',
|
|
1489
|
+
])) {
|
|
1490
|
+
min = unsigned ? 0 : CONSTANTS.INT24_MIN;
|
|
1491
|
+
max = unsigned ? CONSTANTS.INT24_UNSIGNED_MAX : CONSTANTS.INT24_MAX;
|
|
1492
|
+
integer = isColumnType(column, ['MySqlMediumInt', 'SingleStoreMediumInt']);
|
|
1493
|
+
}
|
|
1494
|
+
else if (isColumnType(column, [
|
|
1495
|
+
'PgInteger',
|
|
1496
|
+
'PgSerial',
|
|
1497
|
+
'MySqlInt',
|
|
1498
|
+
'SingleStoreInt',
|
|
1499
|
+
])) {
|
|
1500
|
+
min = unsigned ? 0 : CONSTANTS.INT32_MIN;
|
|
1501
|
+
max = unsigned ? CONSTANTS.INT32_UNSIGNED_MAX : CONSTANTS.INT32_MAX;
|
|
1502
|
+
integer = true;
|
|
1503
|
+
}
|
|
1504
|
+
else if (isColumnType(column, [
|
|
1505
|
+
'PgDoublePrecision',
|
|
1506
|
+
'MySqlReal',
|
|
1507
|
+
'MySqlDouble',
|
|
1508
|
+
'SingleStoreReal',
|
|
1509
|
+
'SingleStoreDouble',
|
|
1510
|
+
'SQLiteReal',
|
|
1511
|
+
])) {
|
|
1512
|
+
min = unsigned ? 0 : CONSTANTS.INT48_MIN;
|
|
1513
|
+
max = unsigned ? CONSTANTS.INT48_UNSIGNED_MAX : CONSTANTS.INT48_MAX;
|
|
1514
|
+
}
|
|
1515
|
+
else if (isColumnType(column, [
|
|
1516
|
+
'PgBigInt53',
|
|
1517
|
+
'PgBigSerial53',
|
|
1518
|
+
'MySqlBigInt53',
|
|
1519
|
+
'MySqlSerial',
|
|
1520
|
+
'SingleStoreBigInt53',
|
|
1521
|
+
'SingleStoreSerial',
|
|
1522
|
+
'SQLiteInteger',
|
|
1523
|
+
])) {
|
|
1524
|
+
unsigned = unsigned || isColumnType(column, ['MySqlSerial', 'SingleStoreSerial']);
|
|
1525
|
+
min = unsigned ? 0 : Number.MIN_SAFE_INTEGER;
|
|
1526
|
+
max = Number.MAX_SAFE_INTEGER;
|
|
1527
|
+
integer = true;
|
|
1528
|
+
}
|
|
1529
|
+
else if (isColumnType(column, ['MySqlYear', 'SingleStoreYear'])) {
|
|
1530
|
+
min = 1901;
|
|
1531
|
+
max = 2155;
|
|
1532
|
+
integer = true;
|
|
1533
|
+
}
|
|
1534
|
+
else {
|
|
1535
|
+
min = Number.MIN_SAFE_INTEGER;
|
|
1536
|
+
max = Number.MAX_SAFE_INTEGER;
|
|
1537
|
+
}
|
|
1538
|
+
let schema = coerce === true || coerce?.number
|
|
1539
|
+
? integer ? z.coerce.number() : z.coerce.number().int()
|
|
1540
|
+
: integer
|
|
1541
|
+
? z.int()
|
|
1542
|
+
: z.number();
|
|
1543
|
+
schema = schema.gte(min).lte(max);
|
|
1544
|
+
return schema;
|
|
1545
|
+
}
|
|
1546
|
+
function bigintColumnToSchema(column, z, coerce) {
|
|
1547
|
+
const unsigned = column.getSQLType().includes('unsigned');
|
|
1548
|
+
const min = unsigned ? 0n : CONSTANTS.INT64_MIN;
|
|
1549
|
+
const max = unsigned ? CONSTANTS.INT64_UNSIGNED_MAX : CONSTANTS.INT64_MAX;
|
|
1550
|
+
const schema = coerce === true || coerce?.bigint ? z.coerce.bigint() : z.bigint();
|
|
1551
|
+
return schema.gte(min).lte(max);
|
|
1552
|
+
}
|
|
1553
|
+
function stringColumnToSchema(column, z, coerce) {
|
|
1554
|
+
if (isColumnType(column, ['PgUUID'])) {
|
|
1555
|
+
return z.uuid();
|
|
1556
|
+
}
|
|
1557
|
+
let max;
|
|
1558
|
+
let regex;
|
|
1559
|
+
let fixed = false;
|
|
1560
|
+
if (isColumnType(column, ['PgVarchar', 'SQLiteText'])) {
|
|
1561
|
+
max = column.length;
|
|
1562
|
+
}
|
|
1563
|
+
else if (isColumnType(column, ['MySqlVarChar', 'SingleStoreVarChar'])) {
|
|
1564
|
+
max = column.length ?? CONSTANTS.INT16_UNSIGNED_MAX;
|
|
1565
|
+
}
|
|
1566
|
+
else if (isColumnType(column, ['MySqlText', 'SingleStoreText'])) {
|
|
1567
|
+
if (column.textType === 'longtext') {
|
|
1568
|
+
max = CONSTANTS.INT32_UNSIGNED_MAX;
|
|
1569
|
+
}
|
|
1570
|
+
else if (column.textType === 'mediumtext') {
|
|
1571
|
+
max = CONSTANTS.INT24_UNSIGNED_MAX;
|
|
1572
|
+
}
|
|
1573
|
+
else if (column.textType === 'text') {
|
|
1574
|
+
max = CONSTANTS.INT16_UNSIGNED_MAX;
|
|
1575
|
+
}
|
|
1576
|
+
else {
|
|
1577
|
+
max = CONSTANTS.INT8_UNSIGNED_MAX;
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
if (isColumnType(column, [
|
|
1581
|
+
'PgChar',
|
|
1582
|
+
'MySqlChar',
|
|
1583
|
+
'SingleStoreChar',
|
|
1584
|
+
])) {
|
|
1585
|
+
max = column.length;
|
|
1586
|
+
fixed = true;
|
|
1587
|
+
}
|
|
1588
|
+
if (isColumnType(column, ['PgBinaryVector'])) {
|
|
1589
|
+
regex = /^[01]+$/;
|
|
1590
|
+
max = column.dimensions;
|
|
1591
|
+
}
|
|
1592
|
+
let schema = coerce === true || coerce?.string ? z.coerce.string() : z.string();
|
|
1593
|
+
schema = regex ? schema.regex(regex) : schema;
|
|
1594
|
+
return max && fixed ? schema.length(max) : max ? schema.max(max) : schema;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
function getColumns(tableLike) {
|
|
1598
|
+
return isTable(tableLike) ? getTableColumns(tableLike) : getViewSelectedFields(tableLike);
|
|
1599
|
+
}
|
|
1600
|
+
function handleColumns(columns, refinements, conditions, factory) {
|
|
1601
|
+
const columnSchemas = {};
|
|
1602
|
+
for (const [key, selected] of Object.entries(columns)) {
|
|
1603
|
+
if (!is(selected, Column) && !is(selected, SQL) && !is(selected, SQL.Aliased) && typeof selected === 'object') {
|
|
1604
|
+
const columns = isTable(selected) || isView(selected) ? getColumns(selected) : selected;
|
|
1605
|
+
columnSchemas[key] = handleColumns(columns, refinements[key] ?? {}, conditions);
|
|
1606
|
+
continue;
|
|
1607
|
+
}
|
|
1608
|
+
const refinement = refinements[key];
|
|
1609
|
+
if (refinement !== undefined && typeof refinement !== 'function') {
|
|
1610
|
+
columnSchemas[key] = refinement;
|
|
1611
|
+
continue;
|
|
1612
|
+
}
|
|
1613
|
+
const column = is(selected, Column) ? selected : undefined;
|
|
1614
|
+
const schema = column ? columnToSchema(column) : v4.z.any();
|
|
1615
|
+
const refined = typeof refinement === 'function' ? refinement(schema) : schema;
|
|
1616
|
+
if (conditions.never(column)) {
|
|
1617
|
+
continue;
|
|
1618
|
+
}
|
|
1619
|
+
else {
|
|
1620
|
+
columnSchemas[key] = refined;
|
|
1621
|
+
}
|
|
1622
|
+
if (column) {
|
|
1623
|
+
if (conditions.nullable(column)) {
|
|
1624
|
+
columnSchemas[key] = columnSchemas[key].nullable();
|
|
1625
|
+
}
|
|
1626
|
+
if (conditions.optional(column)) {
|
|
1627
|
+
columnSchemas[key] = columnSchemas[key].optional();
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
return v4.z.object(columnSchemas);
|
|
1632
|
+
}
|
|
1633
|
+
function handleEnum(enum_, factory) {
|
|
1634
|
+
const zod = v4.z;
|
|
1635
|
+
return zod.enum(enum_.enumValues);
|
|
1636
|
+
}
|
|
1637
|
+
const selectConditions = {
|
|
1638
|
+
never: () => false,
|
|
1639
|
+
optional: () => false,
|
|
1640
|
+
nullable: (column) => !column.notNull,
|
|
1641
|
+
};
|
|
1642
|
+
const insertConditions = {
|
|
1643
|
+
never: (column) => column?.generated?.type === 'always' || column?.generatedIdentity?.type === 'always',
|
|
1644
|
+
optional: (column) => !column.notNull || (column.notNull && column.hasDefault),
|
|
1645
|
+
nullable: (column) => !column.notNull,
|
|
1646
|
+
};
|
|
1647
|
+
const updateConditions = {
|
|
1648
|
+
never: (column) => column?.generated?.type === 'always' || column?.generatedIdentity?.type === 'always',
|
|
1649
|
+
optional: () => true,
|
|
1650
|
+
nullable: (column) => !column.notNull,
|
|
1651
|
+
};
|
|
1652
|
+
const createSelectSchema = (entity, refine) => {
|
|
1653
|
+
if (isPgEnum(entity)) {
|
|
1654
|
+
return handleEnum(entity);
|
|
1655
|
+
}
|
|
1656
|
+
const columns = getColumns(entity);
|
|
1657
|
+
return handleColumns(columns, {}, selectConditions);
|
|
1658
|
+
};
|
|
1659
|
+
const createInsertSchema = (entity, refine) => {
|
|
1660
|
+
const columns = getColumns(entity);
|
|
1661
|
+
return handleColumns(columns, {}, insertConditions);
|
|
1662
|
+
};
|
|
1663
|
+
const createUpdateSchema = (entity, refine) => {
|
|
1664
|
+
const columns = getColumns(entity);
|
|
1665
|
+
return handleColumns(columns, {}, updateConditions);
|
|
1666
|
+
};
|
|
1667
|
+
|
|
1668
|
+
var esprima$1 = {exports: {}};
|
|
1669
|
+
|
|
1670
|
+
var esprima = esprima$1.exports;
|
|
1671
|
+
|
|
1672
|
+
var hasRequiredEsprima;
|
|
1673
|
+
|
|
1674
|
+
function requireEsprima () {
|
|
1675
|
+
if (hasRequiredEsprima) return esprima$1.exports;
|
|
1676
|
+
hasRequiredEsprima = 1;
|
|
1677
|
+
(function (module, exports$1) {
|
|
1678
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
1679
|
+
/* istanbul ignore next */
|
|
1680
|
+
module.exports = factory();
|
|
1681
|
+
})(esprima, function() {
|
|
1682
|
+
return /******/ (function(modules) { // webpackBootstrap
|
|
1683
|
+
/******/ // The module cache
|
|
1684
|
+
/******/ var installedModules = {};
|
|
1685
|
+
|
|
1686
|
+
/******/ // The require function
|
|
1687
|
+
/******/ function __webpack_require__(moduleId) {
|
|
1688
|
+
|
|
1689
|
+
/******/ // Check if module is in cache
|
|
1690
|
+
/* istanbul ignore if */
|
|
1691
|
+
/******/ if(installedModules[moduleId])
|
|
1692
|
+
/******/ return installedModules[moduleId].exports;
|
|
1693
|
+
|
|
1694
|
+
/******/ // Create a new module (and put it into the cache)
|
|
1695
|
+
/******/ var module = installedModules[moduleId] = {
|
|
1696
|
+
/******/ exports: {},
|
|
1697
|
+
/******/ id: moduleId,
|
|
1698
|
+
/******/ loaded: false
|
|
1699
|
+
/******/ };
|
|
1700
|
+
|
|
1701
|
+
/******/ // Execute the module function
|
|
1702
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
1703
|
+
|
|
1704
|
+
/******/ // Flag the module as loaded
|
|
1705
|
+
/******/ module.loaded = true;
|
|
1706
|
+
|
|
1707
|
+
/******/ // Return the exports of the module
|
|
1352
1708
|
/******/ return module.exports;
|
|
1353
1709
|
/******/ }
|
|
1354
1710
|
|
|
@@ -11745,7 +12101,7 @@ SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJS
|
|
|
11745
12101
|
SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
|
|
11746
12102
|
SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
|
|
11747
12103
|
|
|
11748
|
-
|
|
12104
|
+
const base = {
|
|
11749
12105
|
id: text("id").primaryKey(),
|
|
11750
12106
|
createdAt: integer("created_at", { mode: "timestamp_ms" }).default(
|
|
11751
12107
|
sql`(unixepoch('subsec') * 1000)`
|
|
@@ -11755,9 +12111,9 @@ SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(Super
|
|
|
11755
12111
|
updatedBy: text("updated_by").default(sql`null`),
|
|
11756
12112
|
deletedAt: integer("deleted_at", { mode: "timestamp_ms" }).default(sql`null`),
|
|
11757
12113
|
deletedBy: text("deleted_by").default(sql`null`)
|
|
11758
|
-
}
|
|
12114
|
+
};
|
|
11759
12115
|
|
|
11760
|
-
|
|
12116
|
+
const bankAccount$1 = {
|
|
11761
12117
|
holderName: text("holder_name").notNull(),
|
|
11762
12118
|
number: text("number"),
|
|
11763
12119
|
bankCode: text("bank_code", { enum: generalCodes.BANK_CODES }),
|
|
@@ -11777,144 +12133,1396 @@ SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(Super
|
|
|
11777
12133
|
// Australia
|
|
11778
12134
|
brBankNumber: text("br_bank_number")
|
|
11779
12135
|
// Brazil
|
|
11780
|
-
}
|
|
12136
|
+
};
|
|
11781
12137
|
|
|
11782
12138
|
const ibanSchema = zod.z.string().min(1).regex(/^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$/, {
|
|
11783
12139
|
message: "Invalid IBAN format"
|
|
11784
12140
|
});
|
|
11785
|
-
const bicSchema = zod.z.string().min(1).regex(/^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$/, {
|
|
11786
|
-
message: "Invalid SWIFT/BIC format"
|
|
12141
|
+
const bicSchema = zod.z.string().min(1).regex(/^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$/, {
|
|
12142
|
+
message: "Invalid SWIFT/BIC format"
|
|
12143
|
+
});
|
|
12144
|
+
const bankAccountMetadataSchema = zod.z.object({
|
|
12145
|
+
id: zod.z.string().optional(),
|
|
12146
|
+
number: zod.z.string().optional(),
|
|
12147
|
+
bankCode: zod.z.enum(generalCodes.BANK_CODES).optional(),
|
|
12148
|
+
holderName: zod.z.string().optional(),
|
|
12149
|
+
iban: ibanSchema.optional(),
|
|
12150
|
+
address: zod.z.string().optional(),
|
|
12151
|
+
swiftBic: bicSchema.optional(),
|
|
12152
|
+
bicCor: bicSchema.optional(),
|
|
12153
|
+
currency: zod.z.enum(generalCodes.CURRENCY_CODES).optional(),
|
|
12154
|
+
countryCode: zod.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
12155
|
+
routingNumber: zod.z.string().optional(),
|
|
12156
|
+
// US
|
|
12157
|
+
sortCode: zod.z.string().optional(),
|
|
12158
|
+
// UK
|
|
12159
|
+
clabe: zod.z.string().optional(),
|
|
12160
|
+
// Mexico
|
|
12161
|
+
bsb: zod.z.string().optional(),
|
|
12162
|
+
// Australia
|
|
12163
|
+
brBankNumber: zod.z.string().optional()
|
|
12164
|
+
// Brazil
|
|
12165
|
+
});
|
|
12166
|
+
|
|
12167
|
+
zod.z.object({
|
|
12168
|
+
status: zod.z.enum([
|
|
12169
|
+
"queued",
|
|
12170
|
+
// means that instance is waiting to be started (see concurrency limits)
|
|
12171
|
+
"running",
|
|
12172
|
+
"paused",
|
|
12173
|
+
"errored",
|
|
12174
|
+
"terminated",
|
|
12175
|
+
// user terminated the instance while it was running
|
|
12176
|
+
"complete",
|
|
12177
|
+
"waiting",
|
|
12178
|
+
// instance is hibernating and waiting for sleep or event to finish
|
|
12179
|
+
"waitingForPause",
|
|
12180
|
+
// instance is finishing the current work to pause
|
|
12181
|
+
"unknown"
|
|
12182
|
+
]),
|
|
12183
|
+
error: zod.z.object({
|
|
12184
|
+
message: zod.z.string(),
|
|
12185
|
+
name: zod.z.string().optional()
|
|
12186
|
+
}).optional(),
|
|
12187
|
+
output: zod.z.unknown().optional()
|
|
12188
|
+
});
|
|
12189
|
+
|
|
12190
|
+
new z__namespace.$ZodObject({
|
|
12191
|
+
type: "object",
|
|
12192
|
+
shape: {
|
|
12193
|
+
page: new z__namespace.$ZodDefault({
|
|
12194
|
+
type: "default",
|
|
12195
|
+
innerType: new z__namespace.$ZodNumber({
|
|
12196
|
+
type: "number",
|
|
12197
|
+
coerce: true
|
|
12198
|
+
}),
|
|
12199
|
+
defaultValue: () => 1
|
|
12200
|
+
}),
|
|
12201
|
+
limit: new z__namespace.$ZodDefault({
|
|
12202
|
+
type: "default",
|
|
12203
|
+
innerType: new z__namespace.$ZodNumber({
|
|
12204
|
+
type: "number",
|
|
12205
|
+
coerce: true
|
|
12206
|
+
}),
|
|
12207
|
+
defaultValue: () => 20
|
|
12208
|
+
}),
|
|
12209
|
+
sort: new z__namespace.$ZodDefault({
|
|
12210
|
+
type: "default",
|
|
12211
|
+
innerType: new z__namespace.$ZodObject({
|
|
12212
|
+
type: "object",
|
|
12213
|
+
shape: {
|
|
12214
|
+
column: new z__namespace.$ZodDefault({
|
|
12215
|
+
type: "default",
|
|
12216
|
+
innerType: new z__namespace.$ZodEnum({
|
|
12217
|
+
type: "enum",
|
|
12218
|
+
entries: {
|
|
12219
|
+
createdAt: "createdAt",
|
|
12220
|
+
updatedAt: "updatedAt",
|
|
12221
|
+
deletedAt: "deletedAt"
|
|
12222
|
+
}
|
|
12223
|
+
}),
|
|
12224
|
+
defaultValue: () => "updatedAt"
|
|
12225
|
+
}),
|
|
12226
|
+
direction: new z__namespace.$ZodDefault({
|
|
12227
|
+
type: "default",
|
|
12228
|
+
innerType: new z__namespace.$ZodEnum({
|
|
12229
|
+
type: "enum",
|
|
12230
|
+
entries: {
|
|
12231
|
+
asc: "asc",
|
|
12232
|
+
desc: "desc"
|
|
12233
|
+
}
|
|
12234
|
+
}),
|
|
12235
|
+
defaultValue: () => "desc"
|
|
12236
|
+
})
|
|
12237
|
+
}
|
|
12238
|
+
}),
|
|
12239
|
+
defaultValue: () => ({ column: "updatedAt", direction: "desc" })
|
|
12240
|
+
})
|
|
12241
|
+
}
|
|
12242
|
+
});
|
|
12243
|
+
new z__namespace.$ZodObject({
|
|
12244
|
+
type: "object",
|
|
12245
|
+
shape: {
|
|
12246
|
+
page: new z__namespace.$ZodNumber({
|
|
12247
|
+
type: "number"
|
|
12248
|
+
}),
|
|
12249
|
+
limit: new z__namespace.$ZodNumber({
|
|
12250
|
+
type: "number"
|
|
12251
|
+
}),
|
|
12252
|
+
sort: new z__namespace.$ZodObject({
|
|
12253
|
+
type: "object",
|
|
12254
|
+
shape: {
|
|
12255
|
+
column: new z__namespace.$ZodEnum({
|
|
12256
|
+
type: "enum",
|
|
12257
|
+
entries: {
|
|
12258
|
+
createdAt: "createdAt",
|
|
12259
|
+
updatedAt: "updatedAt",
|
|
12260
|
+
deletedAt: "deletedAt"
|
|
12261
|
+
}
|
|
12262
|
+
}),
|
|
12263
|
+
direction: new z__namespace.$ZodEnum({
|
|
12264
|
+
type: "enum",
|
|
12265
|
+
entries: {
|
|
12266
|
+
asc: "asc",
|
|
12267
|
+
desc: "desc"
|
|
12268
|
+
}
|
|
12269
|
+
})
|
|
12270
|
+
}
|
|
12271
|
+
})
|
|
12272
|
+
}
|
|
12273
|
+
});
|
|
12274
|
+
|
|
12275
|
+
const baseMdmSqlite = {
|
|
12276
|
+
...base
|
|
12277
|
+
};
|
|
12278
|
+
|
|
12279
|
+
const party = sqliteTable("party", {
|
|
12280
|
+
...base,
|
|
12281
|
+
internalId: text("internal_id"),
|
|
12282
|
+
note: text("note"),
|
|
12283
|
+
customerStatus: text("customer_status", {
|
|
12284
|
+
enum: CustomerStatusZod
|
|
12285
|
+
}).notNull(),
|
|
12286
|
+
partyType: text("party_type", { enum: PartyTypeZod }).notNull(),
|
|
12287
|
+
language: text("language", { enum: generalCodes.LANGUAGE_CODES }).notNull(),
|
|
12288
|
+
countryCode: text("country_code", { enum: generalCodes.COUNTRY_CODES_2 }),
|
|
12289
|
+
isClient: integer("is_client", { mode: "boolean" }).notNull().default(false),
|
|
12290
|
+
legacyId: text("legacy_id")
|
|
12291
|
+
});
|
|
12292
|
+
|
|
12293
|
+
const address = sqliteTable("address", {
|
|
12294
|
+
...base,
|
|
12295
|
+
internalId: text("internal_id"),
|
|
12296
|
+
partyId: text("party_id").notNull().references(() => party.id),
|
|
12297
|
+
ruianCode: text("ruian_code"),
|
|
12298
|
+
addressType: text("address_type", { enum: AddressTypeZod }).notNull(),
|
|
12299
|
+
street: text("street"),
|
|
12300
|
+
orientationNumber: text("orientation_number"),
|
|
12301
|
+
descriptiveNumber: text("descriptive_number"),
|
|
12302
|
+
municipality: text("municipality").notNull(),
|
|
12303
|
+
municipalityPart: text("municipality_part"),
|
|
12304
|
+
zipCode: text("zip_code").notNull(),
|
|
12305
|
+
district: text("district"),
|
|
12306
|
+
region: text("region"),
|
|
12307
|
+
countryCode: text("state", { enum: generalCodes.COUNTRY_CODES_2 }).notNull()
|
|
12308
|
+
});
|
|
12309
|
+
|
|
12310
|
+
const contact = sqliteTable("contact", {
|
|
12311
|
+
...base,
|
|
12312
|
+
internalId: text("internal_id"),
|
|
12313
|
+
partyId: text("party_id").notNull().references(() => party.id),
|
|
12314
|
+
contactType: text("contact_type", { enum: ContactTypeZod }),
|
|
12315
|
+
email: text("email").notNull(),
|
|
12316
|
+
phoneNumber: text("phone_number").notNull()
|
|
12317
|
+
});
|
|
12318
|
+
|
|
12319
|
+
const idDocument = sqliteTable("id_document", {
|
|
12320
|
+
...base,
|
|
12321
|
+
internalId: text("internal_id"),
|
|
12322
|
+
partyId: text("party_id").notNull().references(() => party.id),
|
|
12323
|
+
idDocType: text("id_doc_type", { enum: IdDocTypeZod }).notNull(),
|
|
12324
|
+
idDocNumber: text("id_doc_number").notNull(),
|
|
12325
|
+
idDocHolderName: text("id_doc_holder_name").notNull(),
|
|
12326
|
+
issueDate: integer("issue_date", { mode: "timestamp_ms" }),
|
|
12327
|
+
expirationDate: integer("expiration_date", { mode: "timestamp_ms" }),
|
|
12328
|
+
issuer: text("issuer"),
|
|
12329
|
+
countryOfIssue: text("country_of_issue", { enum: generalCodes.COUNTRY_CODES_2 }),
|
|
12330
|
+
frontImageUri: text("front_image_uri"),
|
|
12331
|
+
backImageUri: text("back_image_uri"),
|
|
12332
|
+
idDocStatus: text("id_doc_status", { enum: IdDocStatusZod })
|
|
12333
|
+
});
|
|
12334
|
+
|
|
12335
|
+
const individual = sqliteTable("individual", {
|
|
12336
|
+
...base,
|
|
12337
|
+
internalId: text("internal_id"),
|
|
12338
|
+
partyId: text("party_id").notNull().unique().references(() => party.id),
|
|
12339
|
+
name: text("name").notNull(),
|
|
12340
|
+
email: text("email"),
|
|
12341
|
+
phone: text("phone"),
|
|
12342
|
+
surname: text("surname").notNull(),
|
|
12343
|
+
birthDate: text("birth_date"),
|
|
12344
|
+
birthPlace: text("birth_place").notNull(),
|
|
12345
|
+
countryOfBirth: text("country_of_birth", { enum: generalCodes.COUNTRY_CODES_2 }),
|
|
12346
|
+
personalId: text("personal_id").notNull(),
|
|
12347
|
+
gender: text("gender", { enum: GenderZod }).notNull(),
|
|
12348
|
+
citizenship: text("citizenship", { enum: generalCodes.COUNTRY_CODES_2 }).notNull(),
|
|
12349
|
+
citizenshipOther: text("citizenship_other", { enum: generalCodes.COUNTRY_CODES_2 }),
|
|
12350
|
+
employer: text("employer"),
|
|
12351
|
+
employerCountry: text("employer_country", { enum: generalCodes.COUNTRY_CODES_2 }),
|
|
12352
|
+
registeredNumber: text("registered_number").notNull(),
|
|
12353
|
+
isPep: integer("is_pep", { mode: "boolean" }).notNull(),
|
|
12354
|
+
titleBefore: text("title_before"),
|
|
12355
|
+
titleAfter: text("title_after"),
|
|
12356
|
+
birthSurname: text("birth_surname"),
|
|
12357
|
+
vocativeTitle: text("vocative_title"),
|
|
12358
|
+
deathDate: integer("death_date", { mode: "timestamp_ms" }),
|
|
12359
|
+
deathNotification: integer("death_notification", { mode: "timestamp_ms" }),
|
|
12360
|
+
pin: text("pin"),
|
|
12361
|
+
stayAbroad: integer("stay_abroad", { mode: "boolean" }),
|
|
12362
|
+
stayAbroadCountries: text("stay_abroad_countries", {
|
|
12363
|
+
enum: generalCodes.COUNTRY_CODES_2
|
|
12364
|
+
})
|
|
12365
|
+
});
|
|
12366
|
+
|
|
12367
|
+
const organization = sqliteTable("organization", {
|
|
12368
|
+
...base,
|
|
12369
|
+
internalId: text("internal_id"),
|
|
12370
|
+
partyId: text("party_id").notNull().unique().references(() => party.id),
|
|
12371
|
+
businessName: text("business_name").notNull(),
|
|
12372
|
+
email: text("email"),
|
|
12373
|
+
phone: text("phone"),
|
|
12374
|
+
registeredNumber: text("registered_number").notNull(),
|
|
12375
|
+
registeredIn: text("registered_in", { enum: generalCodes.COUNTRY_CODES_2 }).notNull(),
|
|
12376
|
+
operatesIn: text("operates_in", { enum: generalCodes.COUNTRY_CODES_2 }).notNull(),
|
|
12377
|
+
presentIn: text("present_in", { enum: generalCodes.COUNTRY_CODES_2 }).notNull(),
|
|
12378
|
+
monthlyVolumeIn: integer("monthly_volume_in").notNull(),
|
|
12379
|
+
monthlyVolumeOut: integer("monthly_volume_out").notNull(),
|
|
12380
|
+
ownedBy: text("owned_by").notNull(),
|
|
12381
|
+
// UBO, skutecny majitel, podle Marianovy tabulky by toto mela byt mozna relace na party
|
|
12382
|
+
companyObjects: text("company_objects").notNull(),
|
|
12383
|
+
// predmet cinnosti
|
|
12384
|
+
companyObjectsDescription: text("company_objects_description").notNull(),
|
|
12385
|
+
turnover3years: integer("turnover_3_years").notNull(),
|
|
12386
|
+
operationCountries: text("operation_countries").notNull(),
|
|
12387
|
+
annualTurnover: integer("annual_turnover").notNull(),
|
|
12388
|
+
riskyBusinessType: text("risky_business_type"),
|
|
12389
|
+
numberOfEmployees: integer("number_of_employees"),
|
|
12390
|
+
prosecuted: text("prosecuted"),
|
|
12391
|
+
// vedeno u soudu
|
|
12392
|
+
location: text("location"),
|
|
12393
|
+
// v lokalite
|
|
12394
|
+
fileNumber: text("file_number"),
|
|
12395
|
+
// spisova znacka
|
|
12396
|
+
websiteUrl: text("website_url"),
|
|
12397
|
+
vatPayer: integer("vat_payer", { mode: "boolean" }).notNull(),
|
|
12398
|
+
stayAbroad: integer("stay_abroad", { mode: "boolean" }),
|
|
12399
|
+
stayAbroadCountries: text("stay_abroad_countries", {
|
|
12400
|
+
enum: generalCodes.COUNTRY_CODES_2
|
|
12401
|
+
})
|
|
12402
|
+
});
|
|
12403
|
+
|
|
12404
|
+
const partyRelationship = sqliteTable("party_relationship", {
|
|
12405
|
+
...base,
|
|
12406
|
+
internalId: text("internal_id"),
|
|
12407
|
+
relationshipType: text("relationship_type", {
|
|
12408
|
+
enum: PartyRelationshipTypeZod
|
|
12409
|
+
}),
|
|
12410
|
+
fromPartyId: text("from_party_id").references(() => party.id),
|
|
12411
|
+
toPartyId: text("to_party_id").references(() => party.id),
|
|
12412
|
+
fromDate: integer("from_date", { mode: "timestamp_ms" }),
|
|
12413
|
+
// FIXME: Treba se doptat https://develitio.slack.com/archives/C09VAF0G70E/p1769766644943189
|
|
12414
|
+
// viz
|
|
12415
|
+
// - Celé pole `owner[]`
|
|
12416
|
+
// - `titleBefore`, `firstName`, `lastName`, `titleAfter`
|
|
12417
|
+
// - `dateOfBirth`, `idNumber`, `address`
|
|
12418
|
+
// - `sharePercentage`
|
|
12419
|
+
// - `dateOfEstablishmentOfShare`
|
|
12420
|
+
// - `pep`
|
|
12421
|
+
sharePercentage: integer("share_percentage")
|
|
12422
|
+
});
|
|
12423
|
+
|
|
12424
|
+
const taxResidence = sqliteTable("tax_residence", {
|
|
12425
|
+
...base,
|
|
12426
|
+
internalId: text("internal_id"),
|
|
12427
|
+
partyId: text("party_id").notNull().unique().references(() => party.id),
|
|
12428
|
+
country: text("country", { enum: generalCodes.COUNTRY_CODES_2 }).notNull(),
|
|
12429
|
+
taxIdentificationNumber: text("tax_identification_number").notNull()
|
|
12430
|
+
});
|
|
12431
|
+
|
|
12432
|
+
const partyChange = sqliteTable("party_change", {
|
|
12433
|
+
...base,
|
|
12434
|
+
internalId: text("internal_id"),
|
|
12435
|
+
partyId: text("party_id").notNull().references(() => party.id),
|
|
12436
|
+
operation: text("operation").notNull(),
|
|
12437
|
+
diff: text("diff", { mode: "json" }).notNull(),
|
|
12438
|
+
snapshotBefore: text("snapshot_before", { mode: "json" }).notNull(),
|
|
12439
|
+
snapshotAfter: text("snapshot_after", { mode: "json" }).notNull()
|
|
12440
|
+
});
|
|
12441
|
+
|
|
12442
|
+
const bankAccount = sqliteTable("bank_account", {
|
|
12443
|
+
...base,
|
|
12444
|
+
internalId: text("internal_id"),
|
|
12445
|
+
...bankAccount$1,
|
|
12446
|
+
partyId: text("party_id").notNull().references(() => party.id)
|
|
12447
|
+
});
|
|
12448
|
+
|
|
12449
|
+
const aml = sqliteTable("aml", {
|
|
12450
|
+
...base,
|
|
12451
|
+
internalId: text("internal_id"),
|
|
12452
|
+
partyId: text("party_id").notNull().unique().references(() => party.id),
|
|
12453
|
+
sourceOfWealth: text("source_of_wealth").notNull(),
|
|
12454
|
+
yearlyIncome: text("yearly_income").notNull(),
|
|
12455
|
+
tradesPurpose: text("trades_purpose"),
|
|
12456
|
+
sourceOfIncome: text("source_of_income").notNull(),
|
|
12457
|
+
transactionType: text("transaction_type"),
|
|
12458
|
+
transactionTypeExpiry: integer("transaction_type_expiry", {
|
|
12459
|
+
mode: "timestamp_ms"
|
|
12460
|
+
}),
|
|
12461
|
+
estTxsVolumeMonth: text("est_txs_volume_month").notNull(),
|
|
12462
|
+
estTxsVolumeYear: text("est_txs_volume_year").notNull(),
|
|
12463
|
+
tradingCountries: text("trading_countries").notNull(),
|
|
12464
|
+
tradingSide: text("trading_side").notNull(),
|
|
12465
|
+
acceptedAMLTermsAndConditions: integer("accepted_aml_terms_and_conditions", {
|
|
12466
|
+
mode: "boolean"
|
|
12467
|
+
}).notNull(),
|
|
12468
|
+
signatureMethod: text("signature_method"),
|
|
12469
|
+
existencePeriod: text("existence_period"),
|
|
12470
|
+
reputation: text("reputation"),
|
|
12471
|
+
isDistraint: integer("is_distraint", { mode: "boolean" }).notNull().default(false),
|
|
12472
|
+
riskLevel: text("risk_level", { enum: AmlScoreTypeZod }).notNull(),
|
|
12473
|
+
kycStatus: text("kyc_status", { enum: KycStatusZod })
|
|
12474
|
+
});
|
|
12475
|
+
|
|
12476
|
+
const recipient = sqliteTable("recipient", {
|
|
12477
|
+
...base,
|
|
12478
|
+
internalId: text("internal_id"),
|
|
12479
|
+
...bankAccount$1,
|
|
12480
|
+
partyId: text("party_id").notNull().references(() => party.id)
|
|
12481
|
+
});
|
|
12482
|
+
|
|
12483
|
+
const trader = sqliteTable("trader", {
|
|
12484
|
+
...base,
|
|
12485
|
+
internalId: text("internal_id"),
|
|
12486
|
+
type: text("trader", { length: 50, enum: TRADER_TYPE }).$type().notNull(),
|
|
12487
|
+
firstName: text("first_name", { length: 255 }),
|
|
12488
|
+
lastName: text("last_name", { length: 255 }),
|
|
12489
|
+
companyName: text("company_name", { length: 255 }),
|
|
12490
|
+
ico: text("ico", { length: 255 }),
|
|
12491
|
+
dic: text("dic", { length: 255 }),
|
|
12492
|
+
commission: real("commission").notNull(),
|
|
12493
|
+
legacyId: text("legacy_id")
|
|
12494
|
+
});
|
|
12495
|
+
|
|
12496
|
+
sqliteTable("trader_client", {
|
|
12497
|
+
...base,
|
|
12498
|
+
clientId: text("client_id").references(() => party.id),
|
|
12499
|
+
traderId: text("trader_id").references(() => trader.id),
|
|
12500
|
+
internalId: text("internal_id"),
|
|
12501
|
+
legacyId: text("legacy_id")
|
|
12502
|
+
});
|
|
12503
|
+
|
|
12504
|
+
sqliteTable("base", baseMdmSqlite);
|
|
12505
|
+
|
|
12506
|
+
createInsertSchema(address);
|
|
12507
|
+
createUpdateSchema(address);
|
|
12508
|
+
createSelectSchema(address);
|
|
12509
|
+
const addressInsertSchema = zodOpenapi.z.object({
|
|
12510
|
+
id: zodOpenapi.z.uuid().optional(),
|
|
12511
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12512
|
+
internalId: zodOpenapi.z.string().optional().nullable(),
|
|
12513
|
+
ruianCode: zodOpenapi.z.string().optional().nullable(),
|
|
12514
|
+
addressType: zodOpenapi.z.enum(AddressTypeZod),
|
|
12515
|
+
street: zodOpenapi.z.string().optional().nullable(),
|
|
12516
|
+
orientationNumber: zodOpenapi.z.string().optional().nullable(),
|
|
12517
|
+
descriptiveNumber: zodOpenapi.z.string().optional().nullable(),
|
|
12518
|
+
municipality: zodOpenapi.z.string(),
|
|
12519
|
+
municipalityPart: zodOpenapi.z.string().optional().nullable(),
|
|
12520
|
+
zipCode: zodOpenapi.z.string(),
|
|
12521
|
+
district: zodOpenapi.z.string().optional().nullable(),
|
|
12522
|
+
region: zodOpenapi.z.string().optional().nullable(),
|
|
12523
|
+
countryCode: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2)
|
|
12524
|
+
});
|
|
12525
|
+
const addressUpdateSchema = zodOpenapi.z.object({
|
|
12526
|
+
id: zodOpenapi.z.uuid(),
|
|
12527
|
+
partyId: zodOpenapi.z.uuid().optional(),
|
|
12528
|
+
internalId: zodOpenapi.z.string().optional().nullable(),
|
|
12529
|
+
ruianCode: zodOpenapi.z.string().optional().nullable(),
|
|
12530
|
+
addressType: zodOpenapi.z.enum(AddressTypeZod).optional(),
|
|
12531
|
+
street: zodOpenapi.z.string().optional().nullable(),
|
|
12532
|
+
orientationNumber: zodOpenapi.z.string().optional().nullable(),
|
|
12533
|
+
descriptiveNumber: zodOpenapi.z.string().optional().nullable(),
|
|
12534
|
+
municipality: zodOpenapi.z.string().optional(),
|
|
12535
|
+
municipalityPart: zodOpenapi.z.string().optional().nullable(),
|
|
12536
|
+
zipCode: zodOpenapi.z.string().optional(),
|
|
12537
|
+
district: zodOpenapi.z.string().optional().nullable(),
|
|
12538
|
+
region: zodOpenapi.z.string().optional().nullable(),
|
|
12539
|
+
countryCode: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
12540
|
+
createdAt: zodOpenapi.z.coerce.date().nullable().optional()
|
|
12541
|
+
});
|
|
12542
|
+
const addressSelectSchema = zodOpenapi.z.object({
|
|
12543
|
+
id: zodOpenapi.z.uuid(),
|
|
12544
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12545
|
+
internalId: zodOpenapi.z.string().nullable(),
|
|
12546
|
+
ruianCode: zodOpenapi.z.string().nullable(),
|
|
12547
|
+
addressType: zodOpenapi.z.enum(AddressTypeZod),
|
|
12548
|
+
street: zodOpenapi.z.string().nullable(),
|
|
12549
|
+
orientationNumber: zodOpenapi.z.string().nullable(),
|
|
12550
|
+
descriptiveNumber: zodOpenapi.z.string().nullable(),
|
|
12551
|
+
municipality: zodOpenapi.z.string(),
|
|
12552
|
+
municipalityPart: zodOpenapi.z.string().nullable(),
|
|
12553
|
+
zipCode: zodOpenapi.z.string(),
|
|
12554
|
+
district: zodOpenapi.z.string().nullable(),
|
|
12555
|
+
region: zodOpenapi.z.string().nullable(),
|
|
12556
|
+
countryCode: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
12557
|
+
createdAt: zodOpenapi.z.coerce.date().nullable(),
|
|
12558
|
+
updatedAt: zodOpenapi.z.coerce.date().nullable()
|
|
12559
|
+
});
|
|
12560
|
+
|
|
12561
|
+
createInsertSchema(aml);
|
|
12562
|
+
createUpdateSchema(aml);
|
|
12563
|
+
const amlBaseSelectSchema = createSelectSchema(aml);
|
|
12564
|
+
const amlInsertSchema = zodOpenapi.z.object({
|
|
12565
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12566
|
+
internalId: zodOpenapi.z.string().optional().nullable(),
|
|
12567
|
+
sourceOfWealth: zodOpenapi.z.string(),
|
|
12568
|
+
yearlyIncome: zodOpenapi.z.string(),
|
|
12569
|
+
tradesPurpose: zodOpenapi.z.string().optional().nullable(),
|
|
12570
|
+
sourceOfIncome: zodOpenapi.z.string(),
|
|
12571
|
+
transactionType: zodOpenapi.z.string().optional().nullable(),
|
|
12572
|
+
transactionTypeExpiry: zodOpenapi.z.date().optional().nullable(),
|
|
12573
|
+
isDistraint: zodOpenapi.z.boolean().default(false),
|
|
12574
|
+
estTxsVolumeMonth: zodOpenapi.z.string(),
|
|
12575
|
+
estTxsVolumeYear: zodOpenapi.z.string(),
|
|
12576
|
+
tradingCountries: zodOpenapi.z.string(),
|
|
12577
|
+
tradingSide: zodOpenapi.z.string(),
|
|
12578
|
+
acceptedAMLTermsAndConditions: zodOpenapi.z.boolean(),
|
|
12579
|
+
signatureMethod: zodOpenapi.z.string().nullable().optional(),
|
|
12580
|
+
existencePeriod: zodOpenapi.z.string().nullable().optional(),
|
|
12581
|
+
reputation: zodOpenapi.z.string().nullable().optional(),
|
|
12582
|
+
riskLevel: zodOpenapi.z.enum(AmlScoreTypeZod).nullable().optional(),
|
|
12583
|
+
kycStatus: zodOpenapi.z.enum(KycStatusZod).nullable().optional()
|
|
12584
|
+
});
|
|
12585
|
+
const amlUpdateSchema = zodOpenapi.z.object({
|
|
12586
|
+
id: zodOpenapi.z.uuid(),
|
|
12587
|
+
partyId: zodOpenapi.z.uuid().optional(),
|
|
12588
|
+
internalId: zodOpenapi.z.string().optional().nullable(),
|
|
12589
|
+
sourceOfWealth: zodOpenapi.z.string().optional(),
|
|
12590
|
+
yearlyIncome: zodOpenapi.z.string().optional(),
|
|
12591
|
+
tradesPurpose: zodOpenapi.z.string().optional().nullable(),
|
|
12592
|
+
sourceOfIncome: zodOpenapi.z.string().optional(),
|
|
12593
|
+
transactionType: zodOpenapi.z.string().optional().nullable(),
|
|
12594
|
+
transactionTypeExpiry: zodOpenapi.z.date().optional().nullable(),
|
|
12595
|
+
isDistraint: zodOpenapi.z.boolean().optional(),
|
|
12596
|
+
estTxsVolumeMonth: zodOpenapi.z.string(),
|
|
12597
|
+
estTxsVolumeYear: zodOpenapi.z.string(),
|
|
12598
|
+
tradingCountries: zodOpenapi.z.string(),
|
|
12599
|
+
tradingSide: zodOpenapi.z.string(),
|
|
12600
|
+
acceptedAMLTermsAndConditions: zodOpenapi.z.boolean(),
|
|
12601
|
+
signatureMethod: zodOpenapi.z.string().nullable().optional(),
|
|
12602
|
+
existencePeriod: zodOpenapi.z.string().nullable().optional(),
|
|
12603
|
+
reputation: zodOpenapi.z.string().nullable().optional(),
|
|
12604
|
+
riskLevel: zodOpenapi.z.enum(AmlScoreTypeZod).nullable().optional(),
|
|
12605
|
+
kycStatus: zodOpenapi.z.enum(KycStatusZod).nullable().optional()
|
|
12606
|
+
});
|
|
12607
|
+
const amlSelectSchema = amlBaseSelectSchema;
|
|
12608
|
+
|
|
12609
|
+
const bankAccountBaseInsertSchema = createInsertSchema(bankAccount);
|
|
12610
|
+
createUpdateSchema(bankAccount);
|
|
12611
|
+
createSelectSchema(bankAccount);
|
|
12612
|
+
const bankAccountUpdateSchema = bankAccountBaseInsertSchema.extend({ partyId: zodOpenapi.z.uuid() }).omit({});
|
|
12613
|
+
const bankAccountInsertSchema = bankAccountUpdateSchema.omit({
|
|
12614
|
+
id: true
|
|
12615
|
+
});
|
|
12616
|
+
const bankAccountUpsertSchema = bankAccountBaseInsertSchema.required({
|
|
12617
|
+
id: true
|
|
12618
|
+
});
|
|
12619
|
+
const bankAccountSelectSchema = bankAccountUpdateSchema.required();
|
|
12620
|
+
zodOpenapi.z.array(bankAccountSelectSchema);
|
|
12621
|
+
|
|
12622
|
+
createInsertSchema(contact);
|
|
12623
|
+
createUpdateSchema(contact);
|
|
12624
|
+
createSelectSchema(contact);
|
|
12625
|
+
const contactInsertSchema = zodOpenapi.z.object({
|
|
12626
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12627
|
+
internalId: zodOpenapi.z.string().optional().nullable(),
|
|
12628
|
+
contactType: zodOpenapi.z.enum(ContactTypeZod).optional(),
|
|
12629
|
+
email: zodOpenapi.z.email("Invalid email format"),
|
|
12630
|
+
phoneNumber: zodOpenapi.z.string()
|
|
12631
|
+
});
|
|
12632
|
+
const contactUpdateSchema = zodOpenapi.z.object({
|
|
12633
|
+
id: zodOpenapi.z.uuid(),
|
|
12634
|
+
partyId: zodOpenapi.z.uuid().optional(),
|
|
12635
|
+
internalId: zodOpenapi.z.string().optional().nullable(),
|
|
12636
|
+
contactType: zodOpenapi.z.enum(ContactTypeZod).optional(),
|
|
12637
|
+
email: zodOpenapi.z.email("Invalid email format").optional(),
|
|
12638
|
+
phoneNumber: zodOpenapi.z.string().optional()
|
|
12639
|
+
});
|
|
12640
|
+
|
|
12641
|
+
createInsertSchema(individual);
|
|
12642
|
+
createUpdateSchema(individual);
|
|
12643
|
+
createSelectSchema(individual);
|
|
12644
|
+
const individualInsertSchema$1 = zodOpenapi.z.object({
|
|
12645
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12646
|
+
name: zodOpenapi.z.string(),
|
|
12647
|
+
surname: zodOpenapi.z.string(),
|
|
12648
|
+
email: zodOpenapi.z.email("Invalid email format").optional().nullable(),
|
|
12649
|
+
phone: zodOpenapi.z.string().optional().nullable(),
|
|
12650
|
+
birthDate: zodOpenapi.z.string().optional().nullable(),
|
|
12651
|
+
birthPlace: zodOpenapi.z.string(),
|
|
12652
|
+
countryOfBirth: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional().nullable(),
|
|
12653
|
+
personalId: zodOpenapi.z.string(),
|
|
12654
|
+
gender: zodOpenapi.z.enum(GenderZod),
|
|
12655
|
+
citizenship: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
12656
|
+
citizenshipOther: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional().nullable(),
|
|
12657
|
+
employer: zodOpenapi.z.string().optional().nullable(),
|
|
12658
|
+
employerCountry: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional().nullable(),
|
|
12659
|
+
registeredNumber: zodOpenapi.z.string(),
|
|
12660
|
+
isPep: zodOpenapi.z.boolean(),
|
|
12661
|
+
titleBefore: zodOpenapi.z.string().optional().nullable(),
|
|
12662
|
+
titleAfter: zodOpenapi.z.string().optional().nullable(),
|
|
12663
|
+
birthSurname: zodOpenapi.z.string().optional().nullable(),
|
|
12664
|
+
vocativeTitle: zodOpenapi.z.string().optional().nullable(),
|
|
12665
|
+
deathDate: zodOpenapi.z.date().optional().nullable(),
|
|
12666
|
+
deathNotification: zodOpenapi.z.date().optional().nullable(),
|
|
12667
|
+
pin: zodOpenapi.z.string().optional().nullable(),
|
|
12668
|
+
stayAbroad: zodOpenapi.z.boolean().optional().nullable(),
|
|
12669
|
+
stayAbroadCountries: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional().nullable()
|
|
12670
|
+
});
|
|
12671
|
+
const individualUpdateSchema$1 = zodOpenapi.z.object({
|
|
12672
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12673
|
+
id: zodOpenapi.z.uuid(),
|
|
12674
|
+
name: zodOpenapi.z.string().optional(),
|
|
12675
|
+
surname: zodOpenapi.z.string().optional(),
|
|
12676
|
+
email: zodOpenapi.z.email("Invalid email format").optional().nullable(),
|
|
12677
|
+
phone: zodOpenapi.z.string().optional().nullable(),
|
|
12678
|
+
birthDate: zodOpenapi.z.string().optional().nullable(),
|
|
12679
|
+
birthPlace: zodOpenapi.z.string().optional(),
|
|
12680
|
+
countryOfBirth: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional().nullable(),
|
|
12681
|
+
personalId: zodOpenapi.z.string().optional(),
|
|
12682
|
+
gender: zodOpenapi.z.enum(GenderZod).optional(),
|
|
12683
|
+
citizenship: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
12684
|
+
citizenshipOther: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional().nullable(),
|
|
12685
|
+
employer: zodOpenapi.z.string().optional().nullable(),
|
|
12686
|
+
employerCountry: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional().nullable(),
|
|
12687
|
+
registeredNumber: zodOpenapi.z.string().optional(),
|
|
12688
|
+
isPep: zodOpenapi.z.boolean().optional(),
|
|
12689
|
+
titleBefore: zodOpenapi.z.string().optional().nullable(),
|
|
12690
|
+
titleAfter: zodOpenapi.z.string().optional().nullable(),
|
|
12691
|
+
birthSurname: zodOpenapi.z.string().optional().nullable(),
|
|
12692
|
+
vocativeTitle: zodOpenapi.z.string().optional().nullable(),
|
|
12693
|
+
deathDate: zodOpenapi.z.date().optional().nullable(),
|
|
12694
|
+
deathNotification: zodOpenapi.z.date().optional().nullable(),
|
|
12695
|
+
pin: zodOpenapi.z.string().optional().nullable(),
|
|
12696
|
+
stayAbroad: zodOpenapi.z.boolean().optional().nullable(),
|
|
12697
|
+
stayAbroadCountries: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional().nullable()
|
|
12698
|
+
});
|
|
12699
|
+
const individualSelectSchema = zodOpenapi.z.object({
|
|
12700
|
+
id: zodOpenapi.z.uuid(),
|
|
12701
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12702
|
+
internalId: zodOpenapi.z.string().nullable(),
|
|
12703
|
+
name: zodOpenapi.z.string(),
|
|
12704
|
+
surname: zodOpenapi.z.string(),
|
|
12705
|
+
email: zodOpenapi.z.string().nullable(),
|
|
12706
|
+
phone: zodOpenapi.z.string().nullable(),
|
|
12707
|
+
birthDate: zodOpenapi.z.string().nullable(),
|
|
12708
|
+
birthPlace: zodOpenapi.z.string(),
|
|
12709
|
+
countryOfBirth: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).nullable(),
|
|
12710
|
+
personalId: zodOpenapi.z.string(),
|
|
12711
|
+
gender: zodOpenapi.z.enum(GenderZod),
|
|
12712
|
+
citizenship: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
12713
|
+
citizenshipOther: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).nullable(),
|
|
12714
|
+
employer: zodOpenapi.z.string().nullable(),
|
|
12715
|
+
employerCountry: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).nullable(),
|
|
12716
|
+
registeredNumber: zodOpenapi.z.string(),
|
|
12717
|
+
isPep: zodOpenapi.z.boolean(),
|
|
12718
|
+
titleBefore: zodOpenapi.z.string().nullable(),
|
|
12719
|
+
titleAfter: zodOpenapi.z.string().nullable(),
|
|
12720
|
+
birthSurname: zodOpenapi.z.string().nullable(),
|
|
12721
|
+
vocativeTitle: zodOpenapi.z.string().nullable(),
|
|
12722
|
+
deathDate: zodOpenapi.z.coerce.date().nullable(),
|
|
12723
|
+
deathNotification: zodOpenapi.z.coerce.date().nullable(),
|
|
12724
|
+
pin: zodOpenapi.z.string().nullable(),
|
|
12725
|
+
stayAbroad: zodOpenapi.z.boolean().nullable(),
|
|
12726
|
+
stayAbroadCountries: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).nullable(),
|
|
12727
|
+
createdAt: zodOpenapi.z.coerce.date().nullable(),
|
|
12728
|
+
updatedAt: zodOpenapi.z.coerce.date().nullable()
|
|
12729
|
+
});
|
|
12730
|
+
|
|
12731
|
+
createInsertSchema(organization);
|
|
12732
|
+
createUpdateSchema(organization);
|
|
12733
|
+
createSelectSchema(organization);
|
|
12734
|
+
const organizationInsertSchema = zodOpenapi.z.object({
|
|
12735
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12736
|
+
businessName: zodOpenapi.z.string(),
|
|
12737
|
+
email: zodOpenapi.z.email("Invalid email format").optional().nullable(),
|
|
12738
|
+
phone: zodOpenapi.z.string().optional().nullable(),
|
|
12739
|
+
registeredNumber: zodOpenapi.z.string(),
|
|
12740
|
+
registeredIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
12741
|
+
operatesIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
12742
|
+
presentIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
12743
|
+
monthlyVolumeIn: zodOpenapi.z.number(),
|
|
12744
|
+
monthlyVolumeOut: zodOpenapi.z.number(),
|
|
12745
|
+
ownedBy: zodOpenapi.z.string(),
|
|
12746
|
+
companyObjects: zodOpenapi.z.string(),
|
|
12747
|
+
annualTurnover: zodOpenapi.z.number(),
|
|
12748
|
+
numberOfEmployees: zodOpenapi.z.number().optional().nullable(),
|
|
12749
|
+
prosecuted: zodOpenapi.z.string().optional().nullable(),
|
|
12750
|
+
location: zodOpenapi.z.string().optional().nullable(),
|
|
12751
|
+
fileNumber: zodOpenapi.z.string().optional().nullable(),
|
|
12752
|
+
websiteUrl: zodOpenapi.z.url("Invalid website URL").optional().nullable(),
|
|
12753
|
+
vatPayer: zodOpenapi.z.boolean(),
|
|
12754
|
+
companyObjectsDescription: zodOpenapi.z.string(),
|
|
12755
|
+
turnover3years: zodOpenapi.z.number(),
|
|
12756
|
+
operationCountries: zodOpenapi.z.string(),
|
|
12757
|
+
riskyBusinessType: zodOpenapi.z.string().optional().nullable()
|
|
12758
|
+
});
|
|
12759
|
+
const organizationUpdateSchema$1 = zodOpenapi.z.object({
|
|
12760
|
+
partyId: zodOpenapi.z.uuid().optional(),
|
|
12761
|
+
id: zodOpenapi.z.uuid(),
|
|
12762
|
+
businessName: zodOpenapi.z.string().optional(),
|
|
12763
|
+
email: zodOpenapi.z.email("Invalid email format").optional().nullable(),
|
|
12764
|
+
phone: zodOpenapi.z.string().optional().nullable(),
|
|
12765
|
+
registeredNumber: zodOpenapi.z.string().optional(),
|
|
12766
|
+
registeredIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
12767
|
+
operatesIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
12768
|
+
presentIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
12769
|
+
monthlyVolumeIn: zodOpenapi.z.number().optional(),
|
|
12770
|
+
monthlyVolumeOut: zodOpenapi.z.number().optional(),
|
|
12771
|
+
ownedBy: zodOpenapi.z.string().optional(),
|
|
12772
|
+
companyObjects: zodOpenapi.z.string().optional(),
|
|
12773
|
+
annualTurnover: zodOpenapi.z.number().optional(),
|
|
12774
|
+
numberOfEmployees: zodOpenapi.z.number().optional().nullable(),
|
|
12775
|
+
prosecuted: zodOpenapi.z.string().optional().nullable(),
|
|
12776
|
+
location: zodOpenapi.z.string().optional().nullable(),
|
|
12777
|
+
fileNumber: zodOpenapi.z.string().optional().nullable(),
|
|
12778
|
+
websiteUrl: zodOpenapi.z.url("Invalid website URL").optional().nullable(),
|
|
12779
|
+
vatPayer: zodOpenapi.z.boolean().optional(),
|
|
12780
|
+
companyObjectsDescription: zodOpenapi.z.string(),
|
|
12781
|
+
turnover3years: zodOpenapi.z.number(),
|
|
12782
|
+
operationCountries: zodOpenapi.z.string(),
|
|
12783
|
+
riskyBusinessType: zodOpenapi.z.string().optional().nullable()
|
|
12784
|
+
});
|
|
12785
|
+
const organizationOutputSchema = zodOpenapi.z.object({
|
|
12786
|
+
id: zodOpenapi.z.uuid(),
|
|
12787
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12788
|
+
internalId: zodOpenapi.z.string().nullable(),
|
|
12789
|
+
businessName: zodOpenapi.z.string(),
|
|
12790
|
+
email: zodOpenapi.z.string().nullable(),
|
|
12791
|
+
phone: zodOpenapi.z.string().nullable(),
|
|
12792
|
+
registeredNumber: zodOpenapi.z.string(),
|
|
12793
|
+
registeredIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
12794
|
+
operatesIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
12795
|
+
presentIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
12796
|
+
monthlyVolumeIn: zodOpenapi.z.number(),
|
|
12797
|
+
monthlyVolumeOut: zodOpenapi.z.number(),
|
|
12798
|
+
ownedBy: zodOpenapi.z.string(),
|
|
12799
|
+
companyObjects: zodOpenapi.z.string(),
|
|
12800
|
+
annualTurnover: zodOpenapi.z.number(),
|
|
12801
|
+
numberOfEmployees: zodOpenapi.z.number().nullable(),
|
|
12802
|
+
prosecuted: zodOpenapi.z.string().nullable(),
|
|
12803
|
+
location: zodOpenapi.z.string().nullable(),
|
|
12804
|
+
fileNumber: zodOpenapi.z.string().nullable(),
|
|
12805
|
+
websiteUrl: zodOpenapi.z.string().nullable(),
|
|
12806
|
+
vatPayer: zodOpenapi.z.boolean(),
|
|
12807
|
+
companyObjectsDescription: zodOpenapi.z.string(),
|
|
12808
|
+
turnover3years: zodOpenapi.z.number(),
|
|
12809
|
+
operationCountries: zodOpenapi.z.string(),
|
|
12810
|
+
riskyBusinessType: zodOpenapi.z.string().nullable(),
|
|
12811
|
+
stayAbroad: zodOpenapi.z.boolean().nullable(),
|
|
12812
|
+
stayAbroadCountries: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).nullable(),
|
|
12813
|
+
createdAt: zodOpenapi.z.coerce.date().nullable(),
|
|
12814
|
+
updatedAt: zodOpenapi.z.coerce.date().nullable()
|
|
12815
|
+
});
|
|
12816
|
+
const organizationSelectSchema = organizationOutputSchema;
|
|
12817
|
+
zodOpenapi.z.array(organizationOutputSchema);
|
|
12818
|
+
|
|
12819
|
+
zodOpenapi.z.discriminatedUnion("partyType", [
|
|
12820
|
+
zodOpenapi.z.object({
|
|
12821
|
+
partyType: zodOpenapi.z.literal("INDIVIDUAL"),
|
|
12822
|
+
data: individualInsertSchema$1
|
|
12823
|
+
}),
|
|
12824
|
+
zodOpenapi.z.object({
|
|
12825
|
+
partyType: zodOpenapi.z.literal("ORGANIZATION"),
|
|
12826
|
+
data: organizationInsertSchema
|
|
12827
|
+
})
|
|
12828
|
+
]);
|
|
12829
|
+
const disponentCreateSchema = zodOpenapi.z.discriminatedUnion("partyType", [
|
|
12830
|
+
zodOpenapi.z.object({
|
|
12831
|
+
partyType: zodOpenapi.z.literal("INDIVIDUAL"),
|
|
12832
|
+
data: individualInsertSchema$1.omit({ partyId: true })
|
|
12833
|
+
}),
|
|
12834
|
+
zodOpenapi.z.object({
|
|
12835
|
+
partyType: zodOpenapi.z.literal("ORGANIZATION"),
|
|
12836
|
+
data: organizationInsertSchema.omit({ partyId: true })
|
|
12837
|
+
})
|
|
12838
|
+
]);
|
|
12839
|
+
const disponentUpdateSchema$1 = zodOpenapi.z.discriminatedUnion("partyType", [
|
|
12840
|
+
zodOpenapi.z.object({
|
|
12841
|
+
partyType: zodOpenapi.z.literal("INDIVIDUAL"),
|
|
12842
|
+
data: individualUpdateSchema$1
|
|
12843
|
+
}),
|
|
12844
|
+
zodOpenapi.z.object({
|
|
12845
|
+
partyType: zodOpenapi.z.literal("ORGANIZATION"),
|
|
12846
|
+
data: organizationUpdateSchema$1
|
|
12847
|
+
})
|
|
12848
|
+
]);
|
|
12849
|
+
const disponentSelectSchema = zodOpenapi.z.discriminatedUnion("partyType", [
|
|
12850
|
+
zodOpenapi.z.object({
|
|
12851
|
+
partyType: zodOpenapi.z.literal("INDIVIDUAL"),
|
|
12852
|
+
data: individualSelectSchema
|
|
12853
|
+
}),
|
|
12854
|
+
zodOpenapi.z.object({
|
|
12855
|
+
partyType: zodOpenapi.z.literal("ORGANIZATION"),
|
|
12856
|
+
data: organizationSelectSchema
|
|
12857
|
+
})
|
|
12858
|
+
]);
|
|
12859
|
+
zodOpenapi.z.array(disponentSelectSchema).optional();
|
|
12860
|
+
zodOpenapi.z.array(disponentUpdateSchema$1).optional();
|
|
12861
|
+
|
|
12862
|
+
createInsertSchema(idDocument);
|
|
12863
|
+
createUpdateSchema(idDocument);
|
|
12864
|
+
createSelectSchema(idDocument);
|
|
12865
|
+
const idDocumentInsertSchema = zodOpenapi.z.object({
|
|
12866
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12867
|
+
internalId: zodOpenapi.z.string().optional().nullable(),
|
|
12868
|
+
idDocType: zodOpenapi.z.enum(IdDocTypeZod),
|
|
12869
|
+
idDocNumber: zodOpenapi.z.string(),
|
|
12870
|
+
idDocHolderName: zodOpenapi.z.string(),
|
|
12871
|
+
issueDate: zodOpenapi.z.date().optional().nullable(),
|
|
12872
|
+
expirationDate: zodOpenapi.z.date().optional().nullable(),
|
|
12873
|
+
issuer: zodOpenapi.z.string().optional().nullable(),
|
|
12874
|
+
countryOfIssue: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional().nullable(),
|
|
12875
|
+
frontImageUri: zodOpenapi.z.url().optional().nullable(),
|
|
12876
|
+
backImageUri: zodOpenapi.z.url().optional().nullable(),
|
|
12877
|
+
idDocStatus: zodOpenapi.z.enum(IdDocStatusZod).optional().nullable()
|
|
12878
|
+
});
|
|
12879
|
+
const idDocumentUpdateSchema = zodOpenapi.z.object({
|
|
12880
|
+
id: zodOpenapi.z.uuid(),
|
|
12881
|
+
partyId: zodOpenapi.z.uuid().optional(),
|
|
12882
|
+
internalId: zodOpenapi.z.string().optional().nullable(),
|
|
12883
|
+
idDocType: zodOpenapi.z.enum(IdDocTypeZod).optional(),
|
|
12884
|
+
idDocNumber: zodOpenapi.z.string().optional(),
|
|
12885
|
+
idDocHolderName: zodOpenapi.z.string().optional(),
|
|
12886
|
+
issueDate: zodOpenapi.z.date().optional().nullable(),
|
|
12887
|
+
expirationDate: zodOpenapi.z.date().optional().nullable(),
|
|
12888
|
+
issuer: zodOpenapi.z.string().optional().nullable(),
|
|
12889
|
+
countryOfIssue: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional().nullable(),
|
|
12890
|
+
frontImageUri: zodOpenapi.z.url("Invalid URL format").optional().nullable(),
|
|
12891
|
+
backImageUri: zodOpenapi.z.url("Invalid URL format").optional().nullable(),
|
|
12892
|
+
idDocStatus: zodOpenapi.z.enum(IdDocStatusZod).optional().nullable()
|
|
12893
|
+
});
|
|
12894
|
+
|
|
12895
|
+
const recipientBaseInsertSchema = createInsertSchema(recipient);
|
|
12896
|
+
createUpdateSchema(recipient);
|
|
12897
|
+
createSelectSchema(recipient);
|
|
12898
|
+
const recipientUpsertSchema = recipientBaseInsertSchema.required({
|
|
12899
|
+
id: true
|
|
12900
|
+
});
|
|
12901
|
+
const recipientInsertSchema = bankAccountInsertSchema;
|
|
12902
|
+
const recipientUpdateSchema = bankAccountUpdateSchema;
|
|
12903
|
+
const recipientSelectSchema = bankAccountSelectSchema;
|
|
12904
|
+
|
|
12905
|
+
createInsertSchema(party);
|
|
12906
|
+
createUpdateSchema(party);
|
|
12907
|
+
const partySchema$1 = zodOpenapi.z.object({
|
|
12908
|
+
partyType: zodOpenapi.z.enum(PartyTypeZod),
|
|
12909
|
+
language: zodOpenapi.z.enum(generalCodes.LANGUAGE_CODES),
|
|
12910
|
+
id: zodOpenapi.z.uuid().nullable(),
|
|
12911
|
+
note: zodOpenapi.z.string().optional(),
|
|
12912
|
+
countryCode: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
12913
|
+
customerStatus: zodOpenapi.z.enum(CustomerStatusZod).optional(),
|
|
12914
|
+
legacyId: zodOpenapi.z.string().optional()
|
|
12915
|
+
});
|
|
12916
|
+
const partyOutputSchema$1 = zodOpenapi.z.object({
|
|
12917
|
+
internalId: zodOpenapi.z.string().nullable(),
|
|
12918
|
+
customerStatus: zodOpenapi.z.enum(CustomerStatusZod),
|
|
12919
|
+
partyType: zodOpenapi.z.enum(PartyTypeZod),
|
|
12920
|
+
language: zodOpenapi.z.enum(generalCodes.LANGUAGE_CODES),
|
|
12921
|
+
id: zodOpenapi.z.uuid(),
|
|
12922
|
+
note: zodOpenapi.z.string().nullable(),
|
|
12923
|
+
countryCode: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).nullable(),
|
|
12924
|
+
isClient: zodOpenapi.z.boolean(),
|
|
12925
|
+
createdAt: zodOpenapi.z.date().nullable(),
|
|
12926
|
+
updatedAt: zodOpenapi.z.date().nullable()
|
|
12927
|
+
});
|
|
12928
|
+
const createPartySchema = partySchema$1.omit({ id: true });
|
|
12929
|
+
zodOpenapi.z.object({
|
|
12930
|
+
party: createPartySchema,
|
|
12931
|
+
personalData: individualInsertSchema$1.omit({ partyId: true }).nullable(),
|
|
12932
|
+
organizationData: organizationInsertSchema.omit({ partyId: true }).nullable(),
|
|
12933
|
+
bankAccounts: zodOpenapi.z.array(bankAccountInsertSchema.omit({ partyId: true })).nullable(),
|
|
12934
|
+
recipients: zodOpenapi.z.array(recipientInsertSchema.omit({ partyId: true })).nullable(),
|
|
12935
|
+
disponents: zodOpenapi.z.array(disponentCreateSchema).nullable(),
|
|
12936
|
+
addresses: zodOpenapi.z.array(addressInsertSchema.omit({ partyId: true })),
|
|
12937
|
+
aml: amlInsertSchema.omit({ partyId: true })
|
|
12938
|
+
});
|
|
12939
|
+
zodOpenapi.z.object({
|
|
12940
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12941
|
+
party: partySchema$1,
|
|
12942
|
+
personalData: individualUpdateSchema$1.optional(),
|
|
12943
|
+
organizationData: organizationUpdateSchema$1.optional(),
|
|
12944
|
+
bankAccounts: zodOpenapi.z.array(bankAccountUpsertSchema).optional(),
|
|
12945
|
+
recipients: zodOpenapi.z.array(recipientUpsertSchema).optional(),
|
|
12946
|
+
disponents: zodOpenapi.z.array(disponentUpdateSchema$1).optional(),
|
|
12947
|
+
addresses: zodOpenapi.z.array(addressUpdateSchema).optional(),
|
|
12948
|
+
aml: amlUpdateSchema.optional()
|
|
12949
|
+
});
|
|
12950
|
+
const partySelectOutputSchema = zodOpenapi.z.object({
|
|
12951
|
+
party: partyOutputSchema$1.nullable(),
|
|
12952
|
+
personalData: individualSelectSchema.nullable(),
|
|
12953
|
+
organizationData: organizationSelectSchema.nullable(),
|
|
12954
|
+
aml: amlSelectSchema.nullable(),
|
|
12955
|
+
bankAccounts: zodOpenapi.z.array(bankAccountSelectSchema).nullable(),
|
|
12956
|
+
disponents: zodOpenapi.z.array(disponentSelectSchema).nullable(),
|
|
12957
|
+
addresses: zodOpenapi.z.array(addressSelectSchema).nullable(),
|
|
12958
|
+
recipients: zodOpenapi.z.array(recipientSelectSchema).nullable()
|
|
12959
|
+
});
|
|
12960
|
+
zodOpenapi.z.array(partySelectOutputSchema);
|
|
12961
|
+
const partySelectDataSchema = zodOpenapi.z.object({
|
|
12962
|
+
party: partyOutputSchema$1.nullable(),
|
|
12963
|
+
personalData: individualSelectSchema.nullable(),
|
|
12964
|
+
organizationData: organizationSelectSchema.nullable(),
|
|
12965
|
+
aml: amlSelectSchema.nullable()
|
|
12966
|
+
});
|
|
12967
|
+
const partySelectArrayDataSchema = zodOpenapi.z.object({
|
|
12968
|
+
bankAccounts: zodOpenapi.z.array(bankAccountSelectSchema).nullable(),
|
|
12969
|
+
addresses: zodOpenapi.z.array(addressSelectSchema).nullable(),
|
|
12970
|
+
disponents: zodOpenapi.z.array(disponentSelectSchema).nullable(),
|
|
12971
|
+
recipients: zodOpenapi.z.array(recipientSelectSchema).nullable()
|
|
12972
|
+
});
|
|
12973
|
+
zodOpenapi.z.object({
|
|
12974
|
+
...partySelectDataSchema.shape,
|
|
12975
|
+
...partySelectArrayDataSchema.shape
|
|
12976
|
+
});
|
|
12977
|
+
|
|
12978
|
+
createInsertSchema(partyChange);
|
|
12979
|
+
createUpdateSchema(partyChange);
|
|
12980
|
+
createSelectSchema(partyChange);
|
|
12981
|
+
zodOpenapi.z.object({
|
|
12982
|
+
partyId: zodOpenapi.z.uuid().optional().nullable(),
|
|
12983
|
+
internalId: zodOpenapi.z.string().optional().nullable(),
|
|
12984
|
+
operation: zodOpenapi.z.string(),
|
|
12985
|
+
diff: zodOpenapi.z.json(),
|
|
12986
|
+
snapshotBefore: zodOpenapi.z.json(),
|
|
12987
|
+
snapshotAfter: zodOpenapi.z.json()
|
|
12988
|
+
});
|
|
12989
|
+
zodOpenapi.z.object({
|
|
12990
|
+
id: zodOpenapi.z.uuid(),
|
|
12991
|
+
partyId: zodOpenapi.z.uuid().optional().nullable(),
|
|
12992
|
+
internalId: zodOpenapi.z.string().optional().nullable(),
|
|
12993
|
+
operation: zodOpenapi.z.string().optional(),
|
|
12994
|
+
diff: zodOpenapi.z.json().optional(),
|
|
12995
|
+
snapshotBefore: zodOpenapi.z.json().optional(),
|
|
12996
|
+
snapshotAfter: zodOpenapi.z.json().optional()
|
|
12997
|
+
});
|
|
12998
|
+
|
|
12999
|
+
createInsertSchema(partyRelationship);
|
|
13000
|
+
createUpdateSchema(partyRelationship);
|
|
13001
|
+
createSelectSchema(partyRelationship);
|
|
13002
|
+
zodOpenapi.z.object({
|
|
13003
|
+
relationshipType: zodOpenapi.z.enum(PartyRelationshipTypeZod).optional(),
|
|
13004
|
+
frompartyId: zodOpenapi.z.uuid().optional().nullable(),
|
|
13005
|
+
internalId: zodOpenapi.z.string().optional().nullable(),
|
|
13006
|
+
topartyId: zodOpenapi.z.uuid().optional().nullable(),
|
|
13007
|
+
fromDate: zodOpenapi.z.date().optional().nullable(),
|
|
13008
|
+
sharePercentage: zodOpenapi.z.number().max(100).optional().nullable()
|
|
13009
|
+
});
|
|
13010
|
+
zodOpenapi.z.object({
|
|
13011
|
+
id: zodOpenapi.z.uuid(),
|
|
13012
|
+
relationshipType: zodOpenapi.z.enum(PartyRelationshipTypeZod).optional(),
|
|
13013
|
+
frompartyId: zodOpenapi.z.uuid().optional().nullable(),
|
|
13014
|
+
internalId: zodOpenapi.z.string().optional().nullable(),
|
|
13015
|
+
topartyId: zodOpenapi.z.uuid().optional().nullable(),
|
|
13016
|
+
fromDate: zodOpenapi.z.date().optional().nullable(),
|
|
13017
|
+
sharePercentage: zodOpenapi.z.number().max(100).optional().nullable()
|
|
13018
|
+
});
|
|
13019
|
+
|
|
13020
|
+
createInsertSchema(taxResidence);
|
|
13021
|
+
createUpdateSchema(taxResidence);
|
|
13022
|
+
createSelectSchema(taxResidence);
|
|
13023
|
+
zodOpenapi.z.object({
|
|
13024
|
+
partyId: zodOpenapi.z.uuid(),
|
|
13025
|
+
country: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13026
|
+
taxIdentificationNumber: zodOpenapi.z.string()
|
|
13027
|
+
});
|
|
13028
|
+
zodOpenapi.z.object({
|
|
13029
|
+
id: zodOpenapi.z.uuid(),
|
|
13030
|
+
partyId: zodOpenapi.z.uuid().optional(),
|
|
13031
|
+
country: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
13032
|
+
taxIdentificationNumber: zodOpenapi.z.string().optional()
|
|
13033
|
+
});
|
|
13034
|
+
|
|
13035
|
+
createInsertSchema(trader);
|
|
13036
|
+
createUpdateSchema(trader);
|
|
13037
|
+
createSelectSchema(trader);
|
|
13038
|
+
const traderInsertSchema = zodOpenapi.z.object({
|
|
13039
|
+
type: zodOpenapi.z.enum(TRADER_TYPE),
|
|
13040
|
+
commission: zodOpenapi.z.number(),
|
|
13041
|
+
firstName: zodOpenapi.z.string().optional(),
|
|
13042
|
+
lastName: zodOpenapi.z.string().optional(),
|
|
13043
|
+
companyName: zodOpenapi.z.string().optional(),
|
|
13044
|
+
ico: zodOpenapi.z.string().optional(),
|
|
13045
|
+
dic: zodOpenapi.z.string().optional(),
|
|
13046
|
+
legacyId: zodOpenapi.z.string().optional()
|
|
13047
|
+
});
|
|
13048
|
+
const traderUpdateSchema = zodOpenapi.z.object({
|
|
13049
|
+
id: zodOpenapi.z.uuid(),
|
|
13050
|
+
type: zodOpenapi.z.enum(TRADER_TYPE).optional(),
|
|
13051
|
+
commission: zodOpenapi.z.number().optional(),
|
|
13052
|
+
internalId: zodOpenapi.z.string().optional(),
|
|
13053
|
+
firstName: zodOpenapi.z.string().optional(),
|
|
13054
|
+
lastName: zodOpenapi.z.string().optional(),
|
|
13055
|
+
companyName: zodOpenapi.z.string().optional(),
|
|
13056
|
+
ico: zodOpenapi.z.string().optional(),
|
|
13057
|
+
dic: zodOpenapi.z.string().optional(),
|
|
13058
|
+
legacyId: zodOpenapi.z.string().optional()
|
|
13059
|
+
});
|
|
13060
|
+
zodOpenapi.z.object({
|
|
13061
|
+
id: zodOpenapi.z.uuid(),
|
|
13062
|
+
createdAt: zodOpenapi.z.coerce.date().nullable(),
|
|
13063
|
+
updatedAt: zodOpenapi.z.coerce.date().nullable(),
|
|
13064
|
+
deletedAt: zodOpenapi.z.coerce.date().nullable(),
|
|
13065
|
+
type: zodOpenapi.z.enum(TRADER_TYPE),
|
|
13066
|
+
commission: zodOpenapi.z.number(),
|
|
13067
|
+
internalId: zodOpenapi.z.string().nullable(),
|
|
13068
|
+
firstName: zodOpenapi.z.string().nullable(),
|
|
13069
|
+
lastName: zodOpenapi.z.string().nullable(),
|
|
13070
|
+
companyName: zodOpenapi.z.string().nullable(),
|
|
13071
|
+
ico: zodOpenapi.z.string().nullable(),
|
|
13072
|
+
dic: zodOpenapi.z.string().nullable(),
|
|
13073
|
+
legacyId: zodOpenapi.z.string().nullable()
|
|
13074
|
+
});
|
|
13075
|
+
|
|
13076
|
+
zod.z.object({
|
|
13077
|
+
recipient: recipientInsertSchema,
|
|
13078
|
+
partyId: zod.z.string().uuid()
|
|
13079
|
+
});
|
|
13080
|
+
|
|
13081
|
+
zod.z.object({
|
|
13082
|
+
recipient: recipientUpdateSchema
|
|
13083
|
+
});
|
|
13084
|
+
|
|
13085
|
+
zod.z.object({
|
|
13086
|
+
id: zod.z.uuid()
|
|
13087
|
+
});
|
|
13088
|
+
|
|
13089
|
+
const ALLOWED_RECIPIENTS_FILTERS = {
|
|
13090
|
+
NAME: "filterRecipientName",
|
|
13091
|
+
BANK_CODE: "filterRecipientBankCode",
|
|
13092
|
+
CURRENCY: "filterRecipientCurrency"
|
|
13093
|
+
};
|
|
13094
|
+
zod.z.object({
|
|
13095
|
+
page: zod.z.number().positive(),
|
|
13096
|
+
limit: zod.z.number().positive(),
|
|
13097
|
+
sort: zod.z.object({
|
|
13098
|
+
column: zod.z.string(),
|
|
13099
|
+
direction: zod.z.enum(["asc", "desc"])
|
|
13100
|
+
}),
|
|
13101
|
+
[ALLOWED_RECIPIENTS_FILTERS.NAME]: zod.z.union([zod.z.string(), zod.z.string().array()]).optional(),
|
|
13102
|
+
[ALLOWED_RECIPIENTS_FILTERS.BANK_CODE]: zod.z.union([zod.z.enum(generalCodes.BANK_CODES), zod.z.enum(generalCodes.BANK_CODES).array()]).optional(),
|
|
13103
|
+
[ALLOWED_RECIPIENTS_FILTERS.CURRENCY]: zod.z.union([zod.z.enum(generalCodes.CURRENCY_CODES), zod.z.enum(generalCodes.CURRENCY_CODES).array()]).optional(),
|
|
13104
|
+
search: zod.z.string().optional()
|
|
13105
|
+
});
|
|
13106
|
+
|
|
13107
|
+
zod.z.object({
|
|
13108
|
+
id: zod.z.uuid()
|
|
13109
|
+
});
|
|
13110
|
+
|
|
13111
|
+
zod.z.object({
|
|
13112
|
+
trader: traderInsertSchema
|
|
13113
|
+
});
|
|
13114
|
+
|
|
13115
|
+
zod.z.object({
|
|
13116
|
+
trader: traderUpdateSchema
|
|
13117
|
+
});
|
|
13118
|
+
|
|
13119
|
+
zod.z.object({
|
|
13120
|
+
id: zod.z.uuid()
|
|
13121
|
+
});
|
|
13122
|
+
|
|
13123
|
+
zod.z.object({
|
|
13124
|
+
page: zod.z.number().positive(),
|
|
13125
|
+
limit: zod.z.number().positive(),
|
|
13126
|
+
sort: zod.z.object({
|
|
13127
|
+
column: zod.z.string(),
|
|
13128
|
+
direction: zod.z.enum(["asc", "desc"])
|
|
13129
|
+
}),
|
|
13130
|
+
search: zod.z.string().optional(),
|
|
13131
|
+
ids: zod.z.array(zod.z.uuid()).optional()
|
|
13132
|
+
});
|
|
13133
|
+
|
|
13134
|
+
zod.z.object({
|
|
13135
|
+
id: zod.z.uuid()
|
|
13136
|
+
});
|
|
13137
|
+
|
|
13138
|
+
zod.z.object({
|
|
13139
|
+
traderId: zod.z.uuid(),
|
|
13140
|
+
clientId: zod.z.uuid()
|
|
13141
|
+
});
|
|
13142
|
+
zod.z.object({
|
|
13143
|
+
id: zod.z.uuid()
|
|
13144
|
+
});
|
|
13145
|
+
|
|
13146
|
+
zod.z.object({
|
|
13147
|
+
id: zod.z.uuid()
|
|
13148
|
+
});
|
|
13149
|
+
|
|
13150
|
+
zod.z.object({
|
|
13151
|
+
bankAccount: bankAccountInsertSchema,
|
|
13152
|
+
partyId: zod.z.string().uuid()
|
|
13153
|
+
});
|
|
13154
|
+
|
|
13155
|
+
zod.z.object({
|
|
13156
|
+
bankAccount: bankAccountUpsertSchema
|
|
13157
|
+
});
|
|
13158
|
+
|
|
13159
|
+
zod.z.object({
|
|
13160
|
+
id: zod.z.uuid()
|
|
13161
|
+
});
|
|
13162
|
+
|
|
13163
|
+
zod.z.object({
|
|
13164
|
+
id: zod.z.uuid()
|
|
13165
|
+
});
|
|
13166
|
+
|
|
13167
|
+
zod.z.object({
|
|
13168
|
+
address: addressInsertSchema,
|
|
13169
|
+
partyId: zod.z.uuid()
|
|
13170
|
+
});
|
|
13171
|
+
|
|
13172
|
+
zod.z.object({
|
|
13173
|
+
address: addressUpdateSchema
|
|
13174
|
+
});
|
|
13175
|
+
|
|
13176
|
+
zod.z.object({
|
|
13177
|
+
id: zod.z.uuid()
|
|
13178
|
+
});
|
|
13179
|
+
|
|
13180
|
+
zod.z.object({
|
|
13181
|
+
contact: contactInsertSchema,
|
|
13182
|
+
partyId: zod.z.string().uuid()
|
|
13183
|
+
});
|
|
13184
|
+
|
|
13185
|
+
zod.z.object({
|
|
13186
|
+
contact: contactUpdateSchema
|
|
13187
|
+
});
|
|
13188
|
+
|
|
13189
|
+
zod.z.object({
|
|
13190
|
+
idDocument: idDocumentInsertSchema,
|
|
13191
|
+
partyId: zod.z.string()
|
|
13192
|
+
});
|
|
13193
|
+
|
|
13194
|
+
zod.z.object({
|
|
13195
|
+
idDocument: idDocumentUpdateSchema
|
|
13196
|
+
});
|
|
13197
|
+
|
|
13198
|
+
zod.z.object({
|
|
13199
|
+
id: zod.z.uuid()
|
|
13200
|
+
});
|
|
13201
|
+
|
|
13202
|
+
const ALLOWED_ID_DOCUMENTS_FILTERS = {
|
|
13203
|
+
PARTY_ID: "filterIdDocumentPartyId",
|
|
13204
|
+
ISSUER: "filterIdDocumentIssuer"
|
|
13205
|
+
};
|
|
13206
|
+
zod.z.object({
|
|
13207
|
+
pagination: zod.z.object({
|
|
13208
|
+
page: zod.z.number().positive(),
|
|
13209
|
+
limit: zod.z.number().positive(),
|
|
13210
|
+
sort: zod.z.object({
|
|
13211
|
+
column: zod.z.string(),
|
|
13212
|
+
direction: zod.z.enum(["asc", "desc"])
|
|
13213
|
+
}),
|
|
13214
|
+
[ALLOWED_ID_DOCUMENTS_FILTERS.PARTY_ID]: zod.z.union([zod.z.uuid(), zod.z.uuid().array()]).optional(),
|
|
13215
|
+
[ALLOWED_ID_DOCUMENTS_FILTERS.ISSUER]: zod.z.union([zod.z.string(), zod.z.string().array()]).optional(),
|
|
13216
|
+
search: zod.z.string().optional()
|
|
13217
|
+
})
|
|
13218
|
+
});
|
|
13219
|
+
|
|
13220
|
+
zod.z.object({
|
|
13221
|
+
id: zod.z.uuid()
|
|
13222
|
+
});
|
|
13223
|
+
|
|
13224
|
+
zod.z.object({
|
|
13225
|
+
id: zod.z.uuid()
|
|
13226
|
+
});
|
|
13227
|
+
|
|
13228
|
+
zod.z.object({
|
|
13229
|
+
organization: organizationInsertSchema
|
|
13230
|
+
});
|
|
13231
|
+
|
|
13232
|
+
zod.z.object({
|
|
13233
|
+
organization: organizationInsertSchema
|
|
13234
|
+
});
|
|
13235
|
+
|
|
13236
|
+
zod.z.object({
|
|
13237
|
+
id: zod.z.uuid()
|
|
13238
|
+
});
|
|
13239
|
+
|
|
13240
|
+
zod.z.object({
|
|
13241
|
+
id: zod.z.uuid()
|
|
13242
|
+
});
|
|
13243
|
+
|
|
13244
|
+
zod.z.object({
|
|
13245
|
+
individual: individualInsertSchema$1
|
|
13246
|
+
});
|
|
13247
|
+
|
|
13248
|
+
zod.z.object({
|
|
13249
|
+
individual: individualInsertSchema$1
|
|
13250
|
+
});
|
|
13251
|
+
|
|
13252
|
+
zod.z.object({
|
|
13253
|
+
id: zod.z.uuid()
|
|
13254
|
+
});
|
|
13255
|
+
|
|
13256
|
+
zod.z.object({
|
|
13257
|
+
id: zod.z.uuid()
|
|
13258
|
+
});
|
|
13259
|
+
|
|
13260
|
+
zod.z.object({
|
|
13261
|
+
aml: amlInsertSchema
|
|
13262
|
+
});
|
|
13263
|
+
|
|
13264
|
+
zod.z.object({
|
|
13265
|
+
aml: amlInsertSchema
|
|
13266
|
+
});
|
|
13267
|
+
|
|
13268
|
+
zod.z.object({
|
|
13269
|
+
id: zod.z.uuid()
|
|
13270
|
+
});
|
|
13271
|
+
|
|
13272
|
+
const individualInsertSchema = zodOpenapi.z.object({
|
|
13273
|
+
partyId: zodOpenapi.z.uuid(),
|
|
13274
|
+
internalId: zodOpenapi.z.string().optional(),
|
|
13275
|
+
name: zodOpenapi.z.string(),
|
|
13276
|
+
surname: zodOpenapi.z.string(),
|
|
13277
|
+
email: zodOpenapi.z.string().optional(),
|
|
13278
|
+
phone: zodOpenapi.z.string().optional(),
|
|
13279
|
+
birthDate: zodOpenapi.z.string().optional(),
|
|
13280
|
+
birthPlace: zodOpenapi.z.string(),
|
|
13281
|
+
countryOfBirth: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
13282
|
+
personalId: zodOpenapi.z.string(),
|
|
13283
|
+
gender: zodOpenapi.z.enum(GenderZod),
|
|
13284
|
+
citizenship: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13285
|
+
citizenshipOther: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
13286
|
+
employer: zodOpenapi.z.string().optional(),
|
|
13287
|
+
employerCountry: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
13288
|
+
registeredNumber: zodOpenapi.z.string(),
|
|
13289
|
+
isPep: zodOpenapi.z.boolean(),
|
|
13290
|
+
titleBefore: zodOpenapi.z.string().optional(),
|
|
13291
|
+
titleAfter: zodOpenapi.z.string().optional(),
|
|
13292
|
+
birthSurname: zodOpenapi.z.string().optional(),
|
|
13293
|
+
vocativeTitle: zodOpenapi.z.string().optional(),
|
|
13294
|
+
deathDate: zodOpenapi.z.date().optional(),
|
|
13295
|
+
deathNotification: zodOpenapi.z.date().optional(),
|
|
13296
|
+
pin: zodOpenapi.z.string().optional(),
|
|
13297
|
+
stayAbroad: zodOpenapi.z.boolean().optional(),
|
|
13298
|
+
stayAbroadCountries: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional()
|
|
13299
|
+
});
|
|
13300
|
+
const individualUpdateSchema = zodOpenapi.z.object({
|
|
13301
|
+
id: zodOpenapi.z.uuid(),
|
|
13302
|
+
partyId: zodOpenapi.z.uuid(),
|
|
13303
|
+
internalId: zodOpenapi.z.string().optional(),
|
|
13304
|
+
name: zodOpenapi.z.string().optional(),
|
|
13305
|
+
surname: zodOpenapi.z.string().optional(),
|
|
13306
|
+
email: zodOpenapi.z.string().optional(),
|
|
13307
|
+
phone: zodOpenapi.z.string().optional(),
|
|
13308
|
+
birthDate: zodOpenapi.z.string().optional(),
|
|
13309
|
+
birthPlace: zodOpenapi.z.string().optional(),
|
|
13310
|
+
countryOfBirth: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
13311
|
+
personalId: zodOpenapi.z.string().optional(),
|
|
13312
|
+
gender: zodOpenapi.z.enum(GenderZod).optional(),
|
|
13313
|
+
citizenship: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
13314
|
+
citizenshipOther: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
13315
|
+
employer: zodOpenapi.z.string().optional(),
|
|
13316
|
+
employerCountry: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
13317
|
+
registeredNumber: zodOpenapi.z.string().optional(),
|
|
13318
|
+
isPep: zodOpenapi.z.boolean().optional(),
|
|
13319
|
+
titleBefore: zodOpenapi.z.string().optional(),
|
|
13320
|
+
titleAfter: zodOpenapi.z.string().optional(),
|
|
13321
|
+
birthSurname: zodOpenapi.z.string().optional(),
|
|
13322
|
+
vocativeTitle: zodOpenapi.z.string().optional(),
|
|
13323
|
+
deathDate: zodOpenapi.z.date().optional(),
|
|
13324
|
+
deathNotification: zodOpenapi.z.date().optional(),
|
|
13325
|
+
pin: zodOpenapi.z.string().optional(),
|
|
13326
|
+
stayAbroad: zodOpenapi.z.boolean().optional(),
|
|
13327
|
+
stayAbroadCountries: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional()
|
|
13328
|
+
});
|
|
13329
|
+
const individualOutputSchema = zodOpenapi.z.object({
|
|
13330
|
+
id: zodOpenapi.z.uuid(),
|
|
13331
|
+
partyId: zodOpenapi.z.uuid(),
|
|
13332
|
+
internalId: zodOpenapi.z.string().nullable(),
|
|
13333
|
+
name: zodOpenapi.z.string(),
|
|
13334
|
+
surname: zodOpenapi.z.string(),
|
|
13335
|
+
email: zodOpenapi.z.string().nullable(),
|
|
13336
|
+
phone: zodOpenapi.z.string().nullable(),
|
|
13337
|
+
birthDate: zodOpenapi.z.string().nullable(),
|
|
13338
|
+
birthPlace: zodOpenapi.z.string(),
|
|
13339
|
+
countryOfBirth: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).nullable(),
|
|
13340
|
+
personalId: zodOpenapi.z.string(),
|
|
13341
|
+
gender: zodOpenapi.z.enum(GenderZod),
|
|
13342
|
+
citizenship: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13343
|
+
citizenshipOther: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).nullable(),
|
|
13344
|
+
employer: zodOpenapi.z.string().nullable(),
|
|
13345
|
+
employerCountry: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).nullable(),
|
|
13346
|
+
registeredNumber: zodOpenapi.z.string(),
|
|
13347
|
+
isPep: zodOpenapi.z.boolean(),
|
|
13348
|
+
titleBefore: zodOpenapi.z.string().nullable(),
|
|
13349
|
+
titleAfter: zodOpenapi.z.string().nullable(),
|
|
13350
|
+
birthSurname: zodOpenapi.z.string().nullable(),
|
|
13351
|
+
vocativeTitle: zodOpenapi.z.string().nullable(),
|
|
13352
|
+
deathDate: zodOpenapi.z.coerce.date().nullable(),
|
|
13353
|
+
deathNotification: zodOpenapi.z.coerce.date().nullable(),
|
|
13354
|
+
pin: zodOpenapi.z.string().nullable(),
|
|
13355
|
+
stayAbroad: zodOpenapi.z.boolean().nullable(),
|
|
13356
|
+
stayAbroadCountries: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).nullable(),
|
|
13357
|
+
createdAt: zodOpenapi.z.coerce.date().nullable(),
|
|
13358
|
+
updatedAt: zodOpenapi.z.coerce.date().nullable()
|
|
13359
|
+
});
|
|
13360
|
+
|
|
13361
|
+
zodOpenapi.z.object({
|
|
13362
|
+
partyId: zodOpenapi.z.uuid(),
|
|
13363
|
+
internalId: zodOpenapi.z.string().optional(),
|
|
13364
|
+
businessName: zodOpenapi.z.string(),
|
|
13365
|
+
email: zodOpenapi.z.email("Invalid email format").optional(),
|
|
13366
|
+
phone: zodOpenapi.z.string().optional(),
|
|
13367
|
+
registeredNumber: zodOpenapi.z.string(),
|
|
13368
|
+
registeredIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13369
|
+
operatesIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13370
|
+
presentIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13371
|
+
monthlyVolumeIn: zodOpenapi.z.number(),
|
|
13372
|
+
monthlyVolumeOut: zodOpenapi.z.number(),
|
|
13373
|
+
ownedBy: zodOpenapi.z.string(),
|
|
13374
|
+
companyObjects: zodOpenapi.z.string(),
|
|
13375
|
+
annualTurnover: zodOpenapi.z.number(),
|
|
13376
|
+
numberOfEmployees: zodOpenapi.z.number().optional(),
|
|
13377
|
+
prosecuted: zodOpenapi.z.string().optional(),
|
|
13378
|
+
location: zodOpenapi.z.string().optional(),
|
|
13379
|
+
fileNumber: zodOpenapi.z.string().optional(),
|
|
13380
|
+
websiteUrl: zodOpenapi.z.url("Invalid website URL").optional(),
|
|
13381
|
+
vatPayer: zodOpenapi.z.boolean(),
|
|
13382
|
+
companyObjectsDescription: zodOpenapi.z.string(),
|
|
13383
|
+
turnover3years: zodOpenapi.z.number(),
|
|
13384
|
+
operationCountries: zodOpenapi.z.string(),
|
|
13385
|
+
riskyBusinessType: zodOpenapi.z.string().optional()
|
|
13386
|
+
});
|
|
13387
|
+
const organizationUpdateSchema = zodOpenapi.z.object({
|
|
13388
|
+
id: zodOpenapi.z.uuid(),
|
|
13389
|
+
partyId: zodOpenapi.z.uuid().optional(),
|
|
13390
|
+
internalId: zodOpenapi.z.string().optional(),
|
|
13391
|
+
businessName: zodOpenapi.z.string().optional(),
|
|
13392
|
+
email: zodOpenapi.z.email("Invalid email format").optional(),
|
|
13393
|
+
phone: zodOpenapi.z.string().optional(),
|
|
13394
|
+
registeredNumber: zodOpenapi.z.string().optional(),
|
|
13395
|
+
registeredIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
13396
|
+
operatesIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
13397
|
+
presentIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2).optional(),
|
|
13398
|
+
monthlyVolumeIn: zodOpenapi.z.number().optional(),
|
|
13399
|
+
monthlyVolumeOut: zodOpenapi.z.number().optional(),
|
|
13400
|
+
ownedBy: zodOpenapi.z.string().optional(),
|
|
13401
|
+
companyObjects: zodOpenapi.z.string().optional(),
|
|
13402
|
+
annualTurnover: zodOpenapi.z.number().optional(),
|
|
13403
|
+
numberOfEmployees: zodOpenapi.z.number().optional(),
|
|
13404
|
+
prosecuted: zodOpenapi.z.string().optional(),
|
|
13405
|
+
location: zodOpenapi.z.string().optional(),
|
|
13406
|
+
fileNumber: zodOpenapi.z.string().optional(),
|
|
13407
|
+
websiteUrl: zodOpenapi.z.url("Invalid website URL").optional(),
|
|
13408
|
+
vatPayer: zodOpenapi.z.boolean().optional(),
|
|
13409
|
+
companyObjectsDescription: zodOpenapi.z.string(),
|
|
13410
|
+
turnover3years: zodOpenapi.z.number(),
|
|
13411
|
+
operationCountries: zodOpenapi.z.string(),
|
|
13412
|
+
riskyBusinessType: zodOpenapi.z.string().optional()
|
|
13413
|
+
});
|
|
13414
|
+
zodOpenapi.z.object({
|
|
13415
|
+
id: zodOpenapi.z.uuid(),
|
|
13416
|
+
partyId: zodOpenapi.z.uuid(),
|
|
13417
|
+
internalId: zodOpenapi.z.string().nullable(),
|
|
13418
|
+
businessName: zodOpenapi.z.string(),
|
|
13419
|
+
email: zodOpenapi.z.string().nullable(),
|
|
13420
|
+
phone: zodOpenapi.z.string().nullable(),
|
|
13421
|
+
registeredNumber: zodOpenapi.z.string(),
|
|
13422
|
+
registeredIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13423
|
+
operatesIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13424
|
+
presentIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13425
|
+
monthlyVolumeIn: zodOpenapi.z.number(),
|
|
13426
|
+
monthlyVolumeOut: zodOpenapi.z.number(),
|
|
13427
|
+
ownedBy: zodOpenapi.z.string(),
|
|
13428
|
+
companyObjects: zodOpenapi.z.string(),
|
|
13429
|
+
annualTurnover: zodOpenapi.z.number(),
|
|
13430
|
+
numberOfEmployees: zodOpenapi.z.number().nullable(),
|
|
13431
|
+
prosecuted: zodOpenapi.z.string().nullable(),
|
|
13432
|
+
location: zodOpenapi.z.string().nullable(),
|
|
13433
|
+
fileNumber: zodOpenapi.z.string().nullable(),
|
|
13434
|
+
websiteUrl: zodOpenapi.z.string().nullable(),
|
|
13435
|
+
vatPayer: zodOpenapi.z.boolean(),
|
|
13436
|
+
companyObjectsDescription: zodOpenapi.z.string(),
|
|
13437
|
+
turnover3years: zodOpenapi.z.number(),
|
|
13438
|
+
operationCountries: zodOpenapi.z.string(),
|
|
13439
|
+
riskyBusinessType: zodOpenapi.z.string().nullable(),
|
|
13440
|
+
createdAt: zodOpenapi.z.coerce.date().nullable(),
|
|
13441
|
+
updatedAt: zodOpenapi.z.coerce.date().nullable()
|
|
11787
13442
|
});
|
|
11788
|
-
const
|
|
11789
|
-
|
|
11790
|
-
|
|
11791
|
-
|
|
11792
|
-
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
|
|
11800
|
-
|
|
11801
|
-
|
|
11802
|
-
|
|
11803
|
-
|
|
11804
|
-
|
|
11805
|
-
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
|
|
13443
|
+
const createOrganizationInputSchema = zodOpenapi.z.object({
|
|
13444
|
+
partyId: zodOpenapi.z.uuid(),
|
|
13445
|
+
internalId: zodOpenapi.z.string().optional(),
|
|
13446
|
+
businessName: zodOpenapi.z.string(),
|
|
13447
|
+
email: zodOpenapi.z.string().optional(),
|
|
13448
|
+
phone: zodOpenapi.z.string().optional(),
|
|
13449
|
+
registeredNumber: zodOpenapi.z.string(),
|
|
13450
|
+
registeredIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13451
|
+
operatesIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13452
|
+
presentIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13453
|
+
monthlyVolumeIn: zodOpenapi.z.number(),
|
|
13454
|
+
monthlyVolumeOut: zodOpenapi.z.number(),
|
|
13455
|
+
ownedBy: zodOpenapi.z.string(),
|
|
13456
|
+
companyObjects: zodOpenapi.z.string(),
|
|
13457
|
+
annualTurnover: zodOpenapi.z.number(),
|
|
13458
|
+
numberOfEmployees: zodOpenapi.z.number(),
|
|
13459
|
+
prosecuted: zodOpenapi.z.string().optional(),
|
|
13460
|
+
location: zodOpenapi.z.string().optional(),
|
|
13461
|
+
fileNumber: zodOpenapi.z.string().optional(),
|
|
13462
|
+
websiteUrl: zodOpenapi.z.string().optional(),
|
|
13463
|
+
vatPayer: zodOpenapi.z.boolean(),
|
|
13464
|
+
companyObjectsDescription: zodOpenapi.z.string(),
|
|
13465
|
+
turnover3years: zodOpenapi.z.number(),
|
|
13466
|
+
operationCountries: zodOpenapi.z.string(),
|
|
13467
|
+
riskyBusinessType: zodOpenapi.z.string().optional()
|
|
11809
13468
|
});
|
|
11810
|
-
|
|
11811
|
-
|
|
11812
|
-
|
|
11813
|
-
|
|
11814
|
-
|
|
11815
|
-
|
|
11816
|
-
|
|
11817
|
-
|
|
11818
|
-
|
|
11819
|
-
|
|
11820
|
-
|
|
11821
|
-
|
|
11822
|
-
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
|
|
11826
|
-
|
|
11827
|
-
|
|
11828
|
-
|
|
11829
|
-
|
|
11830
|
-
|
|
11831
|
-
|
|
13469
|
+
const createOrganizationOutputSchema = zodOpenapi.z.object({
|
|
13470
|
+
partyId: zodOpenapi.z.uuid(),
|
|
13471
|
+
internalId: zodOpenapi.z.string().nullable(),
|
|
13472
|
+
businessName: zodOpenapi.z.string(),
|
|
13473
|
+
email: zodOpenapi.z.string().nullable(),
|
|
13474
|
+
phone: zodOpenapi.z.string().nullable(),
|
|
13475
|
+
registeredNumber: zodOpenapi.z.string(),
|
|
13476
|
+
registeredIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13477
|
+
operatesIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13478
|
+
presentIn: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
13479
|
+
monthlyVolumeIn: zodOpenapi.z.number(),
|
|
13480
|
+
monthlyVolumeOut: zodOpenapi.z.number(),
|
|
13481
|
+
ownedBy: zodOpenapi.z.string(),
|
|
13482
|
+
companyObjects: zodOpenapi.z.string(),
|
|
13483
|
+
annualTurnover: zodOpenapi.z.number(),
|
|
13484
|
+
numberOfEmployees: zodOpenapi.z.number().nullable(),
|
|
13485
|
+
prosecuted: zodOpenapi.z.string().nullable(),
|
|
13486
|
+
location: zodOpenapi.z.string().nullable(),
|
|
13487
|
+
fileNumber: zodOpenapi.z.string().nullable(),
|
|
13488
|
+
websiteUrl: zodOpenapi.z.string().nullable(),
|
|
13489
|
+
vatPayer: zodOpenapi.z.boolean(),
|
|
13490
|
+
companyObjectsDescription: zodOpenapi.z.string(),
|
|
13491
|
+
turnover3years: zodOpenapi.z.number(),
|
|
13492
|
+
operationCountries: zodOpenapi.z.string(),
|
|
13493
|
+
riskyBusinessType: zodOpenapi.z.string().nullable()
|
|
11832
13494
|
});
|
|
11833
13495
|
|
|
11834
|
-
|
|
11835
|
-
|
|
11836
|
-
|
|
11837
|
-
|
|
11838
|
-
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
|
|
11854
|
-
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
updatedAt: "updatedAt",
|
|
11865
|
-
deletedAt: "deletedAt"
|
|
11866
|
-
}
|
|
11867
|
-
}),
|
|
11868
|
-
defaultValue: () => "updatedAt"
|
|
11869
|
-
}),
|
|
11870
|
-
direction: new z__namespace.$ZodDefault({
|
|
11871
|
-
type: "default",
|
|
11872
|
-
innerType: new z__namespace.$ZodEnum({
|
|
11873
|
-
type: "enum",
|
|
11874
|
-
entries: {
|
|
11875
|
-
asc: "asc",
|
|
11876
|
-
desc: "desc"
|
|
11877
|
-
}
|
|
11878
|
-
}),
|
|
11879
|
-
defaultValue: () => "desc"
|
|
11880
|
-
})
|
|
11881
|
-
}
|
|
11882
|
-
}),
|
|
11883
|
-
defaultValue: () => ({ column: "updatedAt", direction: "desc" })
|
|
11884
|
-
})
|
|
11885
|
-
}
|
|
11886
|
-
});
|
|
11887
|
-
new z__namespace.$ZodObject({
|
|
11888
|
-
type: "object",
|
|
11889
|
-
shape: {
|
|
11890
|
-
page: new z__namespace.$ZodNumber({
|
|
11891
|
-
type: "number"
|
|
11892
|
-
}),
|
|
11893
|
-
limit: new z__namespace.$ZodNumber({
|
|
11894
|
-
type: "number"
|
|
11895
|
-
}),
|
|
11896
|
-
sort: new z__namespace.$ZodObject({
|
|
11897
|
-
type: "object",
|
|
11898
|
-
shape: {
|
|
11899
|
-
column: new z__namespace.$ZodEnum({
|
|
11900
|
-
type: "enum",
|
|
11901
|
-
entries: {
|
|
11902
|
-
createdAt: "createdAt",
|
|
11903
|
-
updatedAt: "updatedAt",
|
|
11904
|
-
deletedAt: "deletedAt"
|
|
11905
|
-
}
|
|
11906
|
-
}),
|
|
11907
|
-
direction: new z__namespace.$ZodEnum({
|
|
11908
|
-
type: "enum",
|
|
11909
|
-
entries: {
|
|
11910
|
-
asc: "asc",
|
|
11911
|
-
desc: "desc"
|
|
11912
|
-
}
|
|
11913
|
-
})
|
|
11914
|
-
}
|
|
11915
|
-
})
|
|
11916
|
-
}
|
|
11917
|
-
});
|
|
13496
|
+
const disponentSchema = zodOpenapi.z.discriminatedUnion("partyType", [
|
|
13497
|
+
zodOpenapi.z.object({
|
|
13498
|
+
partyType: zodOpenapi.z.literal("INDIVIDUAL"),
|
|
13499
|
+
data: individualInsertSchema.omit({ partyId: true })
|
|
13500
|
+
}),
|
|
13501
|
+
zodOpenapi.z.object({
|
|
13502
|
+
partyType: zodOpenapi.z.literal("ORGANIZATION"),
|
|
13503
|
+
data: createOrganizationInputSchema.omit({ partyId: true })
|
|
13504
|
+
})
|
|
13505
|
+
]);
|
|
13506
|
+
const disponentUpdateSchema = zodOpenapi.z.discriminatedUnion("partyType", [
|
|
13507
|
+
zodOpenapi.z.object({
|
|
13508
|
+
partyType: zodOpenapi.z.literal("INDIVIDUAL"),
|
|
13509
|
+
data: individualUpdateSchema
|
|
13510
|
+
}),
|
|
13511
|
+
zodOpenapi.z.object({
|
|
13512
|
+
partyType: zodOpenapi.z.literal("ORGANIZATION"),
|
|
13513
|
+
data: organizationUpdateSchema
|
|
13514
|
+
})
|
|
13515
|
+
]);
|
|
13516
|
+
const disponentOutputSchema = zodOpenapi.z.discriminatedUnion("partyType", [
|
|
13517
|
+
zodOpenapi.z.object({
|
|
13518
|
+
partyType: zodOpenapi.z.literal("INDIVIDUAL"),
|
|
13519
|
+
data: individualOutputSchema.nullable()
|
|
13520
|
+
}),
|
|
13521
|
+
zodOpenapi.z.object({
|
|
13522
|
+
partyType: zodOpenapi.z.literal("ORGANIZATION"),
|
|
13523
|
+
data: createOrganizationOutputSchema.nullable()
|
|
13524
|
+
})
|
|
13525
|
+
]);
|
|
11918
13526
|
|
|
11919
13527
|
const updateBankAccountSchema = zodOpenapi.z.object({
|
|
11920
13528
|
...bankAccountMetadataSchema.shape,
|
|
@@ -11933,7 +13541,7 @@ const bankAccountInputSchema = updateBankAccountSchema.required({
|
|
|
11933
13541
|
}).omit({ id: true, partyId: true });
|
|
11934
13542
|
const bankAccountOutputSchema = zodOpenapi.z.object({
|
|
11935
13543
|
id: zodOpenapi.z.string(),
|
|
11936
|
-
partyId: zodOpenapi.z.uuid()
|
|
13544
|
+
partyId: zodOpenapi.z.uuid(),
|
|
11937
13545
|
internalId: zodOpenapi.z.string().nullable(),
|
|
11938
13546
|
holderName: zodOpenapi.z.string(),
|
|
11939
13547
|
number: zodOpenapi.z.string().nullable(),
|
|
@@ -11953,7 +13561,7 @@ const bankAccountOutputSchema = zodOpenapi.z.object({
|
|
|
11953
13561
|
});
|
|
11954
13562
|
|
|
11955
13563
|
const createAmlInputSchema = zodOpenapi.z.object({
|
|
11956
|
-
partyId: zodOpenapi.z.uuid()
|
|
13564
|
+
partyId: zodOpenapi.z.uuid(),
|
|
11957
13565
|
internalId: zodOpenapi.z.string().optional(),
|
|
11958
13566
|
sourceOfWealth: zodOpenapi.z.string(),
|
|
11959
13567
|
yearlyIncome: zodOpenapi.z.string(),
|
|
@@ -11970,8 +13578,8 @@ const createAmlInputSchema = zodOpenapi.z.object({
|
|
|
11970
13578
|
signatureMethod: zodOpenapi.z.string().optional(),
|
|
11971
13579
|
existencePeriod: zodOpenapi.z.string().optional(),
|
|
11972
13580
|
reputation: zodOpenapi.z.string().optional(),
|
|
11973
|
-
riskLevel: zodOpenapi.z.enum(AmlScoreTypeZod).optional(),
|
|
11974
|
-
kycStatus: zodOpenapi.z.enum(KycStatusZod).optional()
|
|
13581
|
+
riskLevel: zodOpenapi.z.enum(AmlScoreTypeZod$1).optional(),
|
|
13582
|
+
kycStatus: zodOpenapi.z.enum(KycStatusZod$1).optional()
|
|
11975
13583
|
});
|
|
11976
13584
|
const updateAmlInputSchema = zodOpenapi.z.object({
|
|
11977
13585
|
id: zodOpenapi.z.uuid(),
|
|
@@ -11992,12 +13600,12 @@ const updateAmlInputSchema = zodOpenapi.z.object({
|
|
|
11992
13600
|
signatureMethod: zodOpenapi.z.string().optional(),
|
|
11993
13601
|
existencePeriod: zodOpenapi.z.string().optional(),
|
|
11994
13602
|
reputation: zodOpenapi.z.string().optional(),
|
|
11995
|
-
riskLevel: zodOpenapi.z.enum(AmlScoreTypeZod).optional(),
|
|
11996
|
-
kycStatus: zodOpenapi.z.enum(KycStatusZod).optional()
|
|
13603
|
+
riskLevel: zodOpenapi.z.enum(AmlScoreTypeZod$1).optional(),
|
|
13604
|
+
kycStatus: zodOpenapi.z.enum(KycStatusZod$1).optional()
|
|
11997
13605
|
});
|
|
11998
13606
|
const createAmlOutputSchema = zodOpenapi.z.object({
|
|
11999
13607
|
id: zodOpenapi.z.uuid(),
|
|
12000
|
-
partyId: zodOpenapi.z.uuid()
|
|
13608
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12001
13609
|
internalId: zodOpenapi.z.string().nullable(),
|
|
12002
13610
|
sourceOfWealth: zodOpenapi.z.string(),
|
|
12003
13611
|
yearlyIncome: zodOpenapi.z.string(),
|
|
@@ -12014,13 +13622,14 @@ const createAmlOutputSchema = zodOpenapi.z.object({
|
|
|
12014
13622
|
signatureMethod: zodOpenapi.z.string().nullable(),
|
|
12015
13623
|
existencePeriod: zodOpenapi.z.string().nullable(),
|
|
12016
13624
|
reputation: zodOpenapi.z.string().nullable(),
|
|
12017
|
-
riskLevel: zodOpenapi.z.enum(AmlScoreTypeZod),
|
|
12018
|
-
kycStatus: zodOpenapi.z.enum(KycStatusZod).nullable(),
|
|
13625
|
+
riskLevel: zodOpenapi.z.enum(AmlScoreTypeZod$1),
|
|
13626
|
+
kycStatus: zodOpenapi.z.enum(KycStatusZod$1).nullable(),
|
|
12019
13627
|
createdAt: zodOpenapi.z.date().nullable(),
|
|
12020
13628
|
updatedAt: zodOpenapi.z.date().nullable()
|
|
12021
13629
|
});
|
|
12022
13630
|
|
|
12023
13631
|
const createAddressInputSchema = zodOpenapi.z.object({
|
|
13632
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12024
13633
|
addressType: zodOpenapi.z.enum(AddressTypeZod),
|
|
12025
13634
|
internalId: zodOpenapi.z.string().optional(),
|
|
12026
13635
|
street: zodOpenapi.z.string(),
|
|
@@ -12036,7 +13645,7 @@ const createAddressInputSchema = zodOpenapi.z.object({
|
|
|
12036
13645
|
});
|
|
12037
13646
|
const createAddressOutputSchema = zodOpenapi.z.object({
|
|
12038
13647
|
id: zodOpenapi.z.uuid(),
|
|
12039
|
-
partyId: zodOpenapi.z.uuid()
|
|
13648
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12040
13649
|
internalId: zodOpenapi.z.string().nullable(),
|
|
12041
13650
|
addressType: zodOpenapi.z.enum(AddressTypeZod),
|
|
12042
13651
|
street: zodOpenapi.z.string().nullable(),
|
|
@@ -12048,7 +13657,6 @@ const createAddressOutputSchema = zodOpenapi.z.object({
|
|
|
12048
13657
|
district: zodOpenapi.z.string().nullable(),
|
|
12049
13658
|
region: zodOpenapi.z.string().nullable(),
|
|
12050
13659
|
countryCode: zodOpenapi.z.enum(generalCodes.COUNTRY_CODES_2),
|
|
12051
|
-
externalId: zodOpenapi.z.uuid().nullable(),
|
|
12052
13660
|
ruianCode: zodOpenapi.z.string().nullable(),
|
|
12053
13661
|
createdAt: zodOpenapi.z.date().nullable(),
|
|
12054
13662
|
updatedAt: zodOpenapi.z.date().nullable()
|
|
@@ -12102,12 +13710,12 @@ zodOpenapi.z.object({
|
|
|
12102
13710
|
});
|
|
12103
13711
|
const createPartyInputSchema = zodOpenapi.z.object({
|
|
12104
13712
|
party: partySchema.omit({ id: true }),
|
|
12105
|
-
personalData: individualInsertSchema.nullable(),
|
|
12106
|
-
organizationData: createOrganizationInputSchema.nullable(),
|
|
13713
|
+
personalData: individualInsertSchema.omit({ partyId: true }).nullable(),
|
|
13714
|
+
organizationData: createOrganizationInputSchema.omit({ partyId: true }).nullable(),
|
|
12107
13715
|
bankAccounts: zodOpenapi.z.array(bankAccountInputSchema),
|
|
12108
13716
|
disponents: zodOpenapi.z.array(disponentSchema),
|
|
12109
|
-
addresses: zodOpenapi.z.array(createAddressInputSchema),
|
|
12110
|
-
aml: createAmlInputSchema,
|
|
13717
|
+
addresses: zodOpenapi.z.array(createAddressInputSchema.omit({ partyId: true })),
|
|
13718
|
+
aml: createAmlInputSchema.omit({ partyId: true }),
|
|
12111
13719
|
recipients: zodOpenapi.z.array(bankAccountInputSchema)
|
|
12112
13720
|
});
|
|
12113
13721
|
const partyOutputSchema = zodOpenapi.z.object({
|
|
@@ -12148,7 +13756,7 @@ const idDocumentOutputSchema = zodOpenapi.z.object({
|
|
|
12148
13756
|
createdAt: zodOpenapi.z.iso.datetime().nullable(),
|
|
12149
13757
|
updatedAt: zodOpenapi.z.iso.datetime().nullable(),
|
|
12150
13758
|
deletedAt: zodOpenapi.z.iso.datetime().nullable(),
|
|
12151
|
-
partyId: zodOpenapi.z.uuid()
|
|
13759
|
+
partyId: zodOpenapi.z.uuid(),
|
|
12152
13760
|
idDocType: zodOpenapi.z.enum(IdDocTypeZod),
|
|
12153
13761
|
idDocNumber: zodOpenapi.z.string(),
|
|
12154
13762
|
idDocHolderName: zodOpenapi.z.string(),
|
|
@@ -12200,19 +13808,19 @@ const messageResponseSchema = zodOpenapi.z.object({
|
|
|
12200
13808
|
});
|
|
12201
13809
|
|
|
12202
13810
|
exports.AddressTypeZod = AddressTypeZod$1;
|
|
12203
|
-
exports.AmlScoreTypeZod = AmlScoreTypeZod;
|
|
13811
|
+
exports.AmlScoreTypeZod = AmlScoreTypeZod$1;
|
|
12204
13812
|
exports.ClientStatusActionZod = ClientStatusActionZod;
|
|
12205
|
-
exports.ContactTypeZod = ContactTypeZod;
|
|
13813
|
+
exports.ContactTypeZod = ContactTypeZod$1;
|
|
12206
13814
|
exports.CustomerStatusZod = CustomerStatusZod$1;
|
|
12207
13815
|
exports.DOCUMENT_SIDE = DOCUMENT_SIDE;
|
|
12208
13816
|
exports.GenderZod = GenderZod$1;
|
|
12209
13817
|
exports.IdDocStatusZod = IdDocStatusZod$1;
|
|
12210
13818
|
exports.IdDocTypeZod = IdDocTypeZod$1;
|
|
12211
13819
|
exports.IdentificationTypeZod = IdentificationTypeZod;
|
|
12212
|
-
exports.KycStatusZod = KycStatusZod;
|
|
12213
|
-
exports.PartyRelationshipTypeZod = PartyRelationshipTypeZod;
|
|
13820
|
+
exports.KycStatusZod = KycStatusZod$1;
|
|
13821
|
+
exports.PartyRelationshipTypeZod = PartyRelationshipTypeZod$1;
|
|
12214
13822
|
exports.PartyTypeZod = PartyTypeZod$1;
|
|
12215
|
-
exports.TRADER_TYPE = TRADER_TYPE;
|
|
13823
|
+
exports.TRADER_TYPE = TRADER_TYPE$1;
|
|
12216
13824
|
exports.createMdmClient = createMdmClient;
|
|
12217
13825
|
exports.createPartyInputSchema = createPartyInputSchema;
|
|
12218
13826
|
exports.idDocumentCreateInputSchema = idDocumentCreateInputSchema;
|