@taxdao/fintax-mcp 0.2.0
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 +220 -0
- package/dist/app/create-server.d.ts +18 -0
- package/dist/app/create-server.js +80 -0
- package/dist/app/create-server.js.map +1 -0
- package/dist/app/register-tools.d.ts +4 -0
- package/dist/app/register-tools.js +18 -0
- package/dist/app/register-tools.js.map +1 -0
- package/dist/audit/audit-context.d.ts +38 -0
- package/dist/audit/audit-context.js +167 -0
- package/dist/audit/audit-context.js.map +1 -0
- package/dist/audit/audit-sink.d.ts +20 -0
- package/dist/audit/audit-sink.js +6 -0
- package/dist/audit/audit-sink.js.map +1 -0
- package/dist/audit/file-audit-sink.d.ts +6 -0
- package/dist/audit/file-audit-sink.js +18 -0
- package/dist/audit/file-audit-sink.js.map +1 -0
- package/dist/auth/auth-session.d.ts +63 -0
- package/dist/auth/auth-session.js +226 -0
- package/dist/auth/auth-session.js.map +1 -0
- package/dist/auth/credentials.d.ts +6 -0
- package/dist/auth/credentials.js +12 -0
- package/dist/auth/credentials.js.map +1 -0
- package/dist/auth/org-token-provider.d.ts +15 -0
- package/dist/auth/org-token-provider.js +62 -0
- package/dist/auth/org-token-provider.js.map +1 -0
- package/dist/capabilities/capability.d.ts +100 -0
- package/dist/capabilities/capability.js +26 -0
- package/dist/capabilities/capability.js.map +1 -0
- package/dist/capabilities/create-capabilities.d.ts +2 -0
- package/dist/capabilities/create-capabilities.js +37 -0
- package/dist/capabilities/create-capabilities.js.map +1 -0
- package/dist/capabilities/define-capability.d.ts +39 -0
- package/dist/capabilities/define-capability.js +64 -0
- package/dist/capabilities/define-capability.js.map +1 -0
- package/dist/capabilities/definitions/accounting-balances.d.ts +4 -0
- package/dist/capabilities/definitions/accounting-balances.js +98 -0
- package/dist/capabilities/definitions/accounting-balances.js.map +1 -0
- package/dist/capabilities/definitions/accounting-context.d.ts +2 -0
- package/dist/capabilities/definitions/accounting-context.js +17 -0
- package/dist/capabilities/definitions/accounting-context.js.map +1 -0
- package/dist/capabilities/definitions/assets.d.ts +2 -0
- package/dist/capabilities/definitions/assets.js +367 -0
- package/dist/capabilities/definitions/assets.js.map +1 -0
- package/dist/capabilities/definitions/business-documents.d.ts +9 -0
- package/dist/capabilities/definitions/business-documents.js +386 -0
- package/dist/capabilities/definitions/business-documents.js.map +1 -0
- package/dist/capabilities/definitions/dashboard.d.ts +2 -0
- package/dist/capabilities/definitions/dashboard.js +153 -0
- package/dist/capabilities/definitions/dashboard.js.map +1 -0
- package/dist/capabilities/definitions/extended-operation-contracts.d.ts +597 -0
- package/dist/capabilities/definitions/extended-operation-contracts.js +1180 -0
- package/dist/capabilities/definitions/extended-operation-contracts.js.map +1 -0
- package/dist/capabilities/definitions/extended-operations.d.ts +2 -0
- package/dist/capabilities/definitions/extended-operations.js +699 -0
- package/dist/capabilities/definitions/extended-operations.js.map +1 -0
- package/dist/capabilities/definitions/financial-reports.d.ts +2 -0
- package/dist/capabilities/definitions/financial-reports.js +100 -0
- package/dist/capabilities/definitions/financial-reports.js.map +1 -0
- package/dist/capabilities/definitions/fnd-import.d.ts +34 -0
- package/dist/capabilities/definitions/fnd-import.js +282 -0
- package/dist/capabilities/definitions/fnd-import.js.map +1 -0
- package/dist/capabilities/definitions/fund-accounts.d.ts +2 -0
- package/dist/capabilities/definitions/fund-accounts.js +188 -0
- package/dist/capabilities/definitions/fund-accounts.js.map +1 -0
- package/dist/capabilities/definitions/fund-balances.d.ts +2 -0
- package/dist/capabilities/definitions/fund-balances.js +84 -0
- package/dist/capabilities/definitions/fund-balances.js.map +1 -0
- package/dist/capabilities/definitions/journals.d.ts +10 -0
- package/dist/capabilities/definitions/journals.js +224 -0
- package/dist/capabilities/definitions/journals.js.map +1 -0
- package/dist/capabilities/definitions/master-data.d.ts +2 -0
- package/dist/capabilities/definitions/master-data.js +451 -0
- package/dist/capabilities/definitions/master-data.js.map +1 -0
- package/dist/capabilities/definitions/pnl.d.ts +2 -0
- package/dist/capabilities/definitions/pnl.js +139 -0
- package/dist/capabilities/definitions/pnl.js.map +1 -0
- package/dist/capabilities/definitions/reference-data.d.ts +2 -0
- package/dist/capabilities/definitions/reference-data.js +169 -0
- package/dist/capabilities/definitions/reference-data.js.map +1 -0
- package/dist/capabilities/definitions/transaction-drafts.d.ts +2 -0
- package/dist/capabilities/definitions/transaction-drafts.js +157 -0
- package/dist/capabilities/definitions/transaction-drafts.js.map +1 -0
- package/dist/capabilities/definitions/transactions.d.ts +168 -0
- package/dist/capabilities/definitions/transactions.js +79 -0
- package/dist/capabilities/definitions/transactions.js.map +1 -0
- package/dist/capabilities/executor.d.ts +19 -0
- package/dist/capabilities/executor.js +134 -0
- package/dist/capabilities/executor.js.map +1 -0
- package/dist/capabilities/registry.d.ts +7 -0
- package/dist/capabilities/registry.js +51 -0
- package/dist/capabilities/registry.js.map +1 -0
- package/dist/clients/base-client.d.ts +5 -0
- package/dist/clients/base-client.js +13 -0
- package/dist/clients/base-client.js.map +1 -0
- package/dist/clients/http-client.d.ts +29 -0
- package/dist/clients/http-client.js +167 -0
- package/dist/clients/http-client.js.map +1 -0
- package/dist/clients/suite-client.d.ts +5 -0
- package/dist/clients/suite-client.js +5 -0
- package/dist/clients/suite-client.js.map +1 -0
- package/dist/concurrency/lock-manager.d.ts +4 -0
- package/dist/concurrency/lock-manager.js +23 -0
- package/dist/concurrency/lock-manager.js.map +1 -0
- package/dist/config/load-config.d.ts +2 -0
- package/dist/config/load-config.js +18 -0
- package/dist/config/load-config.js.map +1 -0
- package/dist/config/schema.d.ts +24 -0
- package/dist/config/schema.js +85 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/errors/fintax-error.d.ts +24 -0
- package/dist/errors/fintax-error.js +21 -0
- package/dist/errors/fintax-error.js.map +1 -0
- package/dist/errors/normalize-error.d.ts +3 -0
- package/dist/errors/normalize-error.js +67 -0
- package/dist/errors/normalize-error.js.map +1 -0
- package/dist/files/artifact-store.d.ts +17 -0
- package/dist/files/artifact-store.js +74 -0
- package/dist/files/artifact-store.js.map +1 -0
- package/dist/files/input-policy.d.ts +28 -0
- package/dist/files/input-policy.js +109 -0
- package/dist/files/input-policy.js.map +1 -0
- package/dist/files/roots-provider.d.ts +14 -0
- package/dist/files/roots-provider.js +47 -0
- package/dist/files/roots-provider.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/logger.d.ts +3 -0
- package/dist/logging/logger.js +13 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/policies/idempotency.d.ts +32 -0
- package/dist/policies/idempotency.js +155 -0
- package/dist/policies/idempotency.js.map +1 -0
- package/dist/policies/job-reference.d.ts +16 -0
- package/dist/policies/job-reference.js +62 -0
- package/dist/policies/job-reference.js.map +1 -0
- package/dist/policies/operation-plan.d.ts +27 -0
- package/dist/policies/operation-plan.js +99 -0
- package/dist/policies/operation-plan.js.map +1 -0
- package/dist/policies/redaction.d.ts +2 -0
- package/dist/policies/redaction.js +29 -0
- package/dist/policies/redaction.js.map +1 -0
- package/dist/policies/retry.d.ts +8 -0
- package/dist/policies/retry.js +19 -0
- package/dist/policies/retry.js.map +1 -0
- package/dist/responses/tool-response.d.ts +4 -0
- package/dist/responses/tool-response.js +24 -0
- package/dist/responses/tool-response.js.map +1 -0
- package/dist/schemas/common.d.ts +226 -0
- package/dist/schemas/common.js +133 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/domains/accounting-balances.d.ts +497 -0
- package/dist/schemas/domains/accounting-balances.js +226 -0
- package/dist/schemas/domains/accounting-balances.js.map +1 -0
- package/dist/schemas/domains/accounting-context.d.ts +118 -0
- package/dist/schemas/domains/accounting-context.js +54 -0
- package/dist/schemas/domains/accounting-context.js.map +1 -0
- package/dist/schemas/domains/assets.d.ts +2508 -0
- package/dist/schemas/domains/assets.js +960 -0
- package/dist/schemas/domains/assets.js.map +1 -0
- package/dist/schemas/domains/business-documents.d.ts +4406 -0
- package/dist/schemas/domains/business-documents.js +1153 -0
- package/dist/schemas/domains/business-documents.js.map +1 -0
- package/dist/schemas/domains/configuration.d.ts +518 -0
- package/dist/schemas/domains/configuration.js +504 -0
- package/dist/schemas/domains/configuration.js.map +1 -0
- package/dist/schemas/domains/dashboard.d.ts +339 -0
- package/dist/schemas/domains/dashboard.js +211 -0
- package/dist/schemas/domains/dashboard.js.map +1 -0
- package/dist/schemas/domains/extended-operation-results.d.ts +1588 -0
- package/dist/schemas/domains/extended-operation-results.js +275 -0
- package/dist/schemas/domains/extended-operation-results.js.map +1 -0
- package/dist/schemas/domains/extended-operations.d.ts +1061 -0
- package/dist/schemas/domains/extended-operations.js +567 -0
- package/dist/schemas/domains/extended-operations.js.map +1 -0
- package/dist/schemas/domains/extended-query-results.d.ts +1688 -0
- package/dist/schemas/domains/extended-query-results.js +337 -0
- package/dist/schemas/domains/extended-query-results.js.map +1 -0
- package/dist/schemas/domains/financial-reports.d.ts +540 -0
- package/dist/schemas/domains/financial-reports.js +206 -0
- package/dist/schemas/domains/financial-reports.js.map +1 -0
- package/dist/schemas/domains/fnd-import.d.ts +912 -0
- package/dist/schemas/domains/fnd-import.js +396 -0
- package/dist/schemas/domains/fnd-import.js.map +1 -0
- package/dist/schemas/domains/fund-accounts.d.ts +1092 -0
- package/dist/schemas/domains/fund-accounts.js +410 -0
- package/dist/schemas/domains/fund-accounts.js.map +1 -0
- package/dist/schemas/domains/fund-balances.d.ts +476 -0
- package/dist/schemas/domains/fund-balances.js +233 -0
- package/dist/schemas/domains/fund-balances.js.map +1 -0
- package/dist/schemas/domains/journals.d.ts +1619 -0
- package/dist/schemas/domains/journals.js +615 -0
- package/dist/schemas/domains/journals.js.map +1 -0
- package/dist/schemas/domains/master-data.d.ts +2010 -0
- package/dist/schemas/domains/master-data.js +799 -0
- package/dist/schemas/domains/master-data.js.map +1 -0
- package/dist/schemas/domains/pnl.d.ts +837 -0
- package/dist/schemas/domains/pnl.js +469 -0
- package/dist/schemas/domains/pnl.js.map +1 -0
- package/dist/schemas/domains/reference-data.d.ts +227 -0
- package/dist/schemas/domains/reference-data.js +144 -0
- package/dist/schemas/domains/reference-data.js.map +1 -0
- package/dist/schemas/domains/transaction-drafts.d.ts +903 -0
- package/dist/schemas/domains/transaction-drafts.js +242 -0
- package/dist/schemas/domains/transaction-drafts.js.map +1 -0
- package/dist/schemas/domains/transactions.d.ts +910 -0
- package/dist/schemas/domains/transactions.js +266 -0
- package/dist/schemas/domains/transactions.js.map +1 -0
- package/dist/schemas/primitives.d.ts +6 -0
- package/dist/schemas/primitives.js +11 -0
- package/dist/schemas/primitives.js.map +1 -0
- package/dist/schemas/public-input.d.ts +3 -0
- package/dist/schemas/public-input.js +524 -0
- package/dist/schemas/public-input.js.map +1 -0
- package/dist/tools/core-edit/idempotent-write.d.ts +23 -0
- package/dist/tools/core-edit/idempotent-write.js +58 -0
- package/dist/tools/core-edit/idempotent-write.js.map +1 -0
- package/dist/tools/core-edit/save-asset.d.ts +5 -0
- package/dist/tools/core-edit/save-asset.js +334 -0
- package/dist/tools/core-edit/save-asset.js.map +1 -0
- package/dist/tools/core-edit/save-business-document-draft.d.ts +2 -0
- package/dist/tools/core-edit/save-business-document-draft.js +128 -0
- package/dist/tools/core-edit/save-business-document-draft.js.map +1 -0
- package/dist/tools/core-edit/save-fund-account.d.ts +2 -0
- package/dist/tools/core-edit/save-fund-account.js +138 -0
- package/dist/tools/core-edit/save-fund-account.js.map +1 -0
- package/dist/tools/core-edit/save-journal-draft.d.ts +2 -0
- package/dist/tools/core-edit/save-journal-draft.js +122 -0
- package/dist/tools/core-edit/save-journal-draft.js.map +1 -0
- package/dist/tools/core-edit/save-master-data.d.ts +2 -0
- package/dist/tools/core-edit/save-master-data.js +153 -0
- package/dist/tools/core-edit/save-master-data.js.map +1 -0
- package/dist/tools/core-edit/save-transaction-draft.d.ts +2 -0
- package/dist/tools/core-edit/save-transaction-draft.js +128 -0
- package/dist/tools/core-edit/save-transaction-draft.js.map +1 -0
- package/dist/tools/core-read/export-business-documents.d.ts +2 -0
- package/dist/tools/core-read/export-business-documents.js +67 -0
- package/dist/tools/core-read/export-business-documents.js.map +1 -0
- package/dist/tools/core-read/export-journals.d.ts +2 -0
- package/dist/tools/core-read/export-journals.js +56 -0
- package/dist/tools/core-read/export-journals.js.map +1 -0
- package/dist/tools/core-read/export-transactions.d.ts +2 -0
- package/dist/tools/core-read/export-transactions.js +67 -0
- package/dist/tools/core-read/export-transactions.js.map +1 -0
- package/dist/tools/core-read/query-accounting-balances.d.ts +2 -0
- package/dist/tools/core-read/query-accounting-balances.js +135 -0
- package/dist/tools/core-read/query-accounting-balances.js.map +1 -0
- package/dist/tools/core-read/query-accounting-context.d.ts +2 -0
- package/dist/tools/core-read/query-accounting-context.js +76 -0
- package/dist/tools/core-read/query-accounting-context.js.map +1 -0
- package/dist/tools/core-read/query-assets.d.ts +2 -0
- package/dist/tools/core-read/query-assets.js +425 -0
- package/dist/tools/core-read/query-assets.js.map +1 -0
- package/dist/tools/core-read/query-business-documents.d.ts +9 -0
- package/dist/tools/core-read/query-business-documents.js +620 -0
- package/dist/tools/core-read/query-business-documents.js.map +1 -0
- package/dist/tools/core-read/query-dashboard.d.ts +2 -0
- package/dist/tools/core-read/query-dashboard.js +144 -0
- package/dist/tools/core-read/query-dashboard.js.map +1 -0
- package/dist/tools/core-read/query-financial-reports.d.ts +2 -0
- package/dist/tools/core-read/query-financial-reports.js +171 -0
- package/dist/tools/core-read/query-financial-reports.js.map +1 -0
- package/dist/tools/core-read/query-fund-accounts.d.ts +2 -0
- package/dist/tools/core-read/query-fund-accounts.js +140 -0
- package/dist/tools/core-read/query-fund-accounts.js.map +1 -0
- package/dist/tools/core-read/query-fund-balances.d.ts +2 -0
- package/dist/tools/core-read/query-fund-balances.js +150 -0
- package/dist/tools/core-read/query-fund-balances.js.map +1 -0
- package/dist/tools/core-read/query-journals.d.ts +2 -0
- package/dist/tools/core-read/query-journals.js +277 -0
- package/dist/tools/core-read/query-journals.js.map +1 -0
- package/dist/tools/core-read/query-master-data.d.ts +2 -0
- package/dist/tools/core-read/query-master-data.js +363 -0
- package/dist/tools/core-read/query-master-data.js.map +1 -0
- package/dist/tools/core-read/query-pnl.d.ts +2 -0
- package/dist/tools/core-read/query-pnl.js +244 -0
- package/dist/tools/core-read/query-pnl.js.map +1 -0
- package/dist/tools/core-read/query-reference-data.d.ts +2 -0
- package/dist/tools/core-read/query-reference-data.js +293 -0
- package/dist/tools/core-read/query-reference-data.js.map +1 -0
- package/dist/tools/core-read/query-transactions.d.ts +2 -0
- package/dist/tools/core-read/query-transactions.js +58 -0
- package/dist/tools/core-read/query-transactions.js.map +1 -0
- package/dist/tools/create-tools.d.ts +3 -0
- package/dist/tools/create-tools.js +88 -0
- package/dist/tools/create-tools.js.map +1 -0
- package/dist/tools/extended/asset-operation-tools.d.ts +9 -0
- package/dist/tools/extended/asset-operation-tools.js +419 -0
- package/dist/tools/extended/asset-operation-tools.js.map +1 -0
- package/dist/tools/extended/automation-tools.d.ts +7 -0
- package/dist/tools/extended/automation-tools.js +333 -0
- package/dist/tools/extended/automation-tools.js.map +1 -0
- package/dist/tools/extended/configuration-tools.d.ts +14 -0
- package/dist/tools/extended/configuration-tools.js +871 -0
- package/dist/tools/extended/configuration-tools.js.map +1 -0
- package/dist/tools/extended/period-end-tools.d.ts +11 -0
- package/dist/tools/extended/period-end-tools.js +480 -0
- package/dist/tools/extended/period-end-tools.js.map +1 -0
- package/dist/tools/extended/query-output.d.ts +2589 -0
- package/dist/tools/extended/query-output.js +610 -0
- package/dist/tools/extended/query-output.js.map +1 -0
- package/dist/tools/extended/tool-support.d.ts +56 -0
- package/dist/tools/extended/tool-support.js +198 -0
- package/dist/tools/extended/tool-support.js.map +1 -0
- package/dist/tools/extended/workflow-tools.d.ts +10 -0
- package/dist/tools/extended/workflow-tools.js +678 -0
- package/dist/tools/extended/workflow-tools.js.map +1 -0
- package/dist/tools/fnd-import/execute-import.d.ts +2 -0
- package/dist/tools/fnd-import/execute-import.js +201 -0
- package/dist/tools/fnd-import/execute-import.js.map +1 -0
- package/dist/tools/fnd-import/get-import-template.d.ts +2 -0
- package/dist/tools/fnd-import/get-import-template.js +66 -0
- package/dist/tools/fnd-import/get-import-template.js.map +1 -0
- package/dist/tools/fnd-import/get-job-status.d.ts +8 -0
- package/dist/tools/fnd-import/get-job-status.js +201 -0
- package/dist/tools/fnd-import/get-job-status.js.map +1 -0
- package/dist/tools/fnd-import/prepare-import.d.ts +31 -0
- package/dist/tools/fnd-import/prepare-import.js +214 -0
- package/dist/tools/fnd-import/prepare-import.js.map +1 -0
- package/dist/tools/fnd-import/public-import-result.d.ts +18 -0
- package/dist/tools/fnd-import/public-import-result.js +35 -0
- package/dist/tools/fnd-import/public-import-result.js.map +1 -0
- package/dist/tools/tool-definition.d.ts +45 -0
- package/dist/tools/tool-definition.js +11 -0
- package/dist/tools/tool-definition.js.map +1 -0
- package/dist/tools/tool-handler.d.ts +27 -0
- package/dist/tools/tool-handler.js +196 -0
- package/dist/tools/tool-handler.js.map +1 -0
- package/dist/tools/transaction-item.d.ts +225 -0
- package/dist/tools/transaction-item.js +109 -0
- package/dist/tools/transaction-item.js.map +1 -0
- package/dist/transport/draining-transport.d.ts +14 -0
- package/dist/transport/draining-transport.js +36 -0
- package/dist/transport/draining-transport.js.map +1 -0
- package/dist/transport/stdio.d.ts +2 -0
- package/dist/transport/stdio.js +5 -0
- package/dist/transport/stdio.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,799 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { contextSchema, viewPageSuccessEnvelopeSchema, successEnvelopeSchema, } from '../common.js';
|
|
3
|
+
import { decimalStringSchema, upstreamDecimalSchema, uuidSchema, } from '../primitives.js';
|
|
4
|
+
const pagingShape = {
|
|
5
|
+
page: z.number().int().positive().default(1),
|
|
6
|
+
page_size: z.number().int().min(1).max(200).default(50),
|
|
7
|
+
};
|
|
8
|
+
const fndPagingShape = {
|
|
9
|
+
page: z.number().int().positive().default(1),
|
|
10
|
+
page_size: z.number().int().min(1).max(100).default(50),
|
|
11
|
+
};
|
|
12
|
+
export const partyTypeSchema = z.enum([
|
|
13
|
+
'WALLET',
|
|
14
|
+
'EXCHANGE_ACCOUNT',
|
|
15
|
+
'BANK_ACCOUNT',
|
|
16
|
+
'BROKER_ACCOUNT',
|
|
17
|
+
'CONTRACT',
|
|
18
|
+
'ORGANIZATION',
|
|
19
|
+
'INDIVIDUAL',
|
|
20
|
+
'INTERNAL',
|
|
21
|
+
'OTHER',
|
|
22
|
+
]);
|
|
23
|
+
export const trustLevelSchema = z.enum(['WHITELIST', 'GREYLIST', 'BLACKLIST']);
|
|
24
|
+
export const partyRoleTypeSchema = z.enum([
|
|
25
|
+
'CUSTOMER',
|
|
26
|
+
'VENDOR',
|
|
27
|
+
'RELATED',
|
|
28
|
+
'INTERCOMPANY',
|
|
29
|
+
'EMPLOYEE',
|
|
30
|
+
'OTHER',
|
|
31
|
+
]);
|
|
32
|
+
export const partyFiltersSchema = z
|
|
33
|
+
.object({
|
|
34
|
+
keyword: z.string().min(1).optional(),
|
|
35
|
+
party_types: z.array(partyTypeSchema).min(1).max(9).optional(),
|
|
36
|
+
trust_levels: z.array(trustLevelSchema).min(1).max(3).optional(),
|
|
37
|
+
roles: z.array(partyRoleTypeSchema).min(1).max(6).optional(),
|
|
38
|
+
})
|
|
39
|
+
.strict();
|
|
40
|
+
export const symbolAssetTypeSchema = z.enum([
|
|
41
|
+
'FIAT',
|
|
42
|
+
'CRYPTO_NATIVE',
|
|
43
|
+
'CRYPTO_TOKEN',
|
|
44
|
+
'NFT',
|
|
45
|
+
'SECURITY',
|
|
46
|
+
'DERIVATIVE',
|
|
47
|
+
'STABLECOIN',
|
|
48
|
+
'OTHER',
|
|
49
|
+
]);
|
|
50
|
+
export const symbolListStatusSchema = z.enum([
|
|
51
|
+
'ACTIVE',
|
|
52
|
+
'DELISTED',
|
|
53
|
+
'EXPIRED',
|
|
54
|
+
'PENDING_IDENTIFICATION',
|
|
55
|
+
'NO_PRICE_SOURCE',
|
|
56
|
+
'SPAM',
|
|
57
|
+
'IGNORED',
|
|
58
|
+
]);
|
|
59
|
+
export const symbolFiltersSchema = z
|
|
60
|
+
.object({
|
|
61
|
+
keyword: z.string().min(1).optional(),
|
|
62
|
+
asset_types: z.array(symbolAssetTypeSchema).min(1).max(8).optional(),
|
|
63
|
+
trust_levels: z.array(trustLevelSchema).min(1).max(3).optional(),
|
|
64
|
+
list_statuses: z.array(symbolListStatusSchema).min(1).max(7).optional(),
|
|
65
|
+
chain: z.string().min(1).optional(),
|
|
66
|
+
is_priceable: z.boolean().optional(),
|
|
67
|
+
})
|
|
68
|
+
.strict();
|
|
69
|
+
export const symbolSortSchema = z
|
|
70
|
+
.object({
|
|
71
|
+
field: z.enum([
|
|
72
|
+
'symbol',
|
|
73
|
+
'name',
|
|
74
|
+
'asset_type',
|
|
75
|
+
'trust_level',
|
|
76
|
+
'created_at',
|
|
77
|
+
]),
|
|
78
|
+
direction: z.enum(['asc', 'desc']).default('asc'),
|
|
79
|
+
})
|
|
80
|
+
.strict();
|
|
81
|
+
export const projectStatusSchema = z.enum(['ACTIVE', 'SUSPENDED', 'CLOSED']);
|
|
82
|
+
export const projectFiltersSchema = z
|
|
83
|
+
.object({
|
|
84
|
+
search: z.string().min(1).optional(),
|
|
85
|
+
status: projectStatusSchema.optional(),
|
|
86
|
+
})
|
|
87
|
+
.strict();
|
|
88
|
+
export const contractStatusSchema = z.enum([
|
|
89
|
+
'DRAFT',
|
|
90
|
+
'ACTIVE',
|
|
91
|
+
'CLOSED',
|
|
92
|
+
'TERMINATED',
|
|
93
|
+
]);
|
|
94
|
+
export const contractTypeSchema = z.enum(['SALES', 'PURCHASE', 'OTHER']);
|
|
95
|
+
export const contractFiltersSchema = z
|
|
96
|
+
.object({
|
|
97
|
+
search: z.string().min(1).optional(),
|
|
98
|
+
status: contractStatusSchema.optional(),
|
|
99
|
+
contract_type: contractTypeSchema.optional(),
|
|
100
|
+
project_id: z.uuid().optional(),
|
|
101
|
+
})
|
|
102
|
+
.strict();
|
|
103
|
+
export const taxCodeCategorySchema = z.enum([
|
|
104
|
+
'INPUT',
|
|
105
|
+
'OUTPUT',
|
|
106
|
+
'WHT',
|
|
107
|
+
'SURTAX',
|
|
108
|
+
]);
|
|
109
|
+
export const taxCodeFiltersSchema = z
|
|
110
|
+
.object({
|
|
111
|
+
keyword: z.string().min(1).optional(),
|
|
112
|
+
tax_categories: z.array(taxCodeCategorySchema).min(1).max(4).optional(),
|
|
113
|
+
enabled: z.boolean().optional(),
|
|
114
|
+
})
|
|
115
|
+
.strict();
|
|
116
|
+
export const taxCodeSortSchema = z
|
|
117
|
+
.object({
|
|
118
|
+
field: z.enum([
|
|
119
|
+
'tax_code',
|
|
120
|
+
'name',
|
|
121
|
+
'tax_category',
|
|
122
|
+
'tax_rate',
|
|
123
|
+
'created_at',
|
|
124
|
+
]),
|
|
125
|
+
direction: z.enum(['asc', 'desc']).default('asc'),
|
|
126
|
+
})
|
|
127
|
+
.strict();
|
|
128
|
+
export const queryMasterDataInputSchema = z.union([
|
|
129
|
+
z
|
|
130
|
+
.object({
|
|
131
|
+
entity_type: z.literal('party'),
|
|
132
|
+
view: z.literal('list'),
|
|
133
|
+
filters: partyFiltersSchema.default({}),
|
|
134
|
+
...fndPagingShape,
|
|
135
|
+
context: contextSchema.optional(),
|
|
136
|
+
})
|
|
137
|
+
.strict()
|
|
138
|
+
.describe('Transaction-party lists use a fixed order and do not support custom sorting; a page is not sorted again locally.'),
|
|
139
|
+
z
|
|
140
|
+
.object({
|
|
141
|
+
entity_type: z.literal('party'),
|
|
142
|
+
view: z.literal('roles'),
|
|
143
|
+
party_id: z.uuid(),
|
|
144
|
+
context: contextSchema.optional(),
|
|
145
|
+
})
|
|
146
|
+
.strict(),
|
|
147
|
+
z
|
|
148
|
+
.object({
|
|
149
|
+
entity_type: z.literal('party'),
|
|
150
|
+
view: z.literal('addresses'),
|
|
151
|
+
party_id: z.uuid(),
|
|
152
|
+
context: contextSchema.optional(),
|
|
153
|
+
})
|
|
154
|
+
.strict(),
|
|
155
|
+
z
|
|
156
|
+
.object({
|
|
157
|
+
entity_type: z.literal('symbol'),
|
|
158
|
+
view: z.literal('list'),
|
|
159
|
+
filters: symbolFiltersSchema.default({}),
|
|
160
|
+
sort: symbolSortSchema.optional(),
|
|
161
|
+
...fndPagingShape,
|
|
162
|
+
context: contextSchema.optional(),
|
|
163
|
+
})
|
|
164
|
+
.strict()
|
|
165
|
+
.describe('Symbol lists support allowlisted sort fields.'),
|
|
166
|
+
z
|
|
167
|
+
.object({
|
|
168
|
+
entity_type: z.literal('project'),
|
|
169
|
+
view: z.literal('list'),
|
|
170
|
+
filters: projectFiltersSchema.default({}),
|
|
171
|
+
...pagingShape,
|
|
172
|
+
context: contextSchema.optional(),
|
|
173
|
+
})
|
|
174
|
+
.strict()
|
|
175
|
+
.describe('Project lists use a fixed order and do not support custom sorting; a page is not sorted again locally.'),
|
|
176
|
+
z
|
|
177
|
+
.object({
|
|
178
|
+
entity_type: z.literal('project'),
|
|
179
|
+
view: z.literal('detail'),
|
|
180
|
+
id: z.uuid(),
|
|
181
|
+
context: contextSchema.optional(),
|
|
182
|
+
})
|
|
183
|
+
.strict(),
|
|
184
|
+
z
|
|
185
|
+
.object({
|
|
186
|
+
entity_type: z.literal('contract'),
|
|
187
|
+
view: z.literal('list'),
|
|
188
|
+
filters: contractFiltersSchema.default({}),
|
|
189
|
+
...pagingShape,
|
|
190
|
+
context: contextSchema.optional(),
|
|
191
|
+
})
|
|
192
|
+
.strict()
|
|
193
|
+
.describe('Contract lists use a fixed order and do not support custom sorting; a page is not sorted again locally.'),
|
|
194
|
+
z
|
|
195
|
+
.object({
|
|
196
|
+
entity_type: z.literal('contract'),
|
|
197
|
+
view: z.literal('detail'),
|
|
198
|
+
id: z.uuid(),
|
|
199
|
+
context: contextSchema.optional(),
|
|
200
|
+
})
|
|
201
|
+
.strict(),
|
|
202
|
+
z
|
|
203
|
+
.object({
|
|
204
|
+
entity_type: z.literal('tax_code'),
|
|
205
|
+
view: z.literal('list'),
|
|
206
|
+
filters: taxCodeFiltersSchema.default({}),
|
|
207
|
+
sort: taxCodeSortSchema.optional(),
|
|
208
|
+
...fndPagingShape,
|
|
209
|
+
context: contextSchema.optional(),
|
|
210
|
+
})
|
|
211
|
+
.strict()
|
|
212
|
+
.describe('Tax-code lists support allowlisted sort fields.'),
|
|
213
|
+
]);
|
|
214
|
+
const nullableString = z.string().nullable();
|
|
215
|
+
const nullableUuid = z.uuid().nullable();
|
|
216
|
+
const nullableInteger = z.number().int().nullable();
|
|
217
|
+
export const partyRoleUpstreamSchema = z
|
|
218
|
+
.object({
|
|
219
|
+
id: z.uuid(),
|
|
220
|
+
party_id: z.uuid(),
|
|
221
|
+
role: z.string(),
|
|
222
|
+
org_id: z.uuid().nullable().optional(),
|
|
223
|
+
org_name: z.string().nullable().optional(),
|
|
224
|
+
address_count: z.number().int().nonnegative().nullable().optional(),
|
|
225
|
+
ledger_id: z.uuid().nullable().optional(),
|
|
226
|
+
ledger_code: z.string().nullable().optional(),
|
|
227
|
+
ledger_name: z.string().nullable().optional(),
|
|
228
|
+
coa_code: z.string().nullable().optional(),
|
|
229
|
+
coa_name: z.string().nullable().optional(),
|
|
230
|
+
description: z.string().nullable().optional(),
|
|
231
|
+
reference: z.string().nullable().optional(),
|
|
232
|
+
attribute1: z.string().nullable().optional(),
|
|
233
|
+
attribute2: z.string().nullable().optional(),
|
|
234
|
+
attribute3: z.string().nullable().optional(),
|
|
235
|
+
attribute4: z.string().nullable().optional(),
|
|
236
|
+
attribute5: z.string().nullable().optional(),
|
|
237
|
+
attribute6: z.string().nullable().optional(),
|
|
238
|
+
attribute7: z.string().nullable().optional(),
|
|
239
|
+
attribute8: z.string().nullable().optional(),
|
|
240
|
+
attribute9: z.string().nullable().optional(),
|
|
241
|
+
attribute10: z.string().nullable().optional(),
|
|
242
|
+
attribute11: z.string().nullable().optional(),
|
|
243
|
+
attribute12: z.string().nullable().optional(),
|
|
244
|
+
version: z.number().int().nullable().optional(),
|
|
245
|
+
created_at: z.string().nullable().optional(),
|
|
246
|
+
updated_at: z.string().nullable().optional(),
|
|
247
|
+
})
|
|
248
|
+
.passthrough();
|
|
249
|
+
export const partyAddressUpstreamSchema = z
|
|
250
|
+
.object({
|
|
251
|
+
id: z.uuid(),
|
|
252
|
+
party_id: z.uuid(),
|
|
253
|
+
role_id: z.uuid().nullable().optional(),
|
|
254
|
+
address_type: z.string(),
|
|
255
|
+
address: z.string(),
|
|
256
|
+
channel: z.string().nullable().optional(),
|
|
257
|
+
account_name: z.string().nullable().optional(),
|
|
258
|
+
label: z.string().nullable().optional(),
|
|
259
|
+
is_default: z.boolean(),
|
|
260
|
+
description: z.string().nullable().optional(),
|
|
261
|
+
currency: z.string().nullable().optional(),
|
|
262
|
+
swift_code: z.string().nullable().optional(),
|
|
263
|
+
iban: z.string().nullable().optional(),
|
|
264
|
+
branch: z.string().nullable().optional(),
|
|
265
|
+
version: z.number().int().nullable().optional(),
|
|
266
|
+
created_at: z.string().nullable().optional(),
|
|
267
|
+
updated_at: z.string().nullable().optional(),
|
|
268
|
+
})
|
|
269
|
+
.passthrough();
|
|
270
|
+
export const partyUpstreamSchema = z
|
|
271
|
+
.object({
|
|
272
|
+
id: z.uuid(),
|
|
273
|
+
code: z.string(),
|
|
274
|
+
name: z.string(),
|
|
275
|
+
party_type: z.string(),
|
|
276
|
+
trust_level: z.string(),
|
|
277
|
+
version: z.number().int().nullable().optional(),
|
|
278
|
+
created_at: z.string().nullable().optional(),
|
|
279
|
+
updated_at: z.string().nullable().optional(),
|
|
280
|
+
roles: z.array(partyRoleUpstreamSchema).default([]),
|
|
281
|
+
addresses: z.array(partyAddressUpstreamSchema).default([]),
|
|
282
|
+
})
|
|
283
|
+
.passthrough();
|
|
284
|
+
export const partyListUpstreamSchema = z
|
|
285
|
+
.object({
|
|
286
|
+
total: z.number().int().nonnegative(),
|
|
287
|
+
page: z.number().int().positive(),
|
|
288
|
+
page_size: z.number().int().positive(),
|
|
289
|
+
items: z.array(partyUpstreamSchema),
|
|
290
|
+
})
|
|
291
|
+
.passthrough();
|
|
292
|
+
export const partyRoleListUpstreamSchema = z.array(partyRoleUpstreamSchema);
|
|
293
|
+
export const partyAddressListUpstreamSchema = z.array(partyAddressUpstreamSchema);
|
|
294
|
+
export const symbolUpstreamSchema = z
|
|
295
|
+
.object({
|
|
296
|
+
id: z.uuid(),
|
|
297
|
+
symbol: z.string(),
|
|
298
|
+
name: z.string(),
|
|
299
|
+
asset_type: z.string(),
|
|
300
|
+
chain: z.string().nullable().optional(),
|
|
301
|
+
contract_address: z.string().nullable().optional(),
|
|
302
|
+
token_standard: z.string().nullable().optional(),
|
|
303
|
+
nft_collection: z.string().nullable().optional(),
|
|
304
|
+
protocol_id: z.string().nullable().optional(),
|
|
305
|
+
decimals: z.number().int().nullable().optional(),
|
|
306
|
+
icon_url: z.string().nullable().optional(),
|
|
307
|
+
coingecko_id: z.string().nullable().optional(),
|
|
308
|
+
cmc_id: z.string().nullable().optional(),
|
|
309
|
+
iso_code: z.string().nullable().optional(),
|
|
310
|
+
list_status: z.string(),
|
|
311
|
+
trust_level: z.string(),
|
|
312
|
+
is_priceable: z.boolean(),
|
|
313
|
+
auto_price_fill: z.boolean(),
|
|
314
|
+
is_system: z.boolean(),
|
|
315
|
+
display_decimals: z.number().int().nullable().optional(),
|
|
316
|
+
aliases: z.array(z.string()).default([]),
|
|
317
|
+
description: z.string().nullable().optional(),
|
|
318
|
+
version: z.number().int().nullable().optional(),
|
|
319
|
+
created_at: z.string().nullable().optional(),
|
|
320
|
+
updated_at: z.string().nullable().optional(),
|
|
321
|
+
})
|
|
322
|
+
.passthrough();
|
|
323
|
+
export const symbolListUpstreamSchema = z
|
|
324
|
+
.object({
|
|
325
|
+
total: z.number().int().nonnegative(),
|
|
326
|
+
page: z.number().int().positive(),
|
|
327
|
+
page_size: z.number().int().positive(),
|
|
328
|
+
items: z.array(symbolUpstreamSchema),
|
|
329
|
+
})
|
|
330
|
+
.passthrough();
|
|
331
|
+
export const projectUpstreamSchema = z
|
|
332
|
+
.object({
|
|
333
|
+
id: z.uuid(),
|
|
334
|
+
project_code: z.string(),
|
|
335
|
+
name: z.string(),
|
|
336
|
+
org_id: z.uuid().nullable().optional(),
|
|
337
|
+
org_name: z.string().nullable().optional(),
|
|
338
|
+
status: z.string(),
|
|
339
|
+
start_date: z.string().nullable().optional(),
|
|
340
|
+
end_date: z.string().nullable().optional(),
|
|
341
|
+
manager_id: z.uuid().nullable().optional(),
|
|
342
|
+
currency: z.string().nullable().optional(),
|
|
343
|
+
description: z.string().nullable().optional(),
|
|
344
|
+
version: z.number().int().nullable().optional(),
|
|
345
|
+
created_at: z.string().nullable().optional(),
|
|
346
|
+
updated_at: z.string().nullable().optional(),
|
|
347
|
+
})
|
|
348
|
+
.passthrough();
|
|
349
|
+
export const projectListUpstreamSchema = z
|
|
350
|
+
.object({
|
|
351
|
+
total: z.number().int().nonnegative(),
|
|
352
|
+
page: z.number().int().positive(),
|
|
353
|
+
page_size: z.number().int().positive(),
|
|
354
|
+
items: z.array(projectUpstreamSchema),
|
|
355
|
+
})
|
|
356
|
+
.passthrough();
|
|
357
|
+
export const contractUpstreamSchema = z
|
|
358
|
+
.object({
|
|
359
|
+
id: z.uuid(),
|
|
360
|
+
contract_no: z.string(),
|
|
361
|
+
name: z.string(),
|
|
362
|
+
project_id: z.uuid().nullable().optional(),
|
|
363
|
+
project_name: z.string().nullable().optional(),
|
|
364
|
+
org_id: z.uuid().nullable().optional(),
|
|
365
|
+
org_name: z.string().nullable().optional(),
|
|
366
|
+
counterparty: z.string().nullable().optional(),
|
|
367
|
+
contract_type: z.string(),
|
|
368
|
+
currency: z.string().nullable().optional(),
|
|
369
|
+
amount: upstreamDecimalSchema.nullable(),
|
|
370
|
+
sign_date: z.string().nullable().optional(),
|
|
371
|
+
start_date: z.string().nullable().optional(),
|
|
372
|
+
end_date: z.string().nullable().optional(),
|
|
373
|
+
status: z.string(),
|
|
374
|
+
description: z.string().nullable().optional(),
|
|
375
|
+
version: z.number().int().nullable().optional(),
|
|
376
|
+
created_at: z.string().nullable().optional(),
|
|
377
|
+
updated_at: z.string().nullable().optional(),
|
|
378
|
+
})
|
|
379
|
+
.passthrough();
|
|
380
|
+
export const contractListUpstreamSchema = z
|
|
381
|
+
.object({
|
|
382
|
+
total: z.number().int().nonnegative(),
|
|
383
|
+
page: z.number().int().positive(),
|
|
384
|
+
page_size: z.number().int().positive(),
|
|
385
|
+
items: z.array(contractUpstreamSchema),
|
|
386
|
+
})
|
|
387
|
+
.passthrough();
|
|
388
|
+
export const taxCodeUpstreamSchema = z
|
|
389
|
+
.object({
|
|
390
|
+
id: z.uuid(),
|
|
391
|
+
tax_code: z.string(),
|
|
392
|
+
name: z.string(),
|
|
393
|
+
tax_category: z.string(),
|
|
394
|
+
tax_rate: upstreamDecimalSchema.nullable(),
|
|
395
|
+
is_price_included: z.boolean(),
|
|
396
|
+
is_enabled: z.boolean(),
|
|
397
|
+
is_system: z.boolean(),
|
|
398
|
+
description: z.string().nullable().optional(),
|
|
399
|
+
version: z.number().int().nullable().optional(),
|
|
400
|
+
created_at: z.string().nullable().optional(),
|
|
401
|
+
updated_at: z.string().nullable().optional(),
|
|
402
|
+
ledger_id: z.uuid().nullable().optional(),
|
|
403
|
+
coa_code: z.string().nullable().optional(),
|
|
404
|
+
reference: z.string().nullable().optional(),
|
|
405
|
+
attribute1: z.string().nullable().optional(),
|
|
406
|
+
attribute2: z.string().nullable().optional(),
|
|
407
|
+
attribute3: z.string().nullable().optional(),
|
|
408
|
+
attribute4: z.string().nullable().optional(),
|
|
409
|
+
attribute5: z.string().nullable().optional(),
|
|
410
|
+
attribute6: z.string().nullable().optional(),
|
|
411
|
+
attribute7: z.string().nullable().optional(),
|
|
412
|
+
attribute8: z.string().nullable().optional(),
|
|
413
|
+
attribute9: z.string().nullable().optional(),
|
|
414
|
+
attribute10: z.string().nullable().optional(),
|
|
415
|
+
attribute11: z.string().nullable().optional(),
|
|
416
|
+
attribute12: z.string().nullable().optional(),
|
|
417
|
+
})
|
|
418
|
+
.passthrough();
|
|
419
|
+
export const taxCodeListUpstreamSchema = z
|
|
420
|
+
.object({
|
|
421
|
+
total: z.number().int().nonnegative(),
|
|
422
|
+
page: z.number().int().positive(),
|
|
423
|
+
page_size: z.number().int().positive(),
|
|
424
|
+
items: z.array(taxCodeUpstreamSchema),
|
|
425
|
+
})
|
|
426
|
+
.passthrough();
|
|
427
|
+
export const partyRoleSchema = z
|
|
428
|
+
.object({
|
|
429
|
+
id: z.uuid(),
|
|
430
|
+
party_id: z.uuid(),
|
|
431
|
+
role: z.string(),
|
|
432
|
+
org_id: nullableUuid,
|
|
433
|
+
org_name: nullableString,
|
|
434
|
+
address_count: nullableInteger,
|
|
435
|
+
ledger_id: nullableUuid,
|
|
436
|
+
ledger_code: nullableString,
|
|
437
|
+
ledger_name: nullableString,
|
|
438
|
+
coa_code: nullableString,
|
|
439
|
+
coa_name: nullableString,
|
|
440
|
+
description: nullableString,
|
|
441
|
+
reference: nullableString,
|
|
442
|
+
attributes: z.array(nullableString).length(12),
|
|
443
|
+
version: nullableInteger,
|
|
444
|
+
created_at: nullableString,
|
|
445
|
+
updated_at: nullableString,
|
|
446
|
+
})
|
|
447
|
+
.strict();
|
|
448
|
+
export const partyAddressSchema = z
|
|
449
|
+
.object({
|
|
450
|
+
id: z.uuid(),
|
|
451
|
+
party_id: z.uuid(),
|
|
452
|
+
role_id: nullableUuid,
|
|
453
|
+
address_type: z.string(),
|
|
454
|
+
address: z.string(),
|
|
455
|
+
channel: nullableString,
|
|
456
|
+
account_name: nullableString,
|
|
457
|
+
label: nullableString,
|
|
458
|
+
is_default: z.boolean(),
|
|
459
|
+
description: nullableString,
|
|
460
|
+
currency: nullableString,
|
|
461
|
+
swift_code: nullableString,
|
|
462
|
+
iban: nullableString,
|
|
463
|
+
branch: nullableString,
|
|
464
|
+
version: nullableInteger,
|
|
465
|
+
created_at: nullableString,
|
|
466
|
+
updated_at: nullableString,
|
|
467
|
+
})
|
|
468
|
+
.strict();
|
|
469
|
+
export const partySchema = z
|
|
470
|
+
.object({
|
|
471
|
+
id: z.uuid(),
|
|
472
|
+
code: z.string(),
|
|
473
|
+
name: z.string(),
|
|
474
|
+
party_type: z.string(),
|
|
475
|
+
trust_level: z.string(),
|
|
476
|
+
version: nullableInteger,
|
|
477
|
+
created_at: nullableString,
|
|
478
|
+
updated_at: nullableString,
|
|
479
|
+
roles: z.array(partyRoleSchema),
|
|
480
|
+
addresses: z.array(partyAddressSchema),
|
|
481
|
+
})
|
|
482
|
+
.strict();
|
|
483
|
+
export const symbolSchema = z
|
|
484
|
+
.object({
|
|
485
|
+
id: z.uuid(),
|
|
486
|
+
symbol: z.string(),
|
|
487
|
+
name: z.string(),
|
|
488
|
+
asset_type: z.string(),
|
|
489
|
+
chain: nullableString,
|
|
490
|
+
contract_address: nullableString,
|
|
491
|
+
token_standard: nullableString,
|
|
492
|
+
nft_collection: nullableString,
|
|
493
|
+
protocol_id: nullableString,
|
|
494
|
+
decimals: nullableInteger,
|
|
495
|
+
icon_url: nullableString,
|
|
496
|
+
coingecko_id: nullableString,
|
|
497
|
+
cmc_id: nullableString,
|
|
498
|
+
iso_code: nullableString,
|
|
499
|
+
list_status: z.string(),
|
|
500
|
+
trust_level: z.string(),
|
|
501
|
+
is_priceable: z.boolean(),
|
|
502
|
+
auto_price_fill: z.boolean(),
|
|
503
|
+
is_system: z.boolean(),
|
|
504
|
+
display_decimals: nullableInteger,
|
|
505
|
+
aliases: z.array(z.string()),
|
|
506
|
+
description: nullableString,
|
|
507
|
+
version: nullableInteger,
|
|
508
|
+
created_at: nullableString,
|
|
509
|
+
updated_at: nullableString,
|
|
510
|
+
})
|
|
511
|
+
.strict();
|
|
512
|
+
export const projectSchema = z
|
|
513
|
+
.object({
|
|
514
|
+
id: z.uuid(),
|
|
515
|
+
project_code: z.string(),
|
|
516
|
+
name: z.string(),
|
|
517
|
+
org_id: nullableUuid,
|
|
518
|
+
org_name: nullableString,
|
|
519
|
+
status: z.string(),
|
|
520
|
+
start_date: nullableString,
|
|
521
|
+
end_date: nullableString,
|
|
522
|
+
manager_id: nullableUuid,
|
|
523
|
+
currency: nullableString,
|
|
524
|
+
description: nullableString,
|
|
525
|
+
version: nullableInteger,
|
|
526
|
+
created_at: nullableString,
|
|
527
|
+
updated_at: nullableString,
|
|
528
|
+
})
|
|
529
|
+
.strict();
|
|
530
|
+
export const contractSchema = z
|
|
531
|
+
.object({
|
|
532
|
+
id: z.uuid(),
|
|
533
|
+
contract_no: z.string(),
|
|
534
|
+
name: z.string(),
|
|
535
|
+
project_id: nullableUuid,
|
|
536
|
+
project_name: nullableString,
|
|
537
|
+
org_id: nullableUuid,
|
|
538
|
+
org_name: nullableString,
|
|
539
|
+
counterparty: nullableString,
|
|
540
|
+
contract_type: z.string(),
|
|
541
|
+
currency: nullableString,
|
|
542
|
+
amount: decimalStringSchema.nullable(),
|
|
543
|
+
sign_date: nullableString,
|
|
544
|
+
start_date: nullableString,
|
|
545
|
+
end_date: nullableString,
|
|
546
|
+
status: z.string(),
|
|
547
|
+
description: nullableString,
|
|
548
|
+
version: nullableInteger,
|
|
549
|
+
created_at: nullableString,
|
|
550
|
+
updated_at: nullableString,
|
|
551
|
+
})
|
|
552
|
+
.strict();
|
|
553
|
+
export const taxCodeSchema = z
|
|
554
|
+
.object({
|
|
555
|
+
id: z.uuid(),
|
|
556
|
+
tax_code: z.string(),
|
|
557
|
+
name: z.string(),
|
|
558
|
+
tax_category: z.string(),
|
|
559
|
+
tax_rate: decimalStringSchema.nullable(),
|
|
560
|
+
is_price_included: z.boolean(),
|
|
561
|
+
is_enabled: z.boolean(),
|
|
562
|
+
is_system: z.boolean(),
|
|
563
|
+
description: nullableString,
|
|
564
|
+
version: nullableInteger,
|
|
565
|
+
created_at: nullableString,
|
|
566
|
+
updated_at: nullableString,
|
|
567
|
+
ledger_id: nullableUuid,
|
|
568
|
+
coa_code: nullableString,
|
|
569
|
+
reference: nullableString,
|
|
570
|
+
attributes: z.array(nullableString).length(12),
|
|
571
|
+
})
|
|
572
|
+
.strict();
|
|
573
|
+
export const queryMasterDataOutputSchema = viewPageSuccessEnvelopeSchema(z.union([
|
|
574
|
+
z
|
|
575
|
+
.object({
|
|
576
|
+
entity_type: z.literal('party'),
|
|
577
|
+
view: z.literal('list'),
|
|
578
|
+
items: z.array(partySchema),
|
|
579
|
+
})
|
|
580
|
+
.strict(),
|
|
581
|
+
z
|
|
582
|
+
.object({
|
|
583
|
+
entity_type: z.literal('party'),
|
|
584
|
+
view: z.literal('roles'),
|
|
585
|
+
party_id: z.uuid(),
|
|
586
|
+
items: z.array(partyRoleSchema),
|
|
587
|
+
})
|
|
588
|
+
.strict(),
|
|
589
|
+
z
|
|
590
|
+
.object({
|
|
591
|
+
entity_type: z.literal('party'),
|
|
592
|
+
view: z.literal('addresses'),
|
|
593
|
+
party_id: z.uuid(),
|
|
594
|
+
items: z.array(partyAddressSchema),
|
|
595
|
+
})
|
|
596
|
+
.strict(),
|
|
597
|
+
z
|
|
598
|
+
.object({
|
|
599
|
+
entity_type: z.literal('symbol'),
|
|
600
|
+
view: z.literal('list'),
|
|
601
|
+
items: z.array(symbolSchema),
|
|
602
|
+
})
|
|
603
|
+
.strict(),
|
|
604
|
+
z
|
|
605
|
+
.object({
|
|
606
|
+
entity_type: z.literal('project'),
|
|
607
|
+
view: z.literal('list'),
|
|
608
|
+
items: z.array(projectSchema),
|
|
609
|
+
})
|
|
610
|
+
.strict(),
|
|
611
|
+
z
|
|
612
|
+
.object({
|
|
613
|
+
entity_type: z.literal('project'),
|
|
614
|
+
view: z.literal('detail'),
|
|
615
|
+
item: projectSchema,
|
|
616
|
+
})
|
|
617
|
+
.strict(),
|
|
618
|
+
z
|
|
619
|
+
.object({
|
|
620
|
+
entity_type: z.literal('contract'),
|
|
621
|
+
view: z.literal('list'),
|
|
622
|
+
items: z.array(contractSchema),
|
|
623
|
+
})
|
|
624
|
+
.strict(),
|
|
625
|
+
z
|
|
626
|
+
.object({
|
|
627
|
+
entity_type: z.literal('contract'),
|
|
628
|
+
view: z.literal('detail'),
|
|
629
|
+
item: contractSchema,
|
|
630
|
+
})
|
|
631
|
+
.strict(),
|
|
632
|
+
z
|
|
633
|
+
.object({
|
|
634
|
+
entity_type: z.literal('tax_code'),
|
|
635
|
+
view: z.literal('list'),
|
|
636
|
+
items: z.array(taxCodeSchema),
|
|
637
|
+
})
|
|
638
|
+
.strict(),
|
|
639
|
+
]), ['list']);
|
|
640
|
+
const writeContextSchema = z.object({ org_id: uuidSchema }).strict();
|
|
641
|
+
const optionalText = (max) => z.string().max(max).optional();
|
|
642
|
+
const nonNegativeDecimal = decimalStringSchema.refine((value) => !value.startsWith('-'), 'Must be a non-negative decimal string');
|
|
643
|
+
export const partySaveValuesSchema = z
|
|
644
|
+
.object({
|
|
645
|
+
code: z.string().min(1).max(64),
|
|
646
|
+
name: z.string().min(1).max(200),
|
|
647
|
+
party_type: partyTypeSchema,
|
|
648
|
+
trust_level: trustLevelSchema,
|
|
649
|
+
})
|
|
650
|
+
.strict();
|
|
651
|
+
export const partyUpdateValuesSchema = partySaveValuesSchema.omit({
|
|
652
|
+
code: true,
|
|
653
|
+
});
|
|
654
|
+
const symbolShape = {
|
|
655
|
+
symbol: z.string().min(1).max(64),
|
|
656
|
+
name: z.string().min(1).max(200),
|
|
657
|
+
asset_type: symbolAssetTypeSchema,
|
|
658
|
+
chain: optionalText(64),
|
|
659
|
+
contract_address: optionalText(256),
|
|
660
|
+
token_standard: optionalText(64),
|
|
661
|
+
nft_collection: optionalText(256),
|
|
662
|
+
protocol_id: optionalText(128),
|
|
663
|
+
decimals: z.number().int().min(0).max(255).optional(),
|
|
664
|
+
icon_url: optionalText(512),
|
|
665
|
+
coingecko_id: optionalText(128),
|
|
666
|
+
cmc_id: optionalText(128),
|
|
667
|
+
iso_code: optionalText(16),
|
|
668
|
+
trust_level: trustLevelSchema,
|
|
669
|
+
list_status: symbolListStatusSchema,
|
|
670
|
+
is_priceable: z.boolean().optional(),
|
|
671
|
+
auto_price_fill: z.boolean().optional(),
|
|
672
|
+
display_decimals: z.number().int().min(0).max(30).optional(),
|
|
673
|
+
aliases: z.array(z.string().min(1).max(64)).max(50).optional(),
|
|
674
|
+
description: optionalText(512),
|
|
675
|
+
};
|
|
676
|
+
export const symbolSaveValuesSchema = z.object(symbolShape).strict();
|
|
677
|
+
const projectValuesShape = {
|
|
678
|
+
name: z.string().min(1).max(200),
|
|
679
|
+
status: projectStatusSchema,
|
|
680
|
+
start_date: z.iso.date().optional(),
|
|
681
|
+
end_date: z.iso.date().optional(),
|
|
682
|
+
manager_id: uuidSchema.optional(),
|
|
683
|
+
currency: optionalText(8),
|
|
684
|
+
description: optionalText(512),
|
|
685
|
+
};
|
|
686
|
+
export const projectCreateValuesSchema = z
|
|
687
|
+
.object({ project_code: z.string().min(1).max(64), ...projectValuesShape })
|
|
688
|
+
.strict();
|
|
689
|
+
export const projectUpdateValuesSchema = z.object(projectValuesShape).strict();
|
|
690
|
+
const contractValuesShape = {
|
|
691
|
+
name: z.string().min(1).max(200),
|
|
692
|
+
project_id: uuidSchema.optional(),
|
|
693
|
+
counterparty: optionalText(200),
|
|
694
|
+
contract_type: contractTypeSchema,
|
|
695
|
+
currency: optionalText(8),
|
|
696
|
+
amount: nonNegativeDecimal.optional(),
|
|
697
|
+
sign_date: z.iso.date().optional(),
|
|
698
|
+
start_date: z.iso.date().optional(),
|
|
699
|
+
end_date: z.iso.date().optional(),
|
|
700
|
+
status: contractStatusSchema,
|
|
701
|
+
description: optionalText(512),
|
|
702
|
+
};
|
|
703
|
+
export const contractCreateValuesSchema = z
|
|
704
|
+
.object({ contract_no: z.string().min(1).max(64), ...contractValuesShape })
|
|
705
|
+
.strict();
|
|
706
|
+
export const contractUpdateValuesSchema = z
|
|
707
|
+
.object(contractValuesShape)
|
|
708
|
+
.strict();
|
|
709
|
+
const attributesSchema = z
|
|
710
|
+
.array(z.string().max(256).nullable())
|
|
711
|
+
.max(12)
|
|
712
|
+
.optional();
|
|
713
|
+
const taxCodeValuesShape = {
|
|
714
|
+
tax_code: z.string().min(1).max(64),
|
|
715
|
+
name: z.string().min(1).max(200),
|
|
716
|
+
tax_category: taxCodeCategorySchema,
|
|
717
|
+
tax_rate: nonNegativeDecimal,
|
|
718
|
+
is_price_included: z.boolean().optional(),
|
|
719
|
+
is_enabled: z.boolean().optional(),
|
|
720
|
+
description: optionalText(512),
|
|
721
|
+
ledger_id: uuidSchema.optional(),
|
|
722
|
+
coa_code: optionalText(64),
|
|
723
|
+
reference: optionalText(256),
|
|
724
|
+
attributes: attributesSchema,
|
|
725
|
+
};
|
|
726
|
+
export const taxCodeSaveValuesSchema = z.object(taxCodeValuesShape).strict();
|
|
727
|
+
const baseSaveShape = {
|
|
728
|
+
context: writeContextSchema,
|
|
729
|
+
idempotency_key: uuidSchema,
|
|
730
|
+
};
|
|
731
|
+
function mutationSchema(create, update) {
|
|
732
|
+
return z.discriminatedUnion('operation', [
|
|
733
|
+
z.object({ operation: z.literal('create'), values: create }).strict(),
|
|
734
|
+
z
|
|
735
|
+
.object({
|
|
736
|
+
operation: z.literal('update'),
|
|
737
|
+
id: uuidSchema,
|
|
738
|
+
version: z.number().int().nonnegative(),
|
|
739
|
+
values: update,
|
|
740
|
+
})
|
|
741
|
+
.strict(),
|
|
742
|
+
]);
|
|
743
|
+
}
|
|
744
|
+
export const saveMasterDataInputSchema = z.discriminatedUnion('entity_type', [
|
|
745
|
+
z
|
|
746
|
+
.object({
|
|
747
|
+
entity_type: z.literal('party'),
|
|
748
|
+
...baseSaveShape,
|
|
749
|
+
mutation: mutationSchema(partySaveValuesSchema, partyUpdateValuesSchema),
|
|
750
|
+
})
|
|
751
|
+
.strict(),
|
|
752
|
+
z
|
|
753
|
+
.object({
|
|
754
|
+
entity_type: z.literal('symbol'),
|
|
755
|
+
...baseSaveShape,
|
|
756
|
+
mutation: mutationSchema(symbolSaveValuesSchema, symbolSaveValuesSchema),
|
|
757
|
+
})
|
|
758
|
+
.strict(),
|
|
759
|
+
z
|
|
760
|
+
.object({
|
|
761
|
+
entity_type: z.literal('project'),
|
|
762
|
+
...baseSaveShape,
|
|
763
|
+
mutation: mutationSchema(projectCreateValuesSchema, projectUpdateValuesSchema),
|
|
764
|
+
})
|
|
765
|
+
.strict(),
|
|
766
|
+
z
|
|
767
|
+
.object({
|
|
768
|
+
entity_type: z.literal('contract'),
|
|
769
|
+
...baseSaveShape,
|
|
770
|
+
mutation: mutationSchema(contractCreateValuesSchema, contractUpdateValuesSchema),
|
|
771
|
+
})
|
|
772
|
+
.strict(),
|
|
773
|
+
z
|
|
774
|
+
.object({
|
|
775
|
+
entity_type: z.literal('tax_code'),
|
|
776
|
+
...baseSaveShape,
|
|
777
|
+
mutation: mutationSchema(taxCodeSaveValuesSchema, taxCodeSaveValuesSchema),
|
|
778
|
+
})
|
|
779
|
+
.strict(),
|
|
780
|
+
]);
|
|
781
|
+
export const saveMasterDataOutputSchema = successEnvelopeSchema(z
|
|
782
|
+
.object({
|
|
783
|
+
operation: z.enum(['created', 'updated']),
|
|
784
|
+
entity_type: z.enum([
|
|
785
|
+
'party',
|
|
786
|
+
'symbol',
|
|
787
|
+
'project',
|
|
788
|
+
'contract',
|
|
789
|
+
'tax_code',
|
|
790
|
+
]),
|
|
791
|
+
entity: z
|
|
792
|
+
.object({
|
|
793
|
+
id: uuidSchema,
|
|
794
|
+
version: z.number().int().nonnegative().nullable(),
|
|
795
|
+
})
|
|
796
|
+
.strict(),
|
|
797
|
+
})
|
|
798
|
+
.strict());
|
|
799
|
+
//# sourceMappingURL=master-data.js.map
|