@develit-services/ledger 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  const backendSdk = require('@develit-io/backend-sdk');
4
4
  const drizzleOrm = require('drizzle-orm');
5
5
  const sqliteCore = require('drizzle-orm/sqlite-core');
6
- const updateTransactionConfirmationSentAt = require('./ledger.C6xAPWKq.cjs');
6
+ const updateTransactionStatus = require('./ledger.QNHpaH-m.cjs');
7
7
  require('@develit-io/general-codes');
8
8
 
9
9
  const account = sqliteCore.sqliteTable("account", {
@@ -80,14 +80,14 @@ const transaction = sqliteCore.sqliteTable("transaction", {
80
80
  correlationId: sqliteCore.text("correlation_id").notNull(),
81
81
  // Unique ID for the transaction, used for correlation
82
82
  // Business context
83
- referenceType: sqliteCore.text("reference_type", { enum: updateTransactionConfirmationSentAt.REFERENCE_TYPES }).$type().notNull(),
83
+ referenceType: sqliteCore.text("reference_type", { enum: updateTransactionStatus.REFERENCE_TYPES }).$type().notNull(),
84
84
  referenceId: sqliteCore.text("reference_id"),
85
85
  // business transaction ID
86
- type: sqliteCore.text("type", { enum: updateTransactionConfirmationSentAt.TRANSACTION_TYPES }).$type().notNull(),
86
+ type: sqliteCore.text("type", { enum: updateTransactionStatus.TRANSACTION_TYPES }).$type().notNull(),
87
87
  description: sqliteCore.text("description"),
88
88
  completedAt: sqliteCore.integer("completed_at", { mode: "timestamp_ms" }),
89
89
  confirmationSentAt: sqliteCore.integer("confirmation_sent_at", { mode: "timestamp_ms" }),
90
- status: sqliteCore.text("status", { enum: updateTransactionConfirmationSentAt.TRANSACTION_STATUSES }).$type().notNull(),
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
93
  metadata: sqliteCore.text("metadata", { mode: "json" }).$type().notNull(),
@@ -464,16 +464,17 @@ declare const IDENTIFIER_KINDS: readonly ["IBAN", "LOCAL_CZ", "SWIFT", "CRYPTO_A
464
464
  type IdentifierKind = (typeof IDENTIFIER_KINDS)[number];
465
465
  declare const ENTRY_STATUSES: readonly ["PENDING", "REALIZED", "FAILED", "CANCELED"];
466
466
  type EntryStatus = (typeof ENTRY_STATUSES)[number];
467
- declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "WAITING_FOR_COLLATERAL", "COLLATERAL_PAID", "PAUSED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
467
+ declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
468
468
  type TransactionStatus = (typeof TRANSACTION_STATUSES)[number];
469
- declare const TRANSACTION_TYPES: readonly ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER", "COLLATERAL"];
469
+ 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"];
470
470
  type TransactionType = (typeof TRANSACTION_TYPES)[number];
471
- declare const REFERENCE_TYPES: readonly ["PAYMENT", "EXCHANGE", "ORDER", "INTERNAL-TRANSFER", "FORWARD"];
471
+ declare const REFERENCE_TYPES: readonly ["PAYMENT", "EXCHANGE", "ORDER", "INTERNAL-TRANSFER", "FORWARD", "TRANSACTION"];
472
472
  type ReferenceType = (typeof REFERENCE_TYPES)[number];
473
473
  declare const PAYMENT_CHARGE_TYPES: readonly ["SHA", "OUR", "BEN"];
474
474
  type PaymentChargeType = (typeof PAYMENT_CHARGE_TYPES)[number];
475
475
  declare const PAYMENT_TYPES: readonly ["DOMESTIC", "SEPA", "SWIFT", "UNKNOWN"];
476
476
  type PaymentType = (typeof PAYMENT_TYPES)[number];
477
+ declare const REFUNDABLE_TRANSACTION_STATUSES: readonly ["WAITING_FOR_MANUAL_PROCESSING"];
477
478
 
478
479
  type CryptoNetworkCode = (typeof CRYPTO_NETWORK_CODES)[number];
479
480
  declare const PAYMENT_STATUSES: readonly ["PREPARED", "INITIALIZED", "FAILED", "PENDING", "COMPLETED", "CREATED"];
@@ -525,6 +526,12 @@ interface TransactionMetadata {
525
526
  * Additional notes or comments about the transaction
526
527
  */
527
528
  note?: string;
529
+ /**
530
+ * Refund information when transaction type is REFUND
531
+ */
532
+ refund?: {
533
+ isPartialRefund: boolean;
534
+ };
528
535
  }
529
536
  interface EntryMetadata {
530
537
  context?: {
@@ -706,7 +713,7 @@ declare const entry: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
706
713
  tableName: "entry";
707
714
  dataType: "string";
708
715
  columnType: "SQLiteText";
709
- data: "FAILED" | "PENDING" | "REALIZED" | "CANCELED";
716
+ data: "PENDING" | "REALIZED" | "FAILED" | "CANCELED";
710
717
  driverParam: string;
711
718
  notNull: true;
712
719
  hasDefault: false;
@@ -719,7 +726,7 @@ declare const entry: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
719
726
  generated: undefined;
720
727
  }, {}, {
721
728
  length: number | undefined;
722
- $type: "FAILED" | "PENDING" | "REALIZED" | "CANCELED";
729
+ $type: "PENDING" | "REALIZED" | "FAILED" | "CANCELED";
723
730
  }>;
724
731
  isBalanced: drizzle_orm_sqlite_core.SQLiteColumn<{
725
732
  name: "is_balanced";
@@ -813,20 +820,20 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
813
820
  tableName: "transaction";
814
821
  dataType: "string";
815
822
  columnType: "SQLiteText";
816
- data: "PAYMENT" | "EXCHANGE" | "ORDER" | "INTERNAL-TRANSFER" | "FORWARD";
823
+ data: "PAYMENT" | "EXCHANGE" | "ORDER" | "INTERNAL-TRANSFER" | "FORWARD" | "TRANSACTION";
817
824
  driverParam: string;
818
825
  notNull: true;
819
826
  hasDefault: false;
820
827
  isPrimaryKey: false;
821
828
  isAutoincrement: false;
822
829
  hasRuntimeDefault: false;
823
- enumValues: ["PAYMENT", "EXCHANGE", "ORDER", "INTERNAL-TRANSFER", "FORWARD"];
830
+ enumValues: ["PAYMENT", "EXCHANGE", "ORDER", "INTERNAL-TRANSFER", "FORWARD", "TRANSACTION"];
824
831
  baseColumn: never;
825
832
  identity: undefined;
826
833
  generated: undefined;
827
834
  }, {}, {
828
835
  length: number | undefined;
829
- $type: "PAYMENT" | "EXCHANGE" | "ORDER" | "INTERNAL-TRANSFER" | "FORWARD";
836
+ $type: "PAYMENT" | "EXCHANGE" | "ORDER" | "INTERNAL-TRANSFER" | "FORWARD" | "TRANSACTION";
830
837
  }>;
831
838
  referenceId: drizzle_orm_sqlite_core.SQLiteColumn<{
832
839
  name: "reference_id";
@@ -852,20 +859,20 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
852
859
  tableName: "transaction";
853
860
  dataType: "string";
854
861
  columnType: "SQLiteText";
855
- data: "EXCHANGE" | "CLIENT_FUND_IN" | "CLIENT_FUND_OUT" | "PROVIDER_FUND_IN" | "PROVIDER_FUND_OUT" | "UNMATCHED" | "ADJUSTMENT" | "TRANSFER" | "COLLATERAL";
862
+ data: "EXCHANGE" | "CLIENT_FUND_IN" | "CLIENT_FUND_OUT" | "PROVIDER_FUND_IN" | "PROVIDER_FUND_OUT" | "COLLATERAL_FUND_IN" | "COLLATERAL_FUND_OUT" | "UNMATCHED" | "ADJUSTMENT" | "TRANSFER" | "REFUND";
856
863
  driverParam: string;
857
864
  notNull: true;
858
865
  hasDefault: false;
859
866
  isPrimaryKey: false;
860
867
  isAutoincrement: false;
861
868
  hasRuntimeDefault: false;
862
- enumValues: ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER", "COLLATERAL"];
869
+ enumValues: ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "COLLATERAL_FUND_IN", "COLLATERAL_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER", "REFUND"];
863
870
  baseColumn: never;
864
871
  identity: undefined;
865
872
  generated: undefined;
866
873
  }, {}, {
867
874
  length: number | undefined;
868
- $type: "EXCHANGE" | "CLIENT_FUND_IN" | "CLIENT_FUND_OUT" | "PROVIDER_FUND_IN" | "PROVIDER_FUND_OUT" | "UNMATCHED" | "ADJUSTMENT" | "TRANSFER" | "COLLATERAL";
875
+ $type: "EXCHANGE" | "CLIENT_FUND_IN" | "CLIENT_FUND_OUT" | "PROVIDER_FUND_IN" | "PROVIDER_FUND_OUT" | "COLLATERAL_FUND_IN" | "COLLATERAL_FUND_OUT" | "UNMATCHED" | "ADJUSTMENT" | "TRANSFER" | "REFUND";
869
876
  }>;
870
877
  description: drizzle_orm_sqlite_core.SQLiteColumn<{
871
878
  name: "description";
@@ -925,20 +932,20 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
925
932
  tableName: "transaction";
926
933
  dataType: "string";
927
934
  columnType: "SQLiteText";
928
- data: "FAILED" | "WAITING_FOR_PAYMENT" | "WAITING_FOR_COLLATERAL" | "COLLATERAL_PAID" | "PAUSED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
935
+ data: "FAILED" | "WAITING_FOR_PAYMENT" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
929
936
  driverParam: string;
930
937
  notNull: true;
931
938
  hasDefault: false;
932
939
  isPrimaryKey: false;
933
940
  isAutoincrement: false;
934
941
  hasRuntimeDefault: false;
935
- enumValues: ["WAITING_FOR_PAYMENT", "WAITING_FOR_COLLATERAL", "COLLATERAL_PAID", "PAUSED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
942
+ enumValues: ["WAITING_FOR_PAYMENT", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
936
943
  baseColumn: never;
937
944
  identity: undefined;
938
945
  generated: undefined;
939
946
  }, {}, {
940
947
  length: number | undefined;
941
- $type: "FAILED" | "WAITING_FOR_PAYMENT" | "WAITING_FOR_COLLATERAL" | "COLLATERAL_PAID" | "PAUSED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
948
+ $type: "FAILED" | "WAITING_FOR_PAYMENT" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
942
949
  }>;
943
950
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
944
951
  name: "status_reason";
@@ -1066,5 +1073,5 @@ declare namespace schema {
1066
1073
  };
1067
1074
  }
1068
1075
 
1069
- export { ACCOUNT_TYPES as A, BALANCE_STRATEGIES as B, COUNTRY_CODES as C, schema as D, ENTRY_STATUSES as E, account as F, accountIdentifier as G, accountIdentifierMapping as H, IDENTIFIER_KINDS as I, accountIdentifierMappingRelations as J, accountIdentifierRelations as K, accountRelations as L, entry as M, transaction as N, PAYMENT_CHARGE_TYPES as P, REFERENCE_TYPES as R, TRANSACTION_STATUSES as T, ASSET_TYPES as a, BATCH_STATUSES as d, PAYMENT_DIRECTIONS as o, PAYMENT_STATUSES as p, PAYMENT_TYPES as q, TRANSACTION_TYPES as w };
1070
- export type { AccountType as b, AssetType as c, BalanceStrategy as e, BankCode as f, BatchStatus as g, CountryCode as h, CryptoNetworkCode as i, Currency as j, CurrencyCode as k, EntryMetadata as l, EntryStatus as m, IdentifierKind as n, PaymentChargeType as r, PaymentDirection as s, PaymentStatus as t, PaymentType as u, ReferenceType as v, TransactionMetadata as x, TransactionStatus as y, TransactionType as z };
1076
+ export { ACCOUNT_TYPES as A, BALANCE_STRATEGIES as B, COUNTRY_CODES as C, ENTRY_STATUSES as E, schema as F, account as G, accountIdentifier as H, IDENTIFIER_KINDS as I, accountIdentifierMapping as J, accountIdentifierMappingRelations as K, accountIdentifierRelations as L, accountRelations as M, entry as N, transaction as O, PAYMENT_CHARGE_TYPES as P, REFERENCE_TYPES as R, TRANSACTION_STATUSES as T, ASSET_TYPES as a, BATCH_STATUSES as d, PAYMENT_DIRECTIONS as o, PAYMENT_STATUSES as p, PAYMENT_TYPES as q, REFUNDABLE_TRANSACTION_STATUSES as v, TRANSACTION_TYPES as x };
1077
+ export type { TransactionType as D, AccountType as b, AssetType as c, BalanceStrategy as e, BankCode as f, BatchStatus as g, CountryCode as h, CryptoNetworkCode as i, Currency as j, CurrencyCode as k, EntryMetadata as l, EntryStatus as m, IdentifierKind as n, PaymentChargeType as r, PaymentDirection as s, PaymentStatus as t, PaymentType as u, ReferenceType as w, TransactionMetadata as y, TransactionStatus as z };
@@ -464,16 +464,17 @@ declare const IDENTIFIER_KINDS: readonly ["IBAN", "LOCAL_CZ", "SWIFT", "CRYPTO_A
464
464
  type IdentifierKind = (typeof IDENTIFIER_KINDS)[number];
465
465
  declare const ENTRY_STATUSES: readonly ["PENDING", "REALIZED", "FAILED", "CANCELED"];
466
466
  type EntryStatus = (typeof ENTRY_STATUSES)[number];
467
- declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "WAITING_FOR_COLLATERAL", "COLLATERAL_PAID", "PAUSED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
467
+ declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
468
468
  type TransactionStatus = (typeof TRANSACTION_STATUSES)[number];
469
- declare const TRANSACTION_TYPES: readonly ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER", "COLLATERAL"];
469
+ 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"];
470
470
  type TransactionType = (typeof TRANSACTION_TYPES)[number];
471
- declare const REFERENCE_TYPES: readonly ["PAYMENT", "EXCHANGE", "ORDER", "INTERNAL-TRANSFER", "FORWARD"];
471
+ declare const REFERENCE_TYPES: readonly ["PAYMENT", "EXCHANGE", "ORDER", "INTERNAL-TRANSFER", "FORWARD", "TRANSACTION"];
472
472
  type ReferenceType = (typeof REFERENCE_TYPES)[number];
473
473
  declare const PAYMENT_CHARGE_TYPES: readonly ["SHA", "OUR", "BEN"];
474
474
  type PaymentChargeType = (typeof PAYMENT_CHARGE_TYPES)[number];
475
475
  declare const PAYMENT_TYPES: readonly ["DOMESTIC", "SEPA", "SWIFT", "UNKNOWN"];
476
476
  type PaymentType = (typeof PAYMENT_TYPES)[number];
477
+ declare const REFUNDABLE_TRANSACTION_STATUSES: readonly ["WAITING_FOR_MANUAL_PROCESSING"];
477
478
 
478
479
  type CryptoNetworkCode = (typeof CRYPTO_NETWORK_CODES)[number];
479
480
  declare const PAYMENT_STATUSES: readonly ["PREPARED", "INITIALIZED", "FAILED", "PENDING", "COMPLETED", "CREATED"];
@@ -525,6 +526,12 @@ interface TransactionMetadata {
525
526
  * Additional notes or comments about the transaction
526
527
  */
527
528
  note?: string;
529
+ /**
530
+ * Refund information when transaction type is REFUND
531
+ */
532
+ refund?: {
533
+ isPartialRefund: boolean;
534
+ };
528
535
  }
529
536
  interface EntryMetadata {
530
537
  context?: {
@@ -706,7 +713,7 @@ declare const entry: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
706
713
  tableName: "entry";
707
714
  dataType: "string";
708
715
  columnType: "SQLiteText";
709
- data: "FAILED" | "PENDING" | "REALIZED" | "CANCELED";
716
+ data: "PENDING" | "REALIZED" | "FAILED" | "CANCELED";
710
717
  driverParam: string;
711
718
  notNull: true;
712
719
  hasDefault: false;
@@ -719,7 +726,7 @@ declare const entry: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
719
726
  generated: undefined;
720
727
  }, {}, {
721
728
  length: number | undefined;
722
- $type: "FAILED" | "PENDING" | "REALIZED" | "CANCELED";
729
+ $type: "PENDING" | "REALIZED" | "FAILED" | "CANCELED";
723
730
  }>;
724
731
  isBalanced: drizzle_orm_sqlite_core.SQLiteColumn<{
725
732
  name: "is_balanced";
@@ -813,20 +820,20 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
813
820
  tableName: "transaction";
814
821
  dataType: "string";
815
822
  columnType: "SQLiteText";
816
- data: "PAYMENT" | "EXCHANGE" | "ORDER" | "INTERNAL-TRANSFER" | "FORWARD";
823
+ data: "PAYMENT" | "EXCHANGE" | "ORDER" | "INTERNAL-TRANSFER" | "FORWARD" | "TRANSACTION";
817
824
  driverParam: string;
818
825
  notNull: true;
819
826
  hasDefault: false;
820
827
  isPrimaryKey: false;
821
828
  isAutoincrement: false;
822
829
  hasRuntimeDefault: false;
823
- enumValues: ["PAYMENT", "EXCHANGE", "ORDER", "INTERNAL-TRANSFER", "FORWARD"];
830
+ enumValues: ["PAYMENT", "EXCHANGE", "ORDER", "INTERNAL-TRANSFER", "FORWARD", "TRANSACTION"];
824
831
  baseColumn: never;
825
832
  identity: undefined;
826
833
  generated: undefined;
827
834
  }, {}, {
828
835
  length: number | undefined;
829
- $type: "PAYMENT" | "EXCHANGE" | "ORDER" | "INTERNAL-TRANSFER" | "FORWARD";
836
+ $type: "PAYMENT" | "EXCHANGE" | "ORDER" | "INTERNAL-TRANSFER" | "FORWARD" | "TRANSACTION";
830
837
  }>;
831
838
  referenceId: drizzle_orm_sqlite_core.SQLiteColumn<{
832
839
  name: "reference_id";
@@ -852,20 +859,20 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
852
859
  tableName: "transaction";
853
860
  dataType: "string";
854
861
  columnType: "SQLiteText";
855
- data: "EXCHANGE" | "CLIENT_FUND_IN" | "CLIENT_FUND_OUT" | "PROVIDER_FUND_IN" | "PROVIDER_FUND_OUT" | "UNMATCHED" | "ADJUSTMENT" | "TRANSFER" | "COLLATERAL";
862
+ data: "EXCHANGE" | "CLIENT_FUND_IN" | "CLIENT_FUND_OUT" | "PROVIDER_FUND_IN" | "PROVIDER_FUND_OUT" | "COLLATERAL_FUND_IN" | "COLLATERAL_FUND_OUT" | "UNMATCHED" | "ADJUSTMENT" | "TRANSFER" | "REFUND";
856
863
  driverParam: string;
857
864
  notNull: true;
858
865
  hasDefault: false;
859
866
  isPrimaryKey: false;
860
867
  isAutoincrement: false;
861
868
  hasRuntimeDefault: false;
862
- enumValues: ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER", "COLLATERAL"];
869
+ enumValues: ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "COLLATERAL_FUND_IN", "COLLATERAL_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER", "REFUND"];
863
870
  baseColumn: never;
864
871
  identity: undefined;
865
872
  generated: undefined;
866
873
  }, {}, {
867
874
  length: number | undefined;
868
- $type: "EXCHANGE" | "CLIENT_FUND_IN" | "CLIENT_FUND_OUT" | "PROVIDER_FUND_IN" | "PROVIDER_FUND_OUT" | "UNMATCHED" | "ADJUSTMENT" | "TRANSFER" | "COLLATERAL";
875
+ $type: "EXCHANGE" | "CLIENT_FUND_IN" | "CLIENT_FUND_OUT" | "PROVIDER_FUND_IN" | "PROVIDER_FUND_OUT" | "COLLATERAL_FUND_IN" | "COLLATERAL_FUND_OUT" | "UNMATCHED" | "ADJUSTMENT" | "TRANSFER" | "REFUND";
869
876
  }>;
870
877
  description: drizzle_orm_sqlite_core.SQLiteColumn<{
871
878
  name: "description";
@@ -925,20 +932,20 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
925
932
  tableName: "transaction";
926
933
  dataType: "string";
927
934
  columnType: "SQLiteText";
928
- data: "FAILED" | "WAITING_FOR_PAYMENT" | "WAITING_FOR_COLLATERAL" | "COLLATERAL_PAID" | "PAUSED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
935
+ data: "FAILED" | "WAITING_FOR_PAYMENT" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
929
936
  driverParam: string;
930
937
  notNull: true;
931
938
  hasDefault: false;
932
939
  isPrimaryKey: false;
933
940
  isAutoincrement: false;
934
941
  hasRuntimeDefault: false;
935
- enumValues: ["WAITING_FOR_PAYMENT", "WAITING_FOR_COLLATERAL", "COLLATERAL_PAID", "PAUSED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
942
+ enumValues: ["WAITING_FOR_PAYMENT", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
936
943
  baseColumn: never;
937
944
  identity: undefined;
938
945
  generated: undefined;
939
946
  }, {}, {
940
947
  length: number | undefined;
941
- $type: "FAILED" | "WAITING_FOR_PAYMENT" | "WAITING_FOR_COLLATERAL" | "COLLATERAL_PAID" | "PAUSED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
948
+ $type: "FAILED" | "WAITING_FOR_PAYMENT" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
942
949
  }>;
943
950
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
944
951
  name: "status_reason";
@@ -1066,5 +1073,5 @@ declare namespace schema {
1066
1073
  };
1067
1074
  }
1068
1075
 
1069
- export { ACCOUNT_TYPES as A, BALANCE_STRATEGIES as B, COUNTRY_CODES as C, schema as D, ENTRY_STATUSES as E, account as F, accountIdentifier as G, accountIdentifierMapping as H, IDENTIFIER_KINDS as I, accountIdentifierMappingRelations as J, accountIdentifierRelations as K, accountRelations as L, entry as M, transaction as N, PAYMENT_CHARGE_TYPES as P, REFERENCE_TYPES as R, TRANSACTION_STATUSES as T, ASSET_TYPES as a, BATCH_STATUSES as d, PAYMENT_DIRECTIONS as o, PAYMENT_STATUSES as p, PAYMENT_TYPES as q, TRANSACTION_TYPES as w };
1070
- export type { AccountType as b, AssetType as c, BalanceStrategy as e, BankCode as f, BatchStatus as g, CountryCode as h, CryptoNetworkCode as i, Currency as j, CurrencyCode as k, EntryMetadata as l, EntryStatus as m, IdentifierKind as n, PaymentChargeType as r, PaymentDirection as s, PaymentStatus as t, PaymentType as u, ReferenceType as v, TransactionMetadata as x, TransactionStatus as y, TransactionType as z };
1076
+ export { ACCOUNT_TYPES as A, BALANCE_STRATEGIES as B, COUNTRY_CODES as C, ENTRY_STATUSES as E, schema as F, account as G, accountIdentifier as H, IDENTIFIER_KINDS as I, accountIdentifierMapping as J, accountIdentifierMappingRelations as K, accountIdentifierRelations as L, accountRelations as M, entry as N, transaction as O, PAYMENT_CHARGE_TYPES as P, REFERENCE_TYPES as R, TRANSACTION_STATUSES as T, ASSET_TYPES as a, BATCH_STATUSES as d, PAYMENT_DIRECTIONS as o, PAYMENT_STATUSES as p, PAYMENT_TYPES as q, REFUNDABLE_TRANSACTION_STATUSES as v, TRANSACTION_TYPES as x };
1077
+ export type { TransactionType as D, AccountType as b, AssetType as c, BalanceStrategy as e, BankCode as f, BatchStatus as g, CountryCode as h, CryptoNetworkCode as i, Currency as j, CurrencyCode as k, EntryMetadata as l, EntryStatus as m, IdentifierKind as n, PaymentChargeType as r, PaymentDirection as s, PaymentStatus as t, PaymentType as u, ReferenceType as w, TransactionMetadata as y, TransactionStatus as z };
@@ -464,16 +464,17 @@ declare const IDENTIFIER_KINDS: readonly ["IBAN", "LOCAL_CZ", "SWIFT", "CRYPTO_A
464
464
  type IdentifierKind = (typeof IDENTIFIER_KINDS)[number];
465
465
  declare const ENTRY_STATUSES: readonly ["PENDING", "REALIZED", "FAILED", "CANCELED"];
466
466
  type EntryStatus = (typeof ENTRY_STATUSES)[number];
467
- declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "WAITING_FOR_COLLATERAL", "COLLATERAL_PAID", "PAUSED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
467
+ declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
468
468
  type TransactionStatus = (typeof TRANSACTION_STATUSES)[number];
469
- declare const TRANSACTION_TYPES: readonly ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER", "COLLATERAL"];
469
+ 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"];
470
470
  type TransactionType = (typeof TRANSACTION_TYPES)[number];
471
- declare const REFERENCE_TYPES: readonly ["PAYMENT", "EXCHANGE", "ORDER", "INTERNAL-TRANSFER", "FORWARD"];
471
+ declare const REFERENCE_TYPES: readonly ["PAYMENT", "EXCHANGE", "ORDER", "INTERNAL-TRANSFER", "FORWARD", "TRANSACTION"];
472
472
  type ReferenceType = (typeof REFERENCE_TYPES)[number];
473
473
  declare const PAYMENT_CHARGE_TYPES: readonly ["SHA", "OUR", "BEN"];
474
474
  type PaymentChargeType = (typeof PAYMENT_CHARGE_TYPES)[number];
475
475
  declare const PAYMENT_TYPES: readonly ["DOMESTIC", "SEPA", "SWIFT", "UNKNOWN"];
476
476
  type PaymentType = (typeof PAYMENT_TYPES)[number];
477
+ declare const REFUNDABLE_TRANSACTION_STATUSES: readonly ["WAITING_FOR_MANUAL_PROCESSING"];
477
478
 
478
479
  type CryptoNetworkCode = (typeof CRYPTO_NETWORK_CODES)[number];
479
480
  declare const PAYMENT_STATUSES: readonly ["PREPARED", "INITIALIZED", "FAILED", "PENDING", "COMPLETED", "CREATED"];
@@ -525,6 +526,12 @@ interface TransactionMetadata {
525
526
  * Additional notes or comments about the transaction
526
527
  */
527
528
  note?: string;
529
+ /**
530
+ * Refund information when transaction type is REFUND
531
+ */
532
+ refund?: {
533
+ isPartialRefund: boolean;
534
+ };
528
535
  }
529
536
  interface EntryMetadata {
530
537
  context?: {
@@ -706,7 +713,7 @@ declare const entry: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
706
713
  tableName: "entry";
707
714
  dataType: "string";
708
715
  columnType: "SQLiteText";
709
- data: "FAILED" | "PENDING" | "REALIZED" | "CANCELED";
716
+ data: "PENDING" | "REALIZED" | "FAILED" | "CANCELED";
710
717
  driverParam: string;
711
718
  notNull: true;
712
719
  hasDefault: false;
@@ -719,7 +726,7 @@ declare const entry: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
719
726
  generated: undefined;
720
727
  }, {}, {
721
728
  length: number | undefined;
722
- $type: "FAILED" | "PENDING" | "REALIZED" | "CANCELED";
729
+ $type: "PENDING" | "REALIZED" | "FAILED" | "CANCELED";
723
730
  }>;
724
731
  isBalanced: drizzle_orm_sqlite_core.SQLiteColumn<{
725
732
  name: "is_balanced";
@@ -813,20 +820,20 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
813
820
  tableName: "transaction";
814
821
  dataType: "string";
815
822
  columnType: "SQLiteText";
816
- data: "PAYMENT" | "EXCHANGE" | "ORDER" | "INTERNAL-TRANSFER" | "FORWARD";
823
+ data: "PAYMENT" | "EXCHANGE" | "ORDER" | "INTERNAL-TRANSFER" | "FORWARD" | "TRANSACTION";
817
824
  driverParam: string;
818
825
  notNull: true;
819
826
  hasDefault: false;
820
827
  isPrimaryKey: false;
821
828
  isAutoincrement: false;
822
829
  hasRuntimeDefault: false;
823
- enumValues: ["PAYMENT", "EXCHANGE", "ORDER", "INTERNAL-TRANSFER", "FORWARD"];
830
+ enumValues: ["PAYMENT", "EXCHANGE", "ORDER", "INTERNAL-TRANSFER", "FORWARD", "TRANSACTION"];
824
831
  baseColumn: never;
825
832
  identity: undefined;
826
833
  generated: undefined;
827
834
  }, {}, {
828
835
  length: number | undefined;
829
- $type: "PAYMENT" | "EXCHANGE" | "ORDER" | "INTERNAL-TRANSFER" | "FORWARD";
836
+ $type: "PAYMENT" | "EXCHANGE" | "ORDER" | "INTERNAL-TRANSFER" | "FORWARD" | "TRANSACTION";
830
837
  }>;
831
838
  referenceId: drizzle_orm_sqlite_core.SQLiteColumn<{
832
839
  name: "reference_id";
@@ -852,20 +859,20 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
852
859
  tableName: "transaction";
853
860
  dataType: "string";
854
861
  columnType: "SQLiteText";
855
- data: "EXCHANGE" | "CLIENT_FUND_IN" | "CLIENT_FUND_OUT" | "PROVIDER_FUND_IN" | "PROVIDER_FUND_OUT" | "UNMATCHED" | "ADJUSTMENT" | "TRANSFER" | "COLLATERAL";
862
+ data: "EXCHANGE" | "CLIENT_FUND_IN" | "CLIENT_FUND_OUT" | "PROVIDER_FUND_IN" | "PROVIDER_FUND_OUT" | "COLLATERAL_FUND_IN" | "COLLATERAL_FUND_OUT" | "UNMATCHED" | "ADJUSTMENT" | "TRANSFER" | "REFUND";
856
863
  driverParam: string;
857
864
  notNull: true;
858
865
  hasDefault: false;
859
866
  isPrimaryKey: false;
860
867
  isAutoincrement: false;
861
868
  hasRuntimeDefault: false;
862
- enumValues: ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER", "COLLATERAL"];
869
+ enumValues: ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "COLLATERAL_FUND_IN", "COLLATERAL_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER", "REFUND"];
863
870
  baseColumn: never;
864
871
  identity: undefined;
865
872
  generated: undefined;
866
873
  }, {}, {
867
874
  length: number | undefined;
868
- $type: "EXCHANGE" | "CLIENT_FUND_IN" | "CLIENT_FUND_OUT" | "PROVIDER_FUND_IN" | "PROVIDER_FUND_OUT" | "UNMATCHED" | "ADJUSTMENT" | "TRANSFER" | "COLLATERAL";
875
+ $type: "EXCHANGE" | "CLIENT_FUND_IN" | "CLIENT_FUND_OUT" | "PROVIDER_FUND_IN" | "PROVIDER_FUND_OUT" | "COLLATERAL_FUND_IN" | "COLLATERAL_FUND_OUT" | "UNMATCHED" | "ADJUSTMENT" | "TRANSFER" | "REFUND";
869
876
  }>;
870
877
  description: drizzle_orm_sqlite_core.SQLiteColumn<{
871
878
  name: "description";
@@ -925,20 +932,20 @@ declare const transaction: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
925
932
  tableName: "transaction";
926
933
  dataType: "string";
927
934
  columnType: "SQLiteText";
928
- data: "FAILED" | "WAITING_FOR_PAYMENT" | "WAITING_FOR_COLLATERAL" | "COLLATERAL_PAID" | "PAUSED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
935
+ data: "FAILED" | "WAITING_FOR_PAYMENT" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
929
936
  driverParam: string;
930
937
  notNull: true;
931
938
  hasDefault: false;
932
939
  isPrimaryKey: false;
933
940
  isAutoincrement: false;
934
941
  hasRuntimeDefault: false;
935
- enumValues: ["WAITING_FOR_PAYMENT", "WAITING_FOR_COLLATERAL", "COLLATERAL_PAID", "PAUSED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
942
+ enumValues: ["WAITING_FOR_PAYMENT", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "SETTLED"];
936
943
  baseColumn: never;
937
944
  identity: undefined;
938
945
  generated: undefined;
939
946
  }, {}, {
940
947
  length: number | undefined;
941
- $type: "FAILED" | "WAITING_FOR_PAYMENT" | "WAITING_FOR_COLLATERAL" | "COLLATERAL_PAID" | "PAUSED" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
948
+ $type: "FAILED" | "WAITING_FOR_PAYMENT" | "WAITING_FOR_MANUAL_PROCESSING" | "MATCHED" | "RETURNING" | "RETURNED" | "CANCELLED" | "SETTLED";
942
949
  }>;
943
950
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
944
951
  name: "status_reason";
@@ -1066,5 +1073,5 @@ declare namespace schema {
1066
1073
  };
1067
1074
  }
1068
1075
 
1069
- export { ACCOUNT_TYPES as A, BALANCE_STRATEGIES as B, COUNTRY_CODES as C, schema as D, ENTRY_STATUSES as E, account as F, accountIdentifier as G, accountIdentifierMapping as H, IDENTIFIER_KINDS as I, accountIdentifierMappingRelations as J, accountIdentifierRelations as K, accountRelations as L, entry as M, transaction as N, PAYMENT_CHARGE_TYPES as P, REFERENCE_TYPES as R, TRANSACTION_STATUSES as T, ASSET_TYPES as a, BATCH_STATUSES as d, PAYMENT_DIRECTIONS as o, PAYMENT_STATUSES as p, PAYMENT_TYPES as q, TRANSACTION_TYPES as w };
1070
- export type { AccountType as b, AssetType as c, BalanceStrategy as e, BankCode as f, BatchStatus as g, CountryCode as h, CryptoNetworkCode as i, Currency as j, CurrencyCode as k, EntryMetadata as l, EntryStatus as m, IdentifierKind as n, PaymentChargeType as r, PaymentDirection as s, PaymentStatus as t, PaymentType as u, ReferenceType as v, TransactionMetadata as x, TransactionStatus as y, TransactionType as z };
1076
+ export { ACCOUNT_TYPES as A, BALANCE_STRATEGIES as B, COUNTRY_CODES as C, ENTRY_STATUSES as E, schema as F, account as G, accountIdentifier as H, IDENTIFIER_KINDS as I, accountIdentifierMapping as J, accountIdentifierMappingRelations as K, accountIdentifierRelations as L, accountRelations as M, entry as N, transaction as O, PAYMENT_CHARGE_TYPES as P, REFERENCE_TYPES as R, TRANSACTION_STATUSES as T, ASSET_TYPES as a, BATCH_STATUSES as d, PAYMENT_DIRECTIONS as o, PAYMENT_STATUSES as p, PAYMENT_TYPES as q, REFUNDABLE_TRANSACTION_STATUSES as v, TRANSACTION_TYPES as x };
1077
+ export type { TransactionType as D, AccountType as b, AssetType as c, BalanceStrategy as e, BankCode as f, BatchStatus as g, CountryCode as h, CryptoNetworkCode as i, Currency as j, CurrencyCode as k, EntryMetadata as l, EntryStatus as m, IdentifierKind as n, PaymentChargeType as r, PaymentDirection as s, PaymentStatus as t, PaymentType as u, ReferenceType as w, TransactionMetadata as y, TransactionStatus as z };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { D as schema } from './ledger.Ci2NnLFo.mjs';
2
+ import { F as schema } from './ledger.aRF1eJOD.mjs';
3
3
  import { InferSelectModel, ExtractTablesWithRelations, DBQueryConfig, BuildQueryResult, InferInsertModel } from 'drizzle-orm';
4
4
 
5
5
  interface TSchema extends ExtractTablesWithRelations<typeof tables> {
@@ -415,6 +415,7 @@ declare const createTransactionInputSchema: z.ZodObject<{
415
415
  ORDER: "ORDER";
416
416
  "INTERNAL-TRANSFER": "INTERNAL-TRANSFER";
417
417
  FORWARD: "FORWARD";
418
+ TRANSACTION: "TRANSACTION";
418
419
  }>;
419
420
  referenceId: z.ZodOptional<z.ZodString>;
420
421
  type: z.ZodEnum<{
@@ -423,10 +424,12 @@ declare const createTransactionInputSchema: z.ZodObject<{
423
424
  CLIENT_FUND_OUT: "CLIENT_FUND_OUT";
424
425
  PROVIDER_FUND_IN: "PROVIDER_FUND_IN";
425
426
  PROVIDER_FUND_OUT: "PROVIDER_FUND_OUT";
427
+ COLLATERAL_FUND_IN: "COLLATERAL_FUND_IN";
428
+ COLLATERAL_FUND_OUT: "COLLATERAL_FUND_OUT";
426
429
  UNMATCHED: "UNMATCHED";
427
430
  ADJUSTMENT: "ADJUSTMENT";
428
431
  TRANSFER: "TRANSFER";
429
- COLLATERAL: "COLLATERAL";
432
+ REFUND: "REFUND";
430
433
  }>;
431
434
  description: z.ZodOptional<z.ZodString>;
432
435
  paymentId: z.ZodOptional<z.ZodString>;
@@ -1174,9 +1177,6 @@ declare const createTransactionInputSchema: z.ZodObject<{
1174
1177
  status: z.ZodEnum<{
1175
1178
  FAILED: "FAILED";
1176
1179
  WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
1177
- WAITING_FOR_COLLATERAL: "WAITING_FOR_COLLATERAL";
1178
- COLLATERAL_PAID: "COLLATERAL_PAID";
1179
- PAUSED: "PAUSED";
1180
1180
  WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
1181
1181
  MATCHED: "MATCHED";
1182
1182
  RETURNING: "RETURNING";
@@ -1382,6 +1382,7 @@ declare const getTransactionsInputSchema: z.ZodObject<{
1382
1382
  ORDER: "ORDER";
1383
1383
  "INTERNAL-TRANSFER": "INTERNAL-TRANSFER";
1384
1384
  FORWARD: "FORWARD";
1385
+ TRANSACTION: "TRANSACTION";
1385
1386
  }>>;
1386
1387
  filterTransactionReferenceId: z.ZodOptional<z.ZodUUID>;
1387
1388
  filterTransactionType: z.ZodOptional<z.ZodEnum<{
@@ -1390,10 +1391,12 @@ declare const getTransactionsInputSchema: z.ZodObject<{
1390
1391
  CLIENT_FUND_OUT: "CLIENT_FUND_OUT";
1391
1392
  PROVIDER_FUND_IN: "PROVIDER_FUND_IN";
1392
1393
  PROVIDER_FUND_OUT: "PROVIDER_FUND_OUT";
1394
+ COLLATERAL_FUND_IN: "COLLATERAL_FUND_IN";
1395
+ COLLATERAL_FUND_OUT: "COLLATERAL_FUND_OUT";
1393
1396
  UNMATCHED: "UNMATCHED";
1394
1397
  ADJUSTMENT: "ADJUSTMENT";
1395
1398
  TRANSFER: "TRANSFER";
1396
- COLLATERAL: "COLLATERAL";
1399
+ REFUND: "REFUND";
1397
1400
  }>>;
1398
1401
  filterTransactionDescription: z.ZodOptional<z.ZodString>;
1399
1402
  filterTransactionDateFrom: z.ZodOptional<z.ZodDate>;
@@ -1402,9 +1405,6 @@ declare const getTransactionsInputSchema: z.ZodObject<{
1402
1405
  filterTransactionStatus: z.ZodOptional<z.ZodEnum<{
1403
1406
  FAILED: "FAILED";
1404
1407
  WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
1405
- WAITING_FOR_COLLATERAL: "WAITING_FOR_COLLATERAL";
1406
- COLLATERAL_PAID: "COLLATERAL_PAID";
1407
- PAUSED: "PAUSED";
1408
1408
  WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
1409
1409
  MATCHED: "MATCHED";
1410
1410
  RETURNING: "RETURNING";
@@ -1428,6 +1428,7 @@ declare const getTransactionsByReferenceIdInputSchema: z.ZodObject<{
1428
1428
  ORDER: "ORDER";
1429
1429
  "INTERNAL-TRANSFER": "INTERNAL-TRANSFER";
1430
1430
  FORWARD: "FORWARD";
1431
+ TRANSACTION: "TRANSACTION";
1431
1432
  }>;
1432
1433
  referenceId: z.ZodUUID;
1433
1434
  }, z.core.$strip>;
@@ -1646,7 +1647,40 @@ interface UpdateTransactionConfirmationSentAtInput extends z.input<typeof update
1646
1647
  }
1647
1648
  type UpdateTransactionConfirmationSentAtOutput = void;
1648
1649
 
1650
+ declare const refundTransactionInputSchema: z.ZodObject<{
1651
+ transactionId: z.ZodUUID;
1652
+ amount: z.ZodOptional<z.ZodNumber>;
1653
+ reason: z.ZodString;
1654
+ }, z.core.$strip>;
1655
+ interface RefundTransactionInput extends z.infer<typeof refundTransactionInputSchema> {
1656
+ }
1657
+ interface RefundTransactionOutput {
1658
+ refundTransaction: TransactionSelectType;
1659
+ originalTransaction: TransactionSelectType;
1660
+ }
1661
+
1662
+ declare const updateTransactionStatusInputSchema: z.ZodObject<{
1663
+ transactionId: z.ZodUUID;
1664
+ status: z.ZodEnum<{
1665
+ FAILED: "FAILED";
1666
+ WAITING_FOR_PAYMENT: "WAITING_FOR_PAYMENT";
1667
+ WAITING_FOR_MANUAL_PROCESSING: "WAITING_FOR_MANUAL_PROCESSING";
1668
+ MATCHED: "MATCHED";
1669
+ RETURNING: "RETURNING";
1670
+ RETURNED: "RETURNED";
1671
+ CANCELLED: "CANCELLED";
1672
+ SETTLED: "SETTLED";
1673
+ }>;
1674
+ statusReason: z.ZodOptional<z.ZodString>;
1675
+ paymentId: z.ZodOptional<z.ZodString>;
1676
+ completedAt: z.ZodOptional<z.ZodDate>;
1677
+ }, z.core.$strip>;
1678
+ interface UpdateTransactionStatusInput extends z.infer<typeof updateTransactionStatusInputSchema> {
1679
+ }
1680
+ interface UpdateTransactionStatusOutput extends TransactionSelectType {
1681
+ }
1682
+
1649
1683
  declare const tables: typeof schema;
1650
1684
 
1651
- export { findAccountByIdentifierInputSchema as $, cancelTransactionInputSchema as W, createAccountInputSchema as X, createTransactionInputSchema as Y, deleteAccountInputSchema as Z, failTransactionInputSchema as _, getAccountBalanceInputSchema as a0, getAccountIdentifierInputSchema as a1, getAccountInputSchema as a2, getAccountsByOwnerInputSchema as a3, getTransactionByIdInputSchema as a4, getTransactionsByReferenceIdInputSchema as a5, getTransactionsInputSchema as a6, listAccountIdentifiersInputSchema as a7, listAccountsInputSchema as a8, matchTransactionInputSchema as a9, updateAccountInputSchema as aa, updateTransactionConfirmationSentAtInputSchema as ab, tables as t };
1652
- export type { GetAccountBalanceInput as A, GetAccountBalanceOutput as B, CreateTransactionInput as C, DeleteAccountInput as D, UpdateTransactionConfirmationSentAtInput as E, FailTransactionInput as F, GetTransactionByIdInput as G, UpdateTransactionConfirmationSentAtOutput as H, AccountIdentifierInsertType as I, AccountIdentifierMappingInsertType as J, AccountIdentifierMappingSelectType as K, ListAccountsInput as L, MatchTransactionInput as M, AccountIdentifierSelectType as N, AccountInsertType as O, AccountSelectType as P, AccountWithIdentifiersSelectType as Q, IncludeRelation as R, InferResultType as S, TransactionSelectType as T, UpdateAccountInput as U, TransactionInsertType as V, CreateTransactionOutput as a, MatchTransactionOutput as b, FailTransactionOutput as c, CancelTransactionInput as d, CancelTransactionOutput as e, GetTransactionByIdOutput as f, GetTransactionsByIdReferenceInput as g, GetTransactionsByReferenceIdOutput as h, GetTransactionsInput as i, GetTransactionsOutput as j, CreateAccountInput as k, CreateAccountOutput as l, UpdateAccountOutput as m, DeleteAccountOutput as n, GetAccountInput as o, GetAccountOutput as p, GetAccountsByOwnerInput as q, GetAccountsByOwnerOutput as r, ListAccountsOutput as s, GetAccountIdentifierInput as u, GetAccountIdentifierOutput as v, ListAccountIdentifiersInput as w, ListAccountIdentifiersOutput as x, FindAccountByIdentifierInput as y, FindAccountByIdentifierOutput as z };
1685
+ export { createAccountInputSchema as $, cancelTransactionInputSchema as _, createTransactionInputSchema as a0, deleteAccountInputSchema as a1, failTransactionInputSchema as a2, findAccountByIdentifierInputSchema as a3, getAccountBalanceInputSchema as a4, getAccountIdentifierInputSchema as a5, getAccountInputSchema as a6, getAccountsByOwnerInputSchema as a7, getTransactionByIdInputSchema as a8, getTransactionsByReferenceIdInputSchema as a9, getTransactionsInputSchema as aa, listAccountIdentifiersInputSchema as ab, listAccountsInputSchema as ac, matchTransactionInputSchema as ad, refundTransactionInputSchema as ae, updateAccountInputSchema as af, updateTransactionConfirmationSentAtInputSchema as ag, updateTransactionStatusInputSchema as ah, tables as t };
1686
+ export type { FindAccountByIdentifierOutput as A, GetAccountBalanceInput as B, CreateTransactionInput as C, DeleteAccountInput as D, GetAccountBalanceOutput as E, FailTransactionInput as F, GetTransactionByIdInput as G, UpdateTransactionConfirmationSentAtInput as H, UpdateTransactionConfirmationSentAtOutput as I, UpdateTransactionStatusInput as J, UpdateTransactionStatusOutput as K, ListAccountsInput as L, MatchTransactionInput as M, AccountIdentifierInsertType as N, AccountIdentifierMappingInsertType as O, AccountIdentifierMappingSelectType as P, AccountIdentifierSelectType as Q, RefundTransactionInput as R, AccountInsertType as S, TransactionSelectType as T, UpdateAccountInput as U, AccountSelectType as V, AccountWithIdentifiersSelectType as W, IncludeRelation as X, InferResultType as Y, TransactionInsertType as Z, CreateTransactionOutput as a, MatchTransactionOutput as b, FailTransactionOutput as c, CancelTransactionInput as d, CancelTransactionOutput as e, RefundTransactionOutput as f, GetTransactionByIdOutput as g, GetTransactionsByIdReferenceInput as h, GetTransactionsByReferenceIdOutput as i, GetTransactionsInput as j, GetTransactionsOutput as k, CreateAccountInput as l, CreateAccountOutput as m, UpdateAccountOutput as n, DeleteAccountOutput as o, GetAccountInput as p, GetAccountOutput as q, GetAccountsByOwnerInput as r, GetAccountsByOwnerOutput as s, ListAccountsOutput as u, GetAccountIdentifierInput as v, GetAccountIdentifierOutput as w, ListAccountIdentifiersInput as x, ListAccountIdentifiersOutput as y, FindAccountByIdentifierInput as z };