@develit-services/bank 0.7.7 → 0.7.9

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.
@@ -2,9 +2,248 @@ import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
2
2
  import * as drizzle_orm from 'drizzle-orm';
3
3
  import { InferInsertModel, InferSelectModel } from 'drizzle-orm';
4
4
  import { BankAccountMetadata } from '@develit-io/backend-sdk';
5
+ import { CURRENCY_CODES, BANK_CODES, CODES } from '@develit-io/general-codes';
5
6
  import * as drizzle_zod from 'drizzle-zod';
6
7
  import { z } from 'zod';
7
- import { CURRENCY_CODES, BANK_CODES, CODES } from '@develit-io/general-codes';
8
+
9
+ interface BankAccountWithLastSync extends ConnectedAccount {
10
+ lastSyncedAt: Date;
11
+ }
12
+ declare const CONNECTOR_KEYS: readonly ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK", "KB", "CSOB"];
13
+ type ConnectorKey = (typeof CONNECTOR_KEYS)[number];
14
+ declare const CREDENTIALS_TYPES: readonly ["AUTH_TOKEN", "REFRESH_TOKEN", "CLIENT_ID", "API_KEY"];
15
+ type CredentialsType = (typeof CREDENTIALS_TYPES)[number];
16
+ declare const TOKEN_TYPES: readonly ["ACCOUNT_AUTHORIZATION"];
17
+ type TokenType = (typeof TOKEN_TYPES)[number];
18
+ interface ConfigEnvironmentBank {
19
+ allowedProviders: ConnectorKey[];
20
+ }
21
+ interface LastSyncMetadata {
22
+ payments: number;
23
+ paymentsToProcess: number;
24
+ paymentsInserted: number;
25
+ lastSyncPayments: number;
26
+ lastSyncBankRefIds: string[];
27
+ eventsEmitted: number;
28
+ }
29
+
30
+ declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "DOMESTIC", "UNKNOWN"];
31
+ type PaymentType = (typeof PAYMENT_TYPES)[number];
32
+ declare const CHARGE_BEARERS: readonly ["SHA", "OUR", "BEN"];
33
+ type ChargeBearer = (typeof CHARGE_BEARERS)[number];
34
+ declare const INSTRUCTION_PRIORITIES: readonly ["NORM", "HIGH", "INST"];
35
+ type InstructionPriority = (typeof INSTRUCTION_PRIORITIES)[number];
36
+ declare const PAYMENT_STATUSES: readonly ["PREPARED", "FAILED", "PENDING", "COMPLETED", "CREATED"];
37
+ type PaymentStatus = (typeof PAYMENT_STATUSES)[number];
38
+ declare const PAYMENT_DIRECTIONS: readonly ["INCOMING", "OUTGOING"];
39
+ type PaymentDirection = (typeof PAYMENT_DIRECTIONS)[number];
40
+
41
+ type CurrencyCode = (typeof CURRENCY_CODES)[number];
42
+ /**
43
+ * Batch status constants
44
+ */
45
+ declare const BATCH_STATUSES: readonly ["OPEN", "PROCESSING", "READY_TO_SIGN", "SIGNED", "SIGNATURE_FAILED", "FAILED"];
46
+ /**
47
+ * Type definition for batch status
48
+ */
49
+ type BatchStatus = (typeof BATCH_STATUSES)[number];
50
+ declare const ACCOUNT_STATUSES: readonly ["AUTHORIZED", "DISABLED", "EXPIRED"];
51
+ /**
52
+ * Type definition for account status
53
+ */
54
+ type AccountStatus = (typeof ACCOUNT_STATUSES)[number];
55
+ type Currency = CODES.Currency;
56
+
57
+ type BankCode = (typeof BANK_CODES)[number];
58
+ declare const COUNTRY_CODES: ["AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "US" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW", ...("AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "US" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW")[]];
59
+ type CountryCode = (typeof COUNTRY_CODES)[number];
60
+
61
+ type WithStatus<T extends {
62
+ status: PaymentStatus;
63
+ }, S extends PaymentStatus> = Omit<T, 'status'> & {
64
+ status: S;
65
+ };
66
+ type PaymentFailedInsertType = WithStatus<PaymentInsertType, 'FAILED'>;
67
+ /**
68
+ * @deprecated Use PreparedPayment from '~/types/payment-lifecycle' instead
69
+ */
70
+ type PaymentPreparedInsertType = PreparedPayment;
71
+ /**
72
+ * Initiated single payment response from connector
73
+ */
74
+ type InitiatedPayment = {
75
+ authorizationUrl: string;
76
+ payment: PreparedPayment;
77
+ };
78
+ type ResolvedCredentials = {
79
+ value: string;
80
+ expiresAt: Date;
81
+ };
82
+ type CredentialsResolver = (entityId: string) => Promise<ResolvedCredentials | undefined>;
83
+ type ConnectedAccount = {
84
+ id: string;
85
+ iban: string;
86
+ currency: CurrencyCode;
87
+ connectorKey: ConnectorKey;
88
+ bankRefId?: string;
89
+ };
90
+ declare abstract class IBankConnector {
91
+ /** Unique identifier for this bank connector (e.g., 'ERSTE', 'FINBRICKS', 'MOCK') */
92
+ abstract connectorKey: ConnectorKey;
93
+ /** List of bank accounts connected through this connector instance */
94
+ abstract connectedAccounts: ConnectedAccount[];
95
+ /** Optional resolver for loading credentials on demand */
96
+ protected resolveCredentials?: CredentialsResolver;
97
+ /**
98
+ * Checks if this connector supports batch processing for a given payment type.
99
+ * When batch is not supported, batch methods will fall back to initiating
100
+ * individual payments and returning multiple authorization URLs.
101
+ * @param paymentType - Type of payment (DOMESTIC, SEPA, SWIFT)
102
+ * @returns true if native batch API is supported, false if fallback to single payments is needed
103
+ */
104
+ abstract supportsBatch(paymentType: PaymentType): boolean;
105
+ /**
106
+ * Generates authorization URI for connecting a new bank account.
107
+ * @param ott - One-time token used to identify the authorization flow
108
+ * @returns Authorization URL that redirects user to bank's consent page
109
+ */
110
+ abstract getAuthUri({ ott }: {
111
+ ott: string;
112
+ }): Promise<string>;
113
+ /**
114
+ * Completes account authorization after user consent at the bank.
115
+ * Exchanges authorization code for access tokens and retrieves account details.
116
+ * @param urlParams - URL parameters returned from bank's redirect (contains authorization code and ott)
117
+ * @returns Credentials (access/refresh tokens) and account information
118
+ */
119
+ abstract authorizeAccount({ urlParams }: {
120
+ urlParams: string;
121
+ }): Promise<{
122
+ credentials: AccountCredentialsInsertType[];
123
+ accounts: AccountInsertType[];
124
+ }>;
125
+ /**
126
+ * @deprecated Use initiateDomesticBatch, initiateSEPABatch, or initiateForeignBatch instead.
127
+ * Delegates to initiateDomesticBatch for backward compatibility.
128
+ */
129
+ initiateBatch(args: {
130
+ batchId: string;
131
+ payments: BatchedPayment[];
132
+ }): Promise<InitiatedBatch>;
133
+ /**
134
+ * @deprecated Use initiateDomesticPayment instead.
135
+ * Delegates to initiateDomesticPayment for backward compatibility.
136
+ */
137
+ initiateSinglePayment(payment: BatchedPayment): Promise<InitiatedPayment>;
138
+ /**
139
+ * Initiates a single domestic payment.
140
+ * @param payment - Payment details in batched format
141
+ * @returns Initiated payment with authorization URL and prepared payment data
142
+ */
143
+ abstract initiateDomesticPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
144
+ /**
145
+ * Initiates a single SEPA payment.
146
+ * @param payment - Payment details in batched format
147
+ * @returns Initiated payment with authorization URL and prepared payment data
148
+ */
149
+ abstract initiateSEPAPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
150
+ /**
151
+ * Initiates a single foreign (SWIFT) payment.
152
+ * @param payment - Payment details in batched format
153
+ * @returns Initiated payment with authorization URL and prepared payment data
154
+ */
155
+ abstract initiateForeignPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
156
+ /**
157
+ * Initiates a batch of domestic payments with the bank.
158
+ * Falls back to single payments if batch not supported.
159
+ * @param batchId - Unique identifier for the batch
160
+ * @param payments - Array of domestic payments to include in the batch
161
+ * @returns Batch initiation result with authorization URLs and prepared payments
162
+ */
163
+ initiateDomesticBatch({ batchId, payments, }: {
164
+ batchId: string;
165
+ payments: BatchedPayment[];
166
+ }): Promise<InitiatedBatch>;
167
+ /**
168
+ * Initiates a batch of SEPA payments with the bank.
169
+ * Falls back to single payments if batch not supported.
170
+ * @param batchId - Unique identifier for the batch
171
+ * @param payments - Array of SEPA payments to include in the batch
172
+ * @returns Batch initiation result with authorization URLs and prepared payments
173
+ */
174
+ initiateSEPABatch({ batchId, payments, }: {
175
+ batchId: string;
176
+ payments: BatchedPayment[];
177
+ }): Promise<InitiatedBatch>;
178
+ /**
179
+ * Initiates a batch of foreign (SWIFT) payments with the bank.
180
+ * Falls back to single payments if batch not supported.
181
+ * @param batchId - Unique identifier for the batch
182
+ * @param payments - Array of foreign payments to include in the batch
183
+ * @returns Batch initiation result with authorization URLs and prepared payments
184
+ */
185
+ initiateForeignBatch({ batchId, payments, }: {
186
+ batchId: string;
187
+ payments: BatchedPayment[];
188
+ }): Promise<InitiatedBatch>;
189
+ /**
190
+ * Native batch implementation for domestic payments.
191
+ * Must be implemented by connector if it supports domestic batch.
192
+ */
193
+ protected abstract initiateDomesticBatchImpl(args: {
194
+ batchId: string;
195
+ payments: BatchedPayment[];
196
+ }): Promise<InitiatedBatch>;
197
+ /**
198
+ * Native batch implementation for SEPA payments.
199
+ * Must be implemented by connector if it supports SEPA batch.
200
+ */
201
+ protected abstract initiateSEPABatchImpl(args: {
202
+ batchId: string;
203
+ payments: BatchedPayment[];
204
+ }): Promise<InitiatedBatch>;
205
+ /**
206
+ * Native batch implementation for foreign (SWIFT) payments.
207
+ * Must be implemented by connector if it supports foreign batch.
208
+ */
209
+ protected abstract initiateForeignBatchImpl(args: {
210
+ batchId: string;
211
+ payments: BatchedPayment[];
212
+ }): Promise<InitiatedBatch>;
213
+ /**
214
+ * Fetches all payments (transactions) for a given account within a date range.
215
+ * Used for synchronizing account transaction history.
216
+ * @param account - Bank account to fetch payments for
217
+ * @param filter - Date range filter (dateFrom is required, dateTo is optional)
218
+ * @returns Array of parsed bank payments (both incoming and outgoing)
219
+ */
220
+ abstract getAllAccountPayments({ account, filter, }: {
221
+ account: AccountSelectType;
222
+ filter: {
223
+ dateFrom: Date;
224
+ dateTo?: Date;
225
+ };
226
+ }): Promise<ParsedBankPayment[]>;
227
+ /**
228
+ * Retrieves current status of a payment from the bank.
229
+ * @param paymentId - Bank's payment identifier
230
+ * @returns Current payment status (PREPARED, COMPLETED, FAILED, etc.)
231
+ */
232
+ abstract getPaymentStatus({ paymentId, }: {
233
+ paymentId: string;
234
+ }): Promise<PaymentStatus>;
235
+ /**
236
+ * Retrieves current status of a batch from the bank.
237
+ * @param batchId - Bank's batch identifier
238
+ * @returns Batch status and raw API response for debugging
239
+ */
240
+ abstract getBatchStatus({ batchId, }: {
241
+ batchId: string;
242
+ }): Promise<{
243
+ status: BatchStatus;
244
+ apiResponse: object;
245
+ }>;
246
+ }
8
247
 
9
248
  declare const accountCredentialsInsertSchema: drizzle_zod.BuildSchema<"insert", {
10
249
  accountId: drizzle_orm_sqlite_core.SQLiteColumn<{
@@ -31,20 +270,20 @@ declare const accountCredentialsInsertSchema: drizzle_zod.BuildSchema<"insert",
31
270
  tableName: "account_credentials";
32
271
  dataType: "string";
33
272
  columnType: "SQLiteText";
34
- data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
273
+ data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
35
274
  driverParam: string;
36
275
  notNull: true;
37
276
  hasDefault: false;
38
277
  isPrimaryKey: false;
39
278
  isAutoincrement: false;
40
279
  hasRuntimeDefault: false;
41
- enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK"];
280
+ enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK", "KB", "CSOB"];
42
281
  baseColumn: never;
43
282
  identity: undefined;
44
283
  generated: undefined;
45
284
  }, {}, {
46
285
  length: number | undefined;
47
- $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
286
+ $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
48
287
  }>;
49
288
  type: drizzle_orm_sqlite_core.SQLiteColumn<{
50
289
  name: "type";
@@ -255,20 +494,20 @@ declare const accountCredentialsUpdateSchema: drizzle_zod.BuildSchema<"update",
255
494
  tableName: "account_credentials";
256
495
  dataType: "string";
257
496
  columnType: "SQLiteText";
258
- data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
497
+ data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
259
498
  driverParam: string;
260
499
  notNull: true;
261
500
  hasDefault: false;
262
501
  isPrimaryKey: false;
263
502
  isAutoincrement: false;
264
503
  hasRuntimeDefault: false;
265
- enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK"];
504
+ enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK", "KB", "CSOB"];
266
505
  baseColumn: never;
267
506
  identity: undefined;
268
507
  generated: undefined;
269
508
  }, {}, {
270
509
  length: number | undefined;
271
- $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
510
+ $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
272
511
  }>;
273
512
  type: drizzle_orm_sqlite_core.SQLiteColumn<{
274
513
  name: "type";
@@ -479,20 +718,20 @@ declare const accountCredentialsSelectSchema: drizzle_zod.BuildSchema<"select",
479
718
  tableName: "account_credentials";
480
719
  dataType: "string";
481
720
  columnType: "SQLiteText";
482
- data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
721
+ data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
483
722
  driverParam: string;
484
723
  notNull: true;
485
724
  hasDefault: false;
486
725
  isPrimaryKey: false;
487
726
  isAutoincrement: false;
488
727
  hasRuntimeDefault: false;
489
- enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK"];
728
+ enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK", "KB", "CSOB"];
490
729
  baseColumn: never;
491
730
  identity: undefined;
492
731
  generated: undefined;
493
732
  }, {}, {
494
733
  length: number | undefined;
495
- $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
734
+ $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
496
735
  }>;
497
736
  type: drizzle_orm_sqlite_core.SQLiteColumn<{
498
737
  name: "type";
@@ -788,20 +1027,20 @@ declare const accountInsertSchema: drizzle_zod.BuildSchema<"insert", {
788
1027
  tableName: "account";
789
1028
  dataType: "string";
790
1029
  columnType: "SQLiteText";
791
- data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
1030
+ data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
792
1031
  driverParam: string;
793
1032
  notNull: true;
794
1033
  hasDefault: false;
795
1034
  isPrimaryKey: false;
796
1035
  isAutoincrement: false;
797
1036
  hasRuntimeDefault: false;
798
- enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK"];
1037
+ enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK", "KB", "CSOB"];
799
1038
  baseColumn: never;
800
1039
  identity: undefined;
801
1040
  generated: undefined;
802
1041
  }, {}, {
803
1042
  length: number | undefined;
804
- $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
1043
+ $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
805
1044
  }>;
806
1045
  status: drizzle_orm_sqlite_core.SQLiteColumn<{
807
1046
  name: "status";
@@ -1332,20 +1571,20 @@ declare const accountUpdateSchema: drizzle_zod.BuildSchema<"update", {
1332
1571
  tableName: "account";
1333
1572
  dataType: "string";
1334
1573
  columnType: "SQLiteText";
1335
- data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
1574
+ data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
1336
1575
  driverParam: string;
1337
1576
  notNull: true;
1338
1577
  hasDefault: false;
1339
1578
  isPrimaryKey: false;
1340
1579
  isAutoincrement: false;
1341
1580
  hasRuntimeDefault: false;
1342
- enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK"];
1581
+ enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK", "KB", "CSOB"];
1343
1582
  baseColumn: never;
1344
1583
  identity: undefined;
1345
1584
  generated: undefined;
1346
1585
  }, {}, {
1347
1586
  length: number | undefined;
1348
- $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
1587
+ $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
1349
1588
  }>;
1350
1589
  status: drizzle_orm_sqlite_core.SQLiteColumn<{
1351
1590
  name: "status";
@@ -1876,20 +2115,20 @@ declare const accountSelectSchema: drizzle_zod.BuildSchema<"select", {
1876
2115
  tableName: "account";
1877
2116
  dataType: "string";
1878
2117
  columnType: "SQLiteText";
1879
- data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
2118
+ data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
1880
2119
  driverParam: string;
1881
2120
  notNull: true;
1882
2121
  hasDefault: false;
1883
2122
  isPrimaryKey: false;
1884
2123
  isAutoincrement: false;
1885
2124
  hasRuntimeDefault: false;
1886
- enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK"];
2125
+ enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK", "KB", "CSOB"];
1887
2126
  baseColumn: never;
1888
2127
  identity: undefined;
1889
2128
  generated: undefined;
1890
2129
  }, {}, {
1891
2130
  length: number | undefined;
1892
- $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
2131
+ $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
1893
2132
  }>;
1894
2133
  status: drizzle_orm_sqlite_core.SQLiteColumn<{
1895
2134
  name: "status";
@@ -2326,239 +2565,6 @@ type AccountUpdateType = z.infer<typeof accountInsertSchema>;
2326
2565
  type AccountPatchType = z.infer<typeof accountUpdateSchema>;
2327
2566
  type AccountSelectType = z.infer<typeof accountSelectSchema>;
2328
2567
 
2329
- interface BankAccountWithLastSync extends ConnectedAccount {
2330
- lastSyncedAt: Date;
2331
- }
2332
- declare const CONNECTOR_KEYS: readonly ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK"];
2333
- type ConnectorKey = (typeof CONNECTOR_KEYS)[number];
2334
- declare const CREDENTIALS_TYPES: readonly ["AUTH_TOKEN", "REFRESH_TOKEN", "CLIENT_ID", "API_KEY"];
2335
- type CredentialsType = (typeof CREDENTIALS_TYPES)[number];
2336
- declare const TOKEN_TYPES: readonly ["ACCOUNT_AUTHORIZATION"];
2337
- type TokenType = (typeof TOKEN_TYPES)[number];
2338
- interface ConfigEnvironmentBank {
2339
- allowedProviders: ConnectorKey[];
2340
- }
2341
- interface LastSyncMetadata {
2342
- payments: number;
2343
- paymentsToProcess: number;
2344
- paymentsInserted: number;
2345
- lastSyncPayments: number;
2346
- lastSyncBankRefIds: string[];
2347
- eventsEmitted: number;
2348
- }
2349
-
2350
- declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "DOMESTIC", "UNKNOWN"];
2351
- type PaymentType = (typeof PAYMENT_TYPES)[number];
2352
- declare const CHARGE_BEARERS: readonly ["SHA", "OUR", "BEN"];
2353
- type ChargeBearer = (typeof CHARGE_BEARERS)[number];
2354
- declare const INSTRUCTION_PRIORITIES: readonly ["NORM", "HIGH", "INST"];
2355
- type InstructionPriority = (typeof INSTRUCTION_PRIORITIES)[number];
2356
- declare const PAYMENT_STATUSES: readonly ["PREPARED", "FAILED", "PENDING", "COMPLETED", "CREATED"];
2357
- type PaymentStatus = (typeof PAYMENT_STATUSES)[number];
2358
- declare const PAYMENT_DIRECTIONS: readonly ["INCOMING", "OUTGOING"];
2359
- type PaymentDirection = (typeof PAYMENT_DIRECTIONS)[number];
2360
-
2361
- type CurrencyCode = (typeof CURRENCY_CODES)[number];
2362
- /**
2363
- * Batch status constants
2364
- */
2365
- declare const BATCH_STATUSES: readonly ["OPEN", "PROCESSING", "READY_TO_SIGN", "SIGNED", "SIGNATURE_FAILED", "FAILED"];
2366
- /**
2367
- * Type definition for batch status
2368
- */
2369
- type BatchStatus = (typeof BATCH_STATUSES)[number];
2370
- declare const ACCOUNT_STATUSES: readonly ["AUTHORIZED", "DISABLED", "EXPIRED"];
2371
- /**
2372
- * Type definition for account status
2373
- */
2374
- type AccountStatus = (typeof ACCOUNT_STATUSES)[number];
2375
- type Currency = CODES.Currency;
2376
-
2377
- type BankCode = (typeof BANK_CODES)[number];
2378
- declare const COUNTRY_CODES: ["AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "US" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW", ...("AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "US" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW")[]];
2379
- type CountryCode = (typeof COUNTRY_CODES)[number];
2380
-
2381
- type WithStatus<T extends {
2382
- status: PaymentStatus;
2383
- }, S extends PaymentStatus> = Omit<T, 'status'> & {
2384
- status: S;
2385
- };
2386
- type PaymentFailedInsertType = WithStatus<PaymentInsertType, 'FAILED'>;
2387
- /**
2388
- * @deprecated Use PreparedPayment from '~/types/payment-lifecycle' instead
2389
- */
2390
- type PaymentPreparedInsertType = PreparedPayment;
2391
- /**
2392
- * Initiated single payment response from connector
2393
- */
2394
- type InitiatedPayment = {
2395
- authorizationUrl: string;
2396
- payment: PreparedPayment;
2397
- };
2398
- type ConnectedAccount = {
2399
- token: string;
2400
- id: string;
2401
- iban: string;
2402
- currency: CurrencyCode;
2403
- connectorKey: ConnectorKey;
2404
- bankRefId?: string;
2405
- };
2406
- declare abstract class IBankConnector {
2407
- /** Unique identifier for this bank connector (e.g., 'ERSTE', 'FINBRICKS', 'MOCK') */
2408
- abstract connectorKey: ConnectorKey;
2409
- /** List of bank accounts connected through this connector instance */
2410
- abstract connectedAccounts: ConnectedAccount[];
2411
- /**
2412
- * Checks if this connector supports batch processing for a given payment type.
2413
- * When batch is not supported, batch methods will fall back to initiating
2414
- * individual payments and returning multiple authorization URLs.
2415
- * @param paymentType - Type of payment (DOMESTIC, SEPA, SWIFT)
2416
- * @returns true if native batch API is supported, false if fallback to single payments is needed
2417
- */
2418
- abstract supportsBatch(paymentType: PaymentType): boolean;
2419
- /**
2420
- * Generates authorization URI for connecting a new bank account.
2421
- * @param ott - One-time token used to identify the authorization flow
2422
- * @returns Authorization URL that redirects user to bank's consent page
2423
- */
2424
- abstract getAuthUri({ ott }: {
2425
- ott: string;
2426
- }): Promise<string>;
2427
- /**
2428
- * Completes account authorization after user consent at the bank.
2429
- * Exchanges authorization code for access tokens and retrieves account details.
2430
- * @param urlParams - URL parameters returned from bank's redirect (contains authorization code and ott)
2431
- * @returns Credentials (access/refresh tokens) and account information
2432
- */
2433
- abstract authorizeAccount({ urlParams }: {
2434
- urlParams: string;
2435
- }): Promise<{
2436
- credentials: AccountCredentialsInsertType[];
2437
- accounts: AccountInsertType[];
2438
- }>;
2439
- /**
2440
- * @deprecated Use initiateDomesticBatch, initiateSEPABatch, or initiateForeignBatch instead.
2441
- * Delegates to initiateDomesticBatch for backward compatibility.
2442
- */
2443
- initiateBatch(args: {
2444
- batchId: string;
2445
- payments: BatchedPayment[];
2446
- }): Promise<InitiatedBatch>;
2447
- /**
2448
- * @deprecated Use initiateDomesticPayment instead.
2449
- * Delegates to initiateDomesticPayment for backward compatibility.
2450
- */
2451
- initiateSinglePayment(payment: BatchedPayment): Promise<InitiatedPayment>;
2452
- /**
2453
- * Initiates a single domestic payment.
2454
- * @param payment - Payment details in batched format
2455
- * @returns Initiated payment with authorization URL and prepared payment data
2456
- */
2457
- abstract initiateDomesticPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
2458
- /**
2459
- * Initiates a single SEPA payment.
2460
- * @param payment - Payment details in batched format
2461
- * @returns Initiated payment with authorization URL and prepared payment data
2462
- */
2463
- abstract initiateSEPAPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
2464
- /**
2465
- * Initiates a single foreign (SWIFT) payment.
2466
- * @param payment - Payment details in batched format
2467
- * @returns Initiated payment with authorization URL and prepared payment data
2468
- */
2469
- abstract initiateForeignPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
2470
- /**
2471
- * Initiates a batch of domestic payments with the bank.
2472
- * Falls back to single payments if batch not supported.
2473
- * @param batchId - Unique identifier for the batch
2474
- * @param payments - Array of domestic payments to include in the batch
2475
- * @returns Batch initiation result with authorization URLs and prepared payments
2476
- */
2477
- initiateDomesticBatch({ batchId, payments, }: {
2478
- batchId: string;
2479
- payments: BatchedPayment[];
2480
- }): Promise<InitiatedBatch>;
2481
- /**
2482
- * Initiates a batch of SEPA payments with the bank.
2483
- * Falls back to single payments if batch not supported.
2484
- * @param batchId - Unique identifier for the batch
2485
- * @param payments - Array of SEPA payments to include in the batch
2486
- * @returns Batch initiation result with authorization URLs and prepared payments
2487
- */
2488
- initiateSEPABatch({ batchId, payments, }: {
2489
- batchId: string;
2490
- payments: BatchedPayment[];
2491
- }): Promise<InitiatedBatch>;
2492
- /**
2493
- * Initiates a batch of foreign (SWIFT) payments with the bank.
2494
- * Falls back to single payments if batch not supported.
2495
- * @param batchId - Unique identifier for the batch
2496
- * @param payments - Array of foreign payments to include in the batch
2497
- * @returns Batch initiation result with authorization URLs and prepared payments
2498
- */
2499
- initiateForeignBatch({ batchId, payments, }: {
2500
- batchId: string;
2501
- payments: BatchedPayment[];
2502
- }): Promise<InitiatedBatch>;
2503
- /**
2504
- * Native batch implementation for domestic payments.
2505
- * Must be implemented by connector if it supports domestic batch.
2506
- */
2507
- protected abstract initiateDomesticBatchImpl(args: {
2508
- batchId: string;
2509
- payments: BatchedPayment[];
2510
- }): Promise<InitiatedBatch>;
2511
- /**
2512
- * Native batch implementation for SEPA payments.
2513
- * Must be implemented by connector if it supports SEPA batch.
2514
- */
2515
- protected abstract initiateSEPABatchImpl(args: {
2516
- batchId: string;
2517
- payments: BatchedPayment[];
2518
- }): Promise<InitiatedBatch>;
2519
- /**
2520
- * Native batch implementation for foreign (SWIFT) payments.
2521
- * Must be implemented by connector if it supports foreign batch.
2522
- */
2523
- protected abstract initiateForeignBatchImpl(args: {
2524
- batchId: string;
2525
- payments: BatchedPayment[];
2526
- }): Promise<InitiatedBatch>;
2527
- /**
2528
- * Fetches all payments (transactions) for a given account within a date range.
2529
- * Used for synchronizing account transaction history.
2530
- * @param account - Bank account to fetch payments for
2531
- * @param filter - Date range filter (dateFrom is required, dateTo is optional)
2532
- * @returns Array of parsed bank payments (both incoming and outgoing)
2533
- */
2534
- abstract getAllAccountPayments({ account, filter, }: {
2535
- account: AccountSelectType;
2536
- filter: {
2537
- dateFrom: Date;
2538
- dateTo?: Date;
2539
- };
2540
- }): Promise<ParsedBankPayment[]>;
2541
- /**
2542
- * Retrieves current status of a payment from the bank.
2543
- * @param paymentId - Bank's payment identifier
2544
- * @returns Current payment status (PREPARED, COMPLETED, FAILED, etc.)
2545
- */
2546
- abstract getPaymentStatus({ paymentId, }: {
2547
- paymentId: string;
2548
- }): Promise<PaymentStatus>;
2549
- /**
2550
- * Retrieves current status of a batch from the bank.
2551
- * @param batchId - Bank's batch identifier
2552
- * @returns Batch status and raw API response for debugging
2553
- */
2554
- abstract getBatchStatus({ batchId, }: {
2555
- batchId: string;
2556
- }): Promise<{
2557
- status: BatchStatus;
2558
- apiResponse: object;
2559
- }>;
2560
- }
2561
-
2562
2568
  declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
2563
2569
  name: "batch";
2564
2570
  schema: undefined;
@@ -2623,7 +2629,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
2623
2629
  tableName: "batch";
2624
2630
  dataType: "string";
2625
2631
  columnType: "SQLiteText";
2626
- data: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | "FAILED";
2632
+ data: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED";
2627
2633
  driverParam: string;
2628
2634
  notNull: false;
2629
2635
  hasDefault: false;
@@ -2636,7 +2642,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
2636
2642
  generated: undefined;
2637
2643
  }, {}, {
2638
2644
  length: number | undefined;
2639
- $type: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | "FAILED";
2645
+ $type: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED";
2640
2646
  }>;
2641
2647
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
2642
2648
  name: "status_reason";
@@ -2969,20 +2975,20 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
2969
2975
  tableName: "payment";
2970
2976
  dataType: "string";
2971
2977
  columnType: "SQLiteText";
2972
- data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
2978
+ data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
2973
2979
  driverParam: string;
2974
2980
  notNull: true;
2975
2981
  hasDefault: false;
2976
2982
  isPrimaryKey: false;
2977
2983
  isAutoincrement: false;
2978
2984
  hasRuntimeDefault: false;
2979
- enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK"];
2985
+ enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK", "KB", "CSOB"];
2980
2986
  baseColumn: never;
2981
2987
  identity: undefined;
2982
2988
  generated: undefined;
2983
2989
  }, {}, {
2984
2990
  length: number | undefined;
2985
- $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
2991
+ $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
2986
2992
  }>;
2987
2993
  amount: drizzle_orm_sqlite_core.SQLiteColumn<{
2988
2994
  name: "amount";
@@ -3066,7 +3072,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3066
3072
  tableName: "payment";
3067
3073
  dataType: "string";
3068
3074
  columnType: "SQLiteText";
3069
- data: "FAILED" | "PREPARED" | "PENDING" | "COMPLETED" | "CREATED";
3075
+ data: "PREPARED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
3070
3076
  driverParam: string;
3071
3077
  notNull: true;
3072
3078
  hasDefault: false;
@@ -3079,7 +3085,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3079
3085
  generated: undefined;
3080
3086
  }, {}, {
3081
3087
  length: number | undefined;
3082
- $type: "FAILED" | "PREPARED" | "PENDING" | "COMPLETED" | "CREATED";
3088
+ $type: "PREPARED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
3083
3089
  }>;
3084
3090
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
3085
3091
  name: "status_reason";
@@ -3794,20 +3800,20 @@ declare const account: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3794
3800
  tableName: "account";
3795
3801
  dataType: "string";
3796
3802
  columnType: "SQLiteText";
3797
- data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
3803
+ data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
3798
3804
  driverParam: string;
3799
3805
  notNull: true;
3800
3806
  hasDefault: false;
3801
3807
  isPrimaryKey: false;
3802
3808
  isAutoincrement: false;
3803
3809
  hasRuntimeDefault: false;
3804
- enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK"];
3810
+ enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK", "KB", "CSOB"];
3805
3811
  baseColumn: never;
3806
3812
  identity: undefined;
3807
3813
  generated: undefined;
3808
3814
  }, {}, {
3809
3815
  length: number | undefined;
3810
- $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
3816
+ $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
3811
3817
  }>;
3812
3818
  status: drizzle_orm_sqlite_core.SQLiteColumn<{
3813
3819
  name: "status";
@@ -4267,20 +4273,20 @@ declare const accountCredentials: drizzle_orm_sqlite_core.SQLiteTableWithColumns
4267
4273
  tableName: "account_credentials";
4268
4274
  dataType: "string";
4269
4275
  columnType: "SQLiteText";
4270
- data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
4276
+ data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
4271
4277
  driverParam: string;
4272
4278
  notNull: true;
4273
4279
  hasDefault: false;
4274
4280
  isPrimaryKey: false;
4275
4281
  isAutoincrement: false;
4276
4282
  hasRuntimeDefault: false;
4277
- enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK"];
4283
+ enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA", "DBU", "CSAS", "AIRBANK", "KB", "CSOB"];
4278
4284
  baseColumn: never;
4279
4285
  identity: undefined;
4280
4286
  generated: undefined;
4281
4287
  }, {}, {
4282
4288
  length: number | undefined;
4283
- $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK";
4289
+ $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
4284
4290
  }>;
4285
4291
  type: drizzle_orm_sqlite_core.SQLiteColumn<{
4286
4292
  name: "type";
@@ -4755,5 +4761,5 @@ declare function isBatchFailed(batch: {
4755
4761
  status?: string | null;
4756
4762
  }): batch is CompletedBatch;
4757
4763
 
4758
- export { BATCH_STATUSES as F, IBankConnector as I, CHARGE_BEARERS as M, CONNECTOR_KEYS as N, COUNTRY_CODES as O, CREDENTIALS_TYPES as Q, INSTRUCTION_PRIORITIES as V, PAYMENT_DIRECTIONS as X, PAYMENT_STATUSES as Y, PAYMENT_TYPES as Z, TOKEN_TYPES as a6, accountCredentialsInsertSchema as a8, accountCredentialsSelectSchema as a9, accountCredentialsUpdateSchema as aa, accountInsertSchema as ab, accountSelectSchema as ac, accountUpdateSchema as ad, hasPaymentAccountAssigned as ae, isBatchCompleted as af, isBatchFailed as ag, isBatchInitiated as ah, isBatchOpen as ai, isBatchProcessing as aj, isBatchReadyToSign as ak, isBatchSigned as al, isPaymentCompleted as am, isPaymentPrepared as an, account as ao, accountCredentials as ap, batch as aq, ott as ar, payment as as, paymentRelations as at, tables as t, ACCOUNT_STATUSES as v };
4759
- export type { PaymentFailedInsertType as $, AccountSelectType as A, BatchSelectType as B, ConfigEnvironmentBank as C, AccountStatus as D, AccountUpdateType as E, BankAccountWithLastSync as G, BatchInsertType as H, BatchLifecycle as J, BatchPayment as K, LastSyncMetadata as L, PaymentSelectType as P, ChargeBearer as R, CompletedBatch as S, CreatedBatch as T, CredentialsType as U, InstructionPriority as W, PaymentDirection as _, ConnectorKey as a, PaymentInsertType as a0, PaymentLifecycle as a1, PaymentPreparedInsertType as a2, ProcessingBatch as a3, ReadyToSignBatch as a4, SignedBatch as a5, TokenType as a7, ConnectedAccount as b, PaymentType as c, AccountCredentialsInsertType as d, AccountInsertType as e, BatchedPayment as f, InitiatedPayment as g, InitiatedBatch as h, ParsedBankPayment as i, PaymentStatus as j, BatchStatus as k, IncomingPayment as l, BatchMetadata as m, CurrencyCode as n, BankCode as o, CountryCode as p, Currency as q, AccountAssignedPayment as r, PreparedPayment as s, CompletedPayment as u, AccountCredentialsPatchType as w, AccountCredentialsSelectType as x, AccountCredentialsUpdateType as y, AccountPatchType as z };
4764
+ export { BATCH_STATUSES as G, IBankConnector as I, CHARGE_BEARERS as N, CONNECTOR_KEYS as O, COUNTRY_CODES as Q, CREDENTIALS_TYPES as R, INSTRUCTION_PRIORITIES as W, PAYMENT_DIRECTIONS as Y, PAYMENT_STATUSES as Z, PAYMENT_TYPES as _, TOKEN_TYPES as a8, accountCredentialsInsertSchema as aa, accountCredentialsSelectSchema as ab, accountCredentialsUpdateSchema as ac, accountInsertSchema as ad, accountSelectSchema as ae, accountUpdateSchema as af, hasPaymentAccountAssigned as ag, isBatchCompleted as ah, isBatchFailed as ai, isBatchInitiated as aj, isBatchOpen as ak, isBatchProcessing as al, isBatchReadyToSign as am, isBatchSigned as an, isPaymentCompleted as ao, isPaymentPrepared as ap, account as aq, accountCredentials as ar, batch as as, ott as at, payment as au, paymentRelations as av, tables as t, ACCOUNT_STATUSES as w };
4765
+ export type { PaymentDirection as $, AccountSelectType as A, BatchSelectType as B, ConfigEnvironmentBank as C, AccountPatchType as D, AccountStatus as E, AccountUpdateType as F, BankAccountWithLastSync as H, BatchInsertType as J, BatchLifecycle as K, LastSyncMetadata as L, BatchPayment as M, PaymentSelectType as P, ChargeBearer as S, CompletedBatch as T, CreatedBatch as U, CredentialsType as V, InstructionPriority as X, ConnectorKey as a, PaymentFailedInsertType as a0, PaymentInsertType as a1, PaymentLifecycle as a2, PaymentPreparedInsertType as a3, ProcessingBatch as a4, ReadyToSignBatch as a5, ResolvedCredentials as a6, SignedBatch as a7, TokenType as a9, CurrencyCode as b, BankCode as c, CountryCode as d, ConnectedAccount as e, CredentialsResolver as f, AccountCredentialsInsertType as g, AccountInsertType as h, BatchedPayment as i, InitiatedBatch as j, IncomingPayment as k, InitiatedPayment as l, ParsedBankPayment as m, PaymentStatus as n, BatchStatus as o, PaymentType as p, BatchMetadata as q, Currency as r, AccountAssignedPayment as s, PreparedPayment as u, CompletedPayment as v, AccountCredentialsPatchType as x, AccountCredentialsSelectType as y, AccountCredentialsUpdateType as z };