@develit-services/ledger 0.4.2 → 0.4.4
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 +37 -11
- 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 +38 -12
- package/dist/shared/{ledger.BQi7s_NG.d.ts → ledger.2ZZR5AvH.d.ts} +11 -2
- package/dist/shared/{ledger.C4eXkZIj.cjs → ledger.Bc5z2uKn.cjs} +2 -1
- package/dist/shared/{ledger.DQZB5SVv.d.cts → ledger.CPKrhfU8.d.mts} +11 -2
- package/dist/shared/{ledger.CAoxOU3F.cjs → ledger.CU5seGBN.cjs} +12 -3
- 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.DzMWoOWY.d.mts → ledger.DxnspPg_.d.cts} +11 -2
- package/dist/shared/{ledger.Dpxzz64a.mjs → ledger.Dyw24XDs.mjs} +2 -1
- package/dist/shared/{ledger.De19PrJa.mjs → ledger.ZPgXf5Gd.mjs} +12 -3
- 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.Bc5z2uKn.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.CU5seGBN.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.Dyw24XDs.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.ZPgXf5Gd.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.Bc5z2uKn.cjs');
|
|
9
9
|
const drizzleOrm = require('drizzle-orm');
|
|
10
|
-
const updateTransactionStatus = require('../shared/ledger.
|
|
10
|
+
const updateTransactionStatus = require('../shared/ledger.CU5seGBN.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,20 +377,18 @@ 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,
|
|
373
384
|
currency
|
|
374
385
|
};
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
);
|
|
378
|
-
if (error) {
|
|
386
|
+
const data = await this.db.insert(tables.transaction).values(transaction).returning().then(backendSdk.first);
|
|
387
|
+
if (!data) {
|
|
379
388
|
throw backendSdk.createInternalError(null, {
|
|
380
389
|
message: "Failed to create transaction",
|
|
381
390
|
status: 500,
|
|
382
391
|
code: "DB-L-01"
|
|
383
|
-
// database, ledger, error 01
|
|
384
392
|
});
|
|
385
393
|
}
|
|
386
394
|
const result = {
|
|
@@ -419,6 +427,7 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
419
427
|
async _applyMatchAmount({
|
|
420
428
|
existingTransaction,
|
|
421
429
|
paymentId,
|
|
430
|
+
paymentRequestId,
|
|
422
431
|
amount,
|
|
423
432
|
completedAt,
|
|
424
433
|
extraMetadata
|
|
@@ -445,6 +454,7 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
445
454
|
status: isFullyMatched ? "MATCHED" : "PARTIALLY_MATCHED",
|
|
446
455
|
completedAt: isFullyMatched ? completedAt : void 0,
|
|
447
456
|
paymentId,
|
|
457
|
+
paymentRequestId,
|
|
448
458
|
receivedValue: newReceivedValue,
|
|
449
459
|
metadata: updatedMetadata
|
|
450
460
|
}).command.execute().then(backendSdk.first);
|
|
@@ -464,7 +474,8 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
464
474
|
transactionId,
|
|
465
475
|
status: "MATCHED",
|
|
466
476
|
completedAt,
|
|
467
|
-
paymentId
|
|
477
|
+
paymentId,
|
|
478
|
+
paymentRequestId
|
|
468
479
|
}).command.execute().then(backendSdk.first);
|
|
469
480
|
if (!transaction) {
|
|
470
481
|
throw backendSdk.createInternalError(null, {
|
|
@@ -480,7 +491,13 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
480
491
|
{ data: input, schema: updateTransactionStatus.matchTransactionInputSchema },
|
|
481
492
|
{ successMessage: "Transaction successfully matched." },
|
|
482
493
|
async (params) => {
|
|
483
|
-
const {
|
|
494
|
+
const {
|
|
495
|
+
transactionId,
|
|
496
|
+
completedAt,
|
|
497
|
+
paymentId,
|
|
498
|
+
paymentRequestId,
|
|
499
|
+
amount
|
|
500
|
+
} = params;
|
|
484
501
|
const existingTransaction = await getTransactionByIdQuery(
|
|
485
502
|
this.db,
|
|
486
503
|
transactionId
|
|
@@ -502,6 +519,7 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
502
519
|
const { transaction, signal } = await this._applyMatchAmount({
|
|
503
520
|
existingTransaction,
|
|
504
521
|
paymentId,
|
|
522
|
+
paymentRequestId,
|
|
505
523
|
amount,
|
|
506
524
|
completedAt
|
|
507
525
|
});
|
|
@@ -1111,7 +1129,14 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
1111
1129
|
{ data: input, schema: updateTransactionStatus.updateTransactionStatusInputSchema },
|
|
1112
1130
|
{ successMessage: "Transaction status successfully updated." },
|
|
1113
1131
|
async (params) => {
|
|
1114
|
-
const {
|
|
1132
|
+
const {
|
|
1133
|
+
transactionId,
|
|
1134
|
+
status,
|
|
1135
|
+
statusReason,
|
|
1136
|
+
paymentId,
|
|
1137
|
+
paymentRequestId,
|
|
1138
|
+
completedAt
|
|
1139
|
+
} = params;
|
|
1115
1140
|
const existingTransaction = await getTransactionByIdQuery(
|
|
1116
1141
|
this.db,
|
|
1117
1142
|
transactionId
|
|
@@ -1128,6 +1153,7 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
|
1128
1153
|
status,
|
|
1129
1154
|
statusReason,
|
|
1130
1155
|
paymentId,
|
|
1156
|
+
paymentRequestId,
|
|
1131
1157
|
completedAt
|
|
1132
1158
|
});
|
|
1133
1159
|
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
|
-
import { first, develitWorker, uuidv4,
|
|
1
|
+
import { first, develitWorker, uuidv4, 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.Dyw24XDs.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.ZPgXf5Gd.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,20 +373,18 @@ 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,
|
|
369
380
|
currency
|
|
370
381
|
};
|
|
371
|
-
const
|
|
372
|
-
|
|
373
|
-
);
|
|
374
|
-
if (error) {
|
|
382
|
+
const data = await this.db.insert(tables.transaction).values(transaction).returning().then(first);
|
|
383
|
+
if (!data) {
|
|
375
384
|
throw createInternalError(null, {
|
|
376
385
|
message: "Failed to create transaction",
|
|
377
386
|
status: 500,
|
|
378
387
|
code: "DB-L-01"
|
|
379
|
-
// database, ledger, error 01
|
|
380
388
|
});
|
|
381
389
|
}
|
|
382
390
|
const result = {
|
|
@@ -415,6 +423,7 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
415
423
|
async _applyMatchAmount({
|
|
416
424
|
existingTransaction,
|
|
417
425
|
paymentId,
|
|
426
|
+
paymentRequestId,
|
|
418
427
|
amount,
|
|
419
428
|
completedAt,
|
|
420
429
|
extraMetadata
|
|
@@ -441,6 +450,7 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
441
450
|
status: isFullyMatched ? "MATCHED" : "PARTIALLY_MATCHED",
|
|
442
451
|
completedAt: isFullyMatched ? completedAt : void 0,
|
|
443
452
|
paymentId,
|
|
453
|
+
paymentRequestId,
|
|
444
454
|
receivedValue: newReceivedValue,
|
|
445
455
|
metadata: updatedMetadata
|
|
446
456
|
}).command.execute().then(first);
|
|
@@ -460,7 +470,8 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
460
470
|
transactionId,
|
|
461
471
|
status: "MATCHED",
|
|
462
472
|
completedAt,
|
|
463
|
-
paymentId
|
|
473
|
+
paymentId,
|
|
474
|
+
paymentRequestId
|
|
464
475
|
}).command.execute().then(first);
|
|
465
476
|
if (!transaction) {
|
|
466
477
|
throw createInternalError(null, {
|
|
@@ -476,7 +487,13 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
476
487
|
{ data: input, schema: matchTransactionInputSchema },
|
|
477
488
|
{ successMessage: "Transaction successfully matched." },
|
|
478
489
|
async (params) => {
|
|
479
|
-
const {
|
|
490
|
+
const {
|
|
491
|
+
transactionId,
|
|
492
|
+
completedAt,
|
|
493
|
+
paymentId,
|
|
494
|
+
paymentRequestId,
|
|
495
|
+
amount
|
|
496
|
+
} = params;
|
|
480
497
|
const existingTransaction = await getTransactionByIdQuery(
|
|
481
498
|
this.db,
|
|
482
499
|
transactionId
|
|
@@ -498,6 +515,7 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
498
515
|
const { transaction, signal } = await this._applyMatchAmount({
|
|
499
516
|
existingTransaction,
|
|
500
517
|
paymentId,
|
|
518
|
+
paymentRequestId,
|
|
501
519
|
amount,
|
|
502
520
|
completedAt
|
|
503
521
|
});
|
|
@@ -1107,7 +1125,14 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
1107
1125
|
{ data: input, schema: updateTransactionStatusInputSchema },
|
|
1108
1126
|
{ successMessage: "Transaction status successfully updated." },
|
|
1109
1127
|
async (params) => {
|
|
1110
|
-
const {
|
|
1128
|
+
const {
|
|
1129
|
+
transactionId,
|
|
1130
|
+
status,
|
|
1131
|
+
statusReason,
|
|
1132
|
+
paymentId,
|
|
1133
|
+
paymentRequestId,
|
|
1134
|
+
completedAt
|
|
1135
|
+
} = params;
|
|
1111
1136
|
const existingTransaction = await getTransactionByIdQuery(
|
|
1112
1137
|
this.db,
|
|
1113
1138
|
transactionId
|
|
@@ -1124,6 +1149,7 @@ let LedgerServiceBase = class extends develitWorker(
|
|
|
1124
1149
|
status,
|
|
1125
1150
|
statusReason,
|
|
1126
1151
|
paymentId,
|
|
1152
|
+
paymentRequestId,
|
|
1127
1153
|
completedAt
|
|
1128
1154
|
});
|
|
1129
1155
|
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> {
|
|
@@ -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.CU5seGBN.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> {
|
|
@@ -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 must be provided"
|
|
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
|
|
|
@@ -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";
|
|
@@ -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> {
|
|
@@ -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.ZPgXf5Gd.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"),
|
|
@@ -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 must be provided"
|
|
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
|
|
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.CU5seGBN.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.ZPgXf5Gd.mjs';
|
|
2
2
|
export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '@develit-io/backend-sdk';
|