@dalmore/api-contracts 1.0.2 → 1.0.5
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/README.md +34 -55
- package/index.d.mts +17 -0
- package/index.d.ts +17 -0
- package/index.mjs +10970 -0
- package/package.json +10 -46
- package/common/helpers/index.ts +0 -205
- package/common/types/account-contact.types.ts +0 -98
- package/common/types/account-detail.types.ts +0 -27
- package/common/types/account-integration.types.ts +0 -143
- package/common/types/account-manager.types.ts +0 -124
- package/common/types/account.types.ts +0 -296
- package/common/types/activity.types.ts +0 -274
- package/common/types/address.types.ts +0 -41
- package/common/types/aic.types.ts +0 -246
- package/common/types/aml.types.ts +0 -18
- package/common/types/api-key-logs.types.ts +0 -66
- package/common/types/api-keys.types.ts +0 -69
- package/common/types/asset.types.ts +0 -338
- package/common/types/auth.types.ts +0 -370
- package/common/types/batch-jobs.types.ts +0 -150
- package/common/types/bonus-tier.types.ts +0 -147
- package/common/types/cart.types.ts +0 -18
- package/common/types/checklist-items.types.ts +0 -70
- package/common/types/checklist.types.ts +0 -97
- package/common/types/common.types.ts +0 -1520
- package/common/types/comply-advantage-api.types.ts +0 -316
- package/common/types/comply-advantage.types.ts +0 -25
- package/common/types/contact-us.types.ts +0 -107
- package/common/types/contract-helpers.ts +0 -205
- package/common/types/countries.types.ts +0 -375
- package/common/types/covered-person.types.ts +0 -274
- package/common/types/dashboard.types.ts +0 -799
- package/common/types/data-record.types.ts +0 -325
- package/common/types/data-room.types.ts +0 -242
- package/common/types/default-theme-config.types.ts +0 -87
- package/common/types/disbursement-adjustment.types.ts +0 -32
- package/common/types/disbursement-approval-user.types.ts +0 -100
- package/common/types/disbursement-review.types.ts +0 -110
- package/common/types/disbursement-transaction.types.ts +0 -72
- package/common/types/disbursements.types.ts +0 -310
- package/common/types/domain-filter.types.ts +0 -55
- package/common/types/email-theme.types.ts +0 -442
- package/common/types/entity.types.ts +0 -15
- package/common/types/error-responses.types.ts +0 -135
- package/common/types/escrow-account.types.ts +0 -104
- package/common/types/exchange-api-key.types.ts +0 -121
- package/common/types/exchange-import.types.ts +0 -36
- package/common/types/exchange-provider.types.ts +0 -329
- package/common/types/file.types.ts +0 -461
- package/common/types/health.types.ts +0 -29
- package/common/types/index.ts +0 -48
- package/common/types/individuals.types.ts +0 -554
- package/common/types/investor-account.types.ts +0 -1239
- package/common/types/investorAccountIdSchema.type.ts +0 -0
- package/common/types/investors-offering.types.ts +0 -65
- package/common/types/invite.types.ts +0 -133
- package/common/types/issuer-bank-account.types.ts +0 -107
- package/common/types/issuer-offering.types.ts +0 -306
- package/common/types/issuer-payment-method.types.ts +0 -341
- package/common/types/issuer.types.ts +0 -312
- package/common/types/job-item.types.ts +0 -119
- package/common/types/jobs.types.ts +0 -171
- package/common/types/kyb.types.ts +0 -53
- package/common/types/kyc.types.ts +0 -188
- package/common/types/legal-entity.types.ts +0 -185
- package/common/types/login-history.types.ts +0 -46
- package/common/types/mail-template.types.ts +0 -436
- package/common/types/north-cap-integration.types.ts +0 -190
- package/common/types/note.types.ts +0 -109
- package/common/types/notification.types.ts +0 -58
- package/common/types/notion-api.types.ts +0 -374
- package/common/types/notion-database.types.ts +0 -125
- package/common/types/notion-page.types.ts +0 -267
- package/common/types/offering-reports.types.ts +0 -153
- package/common/types/offering-submission.types.ts +0 -314
- package/common/types/offering.types.ts +0 -590
- package/common/types/page-revision.types.ts +0 -86
- package/common/types/page.types.ts +0 -436
- package/common/types/password.type.ts +0 -15
- package/common/types/payment-methods.types.ts +0 -298
- package/common/types/phone.type.ts +0 -27
- package/common/types/portfolio.types.ts +0 -50
- package/common/types/privacy-policy-and-tos.types.ts +0 -231
- package/common/types/queue.types.ts +0 -111
- package/common/types/registered-reps.types.ts +0 -25
- package/common/types/rejection-reasons.types.ts +0 -56
- package/common/types/review.types.ts +0 -133
- package/common/types/role.types.ts +0 -26
- package/common/types/secondary-customer.types.ts +0 -66
- package/common/types/secondary-issuer.types.ts +0 -50
- package/common/types/secondary-order.types.ts +0 -58
- package/common/types/secondary-security.types.ts +0 -60
- package/common/types/secondary-trade.entity.ts +0 -16
- package/common/types/secondary-trade.types.ts +0 -95
- package/common/types/secure-request.types.ts +0 -68
- package/common/types/signer.types.ts +0 -651
- package/common/types/site-link.types.ts +0 -166
- package/common/types/site-settings.types.ts +0 -726
- package/common/types/site.types.ts +0 -270
- package/common/types/sms.types.ts +0 -30
- package/common/types/state-machine.types.ts +0 -177
- package/common/types/states.types.ts +0 -163
- package/common/types/subdoc-preview.types.ts +0 -35
- package/common/types/task.types.ts +0 -258
- package/common/types/trade-adjustment.type.ts +0 -33
- package/common/types/trade-line-item.type.ts +0 -132
- package/common/types/trade.types.ts +0 -931
- package/common/types/transaction.types.ts +0 -198
- package/common/types/trusted-contact.types.ts +0 -122
- package/common/types/typography.types.ts +0 -75
- package/common/types/user-manual.types.ts +0 -290
- package/common/types/user-setting.types.ts +0 -133
- package/common/types/user.types.ts +0 -320
- package/common/types/webhook.types.ts +0 -588
- package/common/types/zip.type.ts +0 -36
- package/contracts/clients/accounts/index.ts +0 -61
- package/contracts/clients/aic/index.ts +0 -59
- package/contracts/clients/api-key-logs/index.ts +0 -53
- package/contracts/clients/api-keys/index.ts +0 -73
- package/contracts/clients/assets/index.ts +0 -102
- package/contracts/clients/auth/index.ts +0 -50
- package/contracts/clients/files/index.ts +0 -166
- package/contracts/clients/files-public/index.ts +0 -166
- package/contracts/clients/index.ts +0 -44
- package/contracts/clients/individuals/index.ts +0 -93
- package/contracts/clients/investor-accounts/index.ts +0 -93
- package/contracts/clients/issuers/index.ts +0 -94
- package/contracts/clients/legal-entities/index.ts +0 -93
- package/contracts/clients/offerings/index.ts +0 -117
- package/contracts/clients/secure-requests/index.ts +0 -34
- package/contracts/clients/sites/index.ts +0 -56
- package/contracts/clients/trades/index.ts +0 -122
- package/contracts/compliance/account-contacts/index.ts +0 -82
- package/contracts/compliance/account-managers/index.ts +0 -142
- package/contracts/compliance/accounts/index.ts +0 -187
- package/contracts/compliance/activities/index.ts +0 -55
- package/contracts/compliance/aic/index.ts +0 -60
- package/contracts/compliance/api-keys/index.ts +0 -91
- package/contracts/compliance/assets/index.ts +0 -122
- package/contracts/compliance/auth/index.ts +0 -134
- package/contracts/compliance/batch-jobs/index.ts +0 -62
- package/contracts/compliance/bonus-tiers/index.ts +0 -55
- package/contracts/compliance/checklist/index.ts +0 -87
- package/contracts/compliance/checklist-items/index.ts +0 -86
- package/contracts/compliance/covered-persons/index.ts +0 -97
- package/contracts/compliance/dashboard/index.ts +0 -111
- package/contracts/compliance/data-records/index.ts +0 -116
- package/contracts/compliance/data-rooms/index.ts +0 -113
- package/contracts/compliance/default-theme-configs/index.ts +0 -95
- package/contracts/compliance/disbursement/index.ts +0 -165
- package/contracts/compliance/disbursement-approval-users/index.ts +0 -84
- package/contracts/compliance/disbursement-transactions/index.ts +0 -37
- package/contracts/compliance/domain-filters/index.ts +0 -117
- package/contracts/compliance/email-themes/index.ts +0 -284
- package/contracts/compliance/escrow-accounts/index.ts +0 -85
- package/contracts/compliance/exchange-api-keys/index.ts +0 -129
- package/contracts/compliance/exchange-imports/index.ts +0 -137
- package/contracts/compliance/files/index.ts +0 -267
- package/contracts/compliance/files-public/index.ts +0 -188
- package/contracts/compliance/health/index.ts +0 -26
- package/contracts/compliance/index.ts +0 -147
- package/contracts/compliance/individuals/index.ts +0 -57
- package/contracts/compliance/investor-accounts/index.ts +0 -141
- package/contracts/compliance/invites/index.ts +0 -137
- package/contracts/compliance/issuer-bank-accounts/index.ts +0 -81
- package/contracts/compliance/issuer-payment-methods/index.ts +0 -81
- package/contracts/compliance/issuers/index.ts +0 -97
- package/contracts/compliance/job-items/index.ts +0 -58
- package/contracts/compliance/jobs/index.ts +0 -59
- package/contracts/compliance/kyb/index.ts +0 -54
- package/contracts/compliance/kyc/index.ts +0 -77
- package/contracts/compliance/legal-entities/index.ts +0 -57
- package/contracts/compliance/login-histories/index.ts +0 -37
- package/contracts/compliance/notes/index.ts +0 -69
- package/contracts/compliance/notion-databases/index.ts +0 -107
- package/contracts/compliance/notion-pages/index.ts +0 -105
- package/contracts/compliance/offering-reports/index.ts +0 -149
- package/contracts/compliance/offerings/index.ts +0 -233
- package/contracts/compliance/pages/index.ts +0 -178
- package/contracts/compliance/payment-methods/index.ts +0 -57
- package/contracts/compliance/rejection-reasons/index.ts +0 -32
- package/contracts/compliance/review/index.ts +0 -169
- package/contracts/compliance/roles/index.ts +0 -34
- package/contracts/compliance/secondary-customers/index.ts +0 -77
- package/contracts/compliance/secondary-orders/index.ts +0 -60
- package/contracts/compliance/secondary-trades/index.ts +0 -100
- package/contracts/compliance/secure-requests/index.ts +0 -54
- package/contracts/compliance/signer/index.ts +0 -369
- package/contracts/compliance/site-links/index.ts +0 -128
- package/contracts/compliance/site-settings/index.ts +0 -669
- package/contracts/compliance/sites/index.ts +0 -56
- package/contracts/compliance/state-machine/index.ts +0 -94
- package/contracts/compliance/tasks/index.ts +0 -91
- package/contracts/compliance/third-parties/index.ts +0 -52
- package/contracts/compliance/trade-line-items/index.ts +0 -59
- package/contracts/compliance/trades/index.ts +0 -230
- package/contracts/compliance/transactions/index.ts +0 -161
- package/contracts/compliance/user-manuals/index.ts +0 -271
- package/contracts/compliance/user-settings/index.ts +0 -189
- package/contracts/compliance/users/index.ts +0 -200
- package/contracts/compliance/webhooks/index.ts +0 -41
- package/contracts/compliance-apikey/accounts/index.ts +0 -58
- package/contracts/compliance-apikey/index.ts +0 -14
- package/contracts/index.ts +0 -6
- package/contracts/investors/account-contacts/index.ts +0 -58
- package/contracts/investors/aic/index.ts +0 -59
- package/contracts/investors/assets/index.ts +0 -61
- package/contracts/investors/auth/index.ts +0 -116
- package/contracts/investors/bonus-tiers/index.ts +0 -37
- package/contracts/investors/cart/index.ts +0 -75
- package/contracts/investors/contact-us/index.ts +0 -48
- package/contracts/investors/data-records/index.ts +0 -113
- package/contracts/investors/data-rooms/index.ts +0 -96
- package/contracts/investors/files/index.ts +0 -167
- package/contracts/investors/files-public/index.ts +0 -185
- package/contracts/investors/index.ts +0 -72
- package/contracts/investors/individuals/index.ts +0 -99
- package/contracts/investors/investor-accounts/index.ts +0 -110
- package/contracts/investors/issuer-payment-methods/index.ts +0 -36
- package/contracts/investors/issuers/index.ts +0 -30
- package/contracts/investors/legal-entities/index.ts +0 -93
- package/contracts/investors/notes/index.ts +0 -69
- package/contracts/investors/offerings/index.ts +0 -93
- package/contracts/investors/pages/index.ts +0 -88
- package/contracts/investors/payment-methods/index.ts +0 -149
- package/contracts/investors/portfolios/index.ts +0 -53
- package/contracts/investors/sites/index.ts +0 -96
- package/contracts/investors/tasks/index.ts +0 -111
- package/contracts/investors/trade-line-items/index.ts +0 -75
- package/contracts/investors/trades/index.ts +0 -114
- package/contracts/investors/transactions/index.ts +0 -37
- package/contracts/investors/trusted-contacts/index.ts +0 -93
- package/contracts/investors/user-manuals/index.ts +0 -62
- package/contracts/investors/user-settings/index.ts +0 -170
- package/contracts/investors/users/index.ts +0 -45
- package/contracts/investors/webhooks/index.ts +0 -30
- package/contracts/issuers/account-contacts/index.ts +0 -76
- package/contracts/issuers/account-integrations/index.ts +0 -97
- package/contracts/issuers/accounts/index.ts +0 -97
- package/contracts/issuers/activities/index.ts +0 -54
- package/contracts/issuers/aic/index.ts +0 -39
- package/contracts/issuers/api-key-logs/index.ts +0 -53
- package/contracts/issuers/api-keys/index.ts +0 -93
- package/contracts/issuers/assets/index.ts +0 -122
- package/contracts/issuers/auth/index.ts +0 -152
- package/contracts/issuers/bonus-tiers/index.ts +0 -55
- package/contracts/issuers/contact-us/index.ts +0 -48
- package/contracts/issuers/covered-persons/index.ts +0 -136
- package/contracts/issuers/dashboard/index.ts +0 -72
- package/contracts/issuers/data-records/index.ts +0 -257
- package/contracts/issuers/data-rooms/index.ts +0 -134
- package/contracts/issuers/disbursement-approval-users/index.ts +0 -82
- package/contracts/issuers/disbursement-transactions/index.ts +0 -53
- package/contracts/issuers/disbursements/index.ts +0 -153
- package/contracts/issuers/email-themes/index.ts +0 -242
- package/contracts/issuers/escrow-accounts/index.ts +0 -81
- package/contracts/issuers/exchange-api-keys/index.ts +0 -144
- package/contracts/issuers/files/index.ts +0 -166
- package/contracts/issuers/files-public/index.ts +0 -166
- package/contracts/issuers/health/index.ts +0 -24
- package/contracts/issuers/index.ts +0 -112
- package/contracts/issuers/investor-accounts/index.ts +0 -148
- package/contracts/issuers/invites/index.ts +0 -129
- package/contracts/issuers/issuer/index.ts +0 -94
- package/contracts/issuers/issuer-bank-accounts/index.ts +0 -81
- package/contracts/issuers/issuer-payment-methods/index.ts +0 -136
- package/contracts/issuers/kyc/index.ts +0 -38
- package/contracts/issuers/login-histories/index.ts +0 -51
- package/contracts/issuers/notes/index.ts +0 -69
- package/contracts/issuers/offerings/index.ts +0 -206
- package/contracts/issuers/pages/index.ts +0 -138
- package/contracts/issuers/payment-methods/index.ts +0 -61
- package/contracts/issuers/portfolios/index.ts +0 -36
- package/contracts/issuers/rejection-reasons/index.ts +0 -32
- package/contracts/issuers/review/index.ts +0 -63
- package/contracts/issuers/secondary-customers/index.ts +0 -55
- package/contracts/issuers/secondary-orders/index.ts +0 -57
- package/contracts/issuers/secondary-trades/index.ts +0 -57
- package/contracts/issuers/secure-requests/index.ts +0 -34
- package/contracts/issuers/site-links/index.ts +0 -116
- package/contracts/issuers/site-settings/index.ts +0 -585
- package/contracts/issuers/sites/index.ts +0 -32
- package/contracts/issuers/tasks/index.ts +0 -111
- package/contracts/issuers/trades/index.ts +0 -132
- package/contracts/issuers/transactions/index.ts +0 -158
- package/contracts/issuers/user-manuals/index.ts +0 -62
- package/contracts/issuers/user-settings/index.ts +0 -170
- package/contracts/issuers/users/index.ts +0 -126
- package/contracts/secondaries/accounts/index.ts +0 -58
- package/contracts/secondaries/index.ts +0 -23
- package/contracts/secondaries/secondary-customers/index.ts +0 -55
- package/contracts/secondaries/secondary-issuers/index.ts +0 -94
- package/contracts/secondaries/secondary-orders/index.ts +0 -56
- package/contracts/secondaries/secondary-securities/index.ts +0 -95
- package/contracts/secondaries/secondary-trades/index.ts +0 -56
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { TypeID } from 'typeid-js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { IBaseEntity } from './entity.types';
|
|
4
|
-
import { accountIdSchema } from './account.types';
|
|
5
|
-
import { AccountZod, IPaginationMeta } from './common.types';
|
|
6
|
-
import { userIdSchema, UserZod } from './user.types';
|
|
7
|
-
|
|
8
|
-
export const disbursementApprovalUserIdSchema = z.string().refine(
|
|
9
|
-
(value) => {
|
|
10
|
-
try {
|
|
11
|
-
const tid = TypeID.fromString(value);
|
|
12
|
-
return tid.getType() === 'disbursement_approval_user';
|
|
13
|
-
} catch {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
message:
|
|
19
|
-
'Invalid disbursement approval user ID format. Must be a valid TypeID with "disbursement_approval_user" prefix.',
|
|
20
|
-
},
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
export enum DisbursementApprovalUsersRole {
|
|
24
|
-
CREATOR = 'CREATOR',
|
|
25
|
-
APPROVER = 'APPROVER',
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const DisbursementApprovalUserZod = IBaseEntity.extend({
|
|
29
|
-
role: z.nativeEnum(DisbursementApprovalUsersRole),
|
|
30
|
-
accountId: accountIdSchema,
|
|
31
|
-
account: z
|
|
32
|
-
.lazy(() => AccountZod)
|
|
33
|
-
.optional()
|
|
34
|
-
.nullable(),
|
|
35
|
-
userId: userIdSchema,
|
|
36
|
-
user: UserZod.optional().nullable(),
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export type DisbursementApprovalUserZod = z.infer<
|
|
40
|
-
typeof DisbursementApprovalUserZod
|
|
41
|
-
>;
|
|
42
|
-
|
|
43
|
-
export const PostDisbursementApprovalUser = z.object({
|
|
44
|
-
role: z.nativeEnum(DisbursementApprovalUsersRole),
|
|
45
|
-
userId: userIdSchema,
|
|
46
|
-
});
|
|
47
|
-
export type PostDisbursementApprovalUser = z.infer<
|
|
48
|
-
typeof PostDisbursementApprovalUser
|
|
49
|
-
>;
|
|
50
|
-
|
|
51
|
-
export const PostComplianceDisbursementApprovalUser =
|
|
52
|
-
PostDisbursementApprovalUser.extend({
|
|
53
|
-
accountId: accountIdSchema.optional().openapi({
|
|
54
|
-
example: 'account_00041061050r3gg28a1c60t3gf',
|
|
55
|
-
}),
|
|
56
|
-
});
|
|
57
|
-
export type PostComplianceDisbursementApprovalUser = z.infer<
|
|
58
|
-
typeof PostComplianceDisbursementApprovalUser
|
|
59
|
-
>;
|
|
60
|
-
|
|
61
|
-
export const DisbursementApprovalUserFiltersZod = z.object({
|
|
62
|
-
userId: userIdSchema.optional(),
|
|
63
|
-
role: z.nativeEnum(DisbursementApprovalUsersRole).optional(),
|
|
64
|
-
accountId: accountIdSchema.optional(),
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
export const IPaginatedDisbursementApprovalUser = z.object({
|
|
68
|
-
items: z.array(DisbursementApprovalUserZod),
|
|
69
|
-
meta: IPaginationMeta,
|
|
70
|
-
});
|
|
71
|
-
export type IPaginatedDisbursementApprovalUser = z.infer<
|
|
72
|
-
typeof IPaginatedDisbursementApprovalUser
|
|
73
|
-
>;
|
|
74
|
-
|
|
75
|
-
const disbursementApprovalUsersInclude = z.enum(['user', 'account']);
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* @description Query parameters for including related entities
|
|
79
|
-
* @xample in contract us as -> query: z.object({}).merge(DisbursementApprovalUsersIncludeQuery),
|
|
80
|
-
*/
|
|
81
|
-
export const DisbursementApprovalUsersIncludeQuery = z.object({
|
|
82
|
-
include: z
|
|
83
|
-
.string()
|
|
84
|
-
.optional()
|
|
85
|
-
.transform((str) => (str ? str.split(',') : []))
|
|
86
|
-
.refine(
|
|
87
|
-
(includes) =>
|
|
88
|
-
includes.every((include) =>
|
|
89
|
-
disbursementApprovalUsersInclude.options.includes(include as any),
|
|
90
|
-
),
|
|
91
|
-
{
|
|
92
|
-
message: `Invalid include option provided. Valid options are: ${disbursementApprovalUsersInclude.options.join(',')}`,
|
|
93
|
-
},
|
|
94
|
-
)
|
|
95
|
-
.openapi({
|
|
96
|
-
example: `${disbursementApprovalUsersInclude.options.join(',')}`,
|
|
97
|
-
}),
|
|
98
|
-
});
|
|
99
|
-
export interface DisbursementApprovalUsersIncludeQuery
|
|
100
|
-
extends z.infer<typeof DisbursementApprovalUsersIncludeQuery> {}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { TypeID } from 'typeid-js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { userIdSchema, UserZod } from './user.types';
|
|
4
|
-
import {
|
|
5
|
-
disbursementIdSchema,
|
|
6
|
-
DisbursementStatus,
|
|
7
|
-
} from './disbursements.types';
|
|
8
|
-
import { IBaseEntity } from './entity.types';
|
|
9
|
-
import { accountIdSchema } from './account.types';
|
|
10
|
-
import { AccountZod, ComplianceReview, IPaginationMeta } from './common.types';
|
|
11
|
-
|
|
12
|
-
export const disbursementReviewIdSchema = z.string().refine(
|
|
13
|
-
(value) => {
|
|
14
|
-
try {
|
|
15
|
-
const tid = TypeID.fromString(value);
|
|
16
|
-
return tid.getType() === 'disbursement_review';
|
|
17
|
-
} catch {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
message:
|
|
23
|
-
'Invalid disbursement review ID format. Must be a valid TypeID with "disbursement_review" prefix.',
|
|
24
|
-
},
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
export const PostDisbursementReviewZod = z.object({
|
|
28
|
-
disbursementReview: z.enum(['APPROVED', 'REJECTED']),
|
|
29
|
-
disbursements: z
|
|
30
|
-
.array(disbursementIdSchema)
|
|
31
|
-
.min(1, 'disbursement is required')
|
|
32
|
-
.max(1, 'Maximum of 1 disbursement allowed')
|
|
33
|
-
.openapi({
|
|
34
|
-
example: ['disbursement_01jjsdrx1seqfse7z4z47sgdp5'],
|
|
35
|
-
}),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export type PostDisbursementReviewZod = z.infer<
|
|
39
|
-
typeof PostDisbursementReviewZod
|
|
40
|
-
>;
|
|
41
|
-
|
|
42
|
-
export const DisbursementReviewZod = IBaseEntity.extend({
|
|
43
|
-
accountId: accountIdSchema,
|
|
44
|
-
account: AccountZod.optional().nullable(),
|
|
45
|
-
userId: userIdSchema,
|
|
46
|
-
user: UserZod.optional().nullable(),
|
|
47
|
-
status: z.nativeEnum(DisbursementStatus),
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
export type DisbursementReviewZod = z.infer<typeof DisbursementReviewZod>;
|
|
51
|
-
|
|
52
|
-
export const IPaginatedDisbursementReviews = z.object({
|
|
53
|
-
items: z.array(DisbursementReviewZod),
|
|
54
|
-
meta: IPaginationMeta,
|
|
55
|
-
});
|
|
56
|
-
export type IPaginatedDisbursementReviews = z.infer<
|
|
57
|
-
typeof IPaginatedDisbursementReviews
|
|
58
|
-
>;
|
|
59
|
-
|
|
60
|
-
const disbursementReviewsInclude = z.enum(['user', 'account', 'disbursement']);
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @description Query parameters for including related entities
|
|
64
|
-
* @xample in contract us as -> query: z.object({}).merge(DisbursementReviewsIncludeQuery),
|
|
65
|
-
*/
|
|
66
|
-
export const DisbursementReviewsIncludeQuery = z.object({
|
|
67
|
-
include: z
|
|
68
|
-
.string()
|
|
69
|
-
.optional()
|
|
70
|
-
.transform((str) => (str ? str.split(',') : []))
|
|
71
|
-
.refine(
|
|
72
|
-
(includes) =>
|
|
73
|
-
includes.every((include) =>
|
|
74
|
-
disbursementReviewsInclude.options.includes(include as any),
|
|
75
|
-
),
|
|
76
|
-
{
|
|
77
|
-
message: `Invalid include option provided. Valid options are: ${disbursementReviewsInclude.options.join(',')}`,
|
|
78
|
-
},
|
|
79
|
-
)
|
|
80
|
-
.openapi({
|
|
81
|
-
example: `${disbursementReviewsInclude.options.join(',')}`,
|
|
82
|
-
}),
|
|
83
|
-
});
|
|
84
|
-
export interface DisbursementReviewsIncludeQuery
|
|
85
|
-
extends z.infer<typeof DisbursementReviewsIncludeQuery> {}
|
|
86
|
-
|
|
87
|
-
export const DisbursementReviewFiltersZod = z.object({
|
|
88
|
-
disbursementId: disbursementIdSchema,
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
export const PostComplianceReviewDisbursementZod = z.object({
|
|
92
|
-
complianceReview: z.enum([
|
|
93
|
-
ComplianceReview.APPROVED,
|
|
94
|
-
ComplianceReview.REJECTED,
|
|
95
|
-
]),
|
|
96
|
-
disbursements: z
|
|
97
|
-
.array(disbursementIdSchema)
|
|
98
|
-
.min(1, 'At least one disbursement is required')
|
|
99
|
-
.max(50, 'Maximum of 50 disbursements allowed')
|
|
100
|
-
.openapi({
|
|
101
|
-
example: [
|
|
102
|
-
'disbursement_01jjsdrx1seqfse7z4z47sgdp5',
|
|
103
|
-
'disbursement_01jjsdrx27enkszq5cnc3hdhrf',
|
|
104
|
-
],
|
|
105
|
-
}),
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
export type PostComplianceReviewDisbursementZod = z.infer<
|
|
109
|
-
typeof PostComplianceReviewDisbursementZod
|
|
110
|
-
>;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { TypeID } from 'typeid-js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
import { accountIdSchema } from './account.types';
|
|
5
|
-
import { IBaseEntity } from './entity.types';
|
|
6
|
-
import { dateSchema } from './common.types';
|
|
7
|
-
import { TransactionStatus, TransactionType } from './transaction.types';
|
|
8
|
-
import { disbursementIdSchema, DisbursementZod } from './disbursements.types';
|
|
9
|
-
|
|
10
|
-
export const disbursementTransactionIdSchema = z.string().refine(
|
|
11
|
-
(value) => {
|
|
12
|
-
try {
|
|
13
|
-
const tid = TypeID.fromString(value);
|
|
14
|
-
return tid.getType() === 'disbursement_transaction';
|
|
15
|
-
} catch {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
message: `Invalid disbursement transaction ID format. Must be a valid TypeID with "disbursement_transaction" prefix.`,
|
|
21
|
-
},
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
export const DisbursementTransactionZod = IBaseEntity.extend({
|
|
25
|
-
id: disbursementTransactionIdSchema,
|
|
26
|
-
accountId: accountIdSchema,
|
|
27
|
-
type: z.nativeEnum(TransactionType),
|
|
28
|
-
status: z.nativeEnum(TransactionStatus),
|
|
29
|
-
tid: z.string().nullable(),
|
|
30
|
-
amount: z.number(),
|
|
31
|
-
currencyCode: z.string(),
|
|
32
|
-
chargedAt: z.date().nullable(),
|
|
33
|
-
cancelledAt: z.date().nullable(),
|
|
34
|
-
disbursementId: z.lazy(() => disbursementIdSchema).nullable(),
|
|
35
|
-
disbursement: z
|
|
36
|
-
.lazy(() => DisbursementZod)
|
|
37
|
-
.optional()
|
|
38
|
-
.nullable(),
|
|
39
|
-
});
|
|
40
|
-
export type DisbursementTransactionZod = z.infer<
|
|
41
|
-
typeof DisbursementTransactionZod
|
|
42
|
-
>;
|
|
43
|
-
|
|
44
|
-
export const PostDisbursementTransactionZod = z.object({
|
|
45
|
-
tid: z.string().min(6).max(64).openapi({ example: 'TXN8A7B6C5' }),
|
|
46
|
-
type: z
|
|
47
|
-
.nativeEnum(TransactionType)
|
|
48
|
-
.openapi({ example: TransactionType.CHARGE }),
|
|
49
|
-
amount: z.number().min(0.01).max(10000000000).openapi({ example: 2000 }),
|
|
50
|
-
disbursementId: z
|
|
51
|
-
.lazy(() => disbursementIdSchema)
|
|
52
|
-
.openapi({
|
|
53
|
-
example: 'disbursement_01j5y5ghx5fg68d663j1fvy2x7',
|
|
54
|
-
}),
|
|
55
|
-
});
|
|
56
|
-
export type PostDisbursementTransactionZod = z.infer<
|
|
57
|
-
typeof PostDisbursementTransactionZod
|
|
58
|
-
>;
|
|
59
|
-
|
|
60
|
-
export const CompliancePostDisbursementTransactionZod =
|
|
61
|
-
PostDisbursementTransactionZod.merge(
|
|
62
|
-
z.object({
|
|
63
|
-
chargedAt: dateSchema.refine(
|
|
64
|
-
(date) => date instanceof Date && date <= new Date(),
|
|
65
|
-
{ message: 'date cannot be in the future' },
|
|
66
|
-
),
|
|
67
|
-
accountId: accountIdSchema,
|
|
68
|
-
}),
|
|
69
|
-
);
|
|
70
|
-
export type CompliancePostDisbursementTransactionZod = z.infer<
|
|
71
|
-
typeof CompliancePostDisbursementTransactionZod
|
|
72
|
-
>;
|
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { IBaseEntity } from './entity.types';
|
|
3
|
-
import { IOffering, offeringIdSchema } from './offering.types';
|
|
4
|
-
import {
|
|
5
|
-
AccountZod,
|
|
6
|
-
BaseStatus,
|
|
7
|
-
ComplianceReview,
|
|
8
|
-
dateSchema,
|
|
9
|
-
IPaginationMeta,
|
|
10
|
-
} from './common.types';
|
|
11
|
-
import { tradeIdSchema } from './trade.types';
|
|
12
|
-
import { accountIdSchema } from './account.types';
|
|
13
|
-
import { TypeID } from 'typeid-js';
|
|
14
|
-
import { issuerIdSchema } from './issuer.types';
|
|
15
|
-
import { issuerBankAccountIdSchema } from './issuer-bank-account.types';
|
|
16
|
-
import { userIdSchema, UserZod } from './user.types';
|
|
17
|
-
import {
|
|
18
|
-
PostDisbursementAdjustmentZod,
|
|
19
|
-
DisbursementAdjustmentType,
|
|
20
|
-
} from './disbursement-adjustment.types';
|
|
21
|
-
import { escrowAccountIdSchema } from './escrow-account.types';
|
|
22
|
-
|
|
23
|
-
export const disbursementIdSchema = z.string().refine(
|
|
24
|
-
(value) => {
|
|
25
|
-
try {
|
|
26
|
-
const tid = TypeID.fromString(value);
|
|
27
|
-
return tid.getType() === 'disbursement';
|
|
28
|
-
} catch {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
message:
|
|
34
|
-
'Invalid disbursement ID format. Must be a valid TypeID with "disbursement" prefix.',
|
|
35
|
-
},
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
export enum DisbursementStatus {
|
|
39
|
-
PENDING = BaseStatus.PENDING,
|
|
40
|
-
APPROVED = BaseStatus.APPROVED,
|
|
41
|
-
REJECTED = BaseStatus.REJECTED,
|
|
42
|
-
SETTLED = BaseStatus.SETTLED,
|
|
43
|
-
COMPLETED = BaseStatus.COMPLETED,
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export const DisbursementZod = IBaseEntity.extend({
|
|
47
|
-
name: z.string().openapi({ example: 'Dalmore' }),
|
|
48
|
-
status: z
|
|
49
|
-
.nativeEnum(DisbursementStatus)
|
|
50
|
-
.openapi({ example: DisbursementStatus.PENDING }),
|
|
51
|
-
requestedAmount: z.number().openapi({ example: 100 }),
|
|
52
|
-
netAmount: z.number().openapi({ example: 1000 }),
|
|
53
|
-
complianceReview: z.nativeEnum(ComplianceReview),
|
|
54
|
-
approversCount: z.number(),
|
|
55
|
-
disbursedAt: z.date().nullable(),
|
|
56
|
-
accountId: accountIdSchema,
|
|
57
|
-
account: z
|
|
58
|
-
.lazy(() => AccountZod)
|
|
59
|
-
.optional()
|
|
60
|
-
.nullable(),
|
|
61
|
-
offeringId: offeringIdSchema,
|
|
62
|
-
offering: z
|
|
63
|
-
.lazy(() => IOffering)
|
|
64
|
-
.optional()
|
|
65
|
-
.nullable(),
|
|
66
|
-
createdById: userIdSchema,
|
|
67
|
-
createdBy: UserZod.optional().nullable(),
|
|
68
|
-
reviewedById: z
|
|
69
|
-
.string()
|
|
70
|
-
.nullable()
|
|
71
|
-
.openapi({ example: 'user_00041061050r3gg28a1c60t3gf' }),
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
export type DisbursementZod = z.infer<typeof DisbursementZod>;
|
|
75
|
-
|
|
76
|
-
export const PostDisbursementTrades = z.object({
|
|
77
|
-
accountId: accountIdSchema.openapi({
|
|
78
|
-
example: 'account_00041061050r3gg28a1c60t3gf',
|
|
79
|
-
}),
|
|
80
|
-
name: z.string().openapi({ example: 'Dalmore' }),
|
|
81
|
-
offeringId: z
|
|
82
|
-
.lazy(() => offeringIdSchema)
|
|
83
|
-
.openapi({
|
|
84
|
-
example: 'offering_00041061050r3gg28a1c60t3gf',
|
|
85
|
-
}),
|
|
86
|
-
trades: z
|
|
87
|
-
.array(tradeIdSchema)
|
|
88
|
-
.min(1, 'At least one trade is required')
|
|
89
|
-
.max(500, 'Maximum of 500 trades allowed')
|
|
90
|
-
.openapi({
|
|
91
|
-
example: [
|
|
92
|
-
'trade_00041061050r3gg28a1c60t3gf',
|
|
93
|
-
'trade_00041061050r3gg28a1c60t3g',
|
|
94
|
-
],
|
|
95
|
-
}),
|
|
96
|
-
});
|
|
97
|
-
export type PostDisbursementTrades = z.infer<typeof PostDisbursementTrades>;
|
|
98
|
-
|
|
99
|
-
export const PostDisbursementOfferings = z.object({
|
|
100
|
-
accountId: accountIdSchema.openapi({
|
|
101
|
-
example: 'account_00041061050r3gg28a1c60t3gf',
|
|
102
|
-
}),
|
|
103
|
-
name: z.string().openapi({ example: 'Dalmore' }),
|
|
104
|
-
offeringId: z
|
|
105
|
-
.lazy(() => offeringIdSchema)
|
|
106
|
-
.openapi({
|
|
107
|
-
example: 'offering_00041061050r3gg28a1c60t3gf',
|
|
108
|
-
}),
|
|
109
|
-
});
|
|
110
|
-
export type PostDisbursementOfferings = z.infer<
|
|
111
|
-
typeof PostDisbursementOfferings
|
|
112
|
-
>;
|
|
113
|
-
|
|
114
|
-
export const DisbursementFiltersZod = z.object({
|
|
115
|
-
name: z.string().optional(),
|
|
116
|
-
offeringId: z.lazy(() => offeringIdSchema).optional(),
|
|
117
|
-
issuerId: z.lazy(() => issuerIdSchema).optional(),
|
|
118
|
-
search: z.string().optional(),
|
|
119
|
-
status: z
|
|
120
|
-
.nativeEnum(DisbursementStatus)
|
|
121
|
-
.optional()
|
|
122
|
-
.openapi({ example: 'PENDING' }),
|
|
123
|
-
from: dateSchema.optional().openapi({ example: 'MM/DD/YYYY' }),
|
|
124
|
-
to: dateSchema.optional().openapi({ example: 'MM/DD/YYYY' }),
|
|
125
|
-
accountId: accountIdSchema.optional(),
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
export const IPaginatedDisbursement = z.object({
|
|
129
|
-
items: z.array(DisbursementZod),
|
|
130
|
-
meta: IPaginationMeta,
|
|
131
|
-
});
|
|
132
|
-
export type IPaginatedDisbursement = z.infer<typeof IPaginatedDisbursement>;
|
|
133
|
-
|
|
134
|
-
export const disbursementsInclude = z.enum([
|
|
135
|
-
'createdBy',
|
|
136
|
-
'reviewedBy',
|
|
137
|
-
'offering',
|
|
138
|
-
'account',
|
|
139
|
-
'issuerBankAccount',
|
|
140
|
-
'escrowAccount',
|
|
141
|
-
'disbursementAdjustments',
|
|
142
|
-
'tradeDisbursements',
|
|
143
|
-
'disbursementReviews',
|
|
144
|
-
'disbursementTransactions',
|
|
145
|
-
'issuer',
|
|
146
|
-
]);
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* @description Query parameters for including related entities
|
|
150
|
-
* @xample in contract us as -> query: z.object({}).merge(DisbursementsIncludeQuery),
|
|
151
|
-
*/
|
|
152
|
-
export const DisbursementsIncludeQuery = z.object({
|
|
153
|
-
include: z
|
|
154
|
-
.string()
|
|
155
|
-
.optional()
|
|
156
|
-
.transform((str) => (str ? str.split(',') : []))
|
|
157
|
-
.refine(
|
|
158
|
-
(includes) =>
|
|
159
|
-
includes.every((include) =>
|
|
160
|
-
disbursementsInclude.options.includes(include as any),
|
|
161
|
-
),
|
|
162
|
-
{
|
|
163
|
-
message: `Invalid include option provided. Valid options are: ${disbursementsInclude.options.join(',')}`,
|
|
164
|
-
},
|
|
165
|
-
)
|
|
166
|
-
.openapi({
|
|
167
|
-
example: `${disbursementsInclude.options.join(',')}`,
|
|
168
|
-
}),
|
|
169
|
-
});
|
|
170
|
-
export interface DisbursementsIncludeQuery
|
|
171
|
-
extends z.infer<typeof DisbursementsIncludeQuery> {}
|
|
172
|
-
|
|
173
|
-
export const PostDisbursementZod = z.object({
|
|
174
|
-
name: z.string().max(50).openapi({ example: 'Dalmore' }),
|
|
175
|
-
offeringId: z
|
|
176
|
-
.lazy(() => offeringIdSchema)
|
|
177
|
-
.openapi({
|
|
178
|
-
example: 'offering_00041061050r3gg28a1c60t3gf',
|
|
179
|
-
}),
|
|
180
|
-
issuerId: z
|
|
181
|
-
.lazy(() => issuerIdSchema)
|
|
182
|
-
.openapi({
|
|
183
|
-
example: 'issuer_00041061050r3gg28a1c60t3gf',
|
|
184
|
-
}),
|
|
185
|
-
issuerBankAccountId: z
|
|
186
|
-
.lazy(() => issuerBankAccountIdSchema)
|
|
187
|
-
.openapi({
|
|
188
|
-
example: 'issuer_bank_account_00041061050r3gg28a1c60t3gf',
|
|
189
|
-
}),
|
|
190
|
-
requestedAmount: z
|
|
191
|
-
.number()
|
|
192
|
-
.min(0.01)
|
|
193
|
-
.max(10000000000)
|
|
194
|
-
.openapi({ example: 2000 }),
|
|
195
|
-
netAmount: z.number().min(0.01).max(10000000000).openapi({ example: 5000 }),
|
|
196
|
-
disbursedAt: dateSchema.optional().nullable(),
|
|
197
|
-
tradeIds: z.array(tradeIdSchema).min(1).max(100),
|
|
198
|
-
disbursementAdjustments: z.array(PostDisbursementAdjustmentZod).refine(
|
|
199
|
-
(adjustments) => {
|
|
200
|
-
const adjustmentTypes = adjustments.map((adj) => adj.type);
|
|
201
|
-
const requiredTypes = Object.values(DisbursementAdjustmentType);
|
|
202
|
-
return requiredTypes.every((type) => adjustmentTypes.includes(type));
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
message: `All disbursement adjustments are required: ${Object.values(DisbursementAdjustmentType).join(', ')}`,
|
|
206
|
-
},
|
|
207
|
-
),
|
|
208
|
-
escrowAccountId: z.lazy(() => escrowAccountIdSchema),
|
|
209
|
-
});
|
|
210
|
-
export type PostDisbursementZod = z.infer<typeof PostDisbursementZod>;
|
|
211
|
-
|
|
212
|
-
export const CompliancePostDisbursementZod = PostDisbursementZod.extend({
|
|
213
|
-
accountId: accountIdSchema,
|
|
214
|
-
});
|
|
215
|
-
export type CompliancePostDisbursementZod = z.infer<
|
|
216
|
-
typeof CompliancePostDisbursementZod
|
|
217
|
-
>;
|
|
218
|
-
|
|
219
|
-
export const DisbursementsMissingConfigQuery = z.object({
|
|
220
|
-
accountId: accountIdSchema.optional(),
|
|
221
|
-
});
|
|
222
|
-
export interface DisbursementsMissingConfigQuery
|
|
223
|
-
extends z.infer<typeof DisbursementsMissingConfigQuery> {}
|
|
224
|
-
|
|
225
|
-
export const DisbursementMissingConfigZod = z.object({
|
|
226
|
-
missingConfigurations: z.array(z.string()),
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
export type DisbursementMissingConfigZod = z.infer<
|
|
230
|
-
typeof DisbursementMissingConfigZod
|
|
231
|
-
>;
|
|
232
|
-
|
|
233
|
-
export const DisbursementSigningLinkZod = z.string().nullable();
|
|
234
|
-
|
|
235
|
-
export type DisbursementSigningLinkZod = z.infer<
|
|
236
|
-
typeof DisbursementSigningLinkZod
|
|
237
|
-
>;
|
|
238
|
-
|
|
239
|
-
export const ComplianceReviewDisbursements = z.object({
|
|
240
|
-
complianceReview: z.enum([
|
|
241
|
-
ComplianceReview.APPROVED,
|
|
242
|
-
ComplianceReview.REJECTED,
|
|
243
|
-
]),
|
|
244
|
-
disbursements: z
|
|
245
|
-
.array(disbursementIdSchema)
|
|
246
|
-
.min(1, 'At least one disbursement is required')
|
|
247
|
-
.max(50, 'Maximum of 50 disbursements allowed')
|
|
248
|
-
.openapi({
|
|
249
|
-
example: [
|
|
250
|
-
'disbursement_01jjsdrx1seqfse7z4z47sgdp5',
|
|
251
|
-
'disbursement_01jjsdrx27enkszq5cnc3hdhrf',
|
|
252
|
-
],
|
|
253
|
-
}),
|
|
254
|
-
});
|
|
255
|
-
export type ComplianceReviewDisbursements = z.infer<
|
|
256
|
-
typeof ComplianceReviewDisbursements
|
|
257
|
-
>;
|
|
258
|
-
|
|
259
|
-
export const TradeDisbursementZod = z.object({
|
|
260
|
-
id: z
|
|
261
|
-
.lazy(() => disbursementIdSchema)
|
|
262
|
-
.openapi({
|
|
263
|
-
example: 'disbursement_00041061050r3gg28a1c60t3gf',
|
|
264
|
-
}),
|
|
265
|
-
name: z.string().openapi({ example: 'Disbursement Name' }),
|
|
266
|
-
status: z
|
|
267
|
-
.nativeEnum(DisbursementStatus)
|
|
268
|
-
.openapi({ example: DisbursementStatus.PENDING }),
|
|
269
|
-
date: z.date().nullable().openapi({ example: 'MM/DD/YYYY' }),
|
|
270
|
-
});
|
|
271
|
-
export type TradeDisbursementZod = z.infer<typeof TradeDisbursementZod>;
|
|
272
|
-
|
|
273
|
-
export const TradeDisbursementsZod = z.array(TradeDisbursementZod);
|
|
274
|
-
export type TradeDisbursementsZod = z.infer<typeof TradeDisbursementsZod>;
|
|
275
|
-
|
|
276
|
-
export const PostDisbursementBalanceZod = z.object({
|
|
277
|
-
offeringId: offeringIdSchema,
|
|
278
|
-
});
|
|
279
|
-
export type PostDisbursementBalanceZod = z.infer<
|
|
280
|
-
typeof PostDisbursementBalanceZod
|
|
281
|
-
>;
|
|
282
|
-
|
|
283
|
-
export const PostDisbursementSummaryZod = z.object({
|
|
284
|
-
offeringId: offeringIdSchema,
|
|
285
|
-
tradeIds: z.array(tradeIdSchema).min(1).max(1000),
|
|
286
|
-
});
|
|
287
|
-
export type PostDisbursementSummaryZod = z.infer<
|
|
288
|
-
typeof PostDisbursementSummaryZod
|
|
289
|
-
>;
|
|
290
|
-
|
|
291
|
-
export const DisbursementBalanceZod = z.object({
|
|
292
|
-
contingencyAmount: z.number(),
|
|
293
|
-
contingencyStatus: z.string(),
|
|
294
|
-
totalRaised: z.number(),
|
|
295
|
-
totalDisbursed: z.number(),
|
|
296
|
-
totalPending: z.number(),
|
|
297
|
-
totalFees: z.number(),
|
|
298
|
-
refundPool: z.number(),
|
|
299
|
-
availableForDisbursements: z.number(),
|
|
300
|
-
});
|
|
301
|
-
export type DisbursementBalanceZod = z.infer<typeof DisbursementBalanceZod>;
|
|
302
|
-
|
|
303
|
-
export const DisbursementSummaryZod = z.object({
|
|
304
|
-
amountRequested: z.number(),
|
|
305
|
-
brokerageFee: z.number(),
|
|
306
|
-
disbursementFee: z.number(),
|
|
307
|
-
refundPool: z.number(),
|
|
308
|
-
amountToBeTransferred: z.number(),
|
|
309
|
-
});
|
|
310
|
-
export type DisbursementSummaryZod = z.infer<typeof DisbursementSummaryZod>;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { extendZodWithOpenApi } from '@anatine/zod-openapi';
|
|
2
|
-
import { TypeID } from 'typeid-js';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
import { IBaseEntity } from './entity.types';
|
|
5
|
-
import { DomainSchema, IPaginationMeta } from './common.types';
|
|
6
|
-
extendZodWithOpenApi(z);
|
|
7
|
-
export const domainFilterIdSchema = z.string().refine(
|
|
8
|
-
(value) => {
|
|
9
|
-
try {
|
|
10
|
-
const tid = TypeID.fromString(value);
|
|
11
|
-
return tid.getType() === 'domain_filter';
|
|
12
|
-
} catch {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
message:
|
|
18
|
-
'Invalid domain filter ID format. Must be a valid TypeID with "domain_filter" prefix. Example: domain_filter_01j5y5ghx5fg68d663j1fvy2x7',
|
|
19
|
-
},
|
|
20
|
-
);
|
|
21
|
-
export const DomainFilterZod = IBaseEntity.extend({
|
|
22
|
-
id: domainFilterIdSchema,
|
|
23
|
-
domain: z.string(),
|
|
24
|
-
});
|
|
25
|
-
export type DomainFilterZod = z.infer<typeof DomainFilterZod>;
|
|
26
|
-
|
|
27
|
-
export const IPaginatedDomainFilter = z.object({
|
|
28
|
-
items: z.array(DomainFilterZod),
|
|
29
|
-
meta: IPaginationMeta,
|
|
30
|
-
});
|
|
31
|
-
export type IPaginatedDomainFilter = z.infer<typeof IPaginatedDomainFilter>;
|
|
32
|
-
|
|
33
|
-
export const PostDomainFilterZod = z.object({
|
|
34
|
-
domain: DomainSchema.openapi({ example: 'dalmoregroup.com' }),
|
|
35
|
-
});
|
|
36
|
-
export type PostDomainFilterZod = z.infer<typeof PostDomainFilterZod>;
|
|
37
|
-
|
|
38
|
-
export const PatchDomainFilterZod = PostDomainFilterZod.extend({});
|
|
39
|
-
export type PatchDomainFilterZod = z.infer<typeof PatchDomainFilterZod>;
|
|
40
|
-
|
|
41
|
-
export const DomainFilterFiltersZod = z.object({
|
|
42
|
-
domain: z
|
|
43
|
-
.string()
|
|
44
|
-
.max(30)
|
|
45
|
-
.optional()
|
|
46
|
-
.openapi({ example: 'dalmoregroup.com' }),
|
|
47
|
-
});
|
|
48
|
-
export type DomainFilterFiltersZod = z.infer<typeof DomainFilterFiltersZod>;
|
|
49
|
-
|
|
50
|
-
export const DomainFilterDeleteResponseZod = z.object({
|
|
51
|
-
message: z.string(),
|
|
52
|
-
});
|
|
53
|
-
export type DomainFilterDeleteResponseZod = z.infer<
|
|
54
|
-
typeof DomainFilterDeleteResponseZod
|
|
55
|
-
>;
|