@develit-services/bank 2.3.0 → 3.0.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 +1 -10
- package/dist/database/schema.d.cts +3 -3
- package/dist/database/schema.d.mts +3 -3
- package/dist/database/schema.d.ts +3 -3
- package/dist/database/schema.mjs +1 -8
- package/dist/export/worker.cjs +137 -137
- package/dist/export/worker.d.cts +115 -451
- package/dist/export/worker.d.mts +115 -451
- package/dist/export/worker.d.ts +115 -451
- package/dist/export/worker.mjs +40 -40
- package/dist/export/workflows.cjs +29 -23
- package/dist/export/workflows.mjs +18 -12
- package/dist/export/wrangler.cjs +7 -12
- package/dist/export/wrangler.d.cts +11 -3
- package/dist/export/wrangler.d.mts +11 -3
- package/dist/export/wrangler.d.ts +11 -3
- package/dist/export/wrangler.mjs +7 -12
- package/dist/shared/bank.9Yw4KHyl.cjs +275 -0
- package/dist/shared/{bank.CxAHQOwW.d.cts → bank.BanqNaZK.d.cts} +9 -9
- package/dist/shared/{bank.BSiA1m0B.mjs → bank.ByesVuDp.mjs} +2 -1
- package/dist/shared/bank.BzDNLxB_.mjs +254 -0
- package/dist/shared/{bank.gVOunsjq.mjs → bank.CTFqGRuY.mjs} +227 -447
- package/dist/shared/{bank.CC4p6Jf-.d.cts → bank.CVCyY-qU.d.cts} +1225 -3788
- package/dist/shared/{bank.CC4p6Jf-.d.mts → bank.CVCyY-qU.d.mts} +1225 -3788
- package/dist/shared/{bank.CC4p6Jf-.d.ts → bank.CVCyY-qU.d.ts} +1225 -3788
- package/dist/shared/{bank.Dl3mNNS2.d.mts → bank.DOlM7clW.d.mts} +9 -9
- package/dist/shared/{bank.DICdNw3T.cjs → bank.OSj3Smwv.cjs} +17 -16
- package/dist/shared/{bank.C5NCnZWS.d.ts → bank.SoKDxQxH.d.ts} +9 -9
- package/dist/shared/{bank.avgw-IRO.cjs → bank.pU2vSCUr.cjs} +234 -474
- package/dist/types.cjs +38 -38
- package/dist/types.d.cts +57 -450
- package/dist/types.d.mts +57 -450
- package/dist/types.d.ts +57 -450
- package/dist/types.mjs +4 -4
- package/package.json +6 -5
- package/dist/shared/{bank.Bz4DIxJL.d.cts → bank.C6sLje8B.d.cts} +3 -3
- package/dist/shared/{bank.Bz4DIxJL.d.mts → bank.C6sLje8B.d.mts} +3 -3
- package/dist/shared/{bank.Bz4DIxJL.d.ts → bank.C6sLje8B.d.ts} +3 -3
|
@@ -1,15 +1,193 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
|
-
const sqliteCore = require('drizzle-orm/sqlite-core');
|
|
5
4
|
const dateFns = require('date-fns');
|
|
6
5
|
const jose = require('jose');
|
|
7
6
|
const zod = require('zod');
|
|
8
7
|
const generalCodes = require('@develit-io/general-codes');
|
|
9
|
-
const
|
|
8
|
+
const database_schema = require('./bank.9Yw4KHyl.cjs');
|
|
10
9
|
const drizzleOrm = require('drizzle-orm');
|
|
11
|
-
require('node:crypto');
|
|
12
10
|
const drizzleZod = require('drizzle-zod');
|
|
11
|
+
require('node:crypto');
|
|
12
|
+
|
|
13
|
+
const relations = drizzleOrm.defineRelations(database_schema.schema, (r) => ({
|
|
14
|
+
payment: {
|
|
15
|
+
batch: r.one.batch({
|
|
16
|
+
from: r.payment.batchId,
|
|
17
|
+
to: r.batch.id
|
|
18
|
+
})
|
|
19
|
+
},
|
|
20
|
+
paymentRequest: {
|
|
21
|
+
batch: r.one.batch({
|
|
22
|
+
from: r.paymentRequest.batchId,
|
|
23
|
+
to: r.batch.id
|
|
24
|
+
}),
|
|
25
|
+
account: r.one.account({
|
|
26
|
+
from: r.paymentRequest.accountId,
|
|
27
|
+
to: r.account.id
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
}));
|
|
31
|
+
|
|
32
|
+
const tables = database_schema.schema;
|
|
33
|
+
|
|
34
|
+
async function signFinbricksJws({
|
|
35
|
+
privateKeyPem,
|
|
36
|
+
merchantId,
|
|
37
|
+
jwsData
|
|
38
|
+
}) {
|
|
39
|
+
const privateKey = await jose.importPKCS8(privateKeyPem, "RS256");
|
|
40
|
+
const payload = JSON.stringify(jwsData);
|
|
41
|
+
const jws = await new jose.SignJWT(JSON.parse(payload)).setProtectedHeader({
|
|
42
|
+
alg: "RS256",
|
|
43
|
+
kid: merchantId,
|
|
44
|
+
typ: "JWT"
|
|
45
|
+
}).sign(privateKey);
|
|
46
|
+
const [header, , signature] = jws.split(".");
|
|
47
|
+
return `${header}..${signature}`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const useFinbricksFetch = async (config, init) => {
|
|
51
|
+
const {
|
|
52
|
+
baseUrl,
|
|
53
|
+
endpoint,
|
|
54
|
+
method = "GET",
|
|
55
|
+
merchantId,
|
|
56
|
+
privateKeyPem,
|
|
57
|
+
query,
|
|
58
|
+
body,
|
|
59
|
+
correlationId,
|
|
60
|
+
psuIp = "88.205.47.1",
|
|
61
|
+
psuAgent = "Develit/BankService"
|
|
62
|
+
} = config;
|
|
63
|
+
const url = new URL(`${baseUrl}${endpoint}`);
|
|
64
|
+
if (query) {
|
|
65
|
+
for (const [k, v] of Object.entries(query)) {
|
|
66
|
+
if (v !== void 0 && v !== null)
|
|
67
|
+
url.searchParams.append(k, v.toString());
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const uriWithQuery = `${endpoint}${url.search ? `?${url.searchParams.toString()}` : ""}`;
|
|
71
|
+
const bodyString = body ? JSON.stringify(body) : "";
|
|
72
|
+
const jwsSignature = await signFinbricksJws({
|
|
73
|
+
privateKeyPem,
|
|
74
|
+
merchantId,
|
|
75
|
+
jwsData: {
|
|
76
|
+
uri: uriWithQuery,
|
|
77
|
+
body: bodyString
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
const headers = {
|
|
81
|
+
"Content-Type": "application/json",
|
|
82
|
+
"JWS-Signature": jwsSignature,
|
|
83
|
+
"PSU-IP-Address": psuIp,
|
|
84
|
+
"PSU-User-Agent": psuAgent,
|
|
85
|
+
...init?.headers
|
|
86
|
+
};
|
|
87
|
+
if (correlationId) {
|
|
88
|
+
headers["Correlation-ID"] = correlationId;
|
|
89
|
+
}
|
|
90
|
+
console.log(
|
|
91
|
+
"[Finbricks] request",
|
|
92
|
+
JSON.stringify(
|
|
93
|
+
{
|
|
94
|
+
method,
|
|
95
|
+
url: url.toString(),
|
|
96
|
+
body: body ?? null
|
|
97
|
+
},
|
|
98
|
+
null,
|
|
99
|
+
2
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
const res = await fetch(url.toString(), {
|
|
103
|
+
method,
|
|
104
|
+
headers,
|
|
105
|
+
body: method !== "GET" ? bodyString : void 0
|
|
106
|
+
});
|
|
107
|
+
if (!res.ok) {
|
|
108
|
+
const text = await res.text().catch(() => "unknown error");
|
|
109
|
+
console.error("[Finbricks] error response", {
|
|
110
|
+
status: res.status,
|
|
111
|
+
statusText: res.statusText,
|
|
112
|
+
url: url.toString(),
|
|
113
|
+
body: text
|
|
114
|
+
});
|
|
115
|
+
throw new Error(
|
|
116
|
+
`Finbricks API error: ${res.status} ${res.statusText} \u2013 ${text}`
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
const json = await res.json();
|
|
120
|
+
console.log(
|
|
121
|
+
"[Finbricks] response",
|
|
122
|
+
JSON.stringify(
|
|
123
|
+
{
|
|
124
|
+
status: res.status,
|
|
125
|
+
url: url.toString(),
|
|
126
|
+
body: json
|
|
127
|
+
},
|
|
128
|
+
null,
|
|
129
|
+
2
|
|
130
|
+
)
|
|
131
|
+
);
|
|
132
|
+
return json;
|
|
133
|
+
};
|
|
134
|
+
class FinbricksClient {
|
|
135
|
+
constructor(baseUrl, merchantId, privateKeyPem, redirectUri) {
|
|
136
|
+
this.BASE_URL = baseUrl;
|
|
137
|
+
this.MERCHANT_ID = merchantId;
|
|
138
|
+
this.PRIVATE_KEY_PEM = privateKeyPem;
|
|
139
|
+
this.REDIRECT_URI = redirectUri;
|
|
140
|
+
}
|
|
141
|
+
async request(params) {
|
|
142
|
+
return useFinbricksFetch({
|
|
143
|
+
baseUrl: this.BASE_URL,
|
|
144
|
+
merchantId: this.MERCHANT_ID,
|
|
145
|
+
privateKeyPem: this.PRIVATE_KEY_PEM,
|
|
146
|
+
...params
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const FINBRICKS_ENDPOINTS = {
|
|
152
|
+
AUTHENTICATE_V2: "/v2/auth/authenticate",
|
|
153
|
+
AUTH_TOKEN_STATUS: "/auth/token",
|
|
154
|
+
AUTH_TOKEN_REVOKE: "/auth/revoke",
|
|
155
|
+
ACCOUNT_LIST: "/account/list",
|
|
156
|
+
ACCOUNT_BALANCE: "/account/balance",
|
|
157
|
+
ACCOUNT_TRANSACTIONS: "/account/transactions",
|
|
158
|
+
TRANSACTION_INIT: "/transaction/platform/init",
|
|
159
|
+
TRANSACTION_STATUS: "/transaction/platform/status",
|
|
160
|
+
TRANSACTION_SEPA_INIT: "/transaction/platform/sepa/init",
|
|
161
|
+
TRANSACTION_FOREIGN_INIT: "/transaction/platform/foreign/init",
|
|
162
|
+
TRANSACTION_BATCH_INIT: "/transaction/platform/batchPayment/init",
|
|
163
|
+
BATCH_STATUS: "/transaction/platform/batchPayment/status",
|
|
164
|
+
BANK_INFO: "/status/bankInfo"
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const TERMINAL_STATUSES$1 = /* @__PURE__ */ new Set([
|
|
168
|
+
"SETTLED",
|
|
169
|
+
"REJECTED",
|
|
170
|
+
"CLOSED"
|
|
171
|
+
]);
|
|
172
|
+
const PENDING_STATUSES = /* @__PURE__ */ new Set([
|
|
173
|
+
"OPENED",
|
|
174
|
+
"AUTHORIZED"
|
|
175
|
+
]);
|
|
176
|
+
function isTerminalStatus(status) {
|
|
177
|
+
return TERMINAL_STATUSES$1.has(status);
|
|
178
|
+
}
|
|
179
|
+
function isPendingStatus(status) {
|
|
180
|
+
return PENDING_STATUSES.has(status);
|
|
181
|
+
}
|
|
182
|
+
function isProcessedStatus(status) {
|
|
183
|
+
return !isPendingStatus(status);
|
|
184
|
+
}
|
|
185
|
+
function hasPaymentAccountAssigned(payment) {
|
|
186
|
+
return "accountId" in payment && "connectorKey" in payment && payment.accountId !== void 0 && payment.connectorKey !== void 0;
|
|
187
|
+
}
|
|
188
|
+
function isPaymentCompleted(payment) {
|
|
189
|
+
return (payment.status === "COMPLETED" || payment.status === "BOOKED" || payment.status === "SETTLED" || payment.status === "REJECTED" || payment.status === "CLOSED") && "bankRefId" in payment && typeof payment.bankRefId === "string";
|
|
190
|
+
}
|
|
13
191
|
|
|
14
192
|
function toIncomingPayment(input) {
|
|
15
193
|
return {
|
|
@@ -241,139 +419,6 @@ class IBankConnector {
|
|
|
241
419
|
}
|
|
242
420
|
}
|
|
243
421
|
|
|
244
|
-
async function signFinbricksJws({
|
|
245
|
-
privateKeyPem,
|
|
246
|
-
merchantId,
|
|
247
|
-
jwsData
|
|
248
|
-
}) {
|
|
249
|
-
const privateKey = await jose.importPKCS8(privateKeyPem, "RS256");
|
|
250
|
-
const payload = JSON.stringify(jwsData);
|
|
251
|
-
const jws = await new jose.SignJWT(JSON.parse(payload)).setProtectedHeader({
|
|
252
|
-
alg: "RS256",
|
|
253
|
-
kid: merchantId,
|
|
254
|
-
typ: "JWT"
|
|
255
|
-
}).sign(privateKey);
|
|
256
|
-
const [header, , signature] = jws.split(".");
|
|
257
|
-
return `${header}..${signature}`;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
const useFinbricksFetch = async (config, init) => {
|
|
261
|
-
const {
|
|
262
|
-
baseUrl,
|
|
263
|
-
endpoint,
|
|
264
|
-
method = "GET",
|
|
265
|
-
merchantId,
|
|
266
|
-
privateKeyPem,
|
|
267
|
-
query,
|
|
268
|
-
body,
|
|
269
|
-
correlationId,
|
|
270
|
-
psuIp = "88.205.47.1",
|
|
271
|
-
psuAgent = "Develit/BankService"
|
|
272
|
-
} = config;
|
|
273
|
-
const url = new URL(`${baseUrl}${endpoint}`);
|
|
274
|
-
if (query) {
|
|
275
|
-
for (const [k, v] of Object.entries(query)) {
|
|
276
|
-
if (v !== void 0 && v !== null)
|
|
277
|
-
url.searchParams.append(k, v.toString());
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
const uriWithQuery = `${endpoint}${url.search ? `?${url.searchParams.toString()}` : ""}`;
|
|
281
|
-
const bodyString = body ? JSON.stringify(body) : "";
|
|
282
|
-
const jwsSignature = await signFinbricksJws({
|
|
283
|
-
privateKeyPem,
|
|
284
|
-
merchantId,
|
|
285
|
-
jwsData: {
|
|
286
|
-
uri: uriWithQuery,
|
|
287
|
-
body: bodyString
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
const headers = {
|
|
291
|
-
"Content-Type": "application/json",
|
|
292
|
-
"JWS-Signature": jwsSignature,
|
|
293
|
-
"PSU-IP-Address": psuIp,
|
|
294
|
-
"PSU-User-Agent": psuAgent,
|
|
295
|
-
...init?.headers
|
|
296
|
-
};
|
|
297
|
-
if (correlationId) {
|
|
298
|
-
headers["Correlation-ID"] = correlationId;
|
|
299
|
-
}
|
|
300
|
-
console.log(
|
|
301
|
-
"[Finbricks] request",
|
|
302
|
-
JSON.stringify(
|
|
303
|
-
{
|
|
304
|
-
method,
|
|
305
|
-
url: url.toString(),
|
|
306
|
-
body: body ?? null
|
|
307
|
-
},
|
|
308
|
-
null,
|
|
309
|
-
2
|
|
310
|
-
)
|
|
311
|
-
);
|
|
312
|
-
const res = await fetch(url.toString(), {
|
|
313
|
-
method,
|
|
314
|
-
headers,
|
|
315
|
-
body: method !== "GET" ? bodyString : void 0
|
|
316
|
-
});
|
|
317
|
-
if (!res.ok) {
|
|
318
|
-
const text = await res.text().catch(() => "unknown error");
|
|
319
|
-
console.error("[Finbricks] error response", {
|
|
320
|
-
status: res.status,
|
|
321
|
-
statusText: res.statusText,
|
|
322
|
-
url: url.toString(),
|
|
323
|
-
body: text
|
|
324
|
-
});
|
|
325
|
-
throw new Error(
|
|
326
|
-
`Finbricks API error: ${res.status} ${res.statusText} \u2013 ${text}`
|
|
327
|
-
);
|
|
328
|
-
}
|
|
329
|
-
const json = await res.json();
|
|
330
|
-
console.log(
|
|
331
|
-
"[Finbricks] response",
|
|
332
|
-
JSON.stringify(
|
|
333
|
-
{
|
|
334
|
-
status: res.status,
|
|
335
|
-
url: url.toString(),
|
|
336
|
-
body: json
|
|
337
|
-
},
|
|
338
|
-
null,
|
|
339
|
-
2
|
|
340
|
-
)
|
|
341
|
-
);
|
|
342
|
-
return json;
|
|
343
|
-
};
|
|
344
|
-
class FinbricksClient {
|
|
345
|
-
constructor(baseUrl, merchantId, privateKeyPem, redirectUri) {
|
|
346
|
-
this.BASE_URL = baseUrl;
|
|
347
|
-
this.MERCHANT_ID = merchantId;
|
|
348
|
-
this.PRIVATE_KEY_PEM = privateKeyPem;
|
|
349
|
-
this.REDIRECT_URI = redirectUri;
|
|
350
|
-
}
|
|
351
|
-
async request(params) {
|
|
352
|
-
return useFinbricksFetch({
|
|
353
|
-
baseUrl: this.BASE_URL,
|
|
354
|
-
merchantId: this.MERCHANT_ID,
|
|
355
|
-
privateKeyPem: this.PRIVATE_KEY_PEM,
|
|
356
|
-
...params
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
const FINBRICKS_ENDPOINTS = {
|
|
362
|
-
AUTHENTICATE_V2: "/v2/auth/authenticate",
|
|
363
|
-
AUTH_TOKEN_STATUS: "/auth/token",
|
|
364
|
-
AUTH_TOKEN_REVOKE: "/auth/revoke",
|
|
365
|
-
ACCOUNT_LIST: "/account/list",
|
|
366
|
-
ACCOUNT_BALANCE: "/account/balance",
|
|
367
|
-
ACCOUNT_TRANSACTIONS: "/account/transactions",
|
|
368
|
-
TRANSACTION_INIT: "/transaction/platform/init",
|
|
369
|
-
TRANSACTION_STATUS: "/transaction/platform/status",
|
|
370
|
-
TRANSACTION_SEPA_INIT: "/transaction/platform/sepa/init",
|
|
371
|
-
TRANSACTION_FOREIGN_INIT: "/transaction/platform/foreign/init",
|
|
372
|
-
TRANSACTION_BATCH_INIT: "/transaction/platform/batchPayment/init",
|
|
373
|
-
BATCH_STATUS: "/transaction/platform/batchPayment/status",
|
|
374
|
-
BANK_INFO: "/status/bankInfo"
|
|
375
|
-
};
|
|
376
|
-
|
|
377
422
|
const mapFinbricksStatus = (status, hasBookingDate) => {
|
|
378
423
|
switch (status) {
|
|
379
424
|
case "BOOK":
|
|
@@ -479,6 +524,26 @@ const SEPA_COUNTRIES = /* @__PURE__ */ new Set([
|
|
|
479
524
|
"GI",
|
|
480
525
|
"XK"
|
|
481
526
|
]);
|
|
527
|
+
function parseOtherIdentification(value) {
|
|
528
|
+
if (!value) return {};
|
|
529
|
+
const [first, second] = value.split("/");
|
|
530
|
+
if (!first) return {};
|
|
531
|
+
const looksLikeIban = first.length >= 15 && /^[A-Z]{2}\d{2}[A-Z0-9]+$/.test(first);
|
|
532
|
+
if (looksLikeIban) {
|
|
533
|
+
const iban = first;
|
|
534
|
+
const swiftBic = second || void 0;
|
|
535
|
+
if (iban.startsWith("CZ") && iban.length === 24) {
|
|
536
|
+
const bankCode = iban.slice(4, 8);
|
|
537
|
+
const number = iban.slice(14, 24).replace(/^0+/, "") || iban.slice(14, 24);
|
|
538
|
+
return { iban, swiftBic, bankCode, number };
|
|
539
|
+
}
|
|
540
|
+
return { iban, swiftBic };
|
|
541
|
+
}
|
|
542
|
+
return {
|
|
543
|
+
number: first,
|
|
544
|
+
bankCode: second || void 0
|
|
545
|
+
};
|
|
546
|
+
}
|
|
482
547
|
function detectPaymentType(tx, isIncoming) {
|
|
483
548
|
const related = tx.entryDetails?.transactionDetails?.relatedParties;
|
|
484
549
|
const otherParty = isIncoming ? related?.debtorAccount : related?.creditorAccount;
|
|
@@ -500,6 +565,12 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
|
|
|
500
565
|
const related = tx.entryDetails?.transactionDetails?.relatedParties;
|
|
501
566
|
const endToEndId = tx.entryDetails.transactionDetails?.references?.endToEndIdentification;
|
|
502
567
|
const symbolsRegex = /^\/?VS\d+/;
|
|
568
|
+
const debtorParsed = parseOtherIdentification(
|
|
569
|
+
related?.debtorAccount?.identification?.other?.identification
|
|
570
|
+
);
|
|
571
|
+
const creditorParsed = parseOtherIdentification(
|
|
572
|
+
related?.creditorAccount?.identification?.other?.identification
|
|
573
|
+
);
|
|
503
574
|
const base = {
|
|
504
575
|
id: backendSdk.uuidv4(),
|
|
505
576
|
correlationId: backendSdk.uuidv4(),
|
|
@@ -517,13 +588,10 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
|
|
|
517
588
|
),
|
|
518
589
|
creditor: {
|
|
519
590
|
holderName: related?.creditorAccount?.name || related?.creditor?.name || "Unknown",
|
|
520
|
-
iban: isIncoming ? account.iban || void 0 : related?.creditorAccount?.identification?.iban ||
|
|
521
|
-
number: isIncoming ? account.number || void 0 :
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
bankCode: isIncoming ? account.bankCode || void 0 : related?.creditorAccount?.identification?.other?.identification ? related.creditorAccount.identification.other.identification.split(
|
|
525
|
-
"/"
|
|
526
|
-
)[1] : account.bankCode || void 0,
|
|
591
|
+
iban: isIncoming ? account.iban || void 0 : related?.creditorAccount?.identification?.iban || creditorParsed.iban || void 0,
|
|
592
|
+
number: isIncoming ? account.number || void 0 : creditorParsed.number || void 0,
|
|
593
|
+
bankCode: isIncoming ? account.bankCode || void 0 : creditorParsed.bankCode || void 0,
|
|
594
|
+
swiftBic: isIncoming ? void 0 : creditorParsed.swiftBic,
|
|
527
595
|
address: related?.creditor?.postalAddress ? {
|
|
528
596
|
streetName: related.creditor.postalAddress.streetName,
|
|
529
597
|
buildingNumber: related.creditor.postalAddress.buildingNumber,
|
|
@@ -534,13 +602,10 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
|
|
|
534
602
|
},
|
|
535
603
|
debtor: {
|
|
536
604
|
holderName: related?.debtorAccount?.name || related?.debtor?.name || "Unknown",
|
|
537
|
-
iban: isIncoming ? related?.debtorAccount?.identification?.iban ||
|
|
538
|
-
number: isIncoming ?
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
bankCode: isIncoming ? related?.debtorAccount?.identification?.other?.identification ? related.debtorAccount.identification.other.identification.split(
|
|
542
|
-
"/"
|
|
543
|
-
)[1] : account.bankCode || void 0 : account.bankCode || void 0,
|
|
605
|
+
iban: isIncoming ? related?.debtorAccount?.identification?.iban || debtorParsed.iban || void 0 : account.iban ?? void 0,
|
|
606
|
+
number: isIncoming ? debtorParsed.number || void 0 : account.number || void 0,
|
|
607
|
+
bankCode: isIncoming ? debtorParsed.bankCode || void 0 : account.bankCode || void 0,
|
|
608
|
+
swiftBic: isIncoming ? debtorParsed.swiftBic : void 0,
|
|
544
609
|
address: related?.debtor?.postalAddress ? {
|
|
545
610
|
streetName: related.debtor.postalAddress.streetName,
|
|
546
611
|
buildingNumber: related.debtor.postalAddress.buildingNumber,
|
|
@@ -898,7 +963,10 @@ class FinbricksConnector extends IBankConnector {
|
|
|
898
963
|
},
|
|
899
964
|
paymentIdentification: {
|
|
900
965
|
merchantTransactionId: bankRefId,
|
|
901
|
-
endToEndIdentification: this.buildEndToEndId(
|
|
966
|
+
endToEndIdentification: this.buildEndToEndId({
|
|
967
|
+
...payment,
|
|
968
|
+
id: payment.id
|
|
969
|
+
})
|
|
902
970
|
},
|
|
903
971
|
amount: payment.amount,
|
|
904
972
|
debtor: {
|
|
@@ -1080,40 +1148,6 @@ class CsobConnector extends FinbricksConnector {
|
|
|
1080
1148
|
}
|
|
1081
1149
|
}
|
|
1082
1150
|
|
|
1083
|
-
const PAYMENT_TYPES = ["SEPA", "SWIFT", "DOMESTIC", "UNKNOWN"];
|
|
1084
|
-
const CHARGE_BEARERS = ["SHA", "OUR", "BEN"];
|
|
1085
|
-
const INSTRUCTION_PRIORITIES = ["NORM", "HIGH", "INST"];
|
|
1086
|
-
const PAYMENT_REQUEST_STATUSES = [
|
|
1087
|
-
"OPENED",
|
|
1088
|
-
"AUTHORIZED",
|
|
1089
|
-
"COMPLETED",
|
|
1090
|
-
"BOOKED",
|
|
1091
|
-
"SETTLED",
|
|
1092
|
-
"REJECTED",
|
|
1093
|
-
"CLOSED"
|
|
1094
|
-
];
|
|
1095
|
-
const PAYMENT_STATUSES = [
|
|
1096
|
-
"PENDING",
|
|
1097
|
-
"PROCESSING",
|
|
1098
|
-
"BOOKED",
|
|
1099
|
-
"CANCELLED",
|
|
1100
|
-
"REJECTED",
|
|
1101
|
-
"SCHEDULED",
|
|
1102
|
-
"HOLD",
|
|
1103
|
-
"INFO"
|
|
1104
|
-
];
|
|
1105
|
-
const PAYMENT_DIRECTIONS = ["INCOMING", "OUTGOING"];
|
|
1106
|
-
const BATCH_STATUSES = [
|
|
1107
|
-
"PROCESSING",
|
|
1108
|
-
"READY_TO_SIGN",
|
|
1109
|
-
"AUTHORIZED",
|
|
1110
|
-
"COMPLETED",
|
|
1111
|
-
"FAILED"
|
|
1112
|
-
];
|
|
1113
|
-
const BATCH_MODES = ["NATIVE", "SINGLE"];
|
|
1114
|
-
const ACCOUNT_STATUSES = ["AUTHORIZED", "DISABLED", "EXPIRED"];
|
|
1115
|
-
const COUNTRY_CODES = generalCodes.COUNTRY_CODES_2;
|
|
1116
|
-
|
|
1117
1151
|
class AirBankConnector extends FinbricksConnector {
|
|
1118
1152
|
constructor(config) {
|
|
1119
1153
|
super("AIRBANK", config);
|
|
@@ -1948,32 +1982,7 @@ class DbuConnector extends IBankConnector {
|
|
|
1948
1982
|
}
|
|
1949
1983
|
}
|
|
1950
1984
|
|
|
1951
|
-
const TERMINAL_STATUSES
|
|
1952
|
-
"SETTLED",
|
|
1953
|
-
"REJECTED",
|
|
1954
|
-
"CLOSED"
|
|
1955
|
-
]);
|
|
1956
|
-
const PENDING_STATUSES = /* @__PURE__ */ new Set([
|
|
1957
|
-
"OPENED",
|
|
1958
|
-
"AUTHORIZED"
|
|
1959
|
-
]);
|
|
1960
|
-
function isTerminalStatus(status) {
|
|
1961
|
-
return TERMINAL_STATUSES$1.has(status);
|
|
1962
|
-
}
|
|
1963
|
-
function isPendingStatus(status) {
|
|
1964
|
-
return PENDING_STATUSES.has(status);
|
|
1965
|
-
}
|
|
1966
|
-
function isProcessedStatus(status) {
|
|
1967
|
-
return !isPendingStatus(status);
|
|
1968
|
-
}
|
|
1969
|
-
function hasPaymentAccountAssigned(payment) {
|
|
1970
|
-
return "accountId" in payment && "connectorKey" in payment && payment.accountId !== void 0 && payment.connectorKey !== void 0;
|
|
1971
|
-
}
|
|
1972
|
-
function isPaymentCompleted(payment) {
|
|
1973
|
-
return (payment.status === "COMPLETED" || payment.status === "BOOKED" || payment.status === "SETTLED" || payment.status === "REJECTED" || payment.status === "CLOSED") && "bankRefId" in payment && typeof payment.bankRefId === "string";
|
|
1974
|
-
}
|
|
1975
|
-
|
|
1976
|
-
const TERMINAL_STATUSES = PAYMENT_REQUEST_STATUSES.filter(isTerminalStatus);
|
|
1985
|
+
const TERMINAL_STATUSES = database_schema.PAYMENT_REQUEST_STATUSES.filter(isTerminalStatus);
|
|
1977
1986
|
const getNonTerminalPaymentRequestsQuery = (db) => db.select().from(tables.paymentRequest).where(
|
|
1978
1987
|
drizzleOrm.and(
|
|
1979
1988
|
drizzleOrm.not(drizzleOrm.inArray(tables.paymentRequest.status, TERMINAL_STATUSES)),
|
|
@@ -2090,7 +2099,10 @@ class ErsteConnector extends IBankConnector {
|
|
|
2090
2099
|
}
|
|
2091
2100
|
const paymentBody = {
|
|
2092
2101
|
paymentIdentification: {
|
|
2093
|
-
endToEndIdentification: this.buildEndToEndId(
|
|
2102
|
+
endToEndIdentification: this.buildEndToEndId({
|
|
2103
|
+
...payment,
|
|
2104
|
+
id: payment.id
|
|
2105
|
+
}),
|
|
2094
2106
|
instructionIdentification: payment.id
|
|
2095
2107
|
},
|
|
2096
2108
|
paymentTypeInformation: { instructionPriority: "NORM" },
|
|
@@ -2395,263 +2407,24 @@ class MockConnector extends IBankConnector {
|
|
|
2395
2407
|
}
|
|
2396
2408
|
}
|
|
2397
2409
|
|
|
2398
|
-
const
|
|
2399
|
-
"ERSTE",
|
|
2400
|
-
"FINBRICKS",
|
|
2401
|
-
"MOCK",
|
|
2402
|
-
"CREDITAS",
|
|
2403
|
-
"MOCK_COBS",
|
|
2404
|
-
"FIO",
|
|
2405
|
-
"MONETA",
|
|
2406
|
-
"DBU",
|
|
2407
|
-
"CSAS",
|
|
2408
|
-
"AIRBANK",
|
|
2409
|
-
"KB",
|
|
2410
|
-
"CSOB"
|
|
2411
|
-
];
|
|
2412
|
-
const CREDENTIALS_TYPES = [
|
|
2413
|
-
"AUTH_TOKEN",
|
|
2414
|
-
"REFRESH_TOKEN",
|
|
2415
|
-
"CLIENT_ID",
|
|
2416
|
-
"API_KEY"
|
|
2417
|
-
];
|
|
2418
|
-
const TOKEN_TYPES = ["ACCOUNT_AUTHORIZATION"];
|
|
2419
|
-
|
|
2420
|
-
const account = sqliteCore.sqliteTable(
|
|
2421
|
-
"account",
|
|
2422
|
-
{
|
|
2423
|
-
...backendSdk.base,
|
|
2424
|
-
...backendSdk.bankAccount,
|
|
2425
|
-
// countryCode is temporary until bankAccount is update to include US country code
|
|
2426
|
-
countryCode: sqliteCore.text("country_code", { enum: COUNTRY_CODES }).$type().notNull(),
|
|
2427
|
-
number: sqliteCore.text("number").notNull(),
|
|
2428
|
-
name: sqliteCore.text("name"),
|
|
2429
|
-
iban: sqliteCore.text("iban").notNull(),
|
|
2430
|
-
bankCode: sqliteCore.text("bank_code", { enum: generalCodes.BANK_CODES }).notNull(),
|
|
2431
|
-
connectorKey: sqliteCore.text("connector_key", {
|
|
2432
|
-
enum: CONNECTOR_KEYS
|
|
2433
|
-
}).$type().notNull(),
|
|
2434
|
-
status: sqliteCore.text("status", { enum: ACCOUNT_STATUSES }).$type().notNull(),
|
|
2435
|
-
bankRefId: sqliteCore.text("bank_ref_id").notNull(),
|
|
2436
|
-
batchSizeLimit: sqliteCore.integer("batch_size_limit").notNull().default(50),
|
|
2437
|
-
syncIntervalS: sqliteCore.integer("sync_interval_s").notNull().default(600),
|
|
2438
|
-
lastSyncAt: sqliteCore.integer("last_sync_at", { mode: "timestamp_ms" }),
|
|
2439
|
-
lastSyncMetadata: sqliteCore.text("last_sync_metadata", {
|
|
2440
|
-
mode: "json"
|
|
2441
|
-
}).$type(),
|
|
2442
|
-
connectorConfig: sqliteCore.text("connector_config", {
|
|
2443
|
-
mode: "json"
|
|
2444
|
-
}).$type()
|
|
2445
|
-
},
|
|
2446
|
-
(t) => [sqliteCore.unique().on(t.iban)]
|
|
2447
|
-
);
|
|
2448
|
-
|
|
2449
|
-
const accountInsertSchema = drizzleZod.createInsertSchema(account, {
|
|
2410
|
+
const accountInsertSchema = drizzleZod.createInsertSchema(database_schema.account, {
|
|
2450
2411
|
address: () => backendSdk.structuredAddressSchema.optional()
|
|
2451
2412
|
});
|
|
2452
|
-
const accountUpdateSchema = drizzleZod.createUpdateSchema(account, {
|
|
2413
|
+
const accountUpdateSchema = drizzleZod.createUpdateSchema(database_schema.account, {
|
|
2453
2414
|
address: () => backendSdk.structuredAddressSchema.optional()
|
|
2454
2415
|
});
|
|
2455
|
-
const accountSelectSchema = drizzleZod.createSelectSchema(account, {
|
|
2416
|
+
const accountSelectSchema = drizzleZod.createSelectSchema(database_schema.account, {
|
|
2456
2417
|
address: () => backendSdk.structuredAddressSchema.nullable()
|
|
2457
2418
|
});
|
|
2458
2419
|
|
|
2459
|
-
const
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
connectorKey: sqliteCore.text("connector_key", {
|
|
2463
|
-
enum: CONNECTOR_KEYS
|
|
2464
|
-
}).$type().notNull(),
|
|
2465
|
-
type: sqliteCore.text("type", {
|
|
2466
|
-
enum: CREDENTIALS_TYPES
|
|
2467
|
-
}).$type().notNull(),
|
|
2468
|
-
value: sqliteCore.text("value").notNull(),
|
|
2469
|
-
expiresAt: sqliteCore.integer("expires_at", { mode: "timestamp_ms" }).notNull()
|
|
2470
|
-
});
|
|
2471
|
-
|
|
2472
|
-
const accountCredentialsInsertSchema = drizzleZod.createInsertSchema(accountCredentials);
|
|
2473
|
-
const accountCredentialsUpdateSchema = drizzleZod.createUpdateSchema(accountCredentials);
|
|
2474
|
-
const accountCredentialsSelectSchema = drizzleZod.createSelectSchema(accountCredentials);
|
|
2475
|
-
|
|
2476
|
-
const ott = sqliteCore.sqliteTable("ott", {
|
|
2477
|
-
...backendSdk.base,
|
|
2478
|
-
oneTimeToken: sqliteCore.text("one_time_token").notNull(),
|
|
2479
|
-
refId: sqliteCore.text("ref_id").notNull(),
|
|
2480
|
-
tokenType: sqliteCore.text("token_type", { enum: TOKEN_TYPES }).$type().notNull(),
|
|
2481
|
-
expiresAt: sqliteCore.integer("expires_at", { mode: "timestamp_ms" }).notNull()
|
|
2482
|
-
});
|
|
2483
|
-
|
|
2484
|
-
const ottInsertSchema = drizzleZod.createInsertSchema(ott);
|
|
2485
|
-
const ottUpdateSchema = drizzleZod.createUpdateSchema(ott);
|
|
2486
|
-
const ottSelectSchema = drizzleZod.createSelectSchema(ott);
|
|
2487
|
-
|
|
2488
|
-
const batch = sqliteCore.sqliteTable("batch", {
|
|
2489
|
-
...backendSdk.base,
|
|
2490
|
-
batchPaymentInitiatedAt: sqliteCore.integer("batch_payment_initiated_at", {
|
|
2491
|
-
mode: "timestamp_ms"
|
|
2492
|
-
}),
|
|
2493
|
-
authorizationUrls: sqliteCore.text("authorization_urls", { mode: "json" }).$type(),
|
|
2494
|
-
accountId: sqliteCore.text("account_id").references(() => account.id, {
|
|
2495
|
-
onDelete: "restrict",
|
|
2496
|
-
onUpdate: "cascade"
|
|
2497
|
-
}),
|
|
2498
|
-
status: sqliteCore.text("status", { enum: BATCH_STATUSES }).$type(),
|
|
2499
|
-
statusReason: sqliteCore.text("status_reason"),
|
|
2500
|
-
statusResponse: sqliteCore.text("status_response", { mode: "json" }).$type(),
|
|
2501
|
-
metadata: sqliteCore.text("metadata", { mode: "json" }).$type(),
|
|
2502
|
-
paymentType: sqliteCore.text("payment_type", {
|
|
2503
|
-
enum: PAYMENT_TYPES
|
|
2504
|
-
}).$type(),
|
|
2505
|
-
paymentsChecksum: sqliteCore.text("payments_checksum"),
|
|
2506
|
-
batchMode: sqliteCore.text("batch_mode", { enum: BATCH_MODES }).$type()
|
|
2507
|
-
});
|
|
2508
|
-
|
|
2509
|
-
const payment = sqliteCore.sqliteTable(
|
|
2510
|
-
"payment",
|
|
2511
|
-
{
|
|
2512
|
-
...backendSdk.base,
|
|
2513
|
-
correlationId: sqliteCore.text("correlation_id").notNull(),
|
|
2514
|
-
refId: sqliteCore.text("ref_id"),
|
|
2515
|
-
bankRefId: sqliteCore.text("bank_ref_id").notNull(),
|
|
2516
|
-
accountId: sqliteCore.text("account_id").references(() => account.id, {
|
|
2517
|
-
onDelete: "restrict",
|
|
2518
|
-
onUpdate: "cascade"
|
|
2519
|
-
}).notNull(),
|
|
2520
|
-
connectorKey: sqliteCore.text("connector_key", { enum: CONNECTOR_KEYS }).$type().notNull(),
|
|
2521
|
-
amount: sqliteCore.real("amount").notNull(),
|
|
2522
|
-
direction: sqliteCore.text("direction").$type().notNull(),
|
|
2523
|
-
paymentType: sqliteCore.text("payment_type").$type().notNull(),
|
|
2524
|
-
currency: sqliteCore.text("currency").$type().notNull(),
|
|
2525
|
-
status: sqliteCore.text("status", { enum: PAYMENT_STATUSES }).$type().notNull(),
|
|
2526
|
-
statusReason: sqliteCore.text("status_reason"),
|
|
2527
|
-
batchId: sqliteCore.text("bank_execution_batch_id"),
|
|
2528
|
-
initiatedAt: sqliteCore.integer("initiated_at", {
|
|
2529
|
-
mode: "timestamp_ms"
|
|
2530
|
-
}),
|
|
2531
|
-
vs: sqliteCore.text("vs"),
|
|
2532
|
-
ss: sqliteCore.text("ss"),
|
|
2533
|
-
ks: sqliteCore.text("ks"),
|
|
2534
|
-
message: sqliteCore.text("message"),
|
|
2535
|
-
chargeBearer: sqliteCore.text("charge_bearer", {
|
|
2536
|
-
enum: CHARGE_BEARERS
|
|
2537
|
-
}).$type(),
|
|
2538
|
-
instructionPriority: sqliteCore.text("instruction_priority", {
|
|
2539
|
-
enum: INSTRUCTION_PRIORITIES
|
|
2540
|
-
}).$type(),
|
|
2541
|
-
processedAt: sqliteCore.integer("processed_at", {
|
|
2542
|
-
mode: "timestamp_ms"
|
|
2543
|
-
}),
|
|
2544
|
-
creditor: sqliteCore.text("creditor", { mode: "json" }).$type().notNull(),
|
|
2545
|
-
creditorIban: sqliteCore.text("creditor_iban"),
|
|
2546
|
-
debtor: sqliteCore.text("debtor", { mode: "json" }).$type().notNull(),
|
|
2547
|
-
debtorIban: sqliteCore.text("debtor_iban")
|
|
2548
|
-
},
|
|
2549
|
-
(t) => [
|
|
2550
|
-
sqliteCore.unique().on(t.connectorKey, t.accountId, t.bankRefId),
|
|
2551
|
-
sqliteCore.index("payment_account_id_idx").on(t.accountId),
|
|
2552
|
-
sqliteCore.index("payment_account_id_status_idx").on(t.accountId, t.status),
|
|
2553
|
-
sqliteCore.index("payment_account_id_created_at_idx").on(t.accountId, t.createdAt),
|
|
2554
|
-
sqliteCore.index("payment_created_at_idx").on(t.createdAt),
|
|
2555
|
-
sqliteCore.index("payment_direction_idx").on(t.direction),
|
|
2556
|
-
sqliteCore.index("payment_batch_id_idx").on(t.batchId),
|
|
2557
|
-
sqliteCore.index("payment_creditor_iban_idx").on(t.creditorIban),
|
|
2558
|
-
sqliteCore.index("payment_debtor_iban_idx").on(t.debtorIban)
|
|
2559
|
-
]
|
|
2560
|
-
);
|
|
2561
|
-
const paymentRelations = relations.relations(payment, ({ one }) => ({
|
|
2562
|
-
batch: one(batch, { fields: [payment.batchId], references: [batch.id] })
|
|
2563
|
-
}));
|
|
2564
|
-
|
|
2565
|
-
const paymentRequest = sqliteCore.sqliteTable(
|
|
2566
|
-
"payment_request",
|
|
2567
|
-
{
|
|
2568
|
-
...backendSdk.base,
|
|
2569
|
-
batchId: sqliteCore.text("batch_id").references(() => batch.id, {
|
|
2570
|
-
onDelete: "restrict",
|
|
2571
|
-
onUpdate: "cascade"
|
|
2572
|
-
}),
|
|
2573
|
-
accountId: sqliteCore.text("account_id").references(() => account.id, {
|
|
2574
|
-
onDelete: "restrict",
|
|
2575
|
-
onUpdate: "cascade"
|
|
2576
|
-
}).notNull(),
|
|
2577
|
-
correlationId: sqliteCore.text("correlation_id").notNull(),
|
|
2578
|
-
refId: sqliteCore.text("ref_id"),
|
|
2579
|
-
bankRefId: sqliteCore.text("bank_ref_id"),
|
|
2580
|
-
connectorKey: sqliteCore.text("connector_key", { enum: CONNECTOR_KEYS }).$type().notNull(),
|
|
2581
|
-
amount: sqliteCore.real("amount").notNull(),
|
|
2582
|
-
paymentType: sqliteCore.text("payment_type", { enum: PAYMENT_TYPES }).$type().notNull(),
|
|
2583
|
-
currency: sqliteCore.text("currency").$type().notNull(),
|
|
2584
|
-
status: sqliteCore.text("status", { enum: PAYMENT_REQUEST_STATUSES }).$type().notNull(),
|
|
2585
|
-
statusReason: sqliteCore.text("status_reason"),
|
|
2586
|
-
authorizationUrl: sqliteCore.text("authorization_url"),
|
|
2587
|
-
initiatedAt: sqliteCore.integer("initiated_at", { mode: "timestamp_ms" }),
|
|
2588
|
-
processedAt: sqliteCore.integer("processed_at", { mode: "timestamp_ms" }),
|
|
2589
|
-
vs: sqliteCore.text("vs"),
|
|
2590
|
-
ss: sqliteCore.text("ss"),
|
|
2591
|
-
ks: sqliteCore.text("ks"),
|
|
2592
|
-
message: sqliteCore.text("message"),
|
|
2593
|
-
chargeBearer: sqliteCore.text("charge_bearer", {
|
|
2594
|
-
enum: CHARGE_BEARERS
|
|
2595
|
-
}).$type(),
|
|
2596
|
-
instructionPriority: sqliteCore.text("instruction_priority", {
|
|
2597
|
-
enum: INSTRUCTION_PRIORITIES
|
|
2598
|
-
}).$type(),
|
|
2599
|
-
creditor: sqliteCore.text("creditor", { mode: "json" }).$type().notNull(),
|
|
2600
|
-
creditorIban: sqliteCore.text("creditor_iban"),
|
|
2601
|
-
debtor: sqliteCore.text("debtor", { mode: "json" }).$type().notNull(),
|
|
2602
|
-
debtorIban: sqliteCore.text("debtor_iban"),
|
|
2603
|
-
sendAsSinglePayment: sqliteCore.integer("send_as_single_payment", {
|
|
2604
|
-
mode: "boolean"
|
|
2605
|
-
})
|
|
2606
|
-
},
|
|
2607
|
-
(t) => [
|
|
2608
|
-
sqliteCore.index("payment_request_batch_id_idx").on(t.batchId),
|
|
2609
|
-
sqliteCore.index("payment_request_account_id_idx").on(t.accountId),
|
|
2610
|
-
sqliteCore.index("payment_request_creditor_iban_idx").on(t.creditorIban),
|
|
2611
|
-
sqliteCore.index("payment_request_debtor_iban_idx").on(t.debtorIban),
|
|
2612
|
-
sqliteCore.index("payment_request_status_idx").on(t.status),
|
|
2613
|
-
sqliteCore.index("payment_request_created_at_idx").on(t.createdAt),
|
|
2614
|
-
sqliteCore.index("payment_request_account_status_idx").on(t.accountId, t.status),
|
|
2615
|
-
sqliteCore.index("payment_request_status_created_at_idx").on(t.status, t.createdAt),
|
|
2616
|
-
sqliteCore.index("payment_request_account_status_created_at_idx").on(
|
|
2617
|
-
t.accountId,
|
|
2618
|
-
t.status,
|
|
2619
|
-
t.createdAt
|
|
2620
|
-
)
|
|
2621
|
-
]
|
|
2622
|
-
);
|
|
2623
|
-
const paymentRequestRelations = relations.relations(paymentRequest, ({ one }) => ({
|
|
2624
|
-
batch: one(batch, {
|
|
2625
|
-
fields: [paymentRequest.batchId],
|
|
2626
|
-
references: [batch.id]
|
|
2627
|
-
}),
|
|
2628
|
-
account: one(account, {
|
|
2629
|
-
fields: [paymentRequest.accountId],
|
|
2630
|
-
references: [account.id]
|
|
2631
|
-
})
|
|
2632
|
-
}));
|
|
2633
|
-
|
|
2634
|
-
const schema = {
|
|
2635
|
-
__proto__: null,
|
|
2636
|
-
account: account,
|
|
2637
|
-
accountCredentials: accountCredentials,
|
|
2638
|
-
batch: batch,
|
|
2639
|
-
ott: ott,
|
|
2640
|
-
payment: payment,
|
|
2641
|
-
paymentRelations: paymentRelations,
|
|
2642
|
-
paymentRequest: paymentRequest,
|
|
2643
|
-
paymentRequestRelations: paymentRequestRelations
|
|
2644
|
-
};
|
|
2420
|
+
const accountCredentialsInsertSchema = drizzleZod.createInsertSchema(database_schema.accountCredentials);
|
|
2421
|
+
const accountCredentialsUpdateSchema = drizzleZod.createUpdateSchema(database_schema.accountCredentials);
|
|
2422
|
+
const accountCredentialsSelectSchema = drizzleZod.createSelectSchema(database_schema.accountCredentials);
|
|
2645
2423
|
|
|
2646
|
-
const
|
|
2424
|
+
const ottInsertSchema = drizzleZod.createInsertSchema(database_schema.ott);
|
|
2425
|
+
const ottUpdateSchema = drizzleZod.createUpdateSchema(database_schema.ott);
|
|
2426
|
+
const ottSelectSchema = drizzleZod.createSelectSchema(database_schema.ott);
|
|
2647
2427
|
|
|
2648
|
-
exports.ACCOUNT_STATUSES = ACCOUNT_STATUSES;
|
|
2649
|
-
exports.BATCH_MODES = BATCH_MODES;
|
|
2650
|
-
exports.BATCH_STATUSES = BATCH_STATUSES;
|
|
2651
|
-
exports.CHARGE_BEARERS = CHARGE_BEARERS;
|
|
2652
|
-
exports.CONNECTOR_KEYS = CONNECTOR_KEYS;
|
|
2653
|
-
exports.COUNTRY_CODES = COUNTRY_CODES;
|
|
2654
|
-
exports.CREDENTIALS_TYPES = CREDENTIALS_TYPES;
|
|
2655
2428
|
exports.CsobConnector = CsobConnector;
|
|
2656
2429
|
exports.DbuConnector = DbuConnector;
|
|
2657
2430
|
exports.ErsteConnector = ErsteConnector;
|
|
@@ -2659,17 +2432,9 @@ exports.FINBRICKS_ENDPOINTS = FINBRICKS_ENDPOINTS;
|
|
|
2659
2432
|
exports.FinbricksClient = FinbricksClient;
|
|
2660
2433
|
exports.FinbricksConnector = FinbricksConnector;
|
|
2661
2434
|
exports.IBankConnector = IBankConnector;
|
|
2662
|
-
exports.INSTRUCTION_PRIORITIES = INSTRUCTION_PRIORITIES;
|
|
2663
2435
|
exports.KBConnector = KBConnector;
|
|
2664
2436
|
exports.MockCobsConnector = MockCobsConnector;
|
|
2665
2437
|
exports.MockConnector = MockConnector;
|
|
2666
|
-
exports.PAYMENT_DIRECTIONS = PAYMENT_DIRECTIONS;
|
|
2667
|
-
exports.PAYMENT_REQUEST_STATUSES = PAYMENT_REQUEST_STATUSES;
|
|
2668
|
-
exports.PAYMENT_STATUSES = PAYMENT_STATUSES;
|
|
2669
|
-
exports.PAYMENT_TYPES = PAYMENT_TYPES;
|
|
2670
|
-
exports.TOKEN_TYPES = TOKEN_TYPES;
|
|
2671
|
-
exports.account = account;
|
|
2672
|
-
exports.accountCredentials = accountCredentials;
|
|
2673
2438
|
exports.accountCredentialsInsertSchema = accountCredentialsInsertSchema;
|
|
2674
2439
|
exports.accountCredentialsSelectSchema = accountCredentialsSelectSchema;
|
|
2675
2440
|
exports.accountCredentialsUpdateSchema = accountCredentialsUpdateSchema;
|
|
@@ -2677,7 +2442,6 @@ exports.accountInsertSchema = accountInsertSchema;
|
|
|
2677
2442
|
exports.accountSelectSchema = accountSelectSchema;
|
|
2678
2443
|
exports.accountUpdateSchema = accountUpdateSchema;
|
|
2679
2444
|
exports.assignAccount = assignAccount;
|
|
2680
|
-
exports.batch = batch;
|
|
2681
2445
|
exports.dbuAccountConfigSchema = dbuAccountConfigSchema;
|
|
2682
2446
|
exports.getNonTerminalPaymentRequestsQuery = getNonTerminalPaymentRequestsQuery;
|
|
2683
2447
|
exports.hasPaymentAccountAssigned = hasPaymentAccountAssigned;
|
|
@@ -2686,14 +2450,10 @@ exports.isPaymentCompleted = isPaymentCompleted;
|
|
|
2686
2450
|
exports.isPendingStatus = isPendingStatus;
|
|
2687
2451
|
exports.isProcessedStatus = isProcessedStatus;
|
|
2688
2452
|
exports.isTerminalStatus = isTerminalStatus;
|
|
2689
|
-
exports.ott = ott;
|
|
2690
2453
|
exports.ottInsertSchema = ottInsertSchema;
|
|
2691
2454
|
exports.ottSelectSchema = ottSelectSchema;
|
|
2692
2455
|
exports.ottUpdateSchema = ottUpdateSchema;
|
|
2693
|
-
exports.
|
|
2694
|
-
exports.paymentRelations = paymentRelations;
|
|
2695
|
-
exports.paymentRequest = paymentRequest;
|
|
2696
|
-
exports.paymentRequestRelations = paymentRequestRelations;
|
|
2456
|
+
exports.relations = relations;
|
|
2697
2457
|
exports.signFinbricksJws = signFinbricksJws;
|
|
2698
2458
|
exports.tables = tables;
|
|
2699
2459
|
exports.toBatchedPayment = toBatchedPayment;
|