@develit-services/bank 0.0.43 → 0.1.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 -1
- package/dist/database/schema.d.cts +1 -1
- package/dist/database/schema.d.mts +1 -1
- package/dist/database/schema.d.ts +1 -1
- package/dist/database/schema.mjs +1 -1
- package/dist/export/worker.cjs +115 -567
- package/dist/export/worker.d.cts +86 -19
- package/dist/export/worker.d.mts +87 -18
- package/dist/export/worker.d.ts +86 -19
- package/dist/export/worker.mjs +107 -556
- package/dist/export/workflows.cjs +21 -0
- package/dist/export/workflows.d.cts +2 -0
- package/dist/export/workflows.d.mts +2 -0
- package/dist/export/workflows.d.ts +2 -0
- package/dist/export/workflows.mjs +15 -0
- package/dist/export/wrangler.cjs +7 -0
- package/dist/export/wrangler.d.cts +5 -0
- package/dist/export/wrangler.d.mts +5 -0
- package/dist/export/wrangler.d.ts +5 -0
- package/dist/export/wrangler.mjs +7 -0
- package/dist/shared/{bank.BVzOzXdX.cjs → bank.3YYIj-n6.cjs} +11 -9
- package/dist/shared/{bank.6WoCPIFy.mjs → bank.B72e0ibs.mjs} +1 -1
- package/dist/shared/{bank.BPcrbUBa.cjs → bank.BgpXGC_1.cjs} +1 -1
- package/dist/shared/{bank.B7uB4cyW.d.cts → bank.BriEYREq.d.cts} +6 -6
- package/dist/shared/{bank.B7uB4cyW.d.mts → bank.BriEYREq.d.mts} +6 -6
- package/dist/shared/{bank.B7uB4cyW.d.ts → bank.BriEYREq.d.ts} +6 -6
- package/dist/shared/bank.CH22Zrdv.d.cts +20 -0
- package/dist/shared/bank.CH22Zrdv.d.mts +20 -0
- package/dist/shared/bank.CH22Zrdv.d.ts +20 -0
- package/dist/shared/{bank.BWcFhTu1.mjs → bank.CcKNlFRd.mjs} +11 -9
- package/dist/shared/{bank.C9Z9B0Po.d.ts → bank.DSZbtb1J.d.mts} +40 -36
- package/dist/shared/{bank.B_JR9YGK.d.cts → bank.Ddhhr_rz.d.ts} +40 -36
- package/dist/shared/{bank.Dadvg35r.d.mts → bank.DqRaP8LS.d.cts} +40 -36
- package/dist/shared/bank.GMK4QNvo.cjs +276 -0
- package/dist/shared/bank.jyyw3_3-.mjs +267 -0
- package/dist/types.cjs +2 -2
- package/dist/types.d.cts +16 -9
- package/dist/types.d.mts +16 -9
- package/dist/types.d.ts +16 -9
- package/dist/types.mjs +2 -2
- package/package.json +6 -1
package/dist/export/worker.mjs
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as getPaymentsByBankRefIdsQuery, u as updatePaymentCommand, c as createPaymentCommand, a as updateAccountLastSyncCommand, b as getCredentialsByAccountId, i as initiateConnector } from '../shared/bank.jyyw3_3-.mjs';
|
|
2
|
+
export { w as BankWorkflows } from '../shared/bank.jyyw3_3-.mjs';
|
|
3
|
+
import { uuidv4, bankAccountMetadataSchema, workflowInstanceStatusSchema, develitWorker, createInternalError, first, action, service } from '@develit-io/backend-sdk';
|
|
2
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
3
5
|
import { drizzle } from 'drizzle-orm/d1';
|
|
4
|
-
import { t as tables,
|
|
6
|
+
import { t as tables, c as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, P as PAYMENT_TYPES, g as CONNECTOR_KEYS, B as BATCH_STATUSES, d as PAYMENT_STATUSES, e as PAYMENT_DIRECTIONS, i as accountInsertSchema, v as getPaymentDirection, M as MockConnector, F as FinbricksConnector, E as ErsteConnector } from '../shared/bank.CcKNlFRd.mjs';
|
|
5
7
|
import 'jose';
|
|
6
8
|
import { CURRENCY_CODES } from '@develit-io/general-codes';
|
|
7
9
|
import { z } from 'zod';
|
|
8
10
|
import { eq, inArray, and, sql, asc, desc, gte, lte } from 'drizzle-orm';
|
|
9
|
-
import
|
|
11
|
+
import 'cloudflare:workflows';
|
|
12
|
+
import '../shared/bank.B72e0ibs.mjs';
|
|
10
13
|
import 'drizzle-orm/sqlite-core';
|
|
11
14
|
import 'date-fns';
|
|
12
15
|
import 'drizzle-zod';
|
|
@@ -26,18 +29,6 @@ const upsertAccountCommand = (db, { account }) => {
|
|
|
26
29
|
};
|
|
27
30
|
};
|
|
28
31
|
|
|
29
|
-
const createPaymentCommand = (db, { payment }) => {
|
|
30
|
-
return {
|
|
31
|
-
command: db.insert(tables.payment).values(payment).returning()
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const updatePaymentCommand = (db, { payment }) => {
|
|
36
|
-
return {
|
|
37
|
-
command: db.update(tables.payment).set(payment).where(eq(tables.payment.id, payment.id)).returning()
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
|
|
41
32
|
const upsertBatchCommand = (db, { batch }) => {
|
|
42
33
|
const id = batch.id || uuidv4();
|
|
43
34
|
const command = db.insert(tables.batch).values({
|
|
@@ -98,23 +89,10 @@ const deleteAccountCredentialsCommand = (db, { accountId }) => {
|
|
|
98
89
|
};
|
|
99
90
|
};
|
|
100
91
|
|
|
101
|
-
const updateAccountLastSyncCommand = (db, { lastSyncedAt, accountId }) => {
|
|
102
|
-
const command = db.update(tables.account).set({
|
|
103
|
-
lastSyncedAt
|
|
104
|
-
}).where(eq(tables.account.id, accountId)).returning();
|
|
105
|
-
return {
|
|
106
|
-
command
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
|
|
110
92
|
const getAccountByIbanQuery = async (db, { iban }) => {
|
|
111
93
|
return await db.select().from(tables.account).where(eq(tables.account.iban, iban)).get();
|
|
112
94
|
};
|
|
113
95
|
|
|
114
|
-
const getAccountByIdQuery = async (db, { accountId }) => {
|
|
115
|
-
return await db.select().from(tables.account).where(eq(tables.account.id, accountId)).get();
|
|
116
|
-
};
|
|
117
|
-
|
|
118
96
|
const getAllAccountsQuery = async (db) => {
|
|
119
97
|
const accountsWithExpiration = await db.select().from(tables.account).leftJoin(
|
|
120
98
|
tables.accountCredentials,
|
|
@@ -224,11 +202,6 @@ const getBatchesQuery = async (db, {
|
|
|
224
202
|
};
|
|
225
203
|
};
|
|
226
204
|
|
|
227
|
-
const getCredentialsByAccountId = async (db, { accountId }) => {
|
|
228
|
-
const cred = await db.select().from(tables.accountCredentials).where(eq(tables.accountCredentials.accountId, accountId)).get();
|
|
229
|
-
return cred;
|
|
230
|
-
};
|
|
231
|
-
|
|
232
205
|
const getAccountOpenBatchesQuery = async (db, { accountId }) => {
|
|
233
206
|
return await db.select().from(tables.batch).where(
|
|
234
207
|
and(
|
|
@@ -247,82 +220,6 @@ const getPaymentByRefIdQuery = async (db, { refId }) => {
|
|
|
247
220
|
return payment;
|
|
248
221
|
};
|
|
249
222
|
|
|
250
|
-
const getPaymentsByBankRefIdsQuery = async (db, { ids }) => {
|
|
251
|
-
return await db.select().from(tables.payment).where(inArray(tables.payment.bankRefId, ids));
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
class CreditasConnector extends FinbricksConnector {
|
|
255
|
-
constructor(config) {
|
|
256
|
-
super("CREDITAS", config);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
class FioConnector extends FinbricksConnector {
|
|
261
|
-
constructor(config) {
|
|
262
|
-
super("FIO", config);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
class MonetaConnector extends FinbricksConnector {
|
|
267
|
-
constructor(config) {
|
|
268
|
-
super("MONETA", config);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
const initiateConnector = ({
|
|
273
|
-
bank,
|
|
274
|
-
env,
|
|
275
|
-
connectedAccounts
|
|
276
|
-
}) => {
|
|
277
|
-
switch (bank) {
|
|
278
|
-
case "ERSTE":
|
|
279
|
-
return new ErsteConnector({
|
|
280
|
-
API_KEY: env.ERSTE_API_KEY,
|
|
281
|
-
CLIENT_ID: env.ERSTE_CLIENT_ID,
|
|
282
|
-
CLIENT_SECRET: env.ERSTE_CLIENT_SECRET,
|
|
283
|
-
REDIRECT_URI: env.REDIRECT_URI,
|
|
284
|
-
AUTH_URI: env.ERSTE_AUTH_URI,
|
|
285
|
-
PAYMENTS_URI: env.ERSTE_PAYMENTS_URI,
|
|
286
|
-
ACCOUNTS_URI: env.ERSTE_ACCOUNTS_URI,
|
|
287
|
-
connectedAccounts
|
|
288
|
-
});
|
|
289
|
-
case "CREDITAS":
|
|
290
|
-
return new CreditasConnector({
|
|
291
|
-
BASE_URI: env.FINBRICKS_BASE_URI,
|
|
292
|
-
MERCHANT_ID: env.FINBRICKS_MERCHANT_ID,
|
|
293
|
-
PRIVATE_KEY_PEM: env.FINBRICKS_PRIVATE_KEY_PEM,
|
|
294
|
-
REDIRECT_URI: env.REDIRECT_URI,
|
|
295
|
-
connectedAccounts
|
|
296
|
-
});
|
|
297
|
-
case "MOCK_COBS":
|
|
298
|
-
return new MockCobsConnector({
|
|
299
|
-
BASE_URI: env.FINBRICKS_BASE_URI,
|
|
300
|
-
MERCHANT_ID: env.FINBRICKS_MERCHANT_ID,
|
|
301
|
-
PRIVATE_KEY_PEM: env.FINBRICKS_PRIVATE_KEY_PEM,
|
|
302
|
-
REDIRECT_URI: env.REDIRECT_URI,
|
|
303
|
-
connectedAccounts
|
|
304
|
-
});
|
|
305
|
-
case "FIO":
|
|
306
|
-
return new FioConnector({
|
|
307
|
-
BASE_URI: env.FINBRICKS_BASE_URI,
|
|
308
|
-
MERCHANT_ID: env.FINBRICKS_MERCHANT_ID,
|
|
309
|
-
PRIVATE_KEY_PEM: env.FINBRICKS_PRIVATE_KEY_PEM,
|
|
310
|
-
REDIRECT_URI: env.REDIRECT_URI,
|
|
311
|
-
connectedAccounts
|
|
312
|
-
});
|
|
313
|
-
case "MONETA":
|
|
314
|
-
return new MonetaConnector({
|
|
315
|
-
BASE_URI: env.FINBRICKS_BASE_URI,
|
|
316
|
-
MERCHANT_ID: env.FINBRICKS_MERCHANT_ID,
|
|
317
|
-
PRIVATE_KEY_PEM: env.FINBRICKS_PRIVATE_KEY_PEM,
|
|
318
|
-
REDIRECT_URI: env.REDIRECT_URI,
|
|
319
|
-
connectedAccounts
|
|
320
|
-
});
|
|
321
|
-
default:
|
|
322
|
-
return new MockConnector();
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
|
|
326
223
|
const seperateSupportedPayments = (mappedPayments, accounts) => {
|
|
327
224
|
const [supportedPayments, unsupportedPayments] = mappedPayments.reduce(
|
|
328
225
|
([valid, invalid], payment) => {
|
|
@@ -436,6 +333,26 @@ const getPaymentsInputSchema = z.object({
|
|
|
436
333
|
const syncAccountInputSchema = z.object({
|
|
437
334
|
accountId: z.uuid()
|
|
438
335
|
});
|
|
336
|
+
z.object({
|
|
337
|
+
instanceId: z.string(),
|
|
338
|
+
details: workflowInstanceStatusSchema
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
const syncAccountStatusInputSchema = z.object({
|
|
342
|
+
accountId: z.uuid()
|
|
343
|
+
});
|
|
344
|
+
z.object({
|
|
345
|
+
instanceId: z.string(),
|
|
346
|
+
details: workflowInstanceStatusSchema
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
const syncAccountRestartInputSchema = z.object({
|
|
350
|
+
accountId: z.uuid()
|
|
351
|
+
});
|
|
352
|
+
z.object({
|
|
353
|
+
instanceId: z.string(),
|
|
354
|
+
details: workflowInstanceStatusSchema
|
|
355
|
+
});
|
|
439
356
|
|
|
440
357
|
const updateAccountInputSchema = z.object({
|
|
441
358
|
account: accountInsertSchema
|
|
@@ -471,13 +388,21 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
471
388
|
for (const account of accounts.filter(
|
|
472
389
|
(acc) => acc.connectorKey === connectorKey
|
|
473
390
|
)) {
|
|
391
|
+
if (!account.lastSyncedAt) {
|
|
392
|
+
this.log({
|
|
393
|
+
message: `Skipping account ${account.id} as it has no lastSyncedAt date.`
|
|
394
|
+
});
|
|
395
|
+
continue;
|
|
396
|
+
}
|
|
474
397
|
const payments = await this.bankConnector.getAllAccountPayments({
|
|
475
398
|
db: this.db,
|
|
476
|
-
|
|
477
|
-
account
|
|
399
|
+
environment: this.env.ENVIRONMENT,
|
|
400
|
+
account,
|
|
401
|
+
filter: {
|
|
402
|
+
dateFrom: account.lastSyncedAt
|
|
403
|
+
}
|
|
478
404
|
});
|
|
479
405
|
if (!payments || payments.length === 0) continue;
|
|
480
|
-
this.log(payments);
|
|
481
406
|
payments.forEach((payment) => {
|
|
482
407
|
payment.direction = getPaymentDirection(payment, account.iban);
|
|
483
408
|
});
|
|
@@ -492,16 +417,42 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
492
417
|
ids: bankRefIds
|
|
493
418
|
}
|
|
494
419
|
);
|
|
420
|
+
const eventsToPush = [];
|
|
495
421
|
const paymentsCommands = allFetchedPayments.map((payment) => {
|
|
496
422
|
const isAlreadyExisting = alreadyExistingPayments.some(
|
|
497
423
|
(existingPayment) => existingPayment.bankRefId === payment.bankRefId
|
|
498
424
|
);
|
|
499
|
-
if (isAlreadyExisting)
|
|
425
|
+
if (isAlreadyExisting) {
|
|
426
|
+
eventsToPush.push({
|
|
427
|
+
eventType: "BANK_PAYMENT",
|
|
428
|
+
eventSignal: "paymentUpdated",
|
|
429
|
+
bankPayment: payment,
|
|
430
|
+
metadata: {
|
|
431
|
+
correlationId: payment.correlationId,
|
|
432
|
+
entityId: payment.id,
|
|
433
|
+
idempotencySuffix: payment.status,
|
|
434
|
+
timestamp: (/* @__PURE__ */ new Date()).toDateString()
|
|
435
|
+
}
|
|
436
|
+
});
|
|
500
437
|
return updatePaymentCommand(this.db, { payment }).command;
|
|
438
|
+
}
|
|
439
|
+
eventsToPush.push({
|
|
440
|
+
eventType: "BANK_PAYMENT",
|
|
441
|
+
eventSignal: "paymentCreated",
|
|
442
|
+
bankPayment: payment,
|
|
443
|
+
metadata: {
|
|
444
|
+
correlationId: payment.correlationId,
|
|
445
|
+
entityId: payment.id,
|
|
446
|
+
timestamp: (/* @__PURE__ */ new Date()).toDateString()
|
|
447
|
+
}
|
|
448
|
+
});
|
|
501
449
|
return createPaymentCommand(this.db, { payment }).command;
|
|
502
450
|
});
|
|
503
451
|
await this.db.batch([paymentsCommands[0], ...paymentsCommands.slice(1)]);
|
|
504
|
-
|
|
452
|
+
await this.pushToQueue(
|
|
453
|
+
this.env.QUEUE_BUS_QUEUE,
|
|
454
|
+
eventsToPush
|
|
455
|
+
);
|
|
505
456
|
for (const account of accounts) {
|
|
506
457
|
const paymentsForAccount = allFetchedPayments.filter(
|
|
507
458
|
(payment) => (payment.direction === "OUTGOING" ? payment.debtorIban : payment.creditorIban) === account.iban
|
|
@@ -522,18 +473,6 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
522
473
|
}).command.execute();
|
|
523
474
|
}
|
|
524
475
|
}
|
|
525
|
-
await this.pushToQueue(
|
|
526
|
-
this.env.QUEUE_BUS_QUEUE,
|
|
527
|
-
allFetchedPayments.map((payment) => ({
|
|
528
|
-
eventType: "BANK_PAYMENT",
|
|
529
|
-
eventSignal: "created",
|
|
530
|
-
bankPayment: payment,
|
|
531
|
-
metadata: {
|
|
532
|
-
correlationId: uuidv4(),
|
|
533
|
-
timestamp: (/* @__PURE__ */ new Date()).toDateString()
|
|
534
|
-
}
|
|
535
|
-
}))
|
|
536
|
-
);
|
|
537
476
|
}
|
|
538
477
|
async _initiateBankConnector({
|
|
539
478
|
connectorKey,
|
|
@@ -599,18 +538,45 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
599
538
|
async syncAccount(input) {
|
|
600
539
|
return this.handleAction(
|
|
601
540
|
{ data: input, schema: syncAccountInputSchema },
|
|
602
|
-
{ successMessage: "Account
|
|
541
|
+
{ successMessage: "Account sync workflow started" },
|
|
603
542
|
async ({ accountId }) => {
|
|
604
|
-
const
|
|
605
|
-
accountId
|
|
543
|
+
const instance = await this.env.SYNC_ACCOUNT_PAYMENTS_WORKFLOW.create({
|
|
544
|
+
id: accountId,
|
|
545
|
+
params: {
|
|
546
|
+
accountId
|
|
547
|
+
}
|
|
606
548
|
});
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
549
|
+
return {
|
|
550
|
+
instanceId: instance.id,
|
|
551
|
+
details: await instance.status()
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
);
|
|
555
|
+
}
|
|
556
|
+
async syncAccountStatus(input) {
|
|
557
|
+
return this.handleAction(
|
|
558
|
+
{ data: input, schema: syncAccountStatusInputSchema },
|
|
559
|
+
{ successMessage: "Account sync workflow status retrieved" },
|
|
560
|
+
async ({ accountId }) => {
|
|
561
|
+
const instance = await this.env.SYNC_ACCOUNT_PAYMENTS_WORKFLOW.get(accountId);
|
|
562
|
+
return {
|
|
563
|
+
instanceId: instance.id,
|
|
564
|
+
details: await instance.status()
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
async syncAccountRestart(input) {
|
|
570
|
+
return this.handleAction(
|
|
571
|
+
{ data: input, schema: syncAccountRestartInputSchema },
|
|
572
|
+
{ successMessage: "Account sync workflow restarted" },
|
|
573
|
+
async ({ accountId }) => {
|
|
574
|
+
const instance = await this.env.SYNC_ACCOUNT_PAYMENTS_WORKFLOW.get(accountId);
|
|
575
|
+
await instance.restart();
|
|
576
|
+
return {
|
|
577
|
+
instanceId: instance.id,
|
|
578
|
+
details: await instance.status()
|
|
579
|
+
};
|
|
614
580
|
}
|
|
615
581
|
);
|
|
616
582
|
}
|
|
@@ -736,14 +702,15 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
736
702
|
this.env.QUEUE_BUS_QUEUE,
|
|
737
703
|
unsupportedPayments.map((unsupported) => ({
|
|
738
704
|
eventType: "BANK_PAYMENT",
|
|
705
|
+
eventSignal: "paymentFailed",
|
|
739
706
|
bankPayment: {
|
|
740
707
|
...unsupported,
|
|
741
708
|
status: "FAILED",
|
|
742
709
|
statusReason: "UNSUPPORTED_ACCOUNT"
|
|
743
710
|
},
|
|
744
|
-
eventSignal: "failed",
|
|
745
711
|
metadata: {
|
|
746
712
|
correlationId: unsupported.correlationId,
|
|
713
|
+
entityId: unsupported.id,
|
|
747
714
|
timestamp: (/* @__PURE__ */ new Date()).toDateString()
|
|
748
715
|
}
|
|
749
716
|
}))
|
|
@@ -1068,10 +1035,11 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
1068
1035
|
this.logQueuePush({ payment, isPaymentExecuted: true });
|
|
1069
1036
|
await this.pushToQueue(this.env.QUEUE_BUS_QUEUE, {
|
|
1070
1037
|
eventType: "BANK_PAYMENT",
|
|
1071
|
-
eventSignal: "
|
|
1038
|
+
eventSignal: "paymentCompleted",
|
|
1072
1039
|
bankPayment: createdPayment,
|
|
1073
1040
|
metadata: {
|
|
1074
1041
|
correlationId: createdPayment.correlationId,
|
|
1042
|
+
entityId: createdPayment.id,
|
|
1075
1043
|
timestamp: (/* @__PURE__ */ new Date()).toDateString()
|
|
1076
1044
|
}
|
|
1077
1045
|
});
|
|
@@ -1212,421 +1180,4 @@ function defineBankService({
|
|
|
1212
1180
|
};
|
|
1213
1181
|
}
|
|
1214
1182
|
|
|
1215
|
-
|
|
1216
|
-
config: {
|
|
1217
|
-
allowedProviders: []
|
|
1218
|
-
// {
|
|
1219
|
-
// connectorKey: 'MOCK_COBS',
|
|
1220
|
-
// id: 'staging-czk',
|
|
1221
|
-
// identification: {
|
|
1222
|
-
// number: '1234567890',
|
|
1223
|
-
// bankCode: '5051',
|
|
1224
|
-
// iban: 'CZ0350510000000000000449',
|
|
1225
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1226
|
-
// },
|
|
1227
|
-
// fallbackLastSync: monthAgo,
|
|
1228
|
-
// currency: 'CZK',
|
|
1229
|
-
// production: false,
|
|
1230
|
-
// },
|
|
1231
|
-
// {
|
|
1232
|
-
// connectorKey: 'MOCK_COBS',
|
|
1233
|
-
// id: 'staging-eur',
|
|
1234
|
-
// identification: {
|
|
1235
|
-
// number: '2345678901',
|
|
1236
|
-
// bankCode: '5051',
|
|
1237
|
-
// iban: 'CZ0750510000000000000668',
|
|
1238
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1239
|
-
// },
|
|
1240
|
-
// fallbackLastSync: monthAgo,
|
|
1241
|
-
// currency: 'EUR',
|
|
1242
|
-
// production: false,
|
|
1243
|
-
// },
|
|
1244
|
-
// {
|
|
1245
|
-
// connectorKey: 'FIO',
|
|
1246
|
-
// id: 'kleinpetr-test',
|
|
1247
|
-
// identification: {
|
|
1248
|
-
// number: '2502130437',
|
|
1249
|
-
// bankCode: '2010',
|
|
1250
|
-
// iban: 'CZ8520100000002502130437',
|
|
1251
|
-
// holderName: 'Petr Klein',
|
|
1252
|
-
// },
|
|
1253
|
-
// fallbackLastSync: monthAgo,
|
|
1254
|
-
// currency: 'CZK',
|
|
1255
|
-
// production: true,
|
|
1256
|
-
// },
|
|
1257
|
-
// {
|
|
1258
|
-
// connectorKey: 'MOCK',
|
|
1259
|
-
// id: 'id-test',
|
|
1260
|
-
// identification: {
|
|
1261
|
-
// number: '777777777',
|
|
1262
|
-
// bankCode: '0800',
|
|
1263
|
-
// iban: 'PL0000000000002444430437',
|
|
1264
|
-
// holderName: 'Test Test',
|
|
1265
|
-
// },
|
|
1266
|
-
// fallbackLastSync: monthAgo,
|
|
1267
|
-
// currency: 'PLN',
|
|
1268
|
-
// production: false,
|
|
1269
|
-
// },
|
|
1270
|
-
// {
|
|
1271
|
-
// connectorKey: 'MOCK_COBS',
|
|
1272
|
-
// id: 'staging-usd',
|
|
1273
|
-
// identification: {
|
|
1274
|
-
// iban: 'CZ3456789012345678901234',
|
|
1275
|
-
// accountNumberWithBankCode: '3456789012/3456',
|
|
1276
|
-
// },
|
|
1277
|
-
// currency: 'USD',
|
|
1278
|
-
// bankCode: '0800',
|
|
1279
|
-
// accountNumber: '3456789012',
|
|
1280
|
-
// production: false,
|
|
1281
|
-
// },
|
|
1282
|
-
// ],
|
|
1283
|
-
// productionAccounts: [
|
|
1284
|
-
// // Banka CREDITAS (2250)
|
|
1285
|
-
// {
|
|
1286
|
-
// connectorKey: 'CREDITAS',
|
|
1287
|
-
// id: '2250-CZK',
|
|
1288
|
-
// identification: {
|
|
1289
|
-
// number: '100602391',
|
|
1290
|
-
// bankCode: '2250',
|
|
1291
|
-
// iban: 'CZ5122500000000100602391',
|
|
1292
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1293
|
-
// },
|
|
1294
|
-
// fallbackLastSync: monthAgo,
|
|
1295
|
-
// currency: 'CZK',
|
|
1296
|
-
// production: true,
|
|
1297
|
-
// },
|
|
1298
|
-
// {
|
|
1299
|
-
// connectorKey: 'CREDITAS',
|
|
1300
|
-
// id: '2250-EUR',
|
|
1301
|
-
// identification: {
|
|
1302
|
-
// number: '100602404',
|
|
1303
|
-
// bankCode: '2250',
|
|
1304
|
-
// iban: 'CZ8822500000000100602404',
|
|
1305
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1306
|
-
// },
|
|
1307
|
-
// fallbackLastSync: monthAgo,
|
|
1308
|
-
// currency: 'EUR',
|
|
1309
|
-
// production: true,
|
|
1310
|
-
// },
|
|
1311
|
-
// {
|
|
1312
|
-
// connectorKey: 'CREDITAS',
|
|
1313
|
-
// id: '2250-USD',
|
|
1314
|
-
// identification: {
|
|
1315
|
-
// number: '100602412',
|
|
1316
|
-
// bankCode: '2250',
|
|
1317
|
-
// iban: 'CZ6622500000000100602412',
|
|
1318
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1319
|
-
// },
|
|
1320
|
-
// fallbackLastSync: monthAgo,
|
|
1321
|
-
// currency: 'USD',
|
|
1322
|
-
// production: true,
|
|
1323
|
-
// },
|
|
1324
|
-
// {
|
|
1325
|
-
// connectorKey: 'CREDITAS',
|
|
1326
|
-
// id: '2250-GBP',
|
|
1327
|
-
// identification: {
|
|
1328
|
-
// number: '100602420',
|
|
1329
|
-
// bankCode: '2250',
|
|
1330
|
-
// iban: 'CZ4422500000000100602420',
|
|
1331
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1332
|
-
// },
|
|
1333
|
-
// fallbackLastSync: monthAgo,
|
|
1334
|
-
// currency: 'GBP',
|
|
1335
|
-
// production: true,
|
|
1336
|
-
// },
|
|
1337
|
-
// {
|
|
1338
|
-
// connectorKey: 'CREDITAS',
|
|
1339
|
-
// id: '2250-CHF',
|
|
1340
|
-
// identification: {
|
|
1341
|
-
// number: '100602439',
|
|
1342
|
-
// bankCode: '2250',
|
|
1343
|
-
// iban: 'CZ1622500000000100602439',
|
|
1344
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1345
|
-
// },
|
|
1346
|
-
// fallbackLastSync: monthAgo,
|
|
1347
|
-
// currency: 'CHF',
|
|
1348
|
-
// production: true,
|
|
1349
|
-
// },
|
|
1350
|
-
// {
|
|
1351
|
-
// connectorKey: 'CREDITAS',
|
|
1352
|
-
// id: '2250-PLN',
|
|
1353
|
-
// identification: {
|
|
1354
|
-
// number: '100602447',
|
|
1355
|
-
// bankCode: '2250',
|
|
1356
|
-
// iban: 'CZ9122500000000100602447',
|
|
1357
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1358
|
-
// },
|
|
1359
|
-
// fallbackLastSync: monthAgo,
|
|
1360
|
-
// currency: 'PLN',
|
|
1361
|
-
// production: true,
|
|
1362
|
-
// },
|
|
1363
|
-
// // Fio banka (2010)
|
|
1364
|
-
// {
|
|
1365
|
-
// connectorKey: 'FINBRICKS',
|
|
1366
|
-
// id: '2010-CZK',
|
|
1367
|
-
// identification: {
|
|
1368
|
-
// number: '2500845869',
|
|
1369
|
-
// bankCode: '2010',
|
|
1370
|
-
// iban: 'CZ0420100000002500845869',
|
|
1371
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1372
|
-
// },
|
|
1373
|
-
// fallbackLastSync: monthAgo,
|
|
1374
|
-
// currency: 'CZK',
|
|
1375
|
-
// production: true,
|
|
1376
|
-
// },
|
|
1377
|
-
// {
|
|
1378
|
-
// connectorKey: 'FINBRICKS',
|
|
1379
|
-
// id: '2010-EUR',
|
|
1380
|
-
// identification: {
|
|
1381
|
-
// number: '2600884128',
|
|
1382
|
-
// bankCode: '2010',
|
|
1383
|
-
// iban: 'CZ0820100000002600884128',
|
|
1384
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1385
|
-
// },
|
|
1386
|
-
// fallbackLastSync: monthAgo,
|
|
1387
|
-
// currency: 'EUR',
|
|
1388
|
-
// production: true,
|
|
1389
|
-
// },
|
|
1390
|
-
// {
|
|
1391
|
-
// connectorKey: 'FINBRICKS',
|
|
1392
|
-
// id: '2010-USD',
|
|
1393
|
-
// identification: {
|
|
1394
|
-
// number: '2700884133',
|
|
1395
|
-
// bankCode: '2010',
|
|
1396
|
-
// iban: 'CZ1420100000002700884133',
|
|
1397
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1398
|
-
// },
|
|
1399
|
-
// fallbackLastSync: monthAgo,
|
|
1400
|
-
// currency: 'USD',
|
|
1401
|
-
// production: true,
|
|
1402
|
-
// },
|
|
1403
|
-
// {
|
|
1404
|
-
// connectorKey: 'FINBRICKS',
|
|
1405
|
-
// id: '2010-CHF',
|
|
1406
|
-
// identification: {
|
|
1407
|
-
// number: '2401098351',
|
|
1408
|
-
// bankCode: '2010',
|
|
1409
|
-
// iban: 'CZ0920100000002401098351',
|
|
1410
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1411
|
-
// },
|
|
1412
|
-
// fallbackLastSync: monthAgo,
|
|
1413
|
-
// currency: 'CHF',
|
|
1414
|
-
// production: true,
|
|
1415
|
-
// },
|
|
1416
|
-
// {
|
|
1417
|
-
// connectorKey: 'FINBRICKS',
|
|
1418
|
-
// id: '2010-GBP',
|
|
1419
|
-
// identification: {
|
|
1420
|
-
// number: '2400884131',
|
|
1421
|
-
// bankCode: '2010',
|
|
1422
|
-
// iban: 'CZ3320100000002400884131',
|
|
1423
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1424
|
-
// },
|
|
1425
|
-
// fallbackLastSync: monthAgo,
|
|
1426
|
-
// currency: 'GBP',
|
|
1427
|
-
// production: true,
|
|
1428
|
-
// },
|
|
1429
|
-
// {
|
|
1430
|
-
// connectorKey: 'FINBRICKS',
|
|
1431
|
-
// id: '2010-PLN',
|
|
1432
|
-
// identification: {
|
|
1433
|
-
// number: '2701098353',
|
|
1434
|
-
// bankCode: '2010',
|
|
1435
|
-
// iban: 'CZ8720100000002701098353',
|
|
1436
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1437
|
-
// },
|
|
1438
|
-
// fallbackLastSync: monthAgo,
|
|
1439
|
-
// currency: 'PLN',
|
|
1440
|
-
// production: true,
|
|
1441
|
-
// },
|
|
1442
|
-
// {
|
|
1443
|
-
// connectorKey: 'FINBRICKS',
|
|
1444
|
-
// id: '2010-CAD',
|
|
1445
|
-
// identification: {
|
|
1446
|
-
// number: '2701478102',
|
|
1447
|
-
// bankCode: '2010',
|
|
1448
|
-
// iban: 'CZ5520100000002701478102',
|
|
1449
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1450
|
-
// },
|
|
1451
|
-
// fallbackLastSync: monthAgo,
|
|
1452
|
-
// currency: 'CAD',
|
|
1453
|
-
// production: true,
|
|
1454
|
-
// },
|
|
1455
|
-
// // Komerční banka (0100)
|
|
1456
|
-
// {
|
|
1457
|
-
// connectorKey: 'FINBRICKS',
|
|
1458
|
-
// id: '0100-CZK',
|
|
1459
|
-
// identification: {
|
|
1460
|
-
// number: '115-1483630297',
|
|
1461
|
-
// bankCode: '0100',
|
|
1462
|
-
// iban: 'CZ5901000001151483630297',
|
|
1463
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1464
|
-
// },
|
|
1465
|
-
// fallbackLastSync: monthAgo,
|
|
1466
|
-
// currency: 'CZK',
|
|
1467
|
-
// production: true,
|
|
1468
|
-
// },
|
|
1469
|
-
// {
|
|
1470
|
-
// connectorKey: 'FINBRICKS',
|
|
1471
|
-
// id: '0100-EUR',
|
|
1472
|
-
// identification: {
|
|
1473
|
-
// number: '115-1484940297',
|
|
1474
|
-
// bankCode: '0100',
|
|
1475
|
-
// iban: 'CZ4201000001151484940297',
|
|
1476
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1477
|
-
// },
|
|
1478
|
-
// fallbackLastSync: monthAgo,
|
|
1479
|
-
// currency: 'EUR',
|
|
1480
|
-
// production: true,
|
|
1481
|
-
// },
|
|
1482
|
-
// {
|
|
1483
|
-
// connectorKey: 'FINBRICKS',
|
|
1484
|
-
// id: '0100-USD',
|
|
1485
|
-
// identification: {
|
|
1486
|
-
// number: '115-1483960237',
|
|
1487
|
-
// bankCode: '0100',
|
|
1488
|
-
// iban: 'CZ6201000001151483960237',
|
|
1489
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1490
|
-
// },
|
|
1491
|
-
// fallbackLastSync: monthAgo,
|
|
1492
|
-
// currency: 'USD',
|
|
1493
|
-
// production: true,
|
|
1494
|
-
// },
|
|
1495
|
-
// {
|
|
1496
|
-
// connectorKey: 'FINBRICKS',
|
|
1497
|
-
// id: '0100-PLN',
|
|
1498
|
-
// identification: {
|
|
1499
|
-
// number: '115-6674290267',
|
|
1500
|
-
// bankCode: '0100',
|
|
1501
|
-
// iban: 'CZ3501000001156674290267',
|
|
1502
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1503
|
-
// },
|
|
1504
|
-
// fallbackLastSync: monthAgo,
|
|
1505
|
-
// currency: 'PLN',
|
|
1506
|
-
// production: true,
|
|
1507
|
-
// },
|
|
1508
|
-
// {
|
|
1509
|
-
// connectorKey: 'FINBRICKS',
|
|
1510
|
-
// id: '0100-SEK',
|
|
1511
|
-
// identification: {
|
|
1512
|
-
// number: '115-9578110207',
|
|
1513
|
-
// bankCode: '0100',
|
|
1514
|
-
// iban: 'CZ2401000001159578110207',
|
|
1515
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1516
|
-
// },
|
|
1517
|
-
// fallbackLastSync: monthAgo,
|
|
1518
|
-
// currency: 'SEK',
|
|
1519
|
-
// production: true,
|
|
1520
|
-
// },
|
|
1521
|
-
// // Česká spořitelna (0800)
|
|
1522
|
-
// {
|
|
1523
|
-
// connectorKey: 'ERSTE',
|
|
1524
|
-
// id: '0800-CZK',
|
|
1525
|
-
// identification: {
|
|
1526
|
-
// number: '4413926379',
|
|
1527
|
-
// bankCode: '0800',
|
|
1528
|
-
// iban: 'CZ7908000000004413926379',
|
|
1529
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1530
|
-
// },
|
|
1531
|
-
// fallbackLastSync: monthAgo,
|
|
1532
|
-
// currency: 'CZK',
|
|
1533
|
-
// production: true,
|
|
1534
|
-
// },
|
|
1535
|
-
// {
|
|
1536
|
-
// connectorKey: 'ERSTE',
|
|
1537
|
-
// id: '0800-EUR',
|
|
1538
|
-
// identification: {
|
|
1539
|
-
// number: '1966646293',
|
|
1540
|
-
// bankCode: '0800',
|
|
1541
|
-
// iban: 'CZ2308000000001966646293',
|
|
1542
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1543
|
-
// },
|
|
1544
|
-
// fallbackLastSync: monthAgo,
|
|
1545
|
-
// currency: 'EUR',
|
|
1546
|
-
// production: true,
|
|
1547
|
-
// },
|
|
1548
|
-
// {
|
|
1549
|
-
// connectorKey: 'ERSTE',
|
|
1550
|
-
// id: '0800-USD',
|
|
1551
|
-
// identification: {
|
|
1552
|
-
// number: '1978982243',
|
|
1553
|
-
// bankCode: '0800',
|
|
1554
|
-
// iban: 'CZ1908000000001978982243',
|
|
1555
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1556
|
-
// },
|
|
1557
|
-
// fallbackLastSync: monthAgo,
|
|
1558
|
-
// currency: 'USD',
|
|
1559
|
-
// production: true,
|
|
1560
|
-
// },
|
|
1561
|
-
// {
|
|
1562
|
-
// connectorKey: 'ERSTE',
|
|
1563
|
-
// id: '0800-HUF',
|
|
1564
|
-
// identification: {
|
|
1565
|
-
// number: '13461252',
|
|
1566
|
-
// bankCode: '0800',
|
|
1567
|
-
// iban: 'CZ1908000000000013461252',
|
|
1568
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1569
|
-
// },
|
|
1570
|
-
// fallbackLastSync: monthAgo,
|
|
1571
|
-
// currency: 'HUF',
|
|
1572
|
-
// production: true,
|
|
1573
|
-
// },
|
|
1574
|
-
// // MONETA Money Bank (0600)
|
|
1575
|
-
// {
|
|
1576
|
-
// connectorKey: 'FINBRICKS',
|
|
1577
|
-
// id: '0600-CZK',
|
|
1578
|
-
// identification: {
|
|
1579
|
-
// number: '224252186',
|
|
1580
|
-
// bankCode: '0600',
|
|
1581
|
-
// iban: 'CZ5906000000000224252186',
|
|
1582
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1583
|
-
// },
|
|
1584
|
-
// fallbackLastSync: monthAgo,
|
|
1585
|
-
// currency: 'CZK',
|
|
1586
|
-
// production: true,
|
|
1587
|
-
// },
|
|
1588
|
-
// {
|
|
1589
|
-
// connectorKey: 'FINBRICKS',
|
|
1590
|
-
// id: '0600-EUR',
|
|
1591
|
-
// identification: {
|
|
1592
|
-
// number: '224252231',
|
|
1593
|
-
// bankCode: '0600',
|
|
1594
|
-
// iban: 'CZ0806000000000224252231',
|
|
1595
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1596
|
-
// },
|
|
1597
|
-
// fallbackLastSync: monthAgo,
|
|
1598
|
-
// currency: 'EUR',
|
|
1599
|
-
// production: true,
|
|
1600
|
-
// },
|
|
1601
|
-
// {
|
|
1602
|
-
// connectorKey: 'FINBRICKS',
|
|
1603
|
-
// id: '0600-USD',
|
|
1604
|
-
// identification: {
|
|
1605
|
-
// number: '224252290',
|
|
1606
|
-
// bankCode: '0600',
|
|
1607
|
-
// iban: 'CZ6406000000000224252290',
|
|
1608
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1609
|
-
// },
|
|
1610
|
-
// fallbackLastSync: monthAgo,
|
|
1611
|
-
// currency: 'USD',
|
|
1612
|
-
// production: true,
|
|
1613
|
-
// },
|
|
1614
|
-
// // NEY spořitelní družstvo (2260)
|
|
1615
|
-
// {
|
|
1616
|
-
// connectorKey: 'FINBRICKS',
|
|
1617
|
-
// id: '2260-CZK',
|
|
1618
|
-
// identification: {
|
|
1619
|
-
// number: '1702700014',
|
|
1620
|
-
// bankCode: '2260',
|
|
1621
|
-
// iban: 'CZ7422600000001702700014',
|
|
1622
|
-
// holderName: 'Devizová Burza a.s.',
|
|
1623
|
-
// },
|
|
1624
|
-
// fallbackLastSync: monthAgo,
|
|
1625
|
-
// currency: 'CZK',
|
|
1626
|
-
// production: true,
|
|
1627
|
-
// },
|
|
1628
|
-
// ],
|
|
1629
|
-
}
|
|
1630
|
-
});
|
|
1631
|
-
|
|
1632
|
-
export { BankService as default, defineBankService };
|
|
1183
|
+
export { defineBankService };
|