@develit-services/ledger 0.3.5 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/database/schema.cjs +2 -2
- package/dist/database/schema.d.cts +1 -1
- package/dist/database/schema.d.mts +1 -1
- package/dist/database/schema.d.ts +1 -1
- package/dist/database/schema.mjs +2 -2
- package/dist/export/worker.cjs +190 -18
- package/dist/export/worker.d.cts +8 -2
- package/dist/export/worker.d.mts +8 -2
- package/dist/export/worker.d.ts +8 -2
- package/dist/export/worker.mjs +190 -18
- package/dist/shared/{ledger.CT5yBFAm.d.mts → ledger.BtCTt25C.d.cts} +39 -10
- package/dist/shared/{ledger.CT5yBFAm.d.ts → ledger.BtCTt25C.d.mts} +39 -10
- package/dist/shared/{ledger.CT5yBFAm.d.cts → ledger.BtCTt25C.d.ts} +39 -10
- package/dist/shared/{ledger.V5SF3fcq.cjs → ledger.C4eXkZIj.cjs} +2 -1
- package/dist/shared/{ledger.Bmi7Cafn.cjs → ledger.CAoxOU3F.cjs} +18 -4
- package/dist/shared/{ledger.Cn5pQymQ.d.mts → ledger.D_QC9ub6.d.mts} +40 -8
- package/dist/shared/{ledger.Bb6l1o9P.mjs → ledger.De19PrJa.mjs} +18 -5
- package/dist/shared/{ledger.DKVdStuQ.mjs → ledger.Dpxzz64a.mjs} +2 -1
- package/dist/shared/{ledger.DKJ1Mplk.d.ts → ledger.WHp2MLCf.d.cts} +40 -8
- package/dist/shared/{ledger.BZeNQHQ7.d.cts → ledger.ZADe_DAC.d.ts} +40 -8
- package/dist/types.cjs +2 -1
- package/dist/types.d.cts +5 -4
- package/dist/types.d.mts +5 -4
- package/dist/types.d.ts +5 -4
- package/dist/types.mjs +1 -1
- package/package.json +2 -2
|
@@ -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", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
707
|
+
declare const TRANSACTION_STATUSES: readonly ["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];
|
|
@@ -773,6 +773,18 @@ interface TransactionMetadata {
|
|
|
773
773
|
refund?: {
|
|
774
774
|
isPartialRefund: boolean;
|
|
775
775
|
};
|
|
776
|
+
/**
|
|
777
|
+
* History of partial matches — each incoming payment that contributed to this transaction
|
|
778
|
+
*/
|
|
779
|
+
partialMatches?: Array<{
|
|
780
|
+
paymentId: string;
|
|
781
|
+
amount: number;
|
|
782
|
+
matchedAt: string;
|
|
783
|
+
}>;
|
|
784
|
+
/**
|
|
785
|
+
* ID of the user who performed a manual action (resolve, refund, etc.)
|
|
786
|
+
*/
|
|
787
|
+
performedBy?: string;
|
|
776
788
|
}
|
|
777
789
|
interface EntryMetadata {
|
|
778
790
|
context?: {
|
|
@@ -954,7 +966,7 @@ declare const entry: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
954
966
|
tableName: "entry";
|
|
955
967
|
dataType: "string";
|
|
956
968
|
columnType: "SQLiteText";
|
|
957
|
-
data: "
|
|
969
|
+
data: "FAILED" | "PENDING" | "REALIZED" | "CANCELED";
|
|
958
970
|
driverParam: string;
|
|
959
971
|
notNull: true;
|
|
960
972
|
hasDefault: false;
|
|
@@ -967,7 +979,7 @@ declare const entry: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
967
979
|
generated: undefined;
|
|
968
980
|
}, {}, {
|
|
969
981
|
length: number | undefined;
|
|
970
|
-
$type: "
|
|
982
|
+
$type: "FAILED" | "PENDING" | "REALIZED" | "CANCELED";
|
|
971
983
|
}>;
|
|
972
984
|
isBalanced: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
973
985
|
name: "is_balanced";
|
|
@@ -1181,7 +1193,7 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1181
1193
|
tableName: "transaction";
|
|
1182
1194
|
dataType: "string";
|
|
1183
1195
|
columnType: "SQLiteText";
|
|
1184
|
-
data: "
|
|
1196
|
+
data: "EXCHANGE" | "PAYMENT" | "ORDER" | "INTERNAL-TRANSFER" | "FORWARD" | "TRANSACTION";
|
|
1185
1197
|
driverParam: string;
|
|
1186
1198
|
notNull: true;
|
|
1187
1199
|
hasDefault: false;
|
|
@@ -1194,7 +1206,7 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1194
1206
|
generated: undefined;
|
|
1195
1207
|
}, {}, {
|
|
1196
1208
|
length: number | undefined;
|
|
1197
|
-
$type: "
|
|
1209
|
+
$type: "EXCHANGE" | "PAYMENT" | "ORDER" | "INTERNAL-TRANSFER" | "FORWARD" | "TRANSACTION";
|
|
1198
1210
|
}>;
|
|
1199
1211
|
referenceId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1200
1212
|
name: "reference_id";
|
|
@@ -1220,7 +1232,7 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1220
1232
|
tableName: "transaction";
|
|
1221
1233
|
dataType: "string";
|
|
1222
1234
|
columnType: "SQLiteText";
|
|
1223
|
-
data: "
|
|
1235
|
+
data: "CLIENT_FUND_IN" | "CLIENT_FUND_OUT" | "PROVIDER_FUND_IN" | "PROVIDER_FUND_OUT" | "COLLATERAL_FUND_IN" | "COLLATERAL_FUND_OUT" | "EXCHANGE" | "UNMATCHED" | "ADJUSTMENT" | "TRANSFER" | "REFUND";
|
|
1224
1236
|
driverParam: string;
|
|
1225
1237
|
notNull: true;
|
|
1226
1238
|
hasDefault: false;
|
|
@@ -1233,7 +1245,7 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1233
1245
|
generated: undefined;
|
|
1234
1246
|
}, {}, {
|
|
1235
1247
|
length: number | undefined;
|
|
1236
|
-
$type: "
|
|
1248
|
+
$type: "CLIENT_FUND_IN" | "CLIENT_FUND_OUT" | "PROVIDER_FUND_IN" | "PROVIDER_FUND_OUT" | "COLLATERAL_FUND_IN" | "COLLATERAL_FUND_OUT" | "EXCHANGE" | "UNMATCHED" | "ADJUSTMENT" | "TRANSFER" | "REFUND";
|
|
1237
1249
|
}>;
|
|
1238
1250
|
description: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1239
1251
|
name: "description";
|
|
@@ -1293,20 +1305,20 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1293
1305
|
tableName: "transaction";
|
|
1294
1306
|
dataType: "string";
|
|
1295
1307
|
columnType: "SQLiteText";
|
|
1296
|
-
data: "FAILED" | "WAITING_FOR_PAYMENT" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1308
|
+
data: "FAILED" | "WAITING_FOR_PAYMENT" | "PARTIALLY_MATCHED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1297
1309
|
driverParam: string;
|
|
1298
1310
|
notNull: true;
|
|
1299
1311
|
hasDefault: false;
|
|
1300
1312
|
isPrimaryKey: false;
|
|
1301
1313
|
isAutoincrement: false;
|
|
1302
1314
|
hasRuntimeDefault: false;
|
|
1303
|
-
enumValues: ["WAITING_FOR_PAYMENT", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
1315
|
+
enumValues: ["WAITING_FOR_PAYMENT", "PARTIALLY_MATCHED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
|
|
1304
1316
|
baseColumn: never;
|
|
1305
1317
|
identity: undefined;
|
|
1306
1318
|
generated: undefined;
|
|
1307
1319
|
}, {}, {
|
|
1308
1320
|
length: number | undefined;
|
|
1309
|
-
$type: "FAILED" | "WAITING_FOR_PAYMENT" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1321
|
+
$type: "FAILED" | "WAITING_FOR_PAYMENT" | "PARTIALLY_MATCHED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
|
|
1310
1322
|
}>;
|
|
1311
1323
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1312
1324
|
name: "status_reason";
|
|
@@ -1382,6 +1394,23 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1382
1394
|
identity: undefined;
|
|
1383
1395
|
generated: undefined;
|
|
1384
1396
|
}, {}, {}>;
|
|
1397
|
+
receivedValue: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1398
|
+
name: "received_value";
|
|
1399
|
+
tableName: "transaction";
|
|
1400
|
+
dataType: "number";
|
|
1401
|
+
columnType: "SQLiteReal";
|
|
1402
|
+
data: number;
|
|
1403
|
+
driverParam: number;
|
|
1404
|
+
notNull: false;
|
|
1405
|
+
hasDefault: false;
|
|
1406
|
+
isPrimaryKey: false;
|
|
1407
|
+
isAutoincrement: false;
|
|
1408
|
+
hasRuntimeDefault: false;
|
|
1409
|
+
enumValues: undefined;
|
|
1410
|
+
baseColumn: never;
|
|
1411
|
+
identity: undefined;
|
|
1412
|
+
generated: undefined;
|
|
1413
|
+
}, {}, {}>;
|
|
1385
1414
|
currency: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1386
1415
|
name: "currency";
|
|
1387
1416
|
tableName: "transaction";
|
|
@@ -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.CAoxOU3F.cjs');
|
|
7
7
|
require('@develit-io/general-codes');
|
|
8
8
|
|
|
9
9
|
const account = sqliteCore.sqliteTable("account", {
|
|
@@ -92,6 +92,7 @@ const transaction = sqliteCore.sqliteTable("transaction", {
|
|
|
92
92
|
paymentId: sqliteCore.text("payment_id"),
|
|
93
93
|
metadata: sqliteCore.text("metadata", { mode: "json" }).$type().notNull(),
|
|
94
94
|
value: sqliteCore.real("value"),
|
|
95
|
+
receivedValue: sqliteCore.real("received_value"),
|
|
95
96
|
currency: sqliteCore.text("currency").$type()
|
|
96
97
|
});
|
|
97
98
|
|
|
@@ -61,7 +61,7 @@ const ENTRY_STATUSES = [
|
|
|
61
61
|
];
|
|
62
62
|
const TRANSACTION_STATUSES = [
|
|
63
63
|
"WAITING_FOR_PAYMENT",
|
|
64
|
-
|
|
64
|
+
"PARTIALLY_MATCHED",
|
|
65
65
|
"WAITING_FOR_MANUAL_PROCESSING",
|
|
66
66
|
"MATCHED",
|
|
67
67
|
"RETURNING",
|
|
@@ -110,7 +110,8 @@ const ALLOWED_TRANSACTION_FILTERS = {
|
|
|
110
110
|
TO: "filterTransactionDateTo",
|
|
111
111
|
DESCRIPTION: "filterTransactionDescription",
|
|
112
112
|
COMPLETED_AT: "filterTransactionCompletedAt",
|
|
113
|
-
STATUS: "filterTransactionStatus"
|
|
113
|
+
STATUS: "filterTransactionStatus",
|
|
114
|
+
STATUSES: "filterTransactionStatuses"
|
|
114
115
|
};
|
|
115
116
|
|
|
116
117
|
const cancelTransactionInputSchema = zod.z.object({
|
|
@@ -188,8 +189,10 @@ const transactionMetadataSchema = zod.z.object({
|
|
|
188
189
|
// ISO 8601
|
|
189
190
|
currency: zod.z.enum(generalCodes.CURRENCY_CODES).optional(),
|
|
190
191
|
amount: zod.z.number().optional(),
|
|
191
|
-
purpose: zod.z.string().optional()
|
|
192
|
+
purpose: zod.z.string().optional(),
|
|
192
193
|
// účel platby
|
|
194
|
+
direction: zod.z.enum(PAYMENT_DIRECTIONS).optional(),
|
|
195
|
+
sendAsSinglePayment: zod.z.boolean().optional()
|
|
193
196
|
}).optional()
|
|
194
197
|
});
|
|
195
198
|
const createTransactionInputSchema = zod.z.object({
|
|
@@ -271,6 +274,7 @@ const getTransactionsInputSchema = zod.z.object({
|
|
|
271
274
|
[ALLOWED_TRANSACTION_FILTERS.TO]: zod.z.date().optional(),
|
|
272
275
|
[ALLOWED_TRANSACTION_FILTERS.COMPLETED_AT]: zod.z.date().optional(),
|
|
273
276
|
[ALLOWED_TRANSACTION_FILTERS.STATUS]: zod.z.enum(TRANSACTION_STATUSES).optional(),
|
|
277
|
+
[ALLOWED_TRANSACTION_FILTERS.STATUSES]: zod.z.array(zod.z.enum(TRANSACTION_STATUSES)).optional(),
|
|
274
278
|
search: zod.z.string().optional()
|
|
275
279
|
});
|
|
276
280
|
|
|
@@ -296,6 +300,7 @@ const listAccountsInputSchema = zod.z.object({
|
|
|
296
300
|
const matchTransactionInputSchema = zod.z.object({
|
|
297
301
|
transactionId: zod.z.uuid(),
|
|
298
302
|
paymentId: zod.z.string(),
|
|
303
|
+
amount: zod.z.number().positive().optional(),
|
|
299
304
|
completedAt: zod.z.date().optional()
|
|
300
305
|
});
|
|
301
306
|
|
|
@@ -318,7 +323,15 @@ const updateTransactionConfirmationSentAtInputSchema = zod.z.object({
|
|
|
318
323
|
const refundTransactionInputSchema = zod.z.object({
|
|
319
324
|
transactionId: zod.z.uuid(),
|
|
320
325
|
amount: zod.z.number().positive().optional(),
|
|
321
|
-
reason: zod.z.string().min(1)
|
|
326
|
+
reason: zod.z.string().min(1),
|
|
327
|
+
performedBy: zod.z.string().min(1).optional()
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
const resolveUnmatchedTransactionInputSchema = zod.z.object({
|
|
331
|
+
unmatchedTransactionId: zod.z.uuid(),
|
|
332
|
+
targetTransactionId: zod.z.uuid(),
|
|
333
|
+
note: zod.z.string().min(1),
|
|
334
|
+
performedBy: zod.z.string().min(1)
|
|
322
335
|
});
|
|
323
336
|
|
|
324
337
|
const updateTransactionStatusInputSchema = zod.z.object({
|
|
@@ -362,6 +375,7 @@ exports.listAccountIdentifiersInputSchema = listAccountIdentifiersInputSchema;
|
|
|
362
375
|
exports.listAccountsInputSchema = listAccountsInputSchema;
|
|
363
376
|
exports.matchTransactionInputSchema = matchTransactionInputSchema;
|
|
364
377
|
exports.refundTransactionInputSchema = refundTransactionInputSchema;
|
|
378
|
+
exports.resolveUnmatchedTransactionInputSchema = resolveUnmatchedTransactionInputSchema;
|
|
365
379
|
exports.updateAccountInputSchema = updateAccountInputSchema;
|
|
366
380
|
exports.updateTransactionConfirmationSentAtInputSchema = updateTransactionConfirmationSentAtInputSchema;
|
|
367
381
|
exports.updateTransactionStatusInputSchema = updateTransactionStatusInputSchema;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { F as schema } from './ledger.
|
|
2
|
+
import { F as schema } from './ledger.BtCTt25C.mjs';
|
|
3
3
|
import { InferSelectModel, ExtractTablesWithRelations, DBQueryConfig, BuildQueryResult, InferInsertModel } from 'drizzle-orm';
|
|
4
4
|
|
|
5
5
|
interface TSchema extends ExtractTablesWithRelations<typeof tables> {
|
|
@@ -411,8 +411,8 @@ interface CreateAccountOutput {
|
|
|
411
411
|
declare const createTransactionInputSchema: z.ZodObject<{
|
|
412
412
|
correlationId: z.ZodString;
|
|
413
413
|
referenceType: z.ZodEnum<{
|
|
414
|
-
PAYMENT: "PAYMENT";
|
|
415
414
|
EXCHANGE: "EXCHANGE";
|
|
415
|
+
PAYMENT: "PAYMENT";
|
|
416
416
|
ORDER: "ORDER";
|
|
417
417
|
"INTERNAL-TRANSFER": "INTERNAL-TRANSFER";
|
|
418
418
|
FORWARD: "FORWARD";
|
|
@@ -420,13 +420,13 @@ declare const createTransactionInputSchema: z.ZodObject<{
|
|
|
420
420
|
}>;
|
|
421
421
|
referenceId: z.ZodOptional<z.ZodString>;
|
|
422
422
|
type: z.ZodEnum<{
|
|
423
|
-
EXCHANGE: "EXCHANGE";
|
|
424
423
|
CLIENT_FUND_IN: "CLIENT_FUND_IN";
|
|
425
424
|
CLIENT_FUND_OUT: "CLIENT_FUND_OUT";
|
|
426
425
|
PROVIDER_FUND_IN: "PROVIDER_FUND_IN";
|
|
427
426
|
PROVIDER_FUND_OUT: "PROVIDER_FUND_OUT";
|
|
428
427
|
COLLATERAL_FUND_IN: "COLLATERAL_FUND_IN";
|
|
429
428
|
COLLATERAL_FUND_OUT: "COLLATERAL_FUND_OUT";
|
|
429
|
+
EXCHANGE: "EXCHANGE";
|
|
430
430
|
UNMATCHED: "UNMATCHED";
|
|
431
431
|
ADJUSTMENT: "ADJUSTMENT";
|
|
432
432
|
TRANSFER: "TRANSFER";
|
|
@@ -1175,11 +1175,17 @@ declare const createTransactionInputSchema: z.ZodObject<{
|
|
|
1175
1175
|
}>>;
|
|
1176
1176
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
1177
1177
|
purpose: z.ZodOptional<z.ZodString>;
|
|
1178
|
+
direction: z.ZodOptional<z.ZodEnum<{
|
|
1179
|
+
INCOMING: "INCOMING";
|
|
1180
|
+
OUTGOING: "OUTGOING";
|
|
1181
|
+
}>>;
|
|
1182
|
+
sendAsSinglePayment: z.ZodOptional<z.ZodBoolean>;
|
|
1178
1183
|
}, z.core.$strip>>;
|
|
1179
1184
|
}, z.core.$strip>>>;
|
|
1180
1185
|
status: z.ZodEnum<{
|
|
1181
1186
|
FAILED: "FAILED";
|
|
1182
1187
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1188
|
+
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1183
1189
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
1184
1190
|
MATCHED: "MATCHED";
|
|
1185
1191
|
RETURNING: "RETURNING";
|
|
@@ -1380,8 +1386,8 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1380
1386
|
}, z.core.$strip>;
|
|
1381
1387
|
filterTransactionCorrelationId: z.ZodOptional<z.ZodUUID>;
|
|
1382
1388
|
filterTransactionReferenceType: z.ZodOptional<z.ZodEnum<{
|
|
1383
|
-
PAYMENT: "PAYMENT";
|
|
1384
1389
|
EXCHANGE: "EXCHANGE";
|
|
1390
|
+
PAYMENT: "PAYMENT";
|
|
1385
1391
|
ORDER: "ORDER";
|
|
1386
1392
|
"INTERNAL-TRANSFER": "INTERNAL-TRANSFER";
|
|
1387
1393
|
FORWARD: "FORWARD";
|
|
@@ -1389,13 +1395,13 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1389
1395
|
}>>;
|
|
1390
1396
|
filterTransactionReferenceId: z.ZodOptional<z.ZodUUID>;
|
|
1391
1397
|
filterTransactionType: z.ZodOptional<z.ZodEnum<{
|
|
1392
|
-
EXCHANGE: "EXCHANGE";
|
|
1393
1398
|
CLIENT_FUND_IN: "CLIENT_FUND_IN";
|
|
1394
1399
|
CLIENT_FUND_OUT: "CLIENT_FUND_OUT";
|
|
1395
1400
|
PROVIDER_FUND_IN: "PROVIDER_FUND_IN";
|
|
1396
1401
|
PROVIDER_FUND_OUT: "PROVIDER_FUND_OUT";
|
|
1397
1402
|
COLLATERAL_FUND_IN: "COLLATERAL_FUND_IN";
|
|
1398
1403
|
COLLATERAL_FUND_OUT: "COLLATERAL_FUND_OUT";
|
|
1404
|
+
EXCHANGE: "EXCHANGE";
|
|
1399
1405
|
UNMATCHED: "UNMATCHED";
|
|
1400
1406
|
ADJUSTMENT: "ADJUSTMENT";
|
|
1401
1407
|
TRANSFER: "TRANSFER";
|
|
@@ -1408,6 +1414,7 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1408
1414
|
filterTransactionStatus: z.ZodOptional<z.ZodEnum<{
|
|
1409
1415
|
FAILED: "FAILED";
|
|
1410
1416
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1417
|
+
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1411
1418
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
1412
1419
|
MATCHED: "MATCHED";
|
|
1413
1420
|
RETURNING: "RETURNING";
|
|
@@ -1415,6 +1422,17 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1415
1422
|
CANCELLED: "CANCELLED";
|
|
1416
1423
|
SETTLED: "SETTLED";
|
|
1417
1424
|
}>>;
|
|
1425
|
+
filterTransactionStatuses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1426
|
+
FAILED: "FAILED";
|
|
1427
|
+
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1428
|
+
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1429
|
+
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
1430
|
+
MATCHED: "MATCHED";
|
|
1431
|
+
RETURNING: "RETURNING";
|
|
1432
|
+
RETURNED: "RETURNED";
|
|
1433
|
+
CANCELLED: "CANCELLED";
|
|
1434
|
+
SETTLED: "SETTLED";
|
|
1435
|
+
}>>>;
|
|
1418
1436
|
search: z.ZodOptional<z.ZodString>;
|
|
1419
1437
|
}, z.core.$strip>;
|
|
1420
1438
|
interface GetTransactionsInput extends z.input<typeof getTransactionsInputSchema> {
|
|
@@ -1426,8 +1444,8 @@ interface GetTransactionsOutput {
|
|
|
1426
1444
|
|
|
1427
1445
|
declare const getTransactionsByReferenceIdInputSchema: z.ZodObject<{
|
|
1428
1446
|
referenceType: z.ZodEnum<{
|
|
1429
|
-
PAYMENT: "PAYMENT";
|
|
1430
1447
|
EXCHANGE: "EXCHANGE";
|
|
1448
|
+
PAYMENT: "PAYMENT";
|
|
1431
1449
|
ORDER: "ORDER";
|
|
1432
1450
|
"INTERNAL-TRANSFER": "INTERNAL-TRANSFER";
|
|
1433
1451
|
FORWARD: "FORWARD";
|
|
@@ -1544,6 +1562,7 @@ interface ListAccountsOutput {
|
|
|
1544
1562
|
declare const matchTransactionInputSchema: z.ZodObject<{
|
|
1545
1563
|
transactionId: z.ZodUUID;
|
|
1546
1564
|
paymentId: z.ZodString;
|
|
1565
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
1547
1566
|
completedAt: z.ZodOptional<z.ZodDate>;
|
|
1548
1567
|
}, z.core.$strip>;
|
|
1549
1568
|
interface MatchTransactionInput extends z.infer<typeof matchTransactionInputSchema> {
|
|
@@ -1654,6 +1673,7 @@ declare const refundTransactionInputSchema: z.ZodObject<{
|
|
|
1654
1673
|
transactionId: z.ZodUUID;
|
|
1655
1674
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
1656
1675
|
reason: z.ZodString;
|
|
1676
|
+
performedBy: z.ZodOptional<z.ZodString>;
|
|
1657
1677
|
}, z.core.$strip>;
|
|
1658
1678
|
interface RefundTransactionInput extends z.infer<typeof refundTransactionInputSchema> {
|
|
1659
1679
|
}
|
|
@@ -1662,11 +1682,23 @@ interface RefundTransactionOutput {
|
|
|
1662
1682
|
originalTransaction: TransactionSelectType;
|
|
1663
1683
|
}
|
|
1664
1684
|
|
|
1685
|
+
declare const resolveUnmatchedTransactionInputSchema: z.ZodObject<{
|
|
1686
|
+
unmatchedTransactionId: z.ZodUUID;
|
|
1687
|
+
targetTransactionId: z.ZodUUID;
|
|
1688
|
+
note: z.ZodString;
|
|
1689
|
+
performedBy: z.ZodString;
|
|
1690
|
+
}, z.core.$strip>;
|
|
1691
|
+
interface ResolveUnmatchedTransactionInput extends z.infer<typeof resolveUnmatchedTransactionInputSchema> {
|
|
1692
|
+
}
|
|
1693
|
+
interface ResolveUnmatchedTransactionOutput extends TransactionSelectType {
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1665
1696
|
declare const updateTransactionStatusInputSchema: z.ZodObject<{
|
|
1666
1697
|
transactionId: z.ZodUUID;
|
|
1667
1698
|
status: z.ZodEnum<{
|
|
1668
1699
|
FAILED: "FAILED";
|
|
1669
1700
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1701
|
+
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1670
1702
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
1671
1703
|
MATCHED: "MATCHED";
|
|
1672
1704
|
RETURNING: "RETURNING";
|
|
@@ -1685,5 +1717,5 @@ interface UpdateTransactionStatusOutput extends TransactionSelectType {
|
|
|
1685
1717
|
|
|
1686
1718
|
declare const tables: typeof schema;
|
|
1687
1719
|
|
|
1688
|
-
export {
|
|
1689
|
-
export type {
|
|
1720
|
+
export { cancelTransactionInputSchema as a0, createAccountInputSchema as a1, createTransactionInputSchema as a2, deleteAccountInputSchema as a3, failTransactionInputSchema as a4, findAccountByIdentifierInputSchema as a5, getAccountBalanceInputSchema as a6, getAccountIdentifierInputSchema as a7, getAccountInputSchema as a8, getAccountsByOwnerInputSchema as a9, getTransactionByIdInputSchema as aa, getTransactionsByReferenceIdInputSchema as ab, getTransactionsInputSchema as ac, listAccountIdentifiersInputSchema as ad, listAccountsInputSchema as ae, matchTransactionInputSchema as af, refundTransactionInputSchema as ag, resolveUnmatchedTransactionInputSchema as ah, updateAccountInputSchema as ai, updateTransactionConfirmationSentAtInputSchema as aj, updateTransactionStatusInputSchema as ak, tables as t };
|
|
1721
|
+
export type { TransactionInsertType as $, ListAccountIdentifiersOutput as A, FindAccountByIdentifierInput as B, CreateTransactionInput as C, DeleteAccountInput as D, FindAccountByIdentifierOutput as E, FailTransactionInput as F, GetTransactionByIdInput as G, GetAccountBalanceInput as H, GetAccountBalanceOutput as I, UpdateTransactionConfirmationSentAtInput as J, UpdateTransactionConfirmationSentAtOutput as K, ListAccountsInput as L, MatchTransactionInput as M, UpdateTransactionStatusInput as N, UpdateTransactionStatusOutput as O, AccountIdentifierInsertType as P, AccountIdentifierMappingInsertType as Q, ResolveUnmatchedTransactionInput as R, AccountIdentifierMappingSelectType as S, TransactionSelectType as T, UpdateAccountInput as U, AccountIdentifierSelectType as V, AccountInsertType as W, AccountSelectType as X, AccountWithIdentifiersSelectType as Y, IncludeRelation as Z, InferResultType as _, CreateTransactionOutput as a, MatchTransactionOutput as b, ResolveUnmatchedTransactionOutput as c, FailTransactionOutput as d, CancelTransactionInput as e, CancelTransactionOutput as f, RefundTransactionInput as g, RefundTransactionOutput as h, GetTransactionByIdOutput as i, GetTransactionsByIdReferenceInput as j, GetTransactionsByReferenceIdOutput as k, GetTransactionsInput as l, GetTransactionsOutput as m, CreateAccountInput as n, CreateAccountOutput as o, UpdateAccountOutput as p, DeleteAccountOutput as q, GetAccountInput as r, GetAccountOutput as s, GetAccountsByOwnerInput as u, GetAccountsByOwnerOutput as v, ListAccountsOutput as w, GetAccountIdentifierInput as x, GetAccountIdentifierOutput as y, ListAccountIdentifiersInput as z };
|
|
@@ -59,7 +59,7 @@ const ENTRY_STATUSES = [
|
|
|
59
59
|
];
|
|
60
60
|
const TRANSACTION_STATUSES = [
|
|
61
61
|
"WAITING_FOR_PAYMENT",
|
|
62
|
-
|
|
62
|
+
"PARTIALLY_MATCHED",
|
|
63
63
|
"WAITING_FOR_MANUAL_PROCESSING",
|
|
64
64
|
"MATCHED",
|
|
65
65
|
"RETURNING",
|
|
@@ -108,7 +108,8 @@ const ALLOWED_TRANSACTION_FILTERS = {
|
|
|
108
108
|
TO: "filterTransactionDateTo",
|
|
109
109
|
DESCRIPTION: "filterTransactionDescription",
|
|
110
110
|
COMPLETED_AT: "filterTransactionCompletedAt",
|
|
111
|
-
STATUS: "filterTransactionStatus"
|
|
111
|
+
STATUS: "filterTransactionStatus",
|
|
112
|
+
STATUSES: "filterTransactionStatuses"
|
|
112
113
|
};
|
|
113
114
|
|
|
114
115
|
const cancelTransactionInputSchema = z.object({
|
|
@@ -186,8 +187,10 @@ const transactionMetadataSchema = z.object({
|
|
|
186
187
|
// ISO 8601
|
|
187
188
|
currency: z.enum(CURRENCY_CODES).optional(),
|
|
188
189
|
amount: z.number().optional(),
|
|
189
|
-
purpose: z.string().optional()
|
|
190
|
+
purpose: z.string().optional(),
|
|
190
191
|
// účel platby
|
|
192
|
+
direction: z.enum(PAYMENT_DIRECTIONS).optional(),
|
|
193
|
+
sendAsSinglePayment: z.boolean().optional()
|
|
191
194
|
}).optional()
|
|
192
195
|
});
|
|
193
196
|
const createTransactionInputSchema = z.object({
|
|
@@ -269,6 +272,7 @@ const getTransactionsInputSchema = z.object({
|
|
|
269
272
|
[ALLOWED_TRANSACTION_FILTERS.TO]: z.date().optional(),
|
|
270
273
|
[ALLOWED_TRANSACTION_FILTERS.COMPLETED_AT]: z.date().optional(),
|
|
271
274
|
[ALLOWED_TRANSACTION_FILTERS.STATUS]: z.enum(TRANSACTION_STATUSES).optional(),
|
|
275
|
+
[ALLOWED_TRANSACTION_FILTERS.STATUSES]: z.array(z.enum(TRANSACTION_STATUSES)).optional(),
|
|
272
276
|
search: z.string().optional()
|
|
273
277
|
});
|
|
274
278
|
|
|
@@ -294,6 +298,7 @@ const listAccountsInputSchema = z.object({
|
|
|
294
298
|
const matchTransactionInputSchema = z.object({
|
|
295
299
|
transactionId: z.uuid(),
|
|
296
300
|
paymentId: z.string(),
|
|
301
|
+
amount: z.number().positive().optional(),
|
|
297
302
|
completedAt: z.date().optional()
|
|
298
303
|
});
|
|
299
304
|
|
|
@@ -316,7 +321,15 @@ const updateTransactionConfirmationSentAtInputSchema = z.object({
|
|
|
316
321
|
const refundTransactionInputSchema = z.object({
|
|
317
322
|
transactionId: z.uuid(),
|
|
318
323
|
amount: z.number().positive().optional(),
|
|
319
|
-
reason: z.string().min(1)
|
|
324
|
+
reason: z.string().min(1),
|
|
325
|
+
performedBy: z.string().min(1).optional()
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
const resolveUnmatchedTransactionInputSchema = z.object({
|
|
329
|
+
unmatchedTransactionId: z.uuid(),
|
|
330
|
+
targetTransactionId: z.uuid(),
|
|
331
|
+
note: z.string().min(1),
|
|
332
|
+
performedBy: z.string().min(1)
|
|
320
333
|
});
|
|
321
334
|
|
|
322
335
|
const updateTransactionStatusInputSchema = z.object({
|
|
@@ -327,4 +340,4 @@ const updateTransactionStatusInputSchema = z.object({
|
|
|
327
340
|
completedAt: z.date().optional()
|
|
328
341
|
});
|
|
329
342
|
|
|
330
|
-
export { ACCOUNT_TYPES as A, BALANCE_STRATEGIES as B, CHARGE_BEARERS as C,
|
|
343
|
+
export { ACCOUNT_TYPES as A, BALANCE_STRATEGIES as B, CHARGE_BEARERS as C, updateAccountInputSchema as D, ENTRY_STATUSES as E, updateTransactionConfirmationSentAtInputSchema as F, updateTransactionStatusInputSchema as G, IDENTIFIER_KINDS as I, PAYMENT_DIRECTIONS as P, REFERENCE_TYPES as R, TRANSACTION_STATUSES as T, ALLOWED_TRANSACTION_FILTERS as a, ASSET_TYPES as b, BATCH_STATUSES as c, COUNTRY_CODES as d, PAYMENT_STATUSES as e, PAYMENT_TYPES as f, REFUNDABLE_TRANSACTION_STATUSES as g, TRANSACTION_TYPES as h, cancelTransactionInputSchema as i, createAccountInputSchema as j, createTransactionInputSchema as k, deleteAccountInputSchema as l, failTransactionInputSchema as m, findAccountByIdentifierInputSchema as n, getAccountBalanceInputSchema as o, getAccountIdentifierInputSchema as p, getAccountInputSchema as q, getAccountsByOwnerInputSchema as r, getTransactionByIdInputSchema as s, getTransactionsByReferenceIdInputSchema as t, getTransactionsInputSchema as u, listAccountIdentifiersInputSchema as v, listAccountsInputSchema as w, matchTransactionInputSchema as x, refundTransactionInputSchema as y, resolveUnmatchedTransactionInputSchema as z };
|
|
@@ -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.De19PrJa.mjs';
|
|
5
5
|
import '@develit-io/general-codes';
|
|
6
6
|
|
|
7
7
|
const account = sqliteTable("account", {
|
|
@@ -90,6 +90,7 @@ const transaction = sqliteTable("transaction", {
|
|
|
90
90
|
paymentId: text("payment_id"),
|
|
91
91
|
metadata: text("metadata", { mode: "json" }).$type().notNull(),
|
|
92
92
|
value: real("value"),
|
|
93
|
+
receivedValue: real("received_value"),
|
|
93
94
|
currency: text("currency").$type()
|
|
94
95
|
});
|
|
95
96
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { F as schema } from './ledger.
|
|
2
|
+
import { F as schema } from './ledger.BtCTt25C.cjs';
|
|
3
3
|
import { InferSelectModel, ExtractTablesWithRelations, DBQueryConfig, BuildQueryResult, InferInsertModel } from 'drizzle-orm';
|
|
4
4
|
|
|
5
5
|
interface TSchema extends ExtractTablesWithRelations<typeof tables> {
|
|
@@ -411,8 +411,8 @@ interface CreateAccountOutput {
|
|
|
411
411
|
declare const createTransactionInputSchema: z.ZodObject<{
|
|
412
412
|
correlationId: z.ZodString;
|
|
413
413
|
referenceType: z.ZodEnum<{
|
|
414
|
-
PAYMENT: "PAYMENT";
|
|
415
414
|
EXCHANGE: "EXCHANGE";
|
|
415
|
+
PAYMENT: "PAYMENT";
|
|
416
416
|
ORDER: "ORDER";
|
|
417
417
|
"INTERNAL-TRANSFER": "INTERNAL-TRANSFER";
|
|
418
418
|
FORWARD: "FORWARD";
|
|
@@ -420,13 +420,13 @@ declare const createTransactionInputSchema: z.ZodObject<{
|
|
|
420
420
|
}>;
|
|
421
421
|
referenceId: z.ZodOptional<z.ZodString>;
|
|
422
422
|
type: z.ZodEnum<{
|
|
423
|
-
EXCHANGE: "EXCHANGE";
|
|
424
423
|
CLIENT_FUND_IN: "CLIENT_FUND_IN";
|
|
425
424
|
CLIENT_FUND_OUT: "CLIENT_FUND_OUT";
|
|
426
425
|
PROVIDER_FUND_IN: "PROVIDER_FUND_IN";
|
|
427
426
|
PROVIDER_FUND_OUT: "PROVIDER_FUND_OUT";
|
|
428
427
|
COLLATERAL_FUND_IN: "COLLATERAL_FUND_IN";
|
|
429
428
|
COLLATERAL_FUND_OUT: "COLLATERAL_FUND_OUT";
|
|
429
|
+
EXCHANGE: "EXCHANGE";
|
|
430
430
|
UNMATCHED: "UNMATCHED";
|
|
431
431
|
ADJUSTMENT: "ADJUSTMENT";
|
|
432
432
|
TRANSFER: "TRANSFER";
|
|
@@ -1175,11 +1175,17 @@ declare const createTransactionInputSchema: z.ZodObject<{
|
|
|
1175
1175
|
}>>;
|
|
1176
1176
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
1177
1177
|
purpose: z.ZodOptional<z.ZodString>;
|
|
1178
|
+
direction: z.ZodOptional<z.ZodEnum<{
|
|
1179
|
+
INCOMING: "INCOMING";
|
|
1180
|
+
OUTGOING: "OUTGOING";
|
|
1181
|
+
}>>;
|
|
1182
|
+
sendAsSinglePayment: z.ZodOptional<z.ZodBoolean>;
|
|
1178
1183
|
}, z.core.$strip>>;
|
|
1179
1184
|
}, z.core.$strip>>>;
|
|
1180
1185
|
status: z.ZodEnum<{
|
|
1181
1186
|
FAILED: "FAILED";
|
|
1182
1187
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1188
|
+
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1183
1189
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
1184
1190
|
MATCHED: "MATCHED";
|
|
1185
1191
|
RETURNING: "RETURNING";
|
|
@@ -1380,8 +1386,8 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1380
1386
|
}, z.core.$strip>;
|
|
1381
1387
|
filterTransactionCorrelationId: z.ZodOptional<z.ZodUUID>;
|
|
1382
1388
|
filterTransactionReferenceType: z.ZodOptional<z.ZodEnum<{
|
|
1383
|
-
PAYMENT: "PAYMENT";
|
|
1384
1389
|
EXCHANGE: "EXCHANGE";
|
|
1390
|
+
PAYMENT: "PAYMENT";
|
|
1385
1391
|
ORDER: "ORDER";
|
|
1386
1392
|
"INTERNAL-TRANSFER": "INTERNAL-TRANSFER";
|
|
1387
1393
|
FORWARD: "FORWARD";
|
|
@@ -1389,13 +1395,13 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1389
1395
|
}>>;
|
|
1390
1396
|
filterTransactionReferenceId: z.ZodOptional<z.ZodUUID>;
|
|
1391
1397
|
filterTransactionType: z.ZodOptional<z.ZodEnum<{
|
|
1392
|
-
EXCHANGE: "EXCHANGE";
|
|
1393
1398
|
CLIENT_FUND_IN: "CLIENT_FUND_IN";
|
|
1394
1399
|
CLIENT_FUND_OUT: "CLIENT_FUND_OUT";
|
|
1395
1400
|
PROVIDER_FUND_IN: "PROVIDER_FUND_IN";
|
|
1396
1401
|
PROVIDER_FUND_OUT: "PROVIDER_FUND_OUT";
|
|
1397
1402
|
COLLATERAL_FUND_IN: "COLLATERAL_FUND_IN";
|
|
1398
1403
|
COLLATERAL_FUND_OUT: "COLLATERAL_FUND_OUT";
|
|
1404
|
+
EXCHANGE: "EXCHANGE";
|
|
1399
1405
|
UNMATCHED: "UNMATCHED";
|
|
1400
1406
|
ADJUSTMENT: "ADJUSTMENT";
|
|
1401
1407
|
TRANSFER: "TRANSFER";
|
|
@@ -1408,6 +1414,7 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1408
1414
|
filterTransactionStatus: z.ZodOptional<z.ZodEnum<{
|
|
1409
1415
|
FAILED: "FAILED";
|
|
1410
1416
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1417
|
+
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1411
1418
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
1412
1419
|
MATCHED: "MATCHED";
|
|
1413
1420
|
RETURNING: "RETURNING";
|
|
@@ -1415,6 +1422,17 @@ declare const getTransactionsInputSchema: z.ZodObject<{
|
|
|
1415
1422
|
CANCELLED: "CANCELLED";
|
|
1416
1423
|
SETTLED: "SETTLED";
|
|
1417
1424
|
}>>;
|
|
1425
|
+
filterTransactionStatuses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1426
|
+
FAILED: "FAILED";
|
|
1427
|
+
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1428
|
+
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1429
|
+
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
1430
|
+
MATCHED: "MATCHED";
|
|
1431
|
+
RETURNING: "RETURNING";
|
|
1432
|
+
RETURNED: "RETURNED";
|
|
1433
|
+
CANCELLED: "CANCELLED";
|
|
1434
|
+
SETTLED: "SETTLED";
|
|
1435
|
+
}>>>;
|
|
1418
1436
|
search: z.ZodOptional<z.ZodString>;
|
|
1419
1437
|
}, z.core.$strip>;
|
|
1420
1438
|
interface GetTransactionsInput extends z.input<typeof getTransactionsInputSchema> {
|
|
@@ -1426,8 +1444,8 @@ interface GetTransactionsOutput {
|
|
|
1426
1444
|
|
|
1427
1445
|
declare const getTransactionsByReferenceIdInputSchema: z.ZodObject<{
|
|
1428
1446
|
referenceType: z.ZodEnum<{
|
|
1429
|
-
PAYMENT: "PAYMENT";
|
|
1430
1447
|
EXCHANGE: "EXCHANGE";
|
|
1448
|
+
PAYMENT: "PAYMENT";
|
|
1431
1449
|
ORDER: "ORDER";
|
|
1432
1450
|
"INTERNAL-TRANSFER": "INTERNAL-TRANSFER";
|
|
1433
1451
|
FORWARD: "FORWARD";
|
|
@@ -1544,6 +1562,7 @@ interface ListAccountsOutput {
|
|
|
1544
1562
|
declare const matchTransactionInputSchema: z.ZodObject<{
|
|
1545
1563
|
transactionId: z.ZodUUID;
|
|
1546
1564
|
paymentId: z.ZodString;
|
|
1565
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
1547
1566
|
completedAt: z.ZodOptional<z.ZodDate>;
|
|
1548
1567
|
}, z.core.$strip>;
|
|
1549
1568
|
interface MatchTransactionInput extends z.infer<typeof matchTransactionInputSchema> {
|
|
@@ -1654,6 +1673,7 @@ declare const refundTransactionInputSchema: z.ZodObject<{
|
|
|
1654
1673
|
transactionId: z.ZodUUID;
|
|
1655
1674
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
1656
1675
|
reason: z.ZodString;
|
|
1676
|
+
performedBy: z.ZodOptional<z.ZodString>;
|
|
1657
1677
|
}, z.core.$strip>;
|
|
1658
1678
|
interface RefundTransactionInput extends z.infer<typeof refundTransactionInputSchema> {
|
|
1659
1679
|
}
|
|
@@ -1662,11 +1682,23 @@ interface RefundTransactionOutput {
|
|
|
1662
1682
|
originalTransaction: TransactionSelectType;
|
|
1663
1683
|
}
|
|
1664
1684
|
|
|
1685
|
+
declare const resolveUnmatchedTransactionInputSchema: z.ZodObject<{
|
|
1686
|
+
unmatchedTransactionId: z.ZodUUID;
|
|
1687
|
+
targetTransactionId: z.ZodUUID;
|
|
1688
|
+
note: z.ZodString;
|
|
1689
|
+
performedBy: z.ZodString;
|
|
1690
|
+
}, z.core.$strip>;
|
|
1691
|
+
interface ResolveUnmatchedTransactionInput extends z.infer<typeof resolveUnmatchedTransactionInputSchema> {
|
|
1692
|
+
}
|
|
1693
|
+
interface ResolveUnmatchedTransactionOutput extends TransactionSelectType {
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1665
1696
|
declare const updateTransactionStatusInputSchema: z.ZodObject<{
|
|
1666
1697
|
transactionId: z.ZodUUID;
|
|
1667
1698
|
status: z.ZodEnum<{
|
|
1668
1699
|
FAILED: "FAILED";
|
|
1669
1700
|
WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
|
|
1701
|
+
PARTIALLY_MATCHED: "PARTIALLY_MATCHED";
|
|
1670
1702
|
WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
|
|
1671
1703
|
MATCHED: "MATCHED";
|
|
1672
1704
|
RETURNING: "RETURNING";
|
|
@@ -1685,5 +1717,5 @@ interface UpdateTransactionStatusOutput extends TransactionSelectType {
|
|
|
1685
1717
|
|
|
1686
1718
|
declare const tables: typeof schema;
|
|
1687
1719
|
|
|
1688
|
-
export {
|
|
1689
|
-
export type {
|
|
1720
|
+
export { cancelTransactionInputSchema as a0, createAccountInputSchema as a1, createTransactionInputSchema as a2, deleteAccountInputSchema as a3, failTransactionInputSchema as a4, findAccountByIdentifierInputSchema as a5, getAccountBalanceInputSchema as a6, getAccountIdentifierInputSchema as a7, getAccountInputSchema as a8, getAccountsByOwnerInputSchema as a9, getTransactionByIdInputSchema as aa, getTransactionsByReferenceIdInputSchema as ab, getTransactionsInputSchema as ac, listAccountIdentifiersInputSchema as ad, listAccountsInputSchema as ae, matchTransactionInputSchema as af, refundTransactionInputSchema as ag, resolveUnmatchedTransactionInputSchema as ah, updateAccountInputSchema as ai, updateTransactionConfirmationSentAtInputSchema as aj, updateTransactionStatusInputSchema as ak, tables as t };
|
|
1721
|
+
export type { TransactionInsertType as $, ListAccountIdentifiersOutput as A, FindAccountByIdentifierInput as B, CreateTransactionInput as C, DeleteAccountInput as D, FindAccountByIdentifierOutput as E, FailTransactionInput as F, GetTransactionByIdInput as G, GetAccountBalanceInput as H, GetAccountBalanceOutput as I, UpdateTransactionConfirmationSentAtInput as J, UpdateTransactionConfirmationSentAtOutput as K, ListAccountsInput as L, MatchTransactionInput as M, UpdateTransactionStatusInput as N, UpdateTransactionStatusOutput as O, AccountIdentifierInsertType as P, AccountIdentifierMappingInsertType as Q, ResolveUnmatchedTransactionInput as R, AccountIdentifierMappingSelectType as S, TransactionSelectType as T, UpdateAccountInput as U, AccountIdentifierSelectType as V, AccountInsertType as W, AccountSelectType as X, AccountWithIdentifiersSelectType as Y, IncludeRelation as Z, InferResultType as _, CreateTransactionOutput as a, MatchTransactionOutput as b, ResolveUnmatchedTransactionOutput as c, FailTransactionOutput as d, CancelTransactionInput as e, CancelTransactionOutput as f, RefundTransactionInput as g, RefundTransactionOutput as h, GetTransactionByIdOutput as i, GetTransactionsByIdReferenceInput as j, GetTransactionsByReferenceIdOutput as k, GetTransactionsInput as l, GetTransactionsOutput as m, CreateAccountInput as n, CreateAccountOutput as o, UpdateAccountOutput as p, DeleteAccountOutput as q, GetAccountInput as r, GetAccountOutput as s, GetAccountsByOwnerInput as u, GetAccountsByOwnerOutput as v, ListAccountsOutput as w, GetAccountIdentifierInput as x, GetAccountIdentifierOutput as y, ListAccountIdentifiersInput as z };
|