@develit-services/ledger 0.2.0 → 0.3.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/dist/database/schema.cjs +2 -2
- package/dist/database/schema.d.cts +1 -1
- package/dist/database/schema.d.mts +1 -1
- package/dist/database/schema.d.ts +1 -1
- package/dist/database/schema.mjs +2 -2
- package/dist/export/worker.cjs +2 -2
- package/dist/export/worker.d.cts +4 -5
- package/dist/export/worker.d.mts +4 -5
- package/dist/export/worker.d.ts +4 -5
- package/dist/export/worker.mjs +2 -2
- package/dist/shared/{ledger._BGfS_Xc.mjs → ledger.229hTbXo.mjs} +7 -2
- package/dist/shared/{ledger.BzCZUESF.cjs → ledger.B2SLAQpo.cjs} +1 -1
- package/dist/shared/{ledger.CG3rFnGr.d.cts → ledger.B9-7wKL6.d.cts} +15 -6
- package/dist/shared/{ledger.BChJGa5-.cjs → ledger.C6xAPWKq.cjs} +7 -2
- package/dist/shared/{ledger.X_sUCnek.mjs → ledger.CvKXXw9R.mjs} +1 -1
- package/dist/shared/{ledger.Bo3kdRvg.d.ts → ledger.D9n1klaX.d.cts} +242 -14
- package/dist/shared/{ledger.Bo3kdRvg.d.cts → ledger.D9n1klaX.d.mts} +242 -14
- package/dist/shared/{ledger.Bo3kdRvg.d.mts → ledger.D9n1klaX.d.ts} +242 -14
- package/dist/shared/{ledger.9Ll_cqva.d.mts → ledger.DHX1YtaC.d.ts} +15 -6
- package/dist/shared/{ledger.Vn3IgETm.d.ts → ledger.o5dDJQGc.d.mts} +15 -6
- package/dist/types.cjs +1 -1
- package/dist/types.d.cts +3 -3
- package/dist/types.d.mts +3 -3
- package/dist/types.d.ts +3 -3
- package/dist/types.mjs +1 -1
- package/package.json +8 -10
package/dist/database/schema.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const database_schema = require('../shared/ledger.
|
|
3
|
+
const database_schema = require('../shared/ledger.B2SLAQpo.cjs');
|
|
4
4
|
require('@develit-io/backend-sdk');
|
|
5
5
|
require('drizzle-orm');
|
|
6
6
|
require('drizzle-orm/sqlite-core');
|
|
7
|
-
require('../shared/ledger.
|
|
7
|
+
require('../shared/ledger.C6xAPWKq.cjs');
|
|
8
8
|
require('zod');
|
|
9
9
|
require('@develit-io/general-codes');
|
|
10
10
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as account, G as accountIdentifier, H as accountIdentifierMapping, L as accountIdentifierMappingRelations, K as accountIdentifierRelations, J as accountRelations, M as entry, N as transaction } from '../shared/ledger.
|
|
1
|
+
export { F as account, G as accountIdentifier, H as accountIdentifierMapping, L as accountIdentifierMappingRelations, K as accountIdentifierRelations, J as accountRelations, M as entry, N as transaction } from '../shared/ledger.D9n1klaX.cjs';
|
|
2
2
|
import 'drizzle-orm';
|
|
3
3
|
import 'drizzle-orm/sqlite-core';
|
|
4
4
|
import '@develit-io/backend-sdk';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as account, G as accountIdentifier, H as accountIdentifierMapping, L as accountIdentifierMappingRelations, K as accountIdentifierRelations, J as accountRelations, M as entry, N as transaction } from '../shared/ledger.
|
|
1
|
+
export { F as account, G as accountIdentifier, H as accountIdentifierMapping, L as accountIdentifierMappingRelations, K as accountIdentifierRelations, J as accountRelations, M as entry, N as transaction } from '../shared/ledger.D9n1klaX.mjs';
|
|
2
2
|
import 'drizzle-orm';
|
|
3
3
|
import 'drizzle-orm/sqlite-core';
|
|
4
4
|
import '@develit-io/backend-sdk';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as account, G as accountIdentifier, H as accountIdentifierMapping, L as accountIdentifierMappingRelations, K as accountIdentifierRelations, J as accountRelations, M as entry, N as transaction } from '../shared/ledger.
|
|
1
|
+
export { F as account, G as accountIdentifier, H as accountIdentifierMapping, L as accountIdentifierMappingRelations, K as accountIdentifierRelations, J as accountRelations, M as entry, N as transaction } from '../shared/ledger.D9n1klaX.js';
|
|
2
2
|
import 'drizzle-orm';
|
|
3
3
|
import 'drizzle-orm/sqlite-core';
|
|
4
4
|
import '@develit-io/backend-sdk';
|
package/dist/database/schema.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { a as account, b as accountIdentifier, c as accountIdentifierMapping, f as accountIdentifierMappingRelations, e as accountIdentifierRelations, d as accountRelations, g as entry, t as transaction } from '../shared/ledger.
|
|
1
|
+
export { a as account, b as accountIdentifier, c as accountIdentifierMapping, f as accountIdentifierMappingRelations, e as accountIdentifierRelations, d as accountRelations, g as entry, t as transaction } from '../shared/ledger.CvKXXw9R.mjs';
|
|
2
2
|
import '@develit-io/backend-sdk';
|
|
3
3
|
import 'drizzle-orm';
|
|
4
4
|
import 'drizzle-orm/sqlite-core';
|
|
5
|
-
import '../shared/ledger.
|
|
5
|
+
import '../shared/ledger.229hTbXo.mjs';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import '@develit-io/general-codes';
|
package/dist/export/worker.cjs
CHANGED
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
6
6
|
const cloudflare_workers = require('cloudflare:workers');
|
|
7
7
|
const d1 = require('drizzle-orm/d1');
|
|
8
|
-
const database_schema = require('../shared/ledger.
|
|
8
|
+
const database_schema = require('../shared/ledger.B2SLAQpo.cjs');
|
|
9
9
|
const drizzleOrm = require('drizzle-orm');
|
|
10
|
-
const updateTransactionConfirmationSentAt = require('../shared/ledger.
|
|
10
|
+
const updateTransactionConfirmationSentAt = require('../shared/ledger.C6xAPWKq.cjs');
|
|
11
11
|
require('@develit-io/general-codes');
|
|
12
12
|
require('drizzle-orm/sqlite-core');
|
|
13
13
|
require('zod');
|
package/dist/export/worker.d.cts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
1
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
4
2
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
|
-
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, M as MatchTransactionInput, b as MatchTransactionOutput, F as FailTransactionInput, c as FailTransactionOutput, d as CancelTransactionInput, e as CancelTransactionOutput, G as GetTransactionByIdInput, f as GetTransactionByIdOutput, g as GetTransactionsByIdReferenceInput, h as GetTransactionsByReferenceIdOutput, i as GetTransactionsInput, j as GetTransactionsOutput, k as CreateAccountInput, l as CreateAccountOutput, U as UpdateAccountInput, m as UpdateAccountOutput, D as DeleteAccountInput, n as DeleteAccountOutput, o as GetAccountInput, p as GetAccountOutput, q as GetAccountsByOwnerInput, r as GetAccountsByOwnerOutput, L as ListAccountsInput, s as ListAccountsOutput, u as GetAccountIdentifierInput, v as GetAccountIdentifierOutput, w as ListAccountIdentifiersInput, x as ListAccountIdentifiersOutput, y as FindAccountByIdentifierInput, z as FindAccountByIdentifierOutput, A as GetAccountBalanceInput, B as GetAccountBalanceOutput, E as UpdateTransactionConfirmationSentAtInput, H as UpdateTransactionConfirmationSentAtOutput } from '../shared/ledger.
|
|
3
|
+
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, M as MatchTransactionInput, b as MatchTransactionOutput, F as FailTransactionInput, c as FailTransactionOutput, d as CancelTransactionInput, e as CancelTransactionOutput, G as GetTransactionByIdInput, f as GetTransactionByIdOutput, g as GetTransactionsByIdReferenceInput, h as GetTransactionsByReferenceIdOutput, i as GetTransactionsInput, j as GetTransactionsOutput, k as CreateAccountInput, l as CreateAccountOutput, U as UpdateAccountInput, m as UpdateAccountOutput, D as DeleteAccountInput, n as DeleteAccountOutput, o as GetAccountInput, p as GetAccountOutput, q as GetAccountsByOwnerInput, r as GetAccountsByOwnerOutput, L as ListAccountsInput, s as ListAccountsOutput, u as GetAccountIdentifierInput, v as GetAccountIdentifierOutput, w as ListAccountIdentifiersInput, x as ListAccountIdentifiersOutput, y as FindAccountByIdentifierInput, z as FindAccountByIdentifierOutput, A as GetAccountBalanceInput, B as GetAccountBalanceOutput, E as UpdateTransactionConfirmationSentAtInput, H as UpdateTransactionConfirmationSentAtOutput } from '../shared/ledger.B9-7wKL6.cjs';
|
|
4
|
+
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
6
5
|
import 'zod';
|
|
7
|
-
import '../shared/ledger.
|
|
6
|
+
import '../shared/ledger.D9n1klaX.cjs';
|
|
8
7
|
import 'drizzle-orm';
|
|
9
8
|
import 'drizzle-orm/sqlite-core';
|
|
10
9
|
import '@develit-io/general-codes';
|
|
11
10
|
|
|
12
|
-
declare const LedgerServiceBase_base:
|
|
11
|
+
declare const LedgerServiceBase_base: any;
|
|
13
12
|
declare class LedgerServiceBase extends LedgerServiceBase_base {
|
|
14
13
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
15
14
|
constructor(ctx: ExecutionContext, env: LedgerEnv);
|
package/dist/export/worker.d.mts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
1
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
4
2
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
|
-
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, M as MatchTransactionInput, b as MatchTransactionOutput, F as FailTransactionInput, c as FailTransactionOutput, d as CancelTransactionInput, e as CancelTransactionOutput, G as GetTransactionByIdInput, f as GetTransactionByIdOutput, g as GetTransactionsByIdReferenceInput, h as GetTransactionsByReferenceIdOutput, i as GetTransactionsInput, j as GetTransactionsOutput, k as CreateAccountInput, l as CreateAccountOutput, U as UpdateAccountInput, m as UpdateAccountOutput, D as DeleteAccountInput, n as DeleteAccountOutput, o as GetAccountInput, p as GetAccountOutput, q as GetAccountsByOwnerInput, r as GetAccountsByOwnerOutput, L as ListAccountsInput, s as ListAccountsOutput, u as GetAccountIdentifierInput, v as GetAccountIdentifierOutput, w as ListAccountIdentifiersInput, x as ListAccountIdentifiersOutput, y as FindAccountByIdentifierInput, z as FindAccountByIdentifierOutput, A as GetAccountBalanceInput, B as GetAccountBalanceOutput, E as UpdateTransactionConfirmationSentAtInput, H as UpdateTransactionConfirmationSentAtOutput } from '../shared/ledger.
|
|
3
|
+
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, M as MatchTransactionInput, b as MatchTransactionOutput, F as FailTransactionInput, c as FailTransactionOutput, d as CancelTransactionInput, e as CancelTransactionOutput, G as GetTransactionByIdInput, f as GetTransactionByIdOutput, g as GetTransactionsByIdReferenceInput, h as GetTransactionsByReferenceIdOutput, i as GetTransactionsInput, j as GetTransactionsOutput, k as CreateAccountInput, l as CreateAccountOutput, U as UpdateAccountInput, m as UpdateAccountOutput, D as DeleteAccountInput, n as DeleteAccountOutput, o as GetAccountInput, p as GetAccountOutput, q as GetAccountsByOwnerInput, r as GetAccountsByOwnerOutput, L as ListAccountsInput, s as ListAccountsOutput, u as GetAccountIdentifierInput, v as GetAccountIdentifierOutput, w as ListAccountIdentifiersInput, x as ListAccountIdentifiersOutput, y as FindAccountByIdentifierInput, z as FindAccountByIdentifierOutput, A as GetAccountBalanceInput, B as GetAccountBalanceOutput, E as UpdateTransactionConfirmationSentAtInput, H as UpdateTransactionConfirmationSentAtOutput } from '../shared/ledger.o5dDJQGc.mjs';
|
|
4
|
+
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
6
5
|
import 'zod';
|
|
7
|
-
import '../shared/ledger.
|
|
6
|
+
import '../shared/ledger.D9n1klaX.mjs';
|
|
8
7
|
import 'drizzle-orm';
|
|
9
8
|
import 'drizzle-orm/sqlite-core';
|
|
10
9
|
import '@develit-io/general-codes';
|
|
11
10
|
|
|
12
|
-
declare const LedgerServiceBase_base:
|
|
11
|
+
declare const LedgerServiceBase_base: any;
|
|
13
12
|
declare class LedgerServiceBase extends LedgerServiceBase_base {
|
|
14
13
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
15
14
|
constructor(ctx: ExecutionContext, env: LedgerEnv);
|
package/dist/export/worker.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
1
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
4
2
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
|
-
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, M as MatchTransactionInput, b as MatchTransactionOutput, F as FailTransactionInput, c as FailTransactionOutput, d as CancelTransactionInput, e as CancelTransactionOutput, G as GetTransactionByIdInput, f as GetTransactionByIdOutput, g as GetTransactionsByIdReferenceInput, h as GetTransactionsByReferenceIdOutput, i as GetTransactionsInput, j as GetTransactionsOutput, k as CreateAccountInput, l as CreateAccountOutput, U as UpdateAccountInput, m as UpdateAccountOutput, D as DeleteAccountInput, n as DeleteAccountOutput, o as GetAccountInput, p as GetAccountOutput, q as GetAccountsByOwnerInput, r as GetAccountsByOwnerOutput, L as ListAccountsInput, s as ListAccountsOutput, u as GetAccountIdentifierInput, v as GetAccountIdentifierOutput, w as ListAccountIdentifiersInput, x as ListAccountIdentifiersOutput, y as FindAccountByIdentifierInput, z as FindAccountByIdentifierOutput, A as GetAccountBalanceInput, B as GetAccountBalanceOutput, E as UpdateTransactionConfirmationSentAtInput, H as UpdateTransactionConfirmationSentAtOutput } from '../shared/ledger.
|
|
3
|
+
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, M as MatchTransactionInput, b as MatchTransactionOutput, F as FailTransactionInput, c as FailTransactionOutput, d as CancelTransactionInput, e as CancelTransactionOutput, G as GetTransactionByIdInput, f as GetTransactionByIdOutput, g as GetTransactionsByIdReferenceInput, h as GetTransactionsByReferenceIdOutput, i as GetTransactionsInput, j as GetTransactionsOutput, k as CreateAccountInput, l as CreateAccountOutput, U as UpdateAccountInput, m as UpdateAccountOutput, D as DeleteAccountInput, n as DeleteAccountOutput, o as GetAccountInput, p as GetAccountOutput, q as GetAccountsByOwnerInput, r as GetAccountsByOwnerOutput, L as ListAccountsInput, s as ListAccountsOutput, u as GetAccountIdentifierInput, v as GetAccountIdentifierOutput, w as ListAccountIdentifiersInput, x as ListAccountIdentifiersOutput, y as FindAccountByIdentifierInput, z as FindAccountByIdentifierOutput, A as GetAccountBalanceInput, B as GetAccountBalanceOutput, E as UpdateTransactionConfirmationSentAtInput, H as UpdateTransactionConfirmationSentAtOutput } from '../shared/ledger.DHX1YtaC.js';
|
|
4
|
+
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
6
5
|
import 'zod';
|
|
7
|
-
import '../shared/ledger.
|
|
6
|
+
import '../shared/ledger.D9n1klaX.js';
|
|
8
7
|
import 'drizzle-orm';
|
|
9
8
|
import 'drizzle-orm/sqlite-core';
|
|
10
9
|
import '@develit-io/general-codes';
|
|
11
10
|
|
|
12
|
-
declare const LedgerServiceBase_base:
|
|
11
|
+
declare const LedgerServiceBase_base: any;
|
|
13
12
|
declare class LedgerServiceBase extends LedgerServiceBase_base {
|
|
14
13
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
15
14
|
constructor(ctx: ExecutionContext, env: LedgerEnv);
|
package/dist/export/worker.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { first, develitWorker, uuidv4, useResult, createInternalError, action, service } from '@develit-io/backend-sdk';
|
|
2
2
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
3
3
|
import { drizzle } from 'drizzle-orm/d1';
|
|
4
|
-
import { s as schema } from '../shared/ledger.
|
|
4
|
+
import { s as schema } from '../shared/ledger.CvKXXw9R.mjs';
|
|
5
5
|
import { eq, and, inArray, or, count, gte, lte, sql, asc, desc } from 'drizzle-orm';
|
|
6
|
-
import { g as createTransactionInputSchema, t as matchTransactionInputSchema, i as failTransactionInputSchema, e as cancelTransactionInputSchema, o as getTransactionByIdInputSchema, q as getTransactionsByReferenceIdInputSchema, p as getTransactionsInputSchema, f as createAccountInputSchema, u as updateAccountInputSchema, h as deleteAccountInputSchema, k as getAccountInputSchema, n as getAccountsByOwnerInputSchema, s as listAccountsInputSchema, m as getAccountIdentifierInputSchema, r as listAccountIdentifiersInputSchema, j as findAccountByIdentifierInputSchema, l as getAccountBalanceInputSchema, v as updateTransactionConfirmationSentAtInputSchema } from '../shared/ledger.
|
|
6
|
+
import { g as createTransactionInputSchema, t as matchTransactionInputSchema, i as failTransactionInputSchema, e as cancelTransactionInputSchema, o as getTransactionByIdInputSchema, q as getTransactionsByReferenceIdInputSchema, p as getTransactionsInputSchema, f as createAccountInputSchema, u as updateAccountInputSchema, h as deleteAccountInputSchema, k as getAccountInputSchema, n as getAccountsByOwnerInputSchema, s as listAccountsInputSchema, m as getAccountIdentifierInputSchema, r as listAccountIdentifiersInputSchema, j as findAccountByIdentifierInputSchema, l as getAccountBalanceInputSchema, v as updateTransactionConfirmationSentAtInputSchema } from '../shared/ledger.229hTbXo.mjs';
|
|
7
7
|
import '@develit-io/general-codes';
|
|
8
8
|
import 'drizzle-orm/sqlite-core';
|
|
9
9
|
import 'zod';
|
|
@@ -59,6 +59,8 @@ const ENTRY_STATUSES = [
|
|
|
59
59
|
];
|
|
60
60
|
const TRANSACTION_STATUSES = [
|
|
61
61
|
"WAITING_FOR_PAYMENT",
|
|
62
|
+
"WAITING_FOR_COLLATERAL",
|
|
63
|
+
"COLLATERAL_PAID",
|
|
62
64
|
"PAUSED",
|
|
63
65
|
"WAITING_FOR_MANUAL_PROCESSING",
|
|
64
66
|
"MATCHED",
|
|
@@ -78,14 +80,17 @@ const TRANSACTION_TYPES = [
|
|
|
78
80
|
"UNMATCHED",
|
|
79
81
|
"ADJUSTMENT",
|
|
80
82
|
// manual correction
|
|
81
|
-
"TRANSFER"
|
|
83
|
+
"TRANSFER",
|
|
82
84
|
// internal transfer between accounts
|
|
85
|
+
"COLLATERAL"
|
|
86
|
+
// forward collateral payment from client
|
|
83
87
|
];
|
|
84
88
|
const REFERENCE_TYPES = [
|
|
85
89
|
"PAYMENT",
|
|
86
90
|
"EXCHANGE",
|
|
87
91
|
"ORDER",
|
|
88
|
-
"INTERNAL-TRANSFER"
|
|
92
|
+
"INTERNAL-TRANSFER",
|
|
93
|
+
"FORWARD"
|
|
89
94
|
];
|
|
90
95
|
const PAYMENT_CHARGE_TYPES = ["SHA", "OUR", "BEN"];
|
|
91
96
|
const PAYMENT_TYPES = ["DOMESTIC", "SEPA", "SWIFT", "UNKNOWN"];
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
4
|
const drizzleOrm = require('drizzle-orm');
|
|
5
5
|
const sqliteCore = require('drizzle-orm/sqlite-core');
|
|
6
|
-
const updateTransactionConfirmationSentAt = require('./ledger.
|
|
6
|
+
const updateTransactionConfirmationSentAt = require('./ledger.C6xAPWKq.cjs');
|
|
7
7
|
require('@develit-io/general-codes');
|
|
8
8
|
|
|
9
9
|
const account = sqliteCore.sqliteTable("account", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { D as schema } from './ledger.
|
|
2
|
+
import { D as schema } from './ledger.D9n1klaX.cjs';
|
|
3
3
|
import { InferSelectModel, ExtractTablesWithRelations, DBQueryConfig, BuildQueryResult, InferInsertModel } from 'drizzle-orm';
|
|
4
4
|
|
|
5
5
|
interface TSchema extends ExtractTablesWithRelations<typeof tables> {
|
|
@@ -410,21 +410,23 @@ interface CreateAccountOutput {
|
|
|
410
410
|
declare const createTransactionInputSchema: z.ZodObject<{
|
|
411
411
|
correlationId: z.ZodString;
|
|
412
412
|
referenceType: z.ZodEnum<{
|
|
413
|
-
EXCHANGE: "EXCHANGE";
|
|
414
413
|
PAYMENT: "PAYMENT";
|
|
414
|
+
EXCHANGE: "EXCHANGE";
|
|
415
415
|
ORDER: "ORDER";
|
|
416
416
|
"INTERNAL-TRANSFER": "INTERNAL-TRANSFER";
|
|
417
|
+
FORWARD: "FORWARD";
|
|
417
418
|
}>;
|
|
418
419
|
referenceId: z.ZodOptional<z.ZodString>;
|
|
419
420
|
type: z.ZodEnum<{
|
|
421
|
+
EXCHANGE: "EXCHANGE";
|
|
420
422
|
CLIENT_FUND_IN: "CLIENT_FUND_IN";
|
|
421
423
|
CLIENT_FUND_OUT: "CLIENT_FUND_OUT";
|
|
422
424
|
PROVIDER_FUND_IN: "PROVIDER_FUND_IN";
|
|
423
425
|
PROVIDER_FUND_OUT: "PROVIDER_FUND_OUT";
|
|
424
|
-
EXCHANGE: "EXCHANGE";
|
|
425
426
|
UNMATCHED: "UNMATCHED";
|
|
426
427
|
ADJUSTMENT: "ADJUSTMENT";
|
|
427
428
|
TRANSFER: "TRANSFER";
|
|
429
|
+
COLLATERAL: "COLLATERAL";
|
|
428
430
|
}>;
|
|
429
431
|
description: z.ZodOptional<z.ZodString>;
|
|
430
432
|
paymentId: z.ZodOptional<z.ZodString>;
|
|
@@ -1172,6 +1174,8 @@ declare const createTransactionInputSchema: z.ZodObject<{
|
|
|
1172
1174
|
status: z.ZodEnum<{
|
|
1173
1175
|
FAILED: "FAILED";
|
|
1174
1176
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1177
|
+
WAITING_FOR_COLLATERAL: "WAITING_FOR_COLLATERAL";
|
|
1178
|
+
COLLATERAL_PAID: "COLLATERAL_PAID";
|
|
1175
1179
|
PAUSED: "PAUSED";
|
|
1176
1180
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
1177
1181
|
MATCHED: "MATCHED";
|
|
@@ -1373,21 +1377,23 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1373
1377
|
}, z.core.$strip>;
|
|
1374
1378
|
filterTransactionCorrelationId: z.ZodOptional<z.ZodUUID>;
|
|
1375
1379
|
filterTransactionReferenceType: z.ZodOptional<z.ZodEnum<{
|
|
1376
|
-
EXCHANGE: "EXCHANGE";
|
|
1377
1380
|
PAYMENT: "PAYMENT";
|
|
1381
|
+
EXCHANGE: "EXCHANGE";
|
|
1378
1382
|
ORDER: "ORDER";
|
|
1379
1383
|
"INTERNAL-TRANSFER": "INTERNAL-TRANSFER";
|
|
1384
|
+
FORWARD: "FORWARD";
|
|
1380
1385
|
}>>;
|
|
1381
1386
|
filterTransactionReferenceId: z.ZodOptional<z.ZodUUID>;
|
|
1382
1387
|
filterTransactionType: z.ZodOptional<z.ZodEnum<{
|
|
1388
|
+
EXCHANGE: "EXCHANGE";
|
|
1383
1389
|
CLIENT_FUND_IN: "CLIENT_FUND_IN";
|
|
1384
1390
|
CLIENT_FUND_OUT: "CLIENT_FUND_OUT";
|
|
1385
1391
|
PROVIDER_FUND_IN: "PROVIDER_FUND_IN";
|
|
1386
1392
|
PROVIDER_FUND_OUT: "PROVIDER_FUND_OUT";
|
|
1387
|
-
EXCHANGE: "EXCHANGE";
|
|
1388
1393
|
UNMATCHED: "UNMATCHED";
|
|
1389
1394
|
ADJUSTMENT: "ADJUSTMENT";
|
|
1390
1395
|
TRANSFER: "TRANSFER";
|
|
1396
|
+
COLLATERAL: "COLLATERAL";
|
|
1391
1397
|
}>>;
|
|
1392
1398
|
filterTransactionDescription: z.ZodOptional<z.ZodString>;
|
|
1393
1399
|
filterTransactionDateFrom: z.ZodOptional<z.ZodDate>;
|
|
@@ -1396,6 +1402,8 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1396
1402
|
filterTransactionStatus: z.ZodOptional<z.ZodEnum<{
|
|
1397
1403
|
FAILED: "FAILED";
|
|
1398
1404
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1405
|
+
WAITING_FOR_COLLATERAL: "WAITING_FOR_COLLATERAL";
|
|
1406
|
+
COLLATERAL_PAID: "COLLATERAL_PAID";
|
|
1399
1407
|
PAUSED: "PAUSED";
|
|
1400
1408
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
1401
1409
|
MATCHED: "MATCHED";
|
|
@@ -1415,10 +1423,11 @@ interface GetTransactionsOutput {
|
|
|
1415
1423
|
|
|
1416
1424
|
declare const getTransactionsByReferenceIdInputSchema: z.ZodObject<{
|
|
1417
1425
|
referenceType: z.ZodEnum<{
|
|
1418
|
-
EXCHANGE: "EXCHANGE";
|
|
1419
1426
|
PAYMENT: "PAYMENT";
|
|
1427
|
+
EXCHANGE: "EXCHANGE";
|
|
1420
1428
|
ORDER: "ORDER";
|
|
1421
1429
|
"INTERNAL-TRANSFER": "INTERNAL-TRANSFER";
|
|
1430
|
+
FORWARD: "FORWARD";
|
|
1422
1431
|
}>;
|
|
1423
1432
|
referenceId: z.ZodUUID;
|
|
1424
1433
|
}, z.core.$strip>;
|
|
@@ -61,6 +61,8 @@ const ENTRY_STATUSES = [
|
|
|
61
61
|
];
|
|
62
62
|
const TRANSACTION_STATUSES = [
|
|
63
63
|
"WAITING_FOR_PAYMENT",
|
|
64
|
+
"WAITING_FOR_COLLATERAL",
|
|
65
|
+
"COLLATERAL_PAID",
|
|
64
66
|
"PAUSED",
|
|
65
67
|
"WAITING_FOR_MANUAL_PROCESSING",
|
|
66
68
|
"MATCHED",
|
|
@@ -80,14 +82,17 @@ const TRANSACTION_TYPES = [
|
|
|
80
82
|
"UNMATCHED",
|
|
81
83
|
"ADJUSTMENT",
|
|
82
84
|
// manual correction
|
|
83
|
-
"TRANSFER"
|
|
85
|
+
"TRANSFER",
|
|
84
86
|
// internal transfer between accounts
|
|
87
|
+
"COLLATERAL"
|
|
88
|
+
// forward collateral payment from client
|
|
85
89
|
];
|
|
86
90
|
const REFERENCE_TYPES = [
|
|
87
91
|
"PAYMENT",
|
|
88
92
|
"EXCHANGE",
|
|
89
93
|
"ORDER",
|
|
90
|
-
"INTERNAL-TRANSFER"
|
|
94
|
+
"INTERNAL-TRANSFER",
|
|
95
|
+
"FORWARD"
|
|
91
96
|
];
|
|
92
97
|
const PAYMENT_CHARGE_TYPES = ["SHA", "OUR", "BEN"];
|
|
93
98
|
const PAYMENT_TYPES = ["DOMESTIC", "SEPA", "SWIFT", "UNKNOWN"];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { base } from '@develit-io/backend-sdk';
|
|
2
2
|
import { relations } from 'drizzle-orm';
|
|
3
3
|
import { sqliteTable, integer, text, real } from 'drizzle-orm/sqlite-core';
|
|
4
|
-
import { T as TRANSACTION_STATUSES, b as TRANSACTION_TYPES, R as REFERENCE_TYPES } from './ledger.
|
|
4
|
+
import { T as TRANSACTION_STATUSES, b as TRANSACTION_TYPES, R as REFERENCE_TYPES } from './ledger.229hTbXo.mjs';
|
|
5
5
|
import '@develit-io/general-codes';
|
|
6
6
|
|
|
7
7
|
const account = sqliteTable("account", {
|