@develit-services/ledger 0.4.2 → 0.4.3
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 +35 -6
- package/dist/export/worker.d.cts +2 -2
- package/dist/export/worker.d.mts +2 -2
- package/dist/export/worker.d.ts +2 -2
- package/dist/export/worker.mjs +35 -6
- package/dist/shared/{ledger.BQi7s_NG.d.ts → ledger.2ZZR5AvH.d.ts} +11 -2
- package/dist/shared/{ledger.Dpxzz64a.mjs → ledger.B3xjxvWW.mjs} +2 -1
- package/dist/shared/{ledger.C4eXkZIj.cjs → ledger.C2YQGhdM.cjs} +2 -1
- package/dist/shared/{ledger.DQZB5SVv.d.cts → ledger.CPKrhfU8.d.mts} +11 -2
- package/dist/shared/{ledger.CNLyjoqY.d.mts → ledger.CZgIHlf1.d.cts} +23 -4
- package/dist/shared/{ledger.CNLyjoqY.d.ts → ledger.CZgIHlf1.d.mts} +23 -4
- package/dist/shared/{ledger.CNLyjoqY.d.cts → ledger.CZgIHlf1.d.ts} +23 -4
- package/dist/shared/{ledger.CAoxOU3F.cjs → ledger.ChjFG1yE.cjs} +12 -3
- package/dist/shared/{ledger.De19PrJa.mjs → ledger.DvHIBJap.mjs} +12 -3
- package/dist/shared/{ledger.DzMWoOWY.d.mts → ledger.DxnspPg_.d.cts} +11 -2
- package/dist/types.cjs +1 -1
- package/dist/types.d.cts +5 -3
- package/dist/types.d.mts +5 -3
- package/dist/types.d.ts +5 -3
- package/dist/types.mjs +1 -1
- package/package.json +1 -1
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.C2YQGhdM.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.ChjFG1yE.cjs');
|
|
8
8
|
require('zod');
|
|
9
9
|
require('@develit-io/general-codes');
|
|
10
10
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { G as account, H as accountIdentifier, J as accountIdentifierMapping, K as accountIdentifierMappingRelations, L as accountIdentifierRelations, M as accountRelations, N as entry, O as transaction } from '../shared/ledger.
|
|
1
|
+
export { G as account, H as accountIdentifier, J as accountIdentifierMapping, K as accountIdentifierMappingRelations, L as accountIdentifierRelations, M as accountRelations, N as entry, O as transaction } from '../shared/ledger.CZgIHlf1.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 { G as account, H as accountIdentifier, J as accountIdentifierMapping, K as accountIdentifierMappingRelations, L as accountIdentifierRelations, M as accountRelations, N as entry, O as transaction } from '../shared/ledger.
|
|
1
|
+
export { G as account, H as accountIdentifier, J as accountIdentifierMapping, K as accountIdentifierMappingRelations, L as accountIdentifierRelations, M as accountRelations, N as entry, O as transaction } from '../shared/ledger.CZgIHlf1.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 { G as account, H as accountIdentifier, J as accountIdentifierMapping, K as accountIdentifierMappingRelations, L as accountIdentifierRelations, M as accountRelations, N as entry, O as transaction } from '../shared/ledger.
|
|
1
|
+
export { G as account, H as accountIdentifier, J as accountIdentifierMapping, K as accountIdentifierMappingRelations, L as accountIdentifierRelations, M as accountRelations, N as entry, O as transaction } from '../shared/ledger.CZgIHlf1.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, d as accountIdentifierMappingRelations, e as accountIdentifierRelations, f as accountRelations, g as entry, t as transaction } from '../shared/ledger.
|
|
1
|
+
export { a as account, b as accountIdentifier, c as accountIdentifierMapping, d as accountIdentifierMappingRelations, e as accountIdentifierRelations, f as accountRelations, g as entry, t as transaction } from '../shared/ledger.B3xjxvWW.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.DvHIBJap.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.C2YQGhdM.cjs');
|
|
9
9
|
const drizzleOrm = require('drizzle-orm');
|
|
10
|
-
const updateTransactionStatus = require('../shared/ledger.
|
|
10
|
+
const updateTransactionStatus = require('../shared/ledger.ChjFG1yE.cjs');
|
|
11
11
|
require('@develit-io/general-codes');
|
|
12
12
|
require('drizzle-orm/sqlite-core');
|
|
13
13
|
require('zod');
|
|
@@ -50,6 +50,7 @@ const updateTransactionStatusCommand = (db, data) => {
|
|
|
50
50
|
transactionId,
|
|
51
51
|
status,
|
|
52
52
|
paymentId,
|
|
53
|
+
paymentRequestId,
|
|
53
54
|
completedAt,
|
|
54
55
|
statusReason,
|
|
55
56
|
receivedValue,
|
|
@@ -61,6 +62,7 @@ const updateTransactionStatusCommand = (db, data) => {
|
|
|
61
62
|
updatedAt: /* @__PURE__ */ new Date(),
|
|
62
63
|
completedAt,
|
|
63
64
|
paymentId,
|
|
65
|
+
...paymentRequestId !== void 0 && { paymentRequestId },
|
|
64
66
|
...receivedValue !== void 0 && { receivedValue },
|
|
65
67
|
...metadata !== void 0 && { metadata }
|
|
66
68
|
}).where(drizzleOrm.eq(tables.transaction.id, transactionId)).returning();
|
|
@@ -253,6 +255,8 @@ const getTransactionsWithPaginationQuery = async ({
|
|
|
253
255
|
filterTransactionCompletedAt,
|
|
254
256
|
filterTransactionStatus,
|
|
255
257
|
filterTransactionStatuses,
|
|
258
|
+
filterTransactionPaymentIds,
|
|
259
|
+
filterTransactionPaymentRequestIds,
|
|
256
260
|
search
|
|
257
261
|
}
|
|
258
262
|
}) => {
|
|
@@ -274,7 +278,12 @@ const getTransactionsWithPaginationQuery = async ({
|
|
|
274
278
|
filterTransactionDateTo ? drizzleOrm.lte(tables.transaction.createdAt, filterTransactionDateTo) : void 0,
|
|
275
279
|
filterTransactionCompletedAt ? drizzleOrm.eq(tables.transaction.completedAt, filterTransactionCompletedAt) : void 0,
|
|
276
280
|
filterTransactionStatus ? drizzleOrm.eq(tables.transaction.status, filterTransactionStatus) : void 0,
|
|
277
|
-
filterTransactionStatuses?.length ? drizzleOrm.inArray(tables.transaction.status, filterTransactionStatuses) : void 0
|
|
281
|
+
filterTransactionStatuses?.length ? drizzleOrm.inArray(tables.transaction.status, filterTransactionStatuses) : void 0,
|
|
282
|
+
filterTransactionPaymentIds?.length ? drizzleOrm.inArray(tables.transaction.paymentId, filterTransactionPaymentIds) : void 0,
|
|
283
|
+
filterTransactionPaymentRequestIds?.length ? drizzleOrm.inArray(
|
|
284
|
+
tables.transaction.paymentRequestId,
|
|
285
|
+
filterTransactionPaymentRequestIds
|
|
286
|
+
) : void 0
|
|
278
287
|
);
|
|
279
288
|
const sortColumn = resolveColumn(tables.transaction, sort.column);
|
|
280
289
|
const [{ totalCount }] = await db.select({ totalCount: drizzleOrm.sql`count(*)` }).from(tables.transaction).where(whereConditions);
|
|
@@ -343,6 +352,7 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
343
352
|
type,
|
|
344
353
|
description,
|
|
345
354
|
paymentId,
|
|
355
|
+
paymentRequestId,
|
|
346
356
|
metadata,
|
|
347
357
|
status,
|
|
348
358
|
value,
|
|
@@ -367,6 +377,7 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
367
377
|
completedAt: null,
|
|
368
378
|
status,
|
|
369
379
|
paymentId,
|
|
380
|
+
paymentRequestId,
|
|
370
381
|
metadata,
|
|
371
382
|
updatedAt: timestamp,
|
|
372
383
|
value,
|
|
@@ -419,6 +430,7 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
419
430
|
async _applyMatchAmount({
|
|
420
431
|
existingTransaction,
|
|
421
432
|
paymentId,
|
|
433
|
+
paymentRequestId,
|
|
422
434
|
amount,
|
|
423
435
|
completedAt,
|
|
424
436
|
extraMetadata
|
|
@@ -445,6 +457,7 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
445
457
|
status: isFullyMatched ? "MATCHED" : "PARTIALLY_MATCHED",
|
|
446
458
|
completedAt: isFullyMatched ? completedAt : void 0,
|
|
447
459
|
paymentId,
|
|
460
|
+
paymentRequestId,
|
|
448
461
|
receivedValue: newReceivedValue,
|
|
449
462
|
metadata: updatedMetadata
|
|
450
463
|
}).command.execute().then(backendSdk.first);
|
|
@@ -464,7 +477,8 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
464
477
|
transactionId,
|
|
465
478
|
status: "MATCHED",
|
|
466
479
|
completedAt,
|
|
467
|
-
paymentId
|
|
480
|
+
paymentId,
|
|
481
|
+
paymentRequestId
|
|
468
482
|
}).command.execute().then(backendSdk.first);
|
|
469
483
|
if (!transaction) {
|
|
470
484
|
throw backendSdk.createInternalError(null, {
|
|
@@ -480,7 +494,13 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
480
494
|
{ data: input, schema: updateTransactionStatus.matchTransactionInputSchema },
|
|
481
495
|
{ successMessage: "Transaction successfully matched." },
|
|
482
496
|
async (params) => {
|
|
483
|
-
const {
|
|
497
|
+
const {
|
|
498
|
+
transactionId,
|
|
499
|
+
completedAt,
|
|
500
|
+
paymentId,
|
|
501
|
+
paymentRequestId,
|
|
502
|
+
amount
|
|
503
|
+
} = params;
|
|
484
504
|
const existingTransaction = await getTransactionByIdQuery(
|
|
485
505
|
this.db,
|
|
486
506
|
transactionId
|
|
@@ -502,6 +522,7 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
502
522
|
const { transaction, signal } = await this._applyMatchAmount({
|
|
503
523
|
existingTransaction,
|
|
504
524
|
paymentId,
|
|
525
|
+
paymentRequestId,
|
|
505
526
|
amount,
|
|
506
527
|
completedAt
|
|
507
528
|
});
|
|
@@ -1111,7 +1132,14 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
1111
1132
|
{ data: input, schema: updateTransactionStatus.updateTransactionStatusInputSchema },
|
|
1112
1133
|
{ successMessage: "Transaction status successfully updated." },
|
|
1113
1134
|
async (params) => {
|
|
1114
|
-
const {
|
|
1135
|
+
const {
|
|
1136
|
+
transactionId,
|
|
1137
|
+
status,
|
|
1138
|
+
statusReason,
|
|
1139
|
+
paymentId,
|
|
1140
|
+
paymentRequestId,
|
|
1141
|
+
completedAt
|
|
1142
|
+
} = params;
|
|
1115
1143
|
const existingTransaction = await getTransactionByIdQuery(
|
|
1116
1144
|
this.db,
|
|
1117
1145
|
transactionId
|
|
@@ -1128,6 +1156,7 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
1128
1156
|
status,
|
|
1129
1157
|
statusReason,
|
|
1130
1158
|
paymentId,
|
|
1159
|
+
paymentRequestId,
|
|
1131
1160
|
completedAt
|
|
1132
1161
|
});
|
|
1133
1162
|
const [updatedTransaction] = await this.db.batch([command]);
|
package/dist/export/worker.d.cts
CHANGED
|
@@ -2,9 +2,9 @@ import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
3
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
|
-
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, M as MatchTransactionInput, b as MatchTransactionOutput, R as ResolveUnmatchedTransactionInput, c as ResolveUnmatchedTransactionOutput, F as FailTransactionInput, d as FailTransactionOutput, e as CancelTransactionInput, f as CancelTransactionOutput, g as RefundTransactionInput, h as RefundTransactionOutput, G as GetTransactionByIdInput, i as GetTransactionByIdOutput, j as GetTransactionsByIdReferenceInput, k as GetTransactionsByReferenceIdOutput, l as GetTransactionsInput, m as GetTransactionsOutput, n as CreateAccountInput, o as CreateAccountOutput, U as UpdateAccountInput, p as UpdateAccountOutput, D as DeleteAccountInput, q as DeleteAccountOutput, r as GetAccountInput, s as GetAccountOutput, u as GetAccountsByOwnerInput, v as GetAccountsByOwnerOutput, L as ListAccountsInput, w as ListAccountsOutput, x as GetAccountIdentifierInput, y as GetAccountIdentifierOutput, z as ListAccountIdentifiersInput, A as ListAccountIdentifiersOutput, B as FindAccountByIdentifierInput, E as FindAccountByIdentifierOutput, H as GetAccountBalanceInput, I as GetAccountBalanceOutput, J as UpdateTransactionConfirmationSentAtInput, K as UpdateTransactionConfirmationSentAtOutput, N as UpdateTransactionStatusInput, O as UpdateTransactionStatusOutput } from '../shared/ledger.
|
|
5
|
+
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, M as MatchTransactionInput, b as MatchTransactionOutput, R as ResolveUnmatchedTransactionInput, c as ResolveUnmatchedTransactionOutput, F as FailTransactionInput, d as FailTransactionOutput, e as CancelTransactionInput, f as CancelTransactionOutput, g as RefundTransactionInput, h as RefundTransactionOutput, G as GetTransactionByIdInput, i as GetTransactionByIdOutput, j as GetTransactionsByIdReferenceInput, k as GetTransactionsByReferenceIdOutput, l as GetTransactionsInput, m as GetTransactionsOutput, n as CreateAccountInput, o as CreateAccountOutput, U as UpdateAccountInput, p as UpdateAccountOutput, D as DeleteAccountInput, q as DeleteAccountOutput, r as GetAccountInput, s as GetAccountOutput, u as GetAccountsByOwnerInput, v as GetAccountsByOwnerOutput, L as ListAccountsInput, w as ListAccountsOutput, x as GetAccountIdentifierInput, y as GetAccountIdentifierOutput, z as ListAccountIdentifiersInput, A as ListAccountIdentifiersOutput, B as FindAccountByIdentifierInput, E as FindAccountByIdentifierOutput, H as GetAccountBalanceInput, I as GetAccountBalanceOutput, J as UpdateTransactionConfirmationSentAtInput, K as UpdateTransactionConfirmationSentAtOutput, N as UpdateTransactionStatusInput, O as UpdateTransactionStatusOutput } from '../shared/ledger.DxnspPg_.cjs';
|
|
6
6
|
import 'zod';
|
|
7
|
-
import '../shared/ledger.
|
|
7
|
+
import '../shared/ledger.CZgIHlf1.cjs';
|
|
8
8
|
import 'drizzle-orm';
|
|
9
9
|
import 'drizzle-orm/sqlite-core';
|
|
10
10
|
import '@develit-io/general-codes';
|
package/dist/export/worker.d.mts
CHANGED
|
@@ -2,9 +2,9 @@ import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
3
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
|
-
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, M as MatchTransactionInput, b as MatchTransactionOutput, R as ResolveUnmatchedTransactionInput, c as ResolveUnmatchedTransactionOutput, F as FailTransactionInput, d as FailTransactionOutput, e as CancelTransactionInput, f as CancelTransactionOutput, g as RefundTransactionInput, h as RefundTransactionOutput, G as GetTransactionByIdInput, i as GetTransactionByIdOutput, j as GetTransactionsByIdReferenceInput, k as GetTransactionsByReferenceIdOutput, l as GetTransactionsInput, m as GetTransactionsOutput, n as CreateAccountInput, o as CreateAccountOutput, U as UpdateAccountInput, p as UpdateAccountOutput, D as DeleteAccountInput, q as DeleteAccountOutput, r as GetAccountInput, s as GetAccountOutput, u as GetAccountsByOwnerInput, v as GetAccountsByOwnerOutput, L as ListAccountsInput, w as ListAccountsOutput, x as GetAccountIdentifierInput, y as GetAccountIdentifierOutput, z as ListAccountIdentifiersInput, A as ListAccountIdentifiersOutput, B as FindAccountByIdentifierInput, E as FindAccountByIdentifierOutput, H as GetAccountBalanceInput, I as GetAccountBalanceOutput, J as UpdateTransactionConfirmationSentAtInput, K as UpdateTransactionConfirmationSentAtOutput, N as UpdateTransactionStatusInput, O as UpdateTransactionStatusOutput } from '../shared/ledger.
|
|
5
|
+
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, M as MatchTransactionInput, b as MatchTransactionOutput, R as ResolveUnmatchedTransactionInput, c as ResolveUnmatchedTransactionOutput, F as FailTransactionInput, d as FailTransactionOutput, e as CancelTransactionInput, f as CancelTransactionOutput, g as RefundTransactionInput, h as RefundTransactionOutput, G as GetTransactionByIdInput, i as GetTransactionByIdOutput, j as GetTransactionsByIdReferenceInput, k as GetTransactionsByReferenceIdOutput, l as GetTransactionsInput, m as GetTransactionsOutput, n as CreateAccountInput, o as CreateAccountOutput, U as UpdateAccountInput, p as UpdateAccountOutput, D as DeleteAccountInput, q as DeleteAccountOutput, r as GetAccountInput, s as GetAccountOutput, u as GetAccountsByOwnerInput, v as GetAccountsByOwnerOutput, L as ListAccountsInput, w as ListAccountsOutput, x as GetAccountIdentifierInput, y as GetAccountIdentifierOutput, z as ListAccountIdentifiersInput, A as ListAccountIdentifiersOutput, B as FindAccountByIdentifierInput, E as FindAccountByIdentifierOutput, H as GetAccountBalanceInput, I as GetAccountBalanceOutput, J as UpdateTransactionConfirmationSentAtInput, K as UpdateTransactionConfirmationSentAtOutput, N as UpdateTransactionStatusInput, O as UpdateTransactionStatusOutput } from '../shared/ledger.CPKrhfU8.mjs';
|
|
6
6
|
import 'zod';
|
|
7
|
-
import '../shared/ledger.
|
|
7
|
+
import '../shared/ledger.CZgIHlf1.mjs';
|
|
8
8
|
import 'drizzle-orm';
|
|
9
9
|
import 'drizzle-orm/sqlite-core';
|
|
10
10
|
import '@develit-io/general-codes';
|
package/dist/export/worker.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
3
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
|
-
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, M as MatchTransactionInput, b as MatchTransactionOutput, R as ResolveUnmatchedTransactionInput, c as ResolveUnmatchedTransactionOutput, F as FailTransactionInput, d as FailTransactionOutput, e as CancelTransactionInput, f as CancelTransactionOutput, g as RefundTransactionInput, h as RefundTransactionOutput, G as GetTransactionByIdInput, i as GetTransactionByIdOutput, j as GetTransactionsByIdReferenceInput, k as GetTransactionsByReferenceIdOutput, l as GetTransactionsInput, m as GetTransactionsOutput, n as CreateAccountInput, o as CreateAccountOutput, U as UpdateAccountInput, p as UpdateAccountOutput, D as DeleteAccountInput, q as DeleteAccountOutput, r as GetAccountInput, s as GetAccountOutput, u as GetAccountsByOwnerInput, v as GetAccountsByOwnerOutput, L as ListAccountsInput, w as ListAccountsOutput, x as GetAccountIdentifierInput, y as GetAccountIdentifierOutput, z as ListAccountIdentifiersInput, A as ListAccountIdentifiersOutput, B as FindAccountByIdentifierInput, E as FindAccountByIdentifierOutput, H as GetAccountBalanceInput, I as GetAccountBalanceOutput, J as UpdateTransactionConfirmationSentAtInput, K as UpdateTransactionConfirmationSentAtOutput, N as UpdateTransactionStatusInput, O as UpdateTransactionStatusOutput } from '../shared/ledger.
|
|
5
|
+
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, M as MatchTransactionInput, b as MatchTransactionOutput, R as ResolveUnmatchedTransactionInput, c as ResolveUnmatchedTransactionOutput, F as FailTransactionInput, d as FailTransactionOutput, e as CancelTransactionInput, f as CancelTransactionOutput, g as RefundTransactionInput, h as RefundTransactionOutput, G as GetTransactionByIdInput, i as GetTransactionByIdOutput, j as GetTransactionsByIdReferenceInput, k as GetTransactionsByReferenceIdOutput, l as GetTransactionsInput, m as GetTransactionsOutput, n as CreateAccountInput, o as CreateAccountOutput, U as UpdateAccountInput, p as UpdateAccountOutput, D as DeleteAccountInput, q as DeleteAccountOutput, r as GetAccountInput, s as GetAccountOutput, u as GetAccountsByOwnerInput, v as GetAccountsByOwnerOutput, L as ListAccountsInput, w as ListAccountsOutput, x as GetAccountIdentifierInput, y as GetAccountIdentifierOutput, z as ListAccountIdentifiersInput, A as ListAccountIdentifiersOutput, B as FindAccountByIdentifierInput, E as FindAccountByIdentifierOutput, H as GetAccountBalanceInput, I as GetAccountBalanceOutput, J as UpdateTransactionConfirmationSentAtInput, K as UpdateTransactionConfirmationSentAtOutput, N as UpdateTransactionStatusInput, O as UpdateTransactionStatusOutput } from '../shared/ledger.2ZZR5AvH.js';
|
|
6
6
|
import 'zod';
|
|
7
|
-
import '../shared/ledger.
|
|
7
|
+
import '../shared/ledger.CZgIHlf1.js';
|
|
8
8
|
import 'drizzle-orm';
|
|
9
9
|
import 'drizzle-orm/sqlite-core';
|
|
10
10
|
import '@develit-io/general-codes';
|
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.B3xjxvWW.mjs';
|
|
5
5
|
import { eq, and, inArray, or, count, gte, lte, sql, asc, desc } from 'drizzle-orm';
|
|
6
|
-
import { k as createTransactionInputSchema, x as matchTransactionInputSchema, z as resolveUnmatchedTransactionInputSchema, m as failTransactionInputSchema, i as cancelTransactionInputSchema, y as refundTransactionInputSchema, g as REFUNDABLE_TRANSACTION_STATUSES, s as getTransactionByIdInputSchema, t as getTransactionsByReferenceIdInputSchema, u as getTransactionsInputSchema, j as createAccountInputSchema, D as updateAccountInputSchema, l as deleteAccountInputSchema, q as getAccountInputSchema, r as getAccountsByOwnerInputSchema, w as listAccountsInputSchema, p as getAccountIdentifierInputSchema, v as listAccountIdentifiersInputSchema, n as findAccountByIdentifierInputSchema, o as getAccountBalanceInputSchema, F as updateTransactionConfirmationSentAtInputSchema, G as updateTransactionStatusInputSchema } from '../shared/ledger.
|
|
6
|
+
import { k as createTransactionInputSchema, x as matchTransactionInputSchema, z as resolveUnmatchedTransactionInputSchema, m as failTransactionInputSchema, i as cancelTransactionInputSchema, y as refundTransactionInputSchema, g as REFUNDABLE_TRANSACTION_STATUSES, s as getTransactionByIdInputSchema, t as getTransactionsByReferenceIdInputSchema, u as getTransactionsInputSchema, j as createAccountInputSchema, D as updateAccountInputSchema, l as deleteAccountInputSchema, q as getAccountInputSchema, r as getAccountsByOwnerInputSchema, w as listAccountsInputSchema, p as getAccountIdentifierInputSchema, v as listAccountIdentifiersInputSchema, n as findAccountByIdentifierInputSchema, o as getAccountBalanceInputSchema, F as updateTransactionConfirmationSentAtInputSchema, G as updateTransactionStatusInputSchema } from '../shared/ledger.DvHIBJap.mjs';
|
|
7
7
|
import '@develit-io/general-codes';
|
|
8
8
|
import 'drizzle-orm/sqlite-core';
|
|
9
9
|
import 'zod';
|
|
@@ -46,6 +46,7 @@ const updateTransactionStatusCommand = (db, data) => {
|
|
|
46
46
|
transactionId,
|
|
47
47
|
status,
|
|
48
48
|
paymentId,
|
|
49
|
+
paymentRequestId,
|
|
49
50
|
completedAt,
|
|
50
51
|
statusReason,
|
|
51
52
|
receivedValue,
|
|
@@ -57,6 +58,7 @@ const updateTransactionStatusCommand = (db, data) => {
|
|
|
57
58
|
updatedAt: /* @__PURE__ */ new Date(),
|
|
58
59
|
completedAt,
|
|
59
60
|
paymentId,
|
|
61
|
+
...paymentRequestId !== void 0 && { paymentRequestId },
|
|
60
62
|
...receivedValue !== void 0 && { receivedValue },
|
|
61
63
|
...metadata !== void 0 && { metadata }
|
|
62
64
|
}).where(eq(tables.transaction.id, transactionId)).returning();
|
|
@@ -249,6 +251,8 @@ const getTransactionsWithPaginationQuery = async ({
|
|
|
249
251
|
filterTransactionCompletedAt,
|
|
250
252
|
filterTransactionStatus,
|
|
251
253
|
filterTransactionStatuses,
|
|
254
|
+
filterTransactionPaymentIds,
|
|
255
|
+
filterTransactionPaymentRequestIds,
|
|
252
256
|
search
|
|
253
257
|
}
|
|
254
258
|
}) => {
|
|
@@ -270,7 +274,12 @@ const getTransactionsWithPaginationQuery = async ({
|
|
|
270
274
|
filterTransactionDateTo ? lte(tables.transaction.createdAt, filterTransactionDateTo) : void 0,
|
|
271
275
|
filterTransactionCompletedAt ? eq(tables.transaction.completedAt, filterTransactionCompletedAt) : void 0,
|
|
272
276
|
filterTransactionStatus ? eq(tables.transaction.status, filterTransactionStatus) : void 0,
|
|
273
|
-
filterTransactionStatuses?.length ? inArray(tables.transaction.status, filterTransactionStatuses) : void 0
|
|
277
|
+
filterTransactionStatuses?.length ? inArray(tables.transaction.status, filterTransactionStatuses) : void 0,
|
|
278
|
+
filterTransactionPaymentIds?.length ? inArray(tables.transaction.paymentId, filterTransactionPaymentIds) : void 0,
|
|
279
|
+
filterTransactionPaymentRequestIds?.length ? inArray(
|
|
280
|
+
tables.transaction.paymentRequestId,
|
|
281
|
+
filterTransactionPaymentRequestIds
|
|
282
|
+
) : void 0
|
|
274
283
|
);
|
|
275
284
|
const sortColumn = resolveColumn(tables.transaction, sort.column);
|
|
276
285
|
const [{ totalCount }] = await db.select({ totalCount: sql`count(*)` }).from(tables.transaction).where(whereConditions);
|
|
@@ -339,6 +348,7 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
339
348
|
type,
|
|
340
349
|
description,
|
|
341
350
|
paymentId,
|
|
351
|
+
paymentRequestId,
|
|
342
352
|
metadata,
|
|
343
353
|
status,
|
|
344
354
|
value,
|
|
@@ -363,6 +373,7 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
363
373
|
completedAt: null,
|
|
364
374
|
status,
|
|
365
375
|
paymentId,
|
|
376
|
+
paymentRequestId,
|
|
366
377
|
metadata,
|
|
367
378
|
updatedAt: timestamp,
|
|
368
379
|
value,
|
|
@@ -415,6 +426,7 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
415
426
|
async _applyMatchAmount({
|
|
416
427
|
existingTransaction,
|
|
417
428
|
paymentId,
|
|
429
|
+
paymentRequestId,
|
|
418
430
|
amount,
|
|
419
431
|
completedAt,
|
|
420
432
|
extraMetadata
|
|
@@ -441,6 +453,7 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
441
453
|
status: isFullyMatched ? "MATCHED" : "PARTIALLY_MATCHED",
|
|
442
454
|
completedAt: isFullyMatched ? completedAt : void 0,
|
|
443
455
|
paymentId,
|
|
456
|
+
paymentRequestId,
|
|
444
457
|
receivedValue: newReceivedValue,
|
|
445
458
|
metadata: updatedMetadata
|
|
446
459
|
}).command.execute().then(first);
|
|
@@ -460,7 +473,8 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
460
473
|
transactionId,
|
|
461
474
|
status: "MATCHED",
|
|
462
475
|
completedAt,
|
|
463
|
-
paymentId
|
|
476
|
+
paymentId,
|
|
477
|
+
paymentRequestId
|
|
464
478
|
}).command.execute().then(first);
|
|
465
479
|
if (!transaction) {
|
|
466
480
|
throw createInternalError(null, {
|
|
@@ -476,7 +490,13 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
476
490
|
{ data: input, schema: matchTransactionInputSchema },
|
|
477
491
|
{ successMessage: "Transaction successfully matched." },
|
|
478
492
|
async (params) => {
|
|
479
|
-
const {
|
|
493
|
+
const {
|
|
494
|
+
transactionId,
|
|
495
|
+
completedAt,
|
|
496
|
+
paymentId,
|
|
497
|
+
paymentRequestId,
|
|
498
|
+
amount
|
|
499
|
+
} = params;
|
|
480
500
|
const existingTransaction = await getTransactionByIdQuery(
|
|
481
501
|
this.db,
|
|
482
502
|
transactionId
|
|
@@ -498,6 +518,7 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
498
518
|
const { transaction, signal } = await this._applyMatchAmount({
|
|
499
519
|
existingTransaction,
|
|
500
520
|
paymentId,
|
|
521
|
+
paymentRequestId,
|
|
501
522
|
amount,
|
|
502
523
|
completedAt
|
|
503
524
|
});
|
|
@@ -1107,7 +1128,14 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
1107
1128
|
{ data: input, schema: updateTransactionStatusInputSchema },
|
|
1108
1129
|
{ successMessage: "Transaction status successfully updated." },
|
|
1109
1130
|
async (params) => {
|
|
1110
|
-
const {
|
|
1131
|
+
const {
|
|
1132
|
+
transactionId,
|
|
1133
|
+
status,
|
|
1134
|
+
statusReason,
|
|
1135
|
+
paymentId,
|
|
1136
|
+
paymentRequestId,
|
|
1137
|
+
completedAt
|
|
1138
|
+
} = params;
|
|
1111
1139
|
const existingTransaction = await getTransactionByIdQuery(
|
|
1112
1140
|
this.db,
|
|
1113
1141
|
transactionId
|
|
@@ -1124,6 +1152,7 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
1124
1152
|
status,
|
|
1125
1153
|
statusReason,
|
|
1126
1154
|
paymentId,
|
|
1155
|
+
paymentRequestId,
|
|
1127
1156
|
completedAt
|
|
1128
1157
|
});
|
|
1129
1158
|
const [updatedTransaction] = await this.db.batch([command]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { F as schema } from './ledger.
|
|
2
|
+
import { F as schema } from './ledger.CZgIHlf1.js';
|
|
3
3
|
import { InferSelectModel, ExtractTablesWithRelations, DBQueryConfig, BuildQueryResult, InferInsertModel } from 'drizzle-orm';
|
|
4
4
|
|
|
5
5
|
interface TSchema extends ExtractTablesWithRelations<typeof tables> {
|
|
@@ -449,6 +449,7 @@ declare const createTransactionInputSchema: z.ZodObject<{
|
|
|
449
449
|
}>;
|
|
450
450
|
description: z.ZodOptional<z.ZodString>;
|
|
451
451
|
paymentId: z.ZodOptional<z.ZodString>;
|
|
452
|
+
paymentRequestId: z.ZodOptional<z.ZodString>;
|
|
452
453
|
metadata: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
453
454
|
rejectImbalanced: z.ZodOptional<z.ZodBoolean>;
|
|
454
455
|
allowPartialFailure: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1229,6 +1230,7 @@ declare const createTransactionInputSchema: z.ZodObject<{
|
|
|
1229
1230
|
}, z.core.$strip>>>;
|
|
1230
1231
|
status: z.ZodEnum<{
|
|
1231
1232
|
FAILED: "FAILED";
|
|
1233
|
+
NEW: "NEW";
|
|
1232
1234
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1233
1235
|
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1234
1236
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
@@ -1473,6 +1475,7 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1473
1475
|
filterTransactionCompletedAt: z.ZodOptional<z.ZodDate>;
|
|
1474
1476
|
filterTransactionStatus: z.ZodOptional<z.ZodEnum<{
|
|
1475
1477
|
FAILED: "FAILED";
|
|
1478
|
+
NEW: "NEW";
|
|
1476
1479
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1477
1480
|
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1478
1481
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
@@ -1484,6 +1487,7 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1484
1487
|
}>>;
|
|
1485
1488
|
filterTransactionStatuses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1486
1489
|
FAILED: "FAILED";
|
|
1490
|
+
NEW: "NEW";
|
|
1487
1491
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1488
1492
|
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1489
1493
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
@@ -1493,6 +1497,8 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1493
1497
|
CANCELLED: "CANCELLED";
|
|
1494
1498
|
SETTLED: "SETTLED";
|
|
1495
1499
|
}>>>;
|
|
1500
|
+
filterTransactionPaymentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1501
|
+
filterTransactionPaymentRequestIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1496
1502
|
search: z.ZodOptional<z.ZodString>;
|
|
1497
1503
|
}, z.core.$strip>;
|
|
1498
1504
|
interface GetTransactionsInput extends z.input<typeof getTransactionsInputSchema> {
|
|
@@ -1621,7 +1627,8 @@ interface ListAccountsOutput {
|
|
|
1621
1627
|
|
|
1622
1628
|
declare const matchTransactionInputSchema: z.ZodObject<{
|
|
1623
1629
|
transactionId: z.ZodUUID;
|
|
1624
|
-
paymentId: z.ZodString
|
|
1630
|
+
paymentId: z.ZodOptional<z.ZodString>;
|
|
1631
|
+
paymentRequestId: z.ZodOptional<z.ZodString>;
|
|
1625
1632
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
1626
1633
|
completedAt: z.ZodOptional<z.ZodDate>;
|
|
1627
1634
|
}, z.core.$strip>;
|
|
@@ -1757,6 +1764,7 @@ declare const updateTransactionStatusInputSchema: z.ZodObject<{
|
|
|
1757
1764
|
transactionId: z.ZodUUID;
|
|
1758
1765
|
status: z.ZodEnum<{
|
|
1759
1766
|
FAILED: "FAILED";
|
|
1767
|
+
NEW: "NEW";
|
|
1760
1768
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1761
1769
|
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1762
1770
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
@@ -1768,6 +1776,7 @@ declare const updateTransactionStatusInputSchema: z.ZodObject<{
|
|
|
1768
1776
|
}>;
|
|
1769
1777
|
statusReason: z.ZodOptional<z.ZodString>;
|
|
1770
1778
|
paymentId: z.ZodOptional<z.ZodString>;
|
|
1779
|
+
paymentRequestId: z.ZodOptional<z.ZodString>;
|
|
1771
1780
|
completedAt: z.ZodOptional<z.ZodDate>;
|
|
1772
1781
|
}, z.core.$strip>;
|
|
1773
1782
|
interface UpdateTransactionStatusInput extends z.infer<typeof updateTransactionStatusInputSchema> {
|
|
@@ -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, h as TRANSACTION_TYPES, R as REFERENCE_TYPES } from './ledger.
|
|
4
|
+
import { T as TRANSACTION_STATUSES, h as TRANSACTION_TYPES, R as REFERENCE_TYPES } from './ledger.DvHIBJap.mjs';
|
|
5
5
|
import '@develit-io/general-codes';
|
|
6
6
|
|
|
7
7
|
const account = sqliteTable("account", {
|
|
@@ -88,6 +88,7 @@ const transaction = sqliteTable("transaction", {
|
|
|
88
88
|
status: text("status", { enum: TRANSACTION_STATUSES }).$type().notNull(),
|
|
89
89
|
statusReason: text("status_reason"),
|
|
90
90
|
paymentId: text("payment_id"),
|
|
91
|
+
paymentRequestId: text("payment_request_id"),
|
|
91
92
|
metadata: text("metadata", { mode: "json" }).$type().notNull(),
|
|
92
93
|
value: real("value"),
|
|
93
94
|
receivedValue: real("received_value"),
|
|
@@ -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 updateTransactionStatus = require('./ledger.
|
|
6
|
+
const updateTransactionStatus = require('./ledger.ChjFG1yE.cjs');
|
|
7
7
|
require('@develit-io/general-codes');
|
|
8
8
|
|
|
9
9
|
const account = sqliteCore.sqliteTable("account", {
|
|
@@ -90,6 +90,7 @@ const transaction = sqliteCore.sqliteTable("transaction", {
|
|
|
90
90
|
status: sqliteCore.text("status", { enum: updateTransactionStatus.TRANSACTION_STATUSES }).$type().notNull(),
|
|
91
91
|
statusReason: sqliteCore.text("status_reason"),
|
|
92
92
|
paymentId: sqliteCore.text("payment_id"),
|
|
93
|
+
paymentRequestId: sqliteCore.text("payment_request_id"),
|
|
93
94
|
metadata: sqliteCore.text("metadata", { mode: "json" }).$type().notNull(),
|
|
94
95
|
value: sqliteCore.real("value"),
|
|
95
96
|
receivedValue: sqliteCore.real("received_value"),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { F as schema } from './ledger.
|
|
2
|
+
import { F as schema } from './ledger.CZgIHlf1.mjs';
|
|
3
3
|
import { InferSelectModel, ExtractTablesWithRelations, DBQueryConfig, BuildQueryResult, InferInsertModel } from 'drizzle-orm';
|
|
4
4
|
|
|
5
5
|
interface TSchema extends ExtractTablesWithRelations<typeof tables> {
|
|
@@ -449,6 +449,7 @@ declare const createTransactionInputSchema: z.ZodObject<{
|
|
|
449
449
|
}>;
|
|
450
450
|
description: z.ZodOptional<z.ZodString>;
|
|
451
451
|
paymentId: z.ZodOptional<z.ZodString>;
|
|
452
|
+
paymentRequestId: z.ZodOptional<z.ZodString>;
|
|
452
453
|
metadata: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
453
454
|
rejectImbalanced: z.ZodOptional<z.ZodBoolean>;
|
|
454
455
|
allowPartialFailure: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1229,6 +1230,7 @@ declare const createTransactionInputSchema: z.ZodObject<{
|
|
|
1229
1230
|
}, z.core.$strip>>>;
|
|
1230
1231
|
status: z.ZodEnum<{
|
|
1231
1232
|
FAILED: "FAILED";
|
|
1233
|
+
NEW: "NEW";
|
|
1232
1234
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1233
1235
|
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1234
1236
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
@@ -1473,6 +1475,7 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1473
1475
|
filterTransactionCompletedAt: z.ZodOptional<z.ZodDate>;
|
|
1474
1476
|
filterTransactionStatus: z.ZodOptional<z.ZodEnum<{
|
|
1475
1477
|
FAILED: "FAILED";
|
|
1478
|
+
NEW: "NEW";
|
|
1476
1479
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1477
1480
|
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1478
1481
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
@@ -1484,6 +1487,7 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1484
1487
|
}>>;
|
|
1485
1488
|
filterTransactionStatuses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1486
1489
|
FAILED: "FAILED";
|
|
1490
|
+
NEW: "NEW";
|
|
1487
1491
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1488
1492
|
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1489
1493
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
@@ -1493,6 +1497,8 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1493
1497
|
CANCELLED: "CANCELLED";
|
|
1494
1498
|
SETTLED: "SETTLED";
|
|
1495
1499
|
}>>>;
|
|
1500
|
+
filterTransactionPaymentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1501
|
+
filterTransactionPaymentRequestIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1496
1502
|
search: z.ZodOptional<z.ZodString>;
|
|
1497
1503
|
}, z.core.$strip>;
|
|
1498
1504
|
interface GetTransactionsInput extends z.input<typeof getTransactionsInputSchema> {
|
|
@@ -1621,7 +1627,8 @@ interface ListAccountsOutput {
|
|
|
1621
1627
|
|
|
1622
1628
|
declare const matchTransactionInputSchema: z.ZodObject<{
|
|
1623
1629
|
transactionId: z.ZodUUID;
|
|
1624
|
-
paymentId: z.ZodString
|
|
1630
|
+
paymentId: z.ZodOptional<z.ZodString>;
|
|
1631
|
+
paymentRequestId: z.ZodOptional<z.ZodString>;
|
|
1625
1632
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
1626
1633
|
completedAt: z.ZodOptional<z.ZodDate>;
|
|
1627
1634
|
}, z.core.$strip>;
|
|
@@ -1757,6 +1764,7 @@ declare const updateTransactionStatusInputSchema: z.ZodObject<{
|
|
|
1757
1764
|
transactionId: z.ZodUUID;
|
|
1758
1765
|
status: z.ZodEnum<{
|
|
1759
1766
|
FAILED: "FAILED";
|
|
1767
|
+
NEW: "NEW";
|
|
1760
1768
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1761
1769
|
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1762
1770
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
@@ -1768,6 +1776,7 @@ declare const updateTransactionStatusInputSchema: z.ZodObject<{
|
|
|
1768
1776
|
}>;
|
|
1769
1777
|
statusReason: z.ZodOptional<z.ZodString>;
|
|
1770
1778
|
paymentId: z.ZodOptional<z.ZodString>;
|
|
1779
|
+
paymentRequestId: z.ZodOptional<z.ZodString>;
|
|
1771
1780
|
completedAt: z.ZodOptional<z.ZodDate>;
|
|
1772
1781
|
}, z.core.$strip>;
|
|
1773
1782
|
interface UpdateTransactionStatusInput extends z.infer<typeof updateTransactionStatusInputSchema> {
|
|
@@ -704,7 +704,7 @@ declare const IDENTIFIER_KINDS: readonly ["IBAN", "LOCAL_CZ", "SWIFT", "CRYPTO_A
|
|
|
704
704
|
type IdentifierKind = (typeof IDENTIFIER_KINDS)[number];
|
|
705
705
|
declare const ENTRY_STATUSES: readonly ["PENDING", "REALIZED", "FAILED", "CANCELED"];
|
|
706
706
|
type EntryStatus = (typeof ENTRY_STATUSES)[number];
|
|
707
|
-
declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "PARTIALLY_MATCHED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
707
|
+
declare const TRANSACTION_STATUSES: readonly ["NEW", "WAITING_FOR_PAYMENT", "PARTIALLY_MATCHED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
708
708
|
type TransactionStatus = (typeof TRANSACTION_STATUSES)[number];
|
|
709
709
|
declare const TRANSACTION_TYPES: readonly ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "COLLATERAL_FUND_IN", "COLLATERAL_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER", "REFUND"];
|
|
710
710
|
type TransactionType = (typeof TRANSACTION_TYPES)[number];
|
|
@@ -1305,20 +1305,20 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1305
1305
|
tableName: "transaction";
|
|
1306
1306
|
dataType: "string";
|
|
1307
1307
|
columnType: "SQLiteText";
|
|
1308
|
-
data: "FAILED" | "WAITING_FOR_PAYMENT" | "PARTIALLY_MATCHED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1308
|
+
data: "FAILED" | "NEW" | "WAITING_FOR_PAYMENT" | "PARTIALLY_MATCHED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1309
1309
|
driverParam: string;
|
|
1310
1310
|
notNull: true;
|
|
1311
1311
|
hasDefault: false;
|
|
1312
1312
|
isPrimaryKey: false;
|
|
1313
1313
|
isAutoincrement: false;
|
|
1314
1314
|
hasRuntimeDefault: false;
|
|
1315
|
-
enumValues: ["WAITING_FOR_PAYMENT", "PARTIALLY_MATCHED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
1315
|
+
enumValues: ["NEW", "WAITING_FOR_PAYMENT", "PARTIALLY_MATCHED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
1316
1316
|
baseColumn: never;
|
|
1317
1317
|
identity: undefined;
|
|
1318
1318
|
generated: undefined;
|
|
1319
1319
|
}, {}, {
|
|
1320
1320
|
length: number | undefined;
|
|
1321
|
-
$type: "FAILED" | "WAITING_FOR_PAYMENT" | "PARTIALLY_MATCHED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1321
|
+
$type: "FAILED" | "NEW" | "WAITING_FOR_PAYMENT" | "PARTIALLY_MATCHED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1322
1322
|
}>;
|
|
1323
1323
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1324
1324
|
name: "status_reason";
|
|
@@ -1358,6 +1358,25 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1358
1358
|
}, {}, {
|
|
1359
1359
|
length: number | undefined;
|
|
1360
1360
|
}>;
|
|
1361
|
+
paymentRequestId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1362
|
+
name: "payment_request_id";
|
|
1363
|
+
tableName: "transaction";
|
|
1364
|
+
dataType: "string";
|
|
1365
|
+
columnType: "SQLiteText";
|
|
1366
|
+
data: string;
|
|
1367
|
+
driverParam: string;
|
|
1368
|
+
notNull: false;
|
|
1369
|
+
hasDefault: false;
|
|
1370
|
+
isPrimaryKey: false;
|
|
1371
|
+
isAutoincrement: false;
|
|
1372
|
+
hasRuntimeDefault: false;
|
|
1373
|
+
enumValues: [string, ...string[]];
|
|
1374
|
+
baseColumn: never;
|
|
1375
|
+
identity: undefined;
|
|
1376
|
+
generated: undefined;
|
|
1377
|
+
}, {}, {
|
|
1378
|
+
length: number | undefined;
|
|
1379
|
+
}>;
|
|
1361
1380
|
metadata: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1362
1381
|
name: "metadata";
|
|
1363
1382
|
tableName: "transaction";
|
|
@@ -704,7 +704,7 @@ declare const IDENTIFIER_KINDS: readonly ["IBAN", "LOCAL_CZ", "SWIFT", "CRYPTO_A
|
|
|
704
704
|
type IdentifierKind = (typeof IDENTIFIER_KINDS)[number];
|
|
705
705
|
declare const ENTRY_STATUSES: readonly ["PENDING", "REALIZED", "FAILED", "CANCELED"];
|
|
706
706
|
type EntryStatus = (typeof ENTRY_STATUSES)[number];
|
|
707
|
-
declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "PARTIALLY_MATCHED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
707
|
+
declare const TRANSACTION_STATUSES: readonly ["NEW", "WAITING_FOR_PAYMENT", "PARTIALLY_MATCHED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
708
708
|
type TransactionStatus = (typeof TRANSACTION_STATUSES)[number];
|
|
709
709
|
declare const TRANSACTION_TYPES: readonly ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "COLLATERAL_FUND_IN", "COLLATERAL_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER", "REFUND"];
|
|
710
710
|
type TransactionType = (typeof TRANSACTION_TYPES)[number];
|
|
@@ -1305,20 +1305,20 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1305
1305
|
tableName: "transaction";
|
|
1306
1306
|
dataType: "string";
|
|
1307
1307
|
columnType: "SQLiteText";
|
|
1308
|
-
data: "FAILED" | "WAITING_FOR_PAYMENT" | "PARTIALLY_MATCHED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1308
|
+
data: "FAILED" | "NEW" | "WAITING_FOR_PAYMENT" | "PARTIALLY_MATCHED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1309
1309
|
driverParam: string;
|
|
1310
1310
|
notNull: true;
|
|
1311
1311
|
hasDefault: false;
|
|
1312
1312
|
isPrimaryKey: false;
|
|
1313
1313
|
isAutoincrement: false;
|
|
1314
1314
|
hasRuntimeDefault: false;
|
|
1315
|
-
enumValues: ["WAITING_FOR_PAYMENT", "PARTIALLY_MATCHED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
1315
|
+
enumValues: ["NEW", "WAITING_FOR_PAYMENT", "PARTIALLY_MATCHED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
1316
1316
|
baseColumn: never;
|
|
1317
1317
|
identity: undefined;
|
|
1318
1318
|
generated: undefined;
|
|
1319
1319
|
}, {}, {
|
|
1320
1320
|
length: number | undefined;
|
|
1321
|
-
$type: "FAILED" | "WAITING_FOR_PAYMENT" | "PARTIALLY_MATCHED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1321
|
+
$type: "FAILED" | "NEW" | "WAITING_FOR_PAYMENT" | "PARTIALLY_MATCHED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1322
1322
|
}>;
|
|
1323
1323
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1324
1324
|
name: "status_reason";
|
|
@@ -1358,6 +1358,25 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1358
1358
|
}, {}, {
|
|
1359
1359
|
length: number | undefined;
|
|
1360
1360
|
}>;
|
|
1361
|
+
paymentRequestId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1362
|
+
name: "payment_request_id";
|
|
1363
|
+
tableName: "transaction";
|
|
1364
|
+
dataType: "string";
|
|
1365
|
+
columnType: "SQLiteText";
|
|
1366
|
+
data: string;
|
|
1367
|
+
driverParam: string;
|
|
1368
|
+
notNull: false;
|
|
1369
|
+
hasDefault: false;
|
|
1370
|
+
isPrimaryKey: false;
|
|
1371
|
+
isAutoincrement: false;
|
|
1372
|
+
hasRuntimeDefault: false;
|
|
1373
|
+
enumValues: [string, ...string[]];
|
|
1374
|
+
baseColumn: never;
|
|
1375
|
+
identity: undefined;
|
|
1376
|
+
generated: undefined;
|
|
1377
|
+
}, {}, {
|
|
1378
|
+
length: number | undefined;
|
|
1379
|
+
}>;
|
|
1361
1380
|
metadata: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1362
1381
|
name: "metadata";
|
|
1363
1382
|
tableName: "transaction";
|
|
@@ -704,7 +704,7 @@ declare const IDENTIFIER_KINDS: readonly ["IBAN", "LOCAL_CZ", "SWIFT", "CRYPTO_A
|
|
|
704
704
|
type IdentifierKind = (typeof IDENTIFIER_KINDS)[number];
|
|
705
705
|
declare const ENTRY_STATUSES: readonly ["PENDING", "REALIZED", "FAILED", "CANCELED"];
|
|
706
706
|
type EntryStatus = (typeof ENTRY_STATUSES)[number];
|
|
707
|
-
declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "PARTIALLY_MATCHED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
707
|
+
declare const TRANSACTION_STATUSES: readonly ["NEW", "WAITING_FOR_PAYMENT", "PARTIALLY_MATCHED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
708
708
|
type TransactionStatus = (typeof TRANSACTION_STATUSES)[number];
|
|
709
709
|
declare const TRANSACTION_TYPES: readonly ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "COLLATERAL_FUND_IN", "COLLATERAL_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER", "REFUND"];
|
|
710
710
|
type TransactionType = (typeof TRANSACTION_TYPES)[number];
|
|
@@ -1305,20 +1305,20 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1305
1305
|
tableName: "transaction";
|
|
1306
1306
|
dataType: "string";
|
|
1307
1307
|
columnType: "SQLiteText";
|
|
1308
|
-
data: "FAILED" | "WAITING_FOR_PAYMENT" | "PARTIALLY_MATCHED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1308
|
+
data: "FAILED" | "NEW" | "WAITING_FOR_PAYMENT" | "PARTIALLY_MATCHED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1309
1309
|
driverParam: string;
|
|
1310
1310
|
notNull: true;
|
|
1311
1311
|
hasDefault: false;
|
|
1312
1312
|
isPrimaryKey: false;
|
|
1313
1313
|
isAutoincrement: false;
|
|
1314
1314
|
hasRuntimeDefault: false;
|
|
1315
|
-
enumValues: ["WAITING_FOR_PAYMENT", "PARTIALLY_MATCHED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
1315
|
+
enumValues: ["NEW", "WAITING_FOR_PAYMENT", "PARTIALLY_MATCHED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
1316
1316
|
baseColumn: never;
|
|
1317
1317
|
identity: undefined;
|
|
1318
1318
|
generated: undefined;
|
|
1319
1319
|
}, {}, {
|
|
1320
1320
|
length: number | undefined;
|
|
1321
|
-
$type: "FAILED" | "WAITING_FOR_PAYMENT" | "PARTIALLY_MATCHED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1321
|
+
$type: "FAILED" | "NEW" | "WAITING_FOR_PAYMENT" | "PARTIALLY_MATCHED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1322
1322
|
}>;
|
|
1323
1323
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1324
1324
|
name: "status_reason";
|
|
@@ -1358,6 +1358,25 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1358
1358
|
}, {}, {
|
|
1359
1359
|
length: number | undefined;
|
|
1360
1360
|
}>;
|
|
1361
|
+
paymentRequestId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1362
|
+
name: "payment_request_id";
|
|
1363
|
+
tableName: "transaction";
|
|
1364
|
+
dataType: "string";
|
|
1365
|
+
columnType: "SQLiteText";
|
|
1366
|
+
data: string;
|
|
1367
|
+
driverParam: string;
|
|
1368
|
+
notNull: false;
|
|
1369
|
+
hasDefault: false;
|
|
1370
|
+
isPrimaryKey: false;
|
|
1371
|
+
isAutoincrement: false;
|
|
1372
|
+
hasRuntimeDefault: false;
|
|
1373
|
+
enumValues: [string, ...string[]];
|
|
1374
|
+
baseColumn: never;
|
|
1375
|
+
identity: undefined;
|
|
1376
|
+
generated: undefined;
|
|
1377
|
+
}, {}, {
|
|
1378
|
+
length: number | undefined;
|
|
1379
|
+
}>;
|
|
1361
1380
|
metadata: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1362
1381
|
name: "metadata";
|
|
1363
1382
|
tableName: "transaction";
|
|
@@ -60,6 +60,7 @@ const ENTRY_STATUSES = [
|
|
|
60
60
|
"CANCELED"
|
|
61
61
|
];
|
|
62
62
|
const TRANSACTION_STATUSES = [
|
|
63
|
+
"NEW",
|
|
63
64
|
"WAITING_FOR_PAYMENT",
|
|
64
65
|
"PARTIALLY_MATCHED",
|
|
65
66
|
"WAITING_FOR_MANUAL_PROCESSING",
|
|
@@ -69,7 +70,6 @@ const TRANSACTION_STATUSES = [
|
|
|
69
70
|
"FAILED",
|
|
70
71
|
"CANCELLED",
|
|
71
72
|
"SETTLED"
|
|
72
|
-
// not used for now, but maybe in future when we have settlement process implemented
|
|
73
73
|
];
|
|
74
74
|
const TRANSACTION_TYPES = [
|
|
75
75
|
"CLIENT_FUND_IN",
|
|
@@ -111,7 +111,9 @@ const ALLOWED_TRANSACTION_FILTERS = {
|
|
|
111
111
|
DESCRIPTION: "filterTransactionDescription",
|
|
112
112
|
COMPLETED_AT: "filterTransactionCompletedAt",
|
|
113
113
|
STATUS: "filterTransactionStatus",
|
|
114
|
-
STATUSES: "filterTransactionStatuses"
|
|
114
|
+
STATUSES: "filterTransactionStatuses",
|
|
115
|
+
PAYMENT_IDS: "filterTransactionPaymentIds",
|
|
116
|
+
PAYMENT_REQUEST_IDS: "filterTransactionPaymentRequestIds"
|
|
115
117
|
};
|
|
116
118
|
|
|
117
119
|
const cancelTransactionInputSchema = zod.z.object({
|
|
@@ -202,6 +204,7 @@ const createTransactionInputSchema = zod.z.object({
|
|
|
202
204
|
type: zod.z.enum(TRANSACTION_TYPES),
|
|
203
205
|
description: zod.z.string().optional(),
|
|
204
206
|
paymentId: zod.z.string().optional(),
|
|
207
|
+
paymentRequestId: zod.z.string().optional(),
|
|
205
208
|
metadata: transactionMetadataSchema.optional().default({}),
|
|
206
209
|
status: zod.z.enum(TRANSACTION_STATUSES),
|
|
207
210
|
currency: zod.z.enum(generalCodes.CURRENCY_CODES).optional(),
|
|
@@ -275,6 +278,8 @@ const getTransactionsInputSchema = zod.z.object({
|
|
|
275
278
|
[ALLOWED_TRANSACTION_FILTERS.COMPLETED_AT]: zod.z.date().optional(),
|
|
276
279
|
[ALLOWED_TRANSACTION_FILTERS.STATUS]: zod.z.enum(TRANSACTION_STATUSES).optional(),
|
|
277
280
|
[ALLOWED_TRANSACTION_FILTERS.STATUSES]: zod.z.array(zod.z.enum(TRANSACTION_STATUSES)).optional(),
|
|
281
|
+
[ALLOWED_TRANSACTION_FILTERS.PAYMENT_IDS]: zod.z.array(zod.z.string()).optional(),
|
|
282
|
+
[ALLOWED_TRANSACTION_FILTERS.PAYMENT_REQUEST_IDS]: zod.z.array(zod.z.string()).optional(),
|
|
278
283
|
search: zod.z.string().optional()
|
|
279
284
|
});
|
|
280
285
|
|
|
@@ -299,9 +304,12 @@ const listAccountsInputSchema = zod.z.object({
|
|
|
299
304
|
|
|
300
305
|
const matchTransactionInputSchema = zod.z.object({
|
|
301
306
|
transactionId: zod.z.uuid(),
|
|
302
|
-
paymentId: zod.z.string(),
|
|
307
|
+
paymentId: zod.z.string().optional(),
|
|
308
|
+
paymentRequestId: zod.z.string().optional(),
|
|
303
309
|
amount: zod.z.number().positive().optional(),
|
|
304
310
|
completedAt: zod.z.date().optional()
|
|
311
|
+
}).refine((data) => data.paymentId || data.paymentRequestId, {
|
|
312
|
+
message: "Either paymentId or paymentRequestId is required"
|
|
305
313
|
});
|
|
306
314
|
|
|
307
315
|
const updateAccountInputSchema = zod.z.object({
|
|
@@ -339,6 +347,7 @@ const updateTransactionStatusInputSchema = zod.z.object({
|
|
|
339
347
|
status: zod.z.enum(TRANSACTION_STATUSES),
|
|
340
348
|
statusReason: zod.z.string().optional(),
|
|
341
349
|
paymentId: zod.z.string().optional(),
|
|
350
|
+
paymentRequestId: zod.z.string().optional(),
|
|
342
351
|
completedAt: zod.z.date().optional()
|
|
343
352
|
});
|
|
344
353
|
|
|
@@ -58,6 +58,7 @@ const ENTRY_STATUSES = [
|
|
|
58
58
|
"CANCELED"
|
|
59
59
|
];
|
|
60
60
|
const TRANSACTION_STATUSES = [
|
|
61
|
+
"NEW",
|
|
61
62
|
"WAITING_FOR_PAYMENT",
|
|
62
63
|
"PARTIALLY_MATCHED",
|
|
63
64
|
"WAITING_FOR_MANUAL_PROCESSING",
|
|
@@ -67,7 +68,6 @@ const TRANSACTION_STATUSES = [
|
|
|
67
68
|
"FAILED",
|
|
68
69
|
"CANCELLED",
|
|
69
70
|
"SETTLED"
|
|
70
|
-
// not used for now, but maybe in future when we have settlement process implemented
|
|
71
71
|
];
|
|
72
72
|
const TRANSACTION_TYPES = [
|
|
73
73
|
"CLIENT_FUND_IN",
|
|
@@ -109,7 +109,9 @@ const ALLOWED_TRANSACTION_FILTERS = {
|
|
|
109
109
|
DESCRIPTION: "filterTransactionDescription",
|
|
110
110
|
COMPLETED_AT: "filterTransactionCompletedAt",
|
|
111
111
|
STATUS: "filterTransactionStatus",
|
|
112
|
-
STATUSES: "filterTransactionStatuses"
|
|
112
|
+
STATUSES: "filterTransactionStatuses",
|
|
113
|
+
PAYMENT_IDS: "filterTransactionPaymentIds",
|
|
114
|
+
PAYMENT_REQUEST_IDS: "filterTransactionPaymentRequestIds"
|
|
113
115
|
};
|
|
114
116
|
|
|
115
117
|
const cancelTransactionInputSchema = z.object({
|
|
@@ -200,6 +202,7 @@ const createTransactionInputSchema = z.object({
|
|
|
200
202
|
type: z.enum(TRANSACTION_TYPES),
|
|
201
203
|
description: z.string().optional(),
|
|
202
204
|
paymentId: z.string().optional(),
|
|
205
|
+
paymentRequestId: z.string().optional(),
|
|
203
206
|
metadata: transactionMetadataSchema.optional().default({}),
|
|
204
207
|
status: z.enum(TRANSACTION_STATUSES),
|
|
205
208
|
currency: z.enum(CURRENCY_CODES).optional(),
|
|
@@ -273,6 +276,8 @@ const getTransactionsInputSchema = z.object({
|
|
|
273
276
|
[ALLOWED_TRANSACTION_FILTERS.COMPLETED_AT]: z.date().optional(),
|
|
274
277
|
[ALLOWED_TRANSACTION_FILTERS.STATUS]: z.enum(TRANSACTION_STATUSES).optional(),
|
|
275
278
|
[ALLOWED_TRANSACTION_FILTERS.STATUSES]: z.array(z.enum(TRANSACTION_STATUSES)).optional(),
|
|
279
|
+
[ALLOWED_TRANSACTION_FILTERS.PAYMENT_IDS]: z.array(z.string()).optional(),
|
|
280
|
+
[ALLOWED_TRANSACTION_FILTERS.PAYMENT_REQUEST_IDS]: z.array(z.string()).optional(),
|
|
276
281
|
search: z.string().optional()
|
|
277
282
|
});
|
|
278
283
|
|
|
@@ -297,9 +302,12 @@ const listAccountsInputSchema = z.object({
|
|
|
297
302
|
|
|
298
303
|
const matchTransactionInputSchema = z.object({
|
|
299
304
|
transactionId: z.uuid(),
|
|
300
|
-
paymentId: z.string(),
|
|
305
|
+
paymentId: z.string().optional(),
|
|
306
|
+
paymentRequestId: z.string().optional(),
|
|
301
307
|
amount: z.number().positive().optional(),
|
|
302
308
|
completedAt: z.date().optional()
|
|
309
|
+
}).refine((data) => data.paymentId || data.paymentRequestId, {
|
|
310
|
+
message: "Either paymentId or paymentRequestId is required"
|
|
303
311
|
});
|
|
304
312
|
|
|
305
313
|
const updateAccountInputSchema = z.object({
|
|
@@ -337,6 +345,7 @@ const updateTransactionStatusInputSchema = z.object({
|
|
|
337
345
|
status: z.enum(TRANSACTION_STATUSES),
|
|
338
346
|
statusReason: z.string().optional(),
|
|
339
347
|
paymentId: z.string().optional(),
|
|
348
|
+
paymentRequestId: z.string().optional(),
|
|
340
349
|
completedAt: z.date().optional()
|
|
341
350
|
});
|
|
342
351
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { F as schema } from './ledger.
|
|
2
|
+
import { F as schema } from './ledger.CZgIHlf1.cjs';
|
|
3
3
|
import { InferSelectModel, ExtractTablesWithRelations, DBQueryConfig, BuildQueryResult, InferInsertModel } from 'drizzle-orm';
|
|
4
4
|
|
|
5
5
|
interface TSchema extends ExtractTablesWithRelations<typeof tables> {
|
|
@@ -449,6 +449,7 @@ declare const createTransactionInputSchema: z.ZodObject<{
|
|
|
449
449
|
}>;
|
|
450
450
|
description: z.ZodOptional<z.ZodString>;
|
|
451
451
|
paymentId: z.ZodOptional<z.ZodString>;
|
|
452
|
+
paymentRequestId: z.ZodOptional<z.ZodString>;
|
|
452
453
|
metadata: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
453
454
|
rejectImbalanced: z.ZodOptional<z.ZodBoolean>;
|
|
454
455
|
allowPartialFailure: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1229,6 +1230,7 @@ declare const createTransactionInputSchema: z.ZodObject<{
|
|
|
1229
1230
|
}, z.core.$strip>>>;
|
|
1230
1231
|
status: z.ZodEnum<{
|
|
1231
1232
|
FAILED: "FAILED";
|
|
1233
|
+
NEW: "NEW";
|
|
1232
1234
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1233
1235
|
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1234
1236
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
@@ -1473,6 +1475,7 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1473
1475
|
filterTransactionCompletedAt: z.ZodOptional<z.ZodDate>;
|
|
1474
1476
|
filterTransactionStatus: z.ZodOptional<z.ZodEnum<{
|
|
1475
1477
|
FAILED: "FAILED";
|
|
1478
|
+
NEW: "NEW";
|
|
1476
1479
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1477
1480
|
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1478
1481
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
@@ -1484,6 +1487,7 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1484
1487
|
}>>;
|
|
1485
1488
|
filterTransactionStatuses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1486
1489
|
FAILED: "FAILED";
|
|
1490
|
+
NEW: "NEW";
|
|
1487
1491
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1488
1492
|
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1489
1493
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
@@ -1493,6 +1497,8 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1493
1497
|
CANCELLED: "CANCELLED";
|
|
1494
1498
|
SETTLED: "SETTLED";
|
|
1495
1499
|
}>>>;
|
|
1500
|
+
filterTransactionPaymentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1501
|
+
filterTransactionPaymentRequestIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1496
1502
|
search: z.ZodOptional<z.ZodString>;
|
|
1497
1503
|
}, z.core.$strip>;
|
|
1498
1504
|
interface GetTransactionsInput extends z.input<typeof getTransactionsInputSchema> {
|
|
@@ -1621,7 +1627,8 @@ interface ListAccountsOutput {
|
|
|
1621
1627
|
|
|
1622
1628
|
declare const matchTransactionInputSchema: z.ZodObject<{
|
|
1623
1629
|
transactionId: z.ZodUUID;
|
|
1624
|
-
paymentId: z.ZodString
|
|
1630
|
+
paymentId: z.ZodOptional<z.ZodString>;
|
|
1631
|
+
paymentRequestId: z.ZodOptional<z.ZodString>;
|
|
1625
1632
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
1626
1633
|
completedAt: z.ZodOptional<z.ZodDate>;
|
|
1627
1634
|
}, z.core.$strip>;
|
|
@@ -1757,6 +1764,7 @@ declare const updateTransactionStatusInputSchema: z.ZodObject<{
|
|
|
1757
1764
|
transactionId: z.ZodUUID;
|
|
1758
1765
|
status: z.ZodEnum<{
|
|
1759
1766
|
FAILED: "FAILED";
|
|
1767
|
+
NEW: "NEW";
|
|
1760
1768
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1761
1769
|
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1762
1770
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
@@ -1768,6 +1776,7 @@ declare const updateTransactionStatusInputSchema: z.ZodObject<{
|
|
|
1768
1776
|
}>;
|
|
1769
1777
|
statusReason: z.ZodOptional<z.ZodString>;
|
|
1770
1778
|
paymentId: z.ZodOptional<z.ZodString>;
|
|
1779
|
+
paymentRequestId: z.ZodOptional<z.ZodString>;
|
|
1771
1780
|
completedAt: z.ZodOptional<z.ZodDate>;
|
|
1772
1781
|
}, z.core.$strip>;
|
|
1773
1782
|
interface UpdateTransactionStatusInput extends z.infer<typeof updateTransactionStatusInputSchema> {
|
package/dist/types.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const updateTransactionStatus = require('./shared/ledger.
|
|
3
|
+
const updateTransactionStatus = require('./shared/ledger.ChjFG1yE.cjs');
|
|
4
4
|
const generalCodes = require('@develit-io/general-codes');
|
|
5
5
|
require('zod');
|
|
6
6
|
require('@develit-io/backend-sdk');
|
package/dist/types.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as ACCOUNT_TYPES, a as ASSET_TYPES, b as AccountType, c as AssetType, B as BALANCE_STRATEGIES, d as BATCH_STATUSES, e as BalanceStrategy, f as BankCode, g as BatchStatus, C as CHARGE_BEARERS, h as COUNTRY_CODES, i as ChargeBearer, j as CountryCode, k as CryptoNetworkCode, l as Currency, m as CurrencyCode, E as ENTRY_STATUSES, n as EntryMetadata, o as EntryStatus, I as IDENTIFIER_KINDS, p as IdentifierKind, P as PAYMENT_DIRECTIONS, q as PAYMENT_STATUSES, r as PAYMENT_TYPES, s as PaymentDirection, t as PaymentStatus, u as PaymentType, R as REFERENCE_TYPES, v as REFUNDABLE_TRANSACTION_STATUSES, w as ReferenceType, T as TRANSACTION_STATUSES, x as TRANSACTION_TYPES, y as TransactionMetadata, z as TransactionStatus, D as TransactionType } from './shared/ledger.
|
|
2
|
-
import { T as TransactionSelectType } from './shared/ledger.
|
|
3
|
-
export { P as AccountIdentifierInsertType, Q as AccountIdentifierMappingInsertType, S as AccountIdentifierMappingSelectType, V as AccountIdentifierSelectType, W as AccountInsertType, X as AccountSelectType, Y as AccountWithIdentifiersSelectType, e as CancelTransactionInput, f as CancelTransactionOutput, n as CreateAccountInput, o as CreateAccountOutput, C as CreateTransactionInput, a as CreateTransactionOutput, D as DeleteAccountInput, q as DeleteAccountOutput, F as FailTransactionInput, d as FailTransactionOutput, B as FindAccountByIdentifierInput, E as FindAccountByIdentifierOutput, H as GetAccountBalanceInput, I as GetAccountBalanceOutput, x as GetAccountIdentifierInput, y as GetAccountIdentifierOutput, r as GetAccountInput, s as GetAccountOutput, u as GetAccountsByOwnerInput, v as GetAccountsByOwnerOutput, G as GetTransactionByIdInput, i as GetTransactionByIdOutput, j as GetTransactionsByIdReferenceInput, k as GetTransactionsByReferenceIdOutput, l as GetTransactionsInput, m as GetTransactionsOutput, Z as IncludeRelation, _ as InferResultType, z as ListAccountIdentifiersInput, A as ListAccountIdentifiersOutput, L as ListAccountsInput, w as ListAccountsOutput, M as MatchTransactionInput, b as MatchTransactionOutput, g as RefundTransactionInput, h as RefundTransactionOutput, R as ResolveUnmatchedTransactionInput, c as ResolveUnmatchedTransactionOutput, $ as TransactionInsertType, U as UpdateAccountInput, p as UpdateAccountOutput, J as UpdateTransactionConfirmationSentAtInput, K as UpdateTransactionConfirmationSentAtOutput, N as UpdateTransactionStatusInput, O as UpdateTransactionStatusOutput, a0 as cancelTransactionInputSchema, a1 as createAccountInputSchema, a2 as createTransactionInputSchema, a3 as deleteAccountInputSchema, a4 as failTransactionInputSchema, a5 as findAccountByIdentifierInputSchema, a6 as getAccountBalanceInputSchema, a7 as getAccountIdentifierInputSchema, a8 as getAccountInputSchema, a9 as getAccountsByOwnerInputSchema, aa as getTransactionByIdInputSchema, ab as getTransactionsByReferenceIdInputSchema, ac as getTransactionsInputSchema, ad as listAccountIdentifiersInputSchema, ae as listAccountsInputSchema, af as matchTransactionInputSchema, ag as refundTransactionInputSchema, ah as resolveUnmatchedTransactionInputSchema, ai as updateAccountInputSchema, aj as updateTransactionConfirmationSentAtInputSchema, ak as updateTransactionStatusInputSchema } from './shared/ledger.
|
|
1
|
+
export { A as ACCOUNT_TYPES, a as ASSET_TYPES, b as AccountType, c as AssetType, B as BALANCE_STRATEGIES, d as BATCH_STATUSES, e as BalanceStrategy, f as BankCode, g as BatchStatus, C as CHARGE_BEARERS, h as COUNTRY_CODES, i as ChargeBearer, j as CountryCode, k as CryptoNetworkCode, l as Currency, m as CurrencyCode, E as ENTRY_STATUSES, n as EntryMetadata, o as EntryStatus, I as IDENTIFIER_KINDS, p as IdentifierKind, P as PAYMENT_DIRECTIONS, q as PAYMENT_STATUSES, r as PAYMENT_TYPES, s as PaymentDirection, t as PaymentStatus, u as PaymentType, R as REFERENCE_TYPES, v as REFUNDABLE_TRANSACTION_STATUSES, w as ReferenceType, T as TRANSACTION_STATUSES, x as TRANSACTION_TYPES, y as TransactionMetadata, z as TransactionStatus, D as TransactionType } from './shared/ledger.CZgIHlf1.cjs';
|
|
2
|
+
import { T as TransactionSelectType } from './shared/ledger.DxnspPg_.cjs';
|
|
3
|
+
export { P as AccountIdentifierInsertType, Q as AccountIdentifierMappingInsertType, S as AccountIdentifierMappingSelectType, V as AccountIdentifierSelectType, W as AccountInsertType, X as AccountSelectType, Y as AccountWithIdentifiersSelectType, e as CancelTransactionInput, f as CancelTransactionOutput, n as CreateAccountInput, o as CreateAccountOutput, C as CreateTransactionInput, a as CreateTransactionOutput, D as DeleteAccountInput, q as DeleteAccountOutput, F as FailTransactionInput, d as FailTransactionOutput, B as FindAccountByIdentifierInput, E as FindAccountByIdentifierOutput, H as GetAccountBalanceInput, I as GetAccountBalanceOutput, x as GetAccountIdentifierInput, y as GetAccountIdentifierOutput, r as GetAccountInput, s as GetAccountOutput, u as GetAccountsByOwnerInput, v as GetAccountsByOwnerOutput, G as GetTransactionByIdInput, i as GetTransactionByIdOutput, j as GetTransactionsByIdReferenceInput, k as GetTransactionsByReferenceIdOutput, l as GetTransactionsInput, m as GetTransactionsOutput, Z as IncludeRelation, _ as InferResultType, z as ListAccountIdentifiersInput, A as ListAccountIdentifiersOutput, L as ListAccountsInput, w as ListAccountsOutput, M as MatchTransactionInput, b as MatchTransactionOutput, g as RefundTransactionInput, h as RefundTransactionOutput, R as ResolveUnmatchedTransactionInput, c as ResolveUnmatchedTransactionOutput, $ as TransactionInsertType, U as UpdateAccountInput, p as UpdateAccountOutput, J as UpdateTransactionConfirmationSentAtInput, K as UpdateTransactionConfirmationSentAtOutput, N as UpdateTransactionStatusInput, O as UpdateTransactionStatusOutput, a0 as cancelTransactionInputSchema, a1 as createAccountInputSchema, a2 as createTransactionInputSchema, a3 as deleteAccountInputSchema, a4 as failTransactionInputSchema, a5 as findAccountByIdentifierInputSchema, a6 as getAccountBalanceInputSchema, a7 as getAccountIdentifierInputSchema, a8 as getAccountInputSchema, a9 as getAccountsByOwnerInputSchema, aa as getTransactionByIdInputSchema, ab as getTransactionsByReferenceIdInputSchema, ac as getTransactionsInputSchema, ad as listAccountIdentifiersInputSchema, ae as listAccountsInputSchema, af as matchTransactionInputSchema, ag as refundTransactionInputSchema, ah as resolveUnmatchedTransactionInputSchema, ai as updateAccountInputSchema, aj as updateTransactionConfirmationSentAtInputSchema, ak as updateTransactionStatusInputSchema } from './shared/ledger.DxnspPg_.cjs';
|
|
4
4
|
export { a as LedgerServiceEnv, b as LedgerServiceEnvironmentConfig, L as LedgerServiceWranglerConfig } from './shared/ledger.VQWxyeV6.cjs';
|
|
5
5
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
6
6
|
export { BANK_CODES, CRYPTO_NETWORK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
@@ -19,6 +19,8 @@ declare const ALLOWED_TRANSACTION_FILTERS: {
|
|
|
19
19
|
readonly COMPLETED_AT: "filterTransactionCompletedAt";
|
|
20
20
|
readonly STATUS: "filterTransactionStatus";
|
|
21
21
|
readonly STATUSES: "filterTransactionStatuses";
|
|
22
|
+
readonly PAYMENT_IDS: "filterTransactionPaymentIds";
|
|
23
|
+
readonly PAYMENT_REQUEST_IDS: "filterTransactionPaymentRequestIds";
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
interface LedgerEntry {
|
package/dist/types.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as ACCOUNT_TYPES, a as ASSET_TYPES, b as AccountType, c as AssetType, B as BALANCE_STRATEGIES, d as BATCH_STATUSES, e as BalanceStrategy, f as BankCode, g as BatchStatus, C as CHARGE_BEARERS, h as COUNTRY_CODES, i as ChargeBearer, j as CountryCode, k as CryptoNetworkCode, l as Currency, m as CurrencyCode, E as ENTRY_STATUSES, n as EntryMetadata, o as EntryStatus, I as IDENTIFIER_KINDS, p as IdentifierKind, P as PAYMENT_DIRECTIONS, q as PAYMENT_STATUSES, r as PAYMENT_TYPES, s as PaymentDirection, t as PaymentStatus, u as PaymentType, R as REFERENCE_TYPES, v as REFUNDABLE_TRANSACTION_STATUSES, w as ReferenceType, T as TRANSACTION_STATUSES, x as TRANSACTION_TYPES, y as TransactionMetadata, z as TransactionStatus, D as TransactionType } from './shared/ledger.
|
|
2
|
-
import { T as TransactionSelectType } from './shared/ledger.
|
|
3
|
-
export { P as AccountIdentifierInsertType, Q as AccountIdentifierMappingInsertType, S as AccountIdentifierMappingSelectType, V as AccountIdentifierSelectType, W as AccountInsertType, X as AccountSelectType, Y as AccountWithIdentifiersSelectType, e as CancelTransactionInput, f as CancelTransactionOutput, n as CreateAccountInput, o as CreateAccountOutput, C as CreateTransactionInput, a as CreateTransactionOutput, D as DeleteAccountInput, q as DeleteAccountOutput, F as FailTransactionInput, d as FailTransactionOutput, B as FindAccountByIdentifierInput, E as FindAccountByIdentifierOutput, H as GetAccountBalanceInput, I as GetAccountBalanceOutput, x as GetAccountIdentifierInput, y as GetAccountIdentifierOutput, r as GetAccountInput, s as GetAccountOutput, u as GetAccountsByOwnerInput, v as GetAccountsByOwnerOutput, G as GetTransactionByIdInput, i as GetTransactionByIdOutput, j as GetTransactionsByIdReferenceInput, k as GetTransactionsByReferenceIdOutput, l as GetTransactionsInput, m as GetTransactionsOutput, Z as IncludeRelation, _ as InferResultType, z as ListAccountIdentifiersInput, A as ListAccountIdentifiersOutput, L as ListAccountsInput, w as ListAccountsOutput, M as MatchTransactionInput, b as MatchTransactionOutput, g as RefundTransactionInput, h as RefundTransactionOutput, R as ResolveUnmatchedTransactionInput, c as ResolveUnmatchedTransactionOutput, $ as TransactionInsertType, U as UpdateAccountInput, p as UpdateAccountOutput, J as UpdateTransactionConfirmationSentAtInput, K as UpdateTransactionConfirmationSentAtOutput, N as UpdateTransactionStatusInput, O as UpdateTransactionStatusOutput, a0 as cancelTransactionInputSchema, a1 as createAccountInputSchema, a2 as createTransactionInputSchema, a3 as deleteAccountInputSchema, a4 as failTransactionInputSchema, a5 as findAccountByIdentifierInputSchema, a6 as getAccountBalanceInputSchema, a7 as getAccountIdentifierInputSchema, a8 as getAccountInputSchema, a9 as getAccountsByOwnerInputSchema, aa as getTransactionByIdInputSchema, ab as getTransactionsByReferenceIdInputSchema, ac as getTransactionsInputSchema, ad as listAccountIdentifiersInputSchema, ae as listAccountsInputSchema, af as matchTransactionInputSchema, ag as refundTransactionInputSchema, ah as resolveUnmatchedTransactionInputSchema, ai as updateAccountInputSchema, aj as updateTransactionConfirmationSentAtInputSchema, ak as updateTransactionStatusInputSchema } from './shared/ledger.
|
|
1
|
+
export { A as ACCOUNT_TYPES, a as ASSET_TYPES, b as AccountType, c as AssetType, B as BALANCE_STRATEGIES, d as BATCH_STATUSES, e as BalanceStrategy, f as BankCode, g as BatchStatus, C as CHARGE_BEARERS, h as COUNTRY_CODES, i as ChargeBearer, j as CountryCode, k as CryptoNetworkCode, l as Currency, m as CurrencyCode, E as ENTRY_STATUSES, n as EntryMetadata, o as EntryStatus, I as IDENTIFIER_KINDS, p as IdentifierKind, P as PAYMENT_DIRECTIONS, q as PAYMENT_STATUSES, r as PAYMENT_TYPES, s as PaymentDirection, t as PaymentStatus, u as PaymentType, R as REFERENCE_TYPES, v as REFUNDABLE_TRANSACTION_STATUSES, w as ReferenceType, T as TRANSACTION_STATUSES, x as TRANSACTION_TYPES, y as TransactionMetadata, z as TransactionStatus, D as TransactionType } from './shared/ledger.CZgIHlf1.mjs';
|
|
2
|
+
import { T as TransactionSelectType } from './shared/ledger.CPKrhfU8.mjs';
|
|
3
|
+
export { P as AccountIdentifierInsertType, Q as AccountIdentifierMappingInsertType, S as AccountIdentifierMappingSelectType, V as AccountIdentifierSelectType, W as AccountInsertType, X as AccountSelectType, Y as AccountWithIdentifiersSelectType, e as CancelTransactionInput, f as CancelTransactionOutput, n as CreateAccountInput, o as CreateAccountOutput, C as CreateTransactionInput, a as CreateTransactionOutput, D as DeleteAccountInput, q as DeleteAccountOutput, F as FailTransactionInput, d as FailTransactionOutput, B as FindAccountByIdentifierInput, E as FindAccountByIdentifierOutput, H as GetAccountBalanceInput, I as GetAccountBalanceOutput, x as GetAccountIdentifierInput, y as GetAccountIdentifierOutput, r as GetAccountInput, s as GetAccountOutput, u as GetAccountsByOwnerInput, v as GetAccountsByOwnerOutput, G as GetTransactionByIdInput, i as GetTransactionByIdOutput, j as GetTransactionsByIdReferenceInput, k as GetTransactionsByReferenceIdOutput, l as GetTransactionsInput, m as GetTransactionsOutput, Z as IncludeRelation, _ as InferResultType, z as ListAccountIdentifiersInput, A as ListAccountIdentifiersOutput, L as ListAccountsInput, w as ListAccountsOutput, M as MatchTransactionInput, b as MatchTransactionOutput, g as RefundTransactionInput, h as RefundTransactionOutput, R as ResolveUnmatchedTransactionInput, c as ResolveUnmatchedTransactionOutput, $ as TransactionInsertType, U as UpdateAccountInput, p as UpdateAccountOutput, J as UpdateTransactionConfirmationSentAtInput, K as UpdateTransactionConfirmationSentAtOutput, N as UpdateTransactionStatusInput, O as UpdateTransactionStatusOutput, a0 as cancelTransactionInputSchema, a1 as createAccountInputSchema, a2 as createTransactionInputSchema, a3 as deleteAccountInputSchema, a4 as failTransactionInputSchema, a5 as findAccountByIdentifierInputSchema, a6 as getAccountBalanceInputSchema, a7 as getAccountIdentifierInputSchema, a8 as getAccountInputSchema, a9 as getAccountsByOwnerInputSchema, aa as getTransactionByIdInputSchema, ab as getTransactionsByReferenceIdInputSchema, ac as getTransactionsInputSchema, ad as listAccountIdentifiersInputSchema, ae as listAccountsInputSchema, af as matchTransactionInputSchema, ag as refundTransactionInputSchema, ah as resolveUnmatchedTransactionInputSchema, ai as updateAccountInputSchema, aj as updateTransactionConfirmationSentAtInputSchema, ak as updateTransactionStatusInputSchema } from './shared/ledger.CPKrhfU8.mjs';
|
|
4
4
|
export { a as LedgerServiceEnv, b as LedgerServiceEnvironmentConfig, L as LedgerServiceWranglerConfig } from './shared/ledger.VQWxyeV6.mjs';
|
|
5
5
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
6
6
|
export { BANK_CODES, CRYPTO_NETWORK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
@@ -19,6 +19,8 @@ declare const ALLOWED_TRANSACTION_FILTERS: {
|
|
|
19
19
|
readonly COMPLETED_AT: "filterTransactionCompletedAt";
|
|
20
20
|
readonly STATUS: "filterTransactionStatus";
|
|
21
21
|
readonly STATUSES: "filterTransactionStatuses";
|
|
22
|
+
readonly PAYMENT_IDS: "filterTransactionPaymentIds";
|
|
23
|
+
readonly PAYMENT_REQUEST_IDS: "filterTransactionPaymentRequestIds";
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
interface LedgerEntry {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as ACCOUNT_TYPES, a as ASSET_TYPES, b as AccountType, c as AssetType, B as BALANCE_STRATEGIES, d as BATCH_STATUSES, e as BalanceStrategy, f as BankCode, g as BatchStatus, C as CHARGE_BEARERS, h as COUNTRY_CODES, i as ChargeBearer, j as CountryCode, k as CryptoNetworkCode, l as Currency, m as CurrencyCode, E as ENTRY_STATUSES, n as EntryMetadata, o as EntryStatus, I as IDENTIFIER_KINDS, p as IdentifierKind, P as PAYMENT_DIRECTIONS, q as PAYMENT_STATUSES, r as PAYMENT_TYPES, s as PaymentDirection, t as PaymentStatus, u as PaymentType, R as REFERENCE_TYPES, v as REFUNDABLE_TRANSACTION_STATUSES, w as ReferenceType, T as TRANSACTION_STATUSES, x as TRANSACTION_TYPES, y as TransactionMetadata, z as TransactionStatus, D as TransactionType } from './shared/ledger.
|
|
2
|
-
import { T as TransactionSelectType } from './shared/ledger.
|
|
3
|
-
export { P as AccountIdentifierInsertType, Q as AccountIdentifierMappingInsertType, S as AccountIdentifierMappingSelectType, V as AccountIdentifierSelectType, W as AccountInsertType, X as AccountSelectType, Y as AccountWithIdentifiersSelectType, e as CancelTransactionInput, f as CancelTransactionOutput, n as CreateAccountInput, o as CreateAccountOutput, C as CreateTransactionInput, a as CreateTransactionOutput, D as DeleteAccountInput, q as DeleteAccountOutput, F as FailTransactionInput, d as FailTransactionOutput, B as FindAccountByIdentifierInput, E as FindAccountByIdentifierOutput, H as GetAccountBalanceInput, I as GetAccountBalanceOutput, x as GetAccountIdentifierInput, y as GetAccountIdentifierOutput, r as GetAccountInput, s as GetAccountOutput, u as GetAccountsByOwnerInput, v as GetAccountsByOwnerOutput, G as GetTransactionByIdInput, i as GetTransactionByIdOutput, j as GetTransactionsByIdReferenceInput, k as GetTransactionsByReferenceIdOutput, l as GetTransactionsInput, m as GetTransactionsOutput, Z as IncludeRelation, _ as InferResultType, z as ListAccountIdentifiersInput, A as ListAccountIdentifiersOutput, L as ListAccountsInput, w as ListAccountsOutput, M as MatchTransactionInput, b as MatchTransactionOutput, g as RefundTransactionInput, h as RefundTransactionOutput, R as ResolveUnmatchedTransactionInput, c as ResolveUnmatchedTransactionOutput, $ as TransactionInsertType, U as UpdateAccountInput, p as UpdateAccountOutput, J as UpdateTransactionConfirmationSentAtInput, K as UpdateTransactionConfirmationSentAtOutput, N as UpdateTransactionStatusInput, O as UpdateTransactionStatusOutput, a0 as cancelTransactionInputSchema, a1 as createAccountInputSchema, a2 as createTransactionInputSchema, a3 as deleteAccountInputSchema, a4 as failTransactionInputSchema, a5 as findAccountByIdentifierInputSchema, a6 as getAccountBalanceInputSchema, a7 as getAccountIdentifierInputSchema, a8 as getAccountInputSchema, a9 as getAccountsByOwnerInputSchema, aa as getTransactionByIdInputSchema, ab as getTransactionsByReferenceIdInputSchema, ac as getTransactionsInputSchema, ad as listAccountIdentifiersInputSchema, ae as listAccountsInputSchema, af as matchTransactionInputSchema, ag as refundTransactionInputSchema, ah as resolveUnmatchedTransactionInputSchema, ai as updateAccountInputSchema, aj as updateTransactionConfirmationSentAtInputSchema, ak as updateTransactionStatusInputSchema } from './shared/ledger.
|
|
1
|
+
export { A as ACCOUNT_TYPES, a as ASSET_TYPES, b as AccountType, c as AssetType, B as BALANCE_STRATEGIES, d as BATCH_STATUSES, e as BalanceStrategy, f as BankCode, g as BatchStatus, C as CHARGE_BEARERS, h as COUNTRY_CODES, i as ChargeBearer, j as CountryCode, k as CryptoNetworkCode, l as Currency, m as CurrencyCode, E as ENTRY_STATUSES, n as EntryMetadata, o as EntryStatus, I as IDENTIFIER_KINDS, p as IdentifierKind, P as PAYMENT_DIRECTIONS, q as PAYMENT_STATUSES, r as PAYMENT_TYPES, s as PaymentDirection, t as PaymentStatus, u as PaymentType, R as REFERENCE_TYPES, v as REFUNDABLE_TRANSACTION_STATUSES, w as ReferenceType, T as TRANSACTION_STATUSES, x as TRANSACTION_TYPES, y as TransactionMetadata, z as TransactionStatus, D as TransactionType } from './shared/ledger.CZgIHlf1.js';
|
|
2
|
+
import { T as TransactionSelectType } from './shared/ledger.2ZZR5AvH.js';
|
|
3
|
+
export { P as AccountIdentifierInsertType, Q as AccountIdentifierMappingInsertType, S as AccountIdentifierMappingSelectType, V as AccountIdentifierSelectType, W as AccountInsertType, X as AccountSelectType, Y as AccountWithIdentifiersSelectType, e as CancelTransactionInput, f as CancelTransactionOutput, n as CreateAccountInput, o as CreateAccountOutput, C as CreateTransactionInput, a as CreateTransactionOutput, D as DeleteAccountInput, q as DeleteAccountOutput, F as FailTransactionInput, d as FailTransactionOutput, B as FindAccountByIdentifierInput, E as FindAccountByIdentifierOutput, H as GetAccountBalanceInput, I as GetAccountBalanceOutput, x as GetAccountIdentifierInput, y as GetAccountIdentifierOutput, r as GetAccountInput, s as GetAccountOutput, u as GetAccountsByOwnerInput, v as GetAccountsByOwnerOutput, G as GetTransactionByIdInput, i as GetTransactionByIdOutput, j as GetTransactionsByIdReferenceInput, k as GetTransactionsByReferenceIdOutput, l as GetTransactionsInput, m as GetTransactionsOutput, Z as IncludeRelation, _ as InferResultType, z as ListAccountIdentifiersInput, A as ListAccountIdentifiersOutput, L as ListAccountsInput, w as ListAccountsOutput, M as MatchTransactionInput, b as MatchTransactionOutput, g as RefundTransactionInput, h as RefundTransactionOutput, R as ResolveUnmatchedTransactionInput, c as ResolveUnmatchedTransactionOutput, $ as TransactionInsertType, U as UpdateAccountInput, p as UpdateAccountOutput, J as UpdateTransactionConfirmationSentAtInput, K as UpdateTransactionConfirmationSentAtOutput, N as UpdateTransactionStatusInput, O as UpdateTransactionStatusOutput, a0 as cancelTransactionInputSchema, a1 as createAccountInputSchema, a2 as createTransactionInputSchema, a3 as deleteAccountInputSchema, a4 as failTransactionInputSchema, a5 as findAccountByIdentifierInputSchema, a6 as getAccountBalanceInputSchema, a7 as getAccountIdentifierInputSchema, a8 as getAccountInputSchema, a9 as getAccountsByOwnerInputSchema, aa as getTransactionByIdInputSchema, ab as getTransactionsByReferenceIdInputSchema, ac as getTransactionsInputSchema, ad as listAccountIdentifiersInputSchema, ae as listAccountsInputSchema, af as matchTransactionInputSchema, ag as refundTransactionInputSchema, ah as resolveUnmatchedTransactionInputSchema, ai as updateAccountInputSchema, aj as updateTransactionConfirmationSentAtInputSchema, ak as updateTransactionStatusInputSchema } from './shared/ledger.2ZZR5AvH.js';
|
|
4
4
|
export { a as LedgerServiceEnv, b as LedgerServiceEnvironmentConfig, L as LedgerServiceWranglerConfig } from './shared/ledger.VQWxyeV6.js';
|
|
5
5
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
6
6
|
export { BANK_CODES, CRYPTO_NETWORK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
@@ -19,6 +19,8 @@ declare const ALLOWED_TRANSACTION_FILTERS: {
|
|
|
19
19
|
readonly COMPLETED_AT: "filterTransactionCompletedAt";
|
|
20
20
|
readonly STATUS: "filterTransactionStatus";
|
|
21
21
|
readonly STATUSES: "filterTransactionStatuses";
|
|
22
|
+
readonly PAYMENT_IDS: "filterTransactionPaymentIds";
|
|
23
|
+
readonly PAYMENT_REQUEST_IDS: "filterTransactionPaymentRequestIds";
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
interface LedgerEntry {
|
package/dist/types.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ACCOUNT_TYPES, a as ALLOWED_TRANSACTION_FILTERS, b as ASSET_TYPES, B as BALANCE_STRATEGIES, c as BATCH_STATUSES, C as CHARGE_BEARERS, d as COUNTRY_CODES, E as ENTRY_STATUSES, I as IDENTIFIER_KINDS, P as PAYMENT_DIRECTIONS, e as PAYMENT_STATUSES, f as PAYMENT_TYPES, R as REFERENCE_TYPES, g as REFUNDABLE_TRANSACTION_STATUSES, T as TRANSACTION_STATUSES, h as TRANSACTION_TYPES, i as cancelTransactionInputSchema, j as createAccountInputSchema, k as createTransactionInputSchema, l as deleteAccountInputSchema, m as failTransactionInputSchema, n as findAccountByIdentifierInputSchema, o as getAccountBalanceInputSchema, p as getAccountIdentifierInputSchema, q as getAccountInputSchema, r as getAccountsByOwnerInputSchema, s as getTransactionByIdInputSchema, t as getTransactionsByReferenceIdInputSchema, u as getTransactionsInputSchema, v as listAccountIdentifiersInputSchema, w as listAccountsInputSchema, x as matchTransactionInputSchema, y as refundTransactionInputSchema, z as resolveUnmatchedTransactionInputSchema, D as updateAccountInputSchema, F as updateTransactionConfirmationSentAtInputSchema, G as updateTransactionStatusInputSchema } from './shared/ledger.
|
|
1
|
+
export { A as ACCOUNT_TYPES, a as ALLOWED_TRANSACTION_FILTERS, b as ASSET_TYPES, B as BALANCE_STRATEGIES, c as BATCH_STATUSES, C as CHARGE_BEARERS, d as COUNTRY_CODES, E as ENTRY_STATUSES, I as IDENTIFIER_KINDS, P as PAYMENT_DIRECTIONS, e as PAYMENT_STATUSES, f as PAYMENT_TYPES, R as REFERENCE_TYPES, g as REFUNDABLE_TRANSACTION_STATUSES, T as TRANSACTION_STATUSES, h as TRANSACTION_TYPES, i as cancelTransactionInputSchema, j as createAccountInputSchema, k as createTransactionInputSchema, l as deleteAccountInputSchema, m as failTransactionInputSchema, n as findAccountByIdentifierInputSchema, o as getAccountBalanceInputSchema, p as getAccountIdentifierInputSchema, q as getAccountInputSchema, r as getAccountsByOwnerInputSchema, s as getTransactionByIdInputSchema, t as getTransactionsByReferenceIdInputSchema, u as getTransactionsInputSchema, v as listAccountIdentifiersInputSchema, w as listAccountsInputSchema, x as matchTransactionInputSchema, y as refundTransactionInputSchema, z as resolveUnmatchedTransactionInputSchema, D as updateAccountInputSchema, F as updateTransactionConfirmationSentAtInputSchema, G as updateTransactionStatusInputSchema } from './shared/ledger.DvHIBJap.mjs';
|
|
2
2
|
export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '@develit-io/backend-sdk';
|