@develit-services/bank 0.0.28 → 0.0.30
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 +10 -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 +8 -1
- package/dist/export/worker.cjs +888 -575
- package/dist/export/worker.d.cts +210 -12
- package/dist/export/worker.d.mts +210 -12
- package/dist/export/worker.d.ts +210 -12
- package/dist/export/worker.mjs +859 -546
- package/dist/export/wrangler.cjs +1 -11
- package/dist/export/wrangler.d.cts +8 -9
- package/dist/export/wrangler.d.mts +8 -9
- package/dist/export/wrangler.d.ts +8 -9
- package/dist/export/wrangler.mjs +1 -11
- package/dist/shared/{bank.Cy_TcyKb.cjs → bank.BMRBXGF1.cjs} +347 -106
- package/dist/shared/{bank.CEZKAEiY.d.cts → bank.BchnXQDL.d.cts} +2 -2
- package/dist/shared/{bank.CEZKAEiY.d.mts → bank.BchnXQDL.d.mts} +2 -2
- package/dist/shared/{bank.CEZKAEiY.d.ts → bank.BchnXQDL.d.ts} +2 -2
- package/dist/shared/bank.CtUeOz8i.d.ts +1648 -0
- package/dist/shared/bank.D8o86NLF.d.mts +1648 -0
- package/dist/shared/bank.DUalSuEK.d.cts +1648 -0
- package/dist/shared/bank.DbNuuGvb.mjs +9 -0
- package/dist/shared/bank.DuY4d2y_.cjs +11 -0
- package/dist/shared/{bank.BuNG2S8h.d.cts → bank.Nf6oaNfB.d.cts} +547 -11
- package/dist/shared/{bank.BuNG2S8h.d.mts → bank.Nf6oaNfB.d.mts} +547 -11
- package/dist/shared/{bank.BuNG2S8h.d.ts → bank.Nf6oaNfB.d.ts} +547 -11
- package/dist/shared/{bank.DnDcNEvX.mjs → bank.YCUhOduX.mjs} +330 -107
- package/dist/types.cjs +32 -20
- package/dist/types.d.cts +496 -35
- package/dist/types.d.mts +496 -35
- package/dist/types.d.ts +496 -35
- package/dist/types.mjs +5 -4
- package/package.json +1 -1
- package/dist/shared/bank.BkLncGmL.d.ts +0 -122
- package/dist/shared/bank.C9jAvwna.mjs +0 -90
- package/dist/shared/bank.DWVLVMDa.d.mts +0 -122
- package/dist/shared/bank.DmypH3Au.d.cts +0 -122
- package/dist/shared/bank.P9gDUycr.cjs +0 -98
package/dist/export/worker.mjs
CHANGED
|
@@ -1,74 +1,31 @@
|
|
|
1
1
|
import { uuidv4, useResult, createInternalError, develitWorker, first, RPCResponse, action, service } from '@develit-io/backend-sdk';
|
|
2
|
-
import {
|
|
2
|
+
import { t as tables, F as FinbricksConnector, M as MockConnector, E as ErsteConnector, P as PAYMENT_TYPES, e as CONNECTOR_KEYS, c as PAYMENT_STATUSES, d as PAYMENT_DIRECTIONS, q as getPaymentDirection } from '../shared/bank.YCUhOduX.mjs';
|
|
3
3
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
4
4
|
import { drizzle } from 'drizzle-orm/d1';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { CURRENCY_CODES } from '@develit-io/general-codes';
|
|
7
|
-
import { C as CONNECTOR_KEYS } from '../shared/bank.C9jAvwna.mjs';
|
|
8
7
|
import 'jose';
|
|
9
|
-
import { eq, and, inArray, desc,
|
|
8
|
+
import { eq, and, inArray, sql, asc, desc, gte, lte } from 'drizzle-orm';
|
|
9
|
+
import { M as MockCobsConnector } from '../shared/bank.DbNuuGvb.mjs';
|
|
10
10
|
import superjson from 'superjson';
|
|
11
|
-
import '
|
|
11
|
+
import 'drizzle-zod';
|
|
12
12
|
import 'drizzle-orm/sqlite-core';
|
|
13
|
+
import 'date-fns';
|
|
13
14
|
import 'drizzle-orm/relations';
|
|
14
15
|
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
debtorAccountNumberWithBankCode: z.string(),
|
|
29
|
-
debtorIban: z.string()
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const getAuthUriInputSchema = z.object({
|
|
33
|
-
accountId: z.string()
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const authorizeAccountInputSchema = z.object({
|
|
37
|
-
ott: z.string(),
|
|
38
|
-
urlParams: z.string()
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
const simulateDepositInputSchema = z.object({
|
|
42
|
-
amount: z.number(),
|
|
43
|
-
currency: z.enum(CURRENCY_CODES),
|
|
44
|
-
bankingVs: z.string().max(10),
|
|
45
|
-
bankingSs: z.string().max(10).optional(),
|
|
46
|
-
bankingKs: z.string().max(10).optional(),
|
|
47
|
-
message: z.string(),
|
|
48
|
-
creditorIban: z.string().max(34),
|
|
49
|
-
creditorHolderName: z.string(),
|
|
50
|
-
debtorIban: z.string().max(34),
|
|
51
|
-
debtorHolderName: z.string()
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
const setLastSyncAtInputSchema = z.object({
|
|
55
|
-
iban: z.string(),
|
|
56
|
-
lastSyncedAt: z.coerce.date()
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
const initiateConnectorInputSchema = z.object({
|
|
60
|
-
connectorKey: z.enum(CONNECTOR_KEYS)
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
const getBatchesInputSchema = z.object({
|
|
64
|
-
limit: z.number().positive().optional().default(100),
|
|
65
|
-
offset: z.number().min(0).optional().default(0)
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
const processBatchInputSchema = z.object({
|
|
69
|
-
connectorKey: z.enum(CONNECTOR_KEYS),
|
|
70
|
-
batch: z.custom()
|
|
71
|
-
});
|
|
16
|
+
const upsertAccountCommand = (db, { account }) => {
|
|
17
|
+
const id = account.id || uuidv4();
|
|
18
|
+
const command = db.insert(tables.account).values({ ...account, id }).onConflictDoUpdate({
|
|
19
|
+
target: tables.account.iban,
|
|
20
|
+
set: {
|
|
21
|
+
...account
|
|
22
|
+
}
|
|
23
|
+
}).returning();
|
|
24
|
+
return {
|
|
25
|
+
id,
|
|
26
|
+
command
|
|
27
|
+
};
|
|
28
|
+
};
|
|
72
29
|
|
|
73
30
|
const createPaymentCommand = (db, { payment }) => {
|
|
74
31
|
return {
|
|
@@ -101,7 +58,7 @@ const upsertBatchCommand = (db, { batch }) => {
|
|
|
101
58
|
|
|
102
59
|
const createOneTimeTokenCommand = (db, {
|
|
103
60
|
ott,
|
|
104
|
-
|
|
61
|
+
refId,
|
|
105
62
|
tokenType
|
|
106
63
|
}) => {
|
|
107
64
|
const id = uuidv4();
|
|
@@ -110,13 +67,38 @@ const createOneTimeTokenCommand = (db, {
|
|
|
110
67
|
id,
|
|
111
68
|
oneTimeToken: ott,
|
|
112
69
|
tokenType,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
expiresAt
|
|
70
|
+
expiresAt,
|
|
71
|
+
refId
|
|
116
72
|
}).returning();
|
|
117
73
|
return { id, command };
|
|
118
74
|
};
|
|
119
75
|
|
|
76
|
+
const expireOneTimeTokenCommand = (db, {
|
|
77
|
+
ott
|
|
78
|
+
}) => {
|
|
79
|
+
return {
|
|
80
|
+
command: db.update(tables.ott).set({
|
|
81
|
+
expiresAt: /* @__PURE__ */ new Date()
|
|
82
|
+
}).where(eq(tables.ott.oneTimeToken, ott))
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const createAccountCredentialsCommand = (db, { credentials }) => {
|
|
87
|
+
const id = credentials.id || uuidv4();
|
|
88
|
+
const command = db.insert(tables.accountCredentials).values({ ...credentials, id }).returning();
|
|
89
|
+
return {
|
|
90
|
+
id,
|
|
91
|
+
command
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const deleteAccountCredentialsCommand = (db, { accountId }) => {
|
|
96
|
+
const command = db.delete(tables.accountCredentials).where(eq(tables.accountCredentials.accountId, accountId));
|
|
97
|
+
return {
|
|
98
|
+
command
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
|
|
120
102
|
const getPaymentByRefIdQuery = async (db, { refId }) => {
|
|
121
103
|
const payment = await db.select().from(tables.payment).where(eq(tables.payment.refId, refId)).limit(1).get();
|
|
122
104
|
return payment;
|
|
@@ -140,6 +122,102 @@ const getOttQuery = async (db, { ott }) => {
|
|
|
140
122
|
return await db.select().from(tables.ott).where(eq(tables.ott.oneTimeToken, ott)).get();
|
|
141
123
|
};
|
|
142
124
|
|
|
125
|
+
const getAllPendingBatchesQuery = (db) => {
|
|
126
|
+
return db.select().from(tables.batch).where(
|
|
127
|
+
inArray(tables.batch.status, [
|
|
128
|
+
"PROCESSING",
|
|
129
|
+
"READY_TO_SIGN",
|
|
130
|
+
"WAITING_FOR_PROCESSING"
|
|
131
|
+
])
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const getCredentialsByAccountId = async (db, { accountId }) => {
|
|
136
|
+
const cred = await db.select().from(tables.accountCredentials).where(eq(tables.accountCredentials.accountId, accountId)).get();
|
|
137
|
+
return cred;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const getAccountByIbanQuery = async (db, { iban }) => {
|
|
141
|
+
return await db.select().from(tables.account).where(eq(tables.account.iban, iban)).get();
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const getAllAccountsQuery = async (db) => {
|
|
145
|
+
const accountsWithExpiration = await db.select().from(tables.account).leftJoin(
|
|
146
|
+
tables.accountCredentials,
|
|
147
|
+
eq(tables.accountCredentials.accountId, tables.account.id)
|
|
148
|
+
);
|
|
149
|
+
return accountsWithExpiration.map(({ account, account_credentials }) => {
|
|
150
|
+
return {
|
|
151
|
+
...account,
|
|
152
|
+
expiresAt: account_credentials?.expiresAt
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const buildMultiFilterConditions = (column, value) => {
|
|
158
|
+
if (value === void 0) return void 0;
|
|
159
|
+
if (Array.isArray(value)) {
|
|
160
|
+
return value.length > 0 ? inArray(column, value) : void 0;
|
|
161
|
+
}
|
|
162
|
+
return eq(column, value);
|
|
163
|
+
};
|
|
164
|
+
const buildRangeFilterConditions = (column, minValue, maxValue) => {
|
|
165
|
+
const conditions = [];
|
|
166
|
+
if (minValue !== void 0) {
|
|
167
|
+
conditions.push(gte(column, minValue));
|
|
168
|
+
}
|
|
169
|
+
if (maxValue !== void 0) {
|
|
170
|
+
conditions.push(lte(column, maxValue));
|
|
171
|
+
}
|
|
172
|
+
if (conditions.length === 0) return void 0;
|
|
173
|
+
if (conditions.length === 1) return conditions[0];
|
|
174
|
+
return and(...conditions);
|
|
175
|
+
};
|
|
176
|
+
const resolveColumn = (table, column, fallback = "updatedAt") => {
|
|
177
|
+
const key = column && column in table ? column : fallback;
|
|
178
|
+
return table[key];
|
|
179
|
+
};
|
|
180
|
+
const getPaymentsWithPaginationQuery = async (db, {
|
|
181
|
+
limit,
|
|
182
|
+
page,
|
|
183
|
+
sort,
|
|
184
|
+
filterPaymentAccountId,
|
|
185
|
+
filterPaymentAmount,
|
|
186
|
+
filterPaymentCurrency,
|
|
187
|
+
filterPaymentDateFrom,
|
|
188
|
+
filterPaymentDateTo,
|
|
189
|
+
filterPaymentStatus,
|
|
190
|
+
filterPaymentyDirection
|
|
191
|
+
}) => {
|
|
192
|
+
const whereConditions = and(
|
|
193
|
+
buildMultiFilterConditions(
|
|
194
|
+
tables.payment.accountId,
|
|
195
|
+
filterPaymentAccountId
|
|
196
|
+
),
|
|
197
|
+
buildMultiFilterConditions(tables.payment.amount, filterPaymentAmount),
|
|
198
|
+
buildMultiFilterConditions(tables.payment.currency, filterPaymentCurrency),
|
|
199
|
+
buildRangeFilterConditions(
|
|
200
|
+
tables.payment.createdAt,
|
|
201
|
+
filterPaymentDateFrom,
|
|
202
|
+
filterPaymentDateTo
|
|
203
|
+
),
|
|
204
|
+
buildMultiFilterConditions(tables.payment.status, filterPaymentStatus),
|
|
205
|
+
buildMultiFilterConditions(
|
|
206
|
+
tables.payment.direction,
|
|
207
|
+
filterPaymentyDirection
|
|
208
|
+
)
|
|
209
|
+
);
|
|
210
|
+
const sortColumn = resolveColumn(tables.payment, sort.column);
|
|
211
|
+
const [{ totalCount }] = await db.select({
|
|
212
|
+
totalCount: sql`count(*)`
|
|
213
|
+
}).from(tables.payment).where(whereConditions);
|
|
214
|
+
const payments = await db.select().from(tables.payment).where(whereConditions).limit(limit).offset((page - 1) * limit).orderBy(sort.direction === "asc" ? asc(sortColumn) : desc(sortColumn));
|
|
215
|
+
return {
|
|
216
|
+
payments,
|
|
217
|
+
totalCount
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
|
|
143
221
|
class CreditasConnector extends FinbricksConnector {
|
|
144
222
|
constructor(config) {
|
|
145
223
|
super("CREDITAS", config);
|
|
@@ -158,53 +236,57 @@ class MonetaConnector extends FinbricksConnector {
|
|
|
158
236
|
}
|
|
159
237
|
}
|
|
160
238
|
|
|
161
|
-
const initiateConnector = (
|
|
239
|
+
const initiateConnector = ({
|
|
240
|
+
bank,
|
|
241
|
+
env,
|
|
242
|
+
connectedAccounts
|
|
243
|
+
}) => {
|
|
162
244
|
switch (bank) {
|
|
163
245
|
case "ERSTE":
|
|
164
246
|
return new ErsteConnector({
|
|
165
247
|
API_KEY: env.ERSTE_API_KEY,
|
|
166
248
|
CLIENT_ID: env.ERSTE_CLIENT_ID,
|
|
167
249
|
CLIENT_SECRET: env.ERSTE_CLIENT_SECRET,
|
|
168
|
-
REDIRECT_URI: env.
|
|
250
|
+
REDIRECT_URI: env.REDIRECT_URI,
|
|
169
251
|
AUTH_URI: env.ERSTE_AUTH_URI,
|
|
170
252
|
PAYMENTS_URI: env.ERSTE_PAYMENTS_URI,
|
|
171
253
|
ACCOUNTS_URI: env.ERSTE_ACCOUNTS_URI,
|
|
172
|
-
|
|
254
|
+
connectedAccounts
|
|
173
255
|
});
|
|
174
256
|
case "CREDITAS":
|
|
175
257
|
return new CreditasConnector({
|
|
176
258
|
BASE_URI: env.FINBRICKS_BASE_URI,
|
|
177
259
|
MERCHANT_ID: env.FINBRICKS_MERCHANT_ID,
|
|
178
260
|
PRIVATE_KEY_PEM: env.FINBRICKS_PRIVATE_KEY_PEM,
|
|
179
|
-
REDIRECT_URI: env.
|
|
180
|
-
|
|
261
|
+
REDIRECT_URI: env.REDIRECT_URI,
|
|
262
|
+
connectedAccounts
|
|
181
263
|
});
|
|
182
264
|
case "MOCK_COBS":
|
|
183
265
|
return new MockCobsConnector({
|
|
184
266
|
BASE_URI: env.FINBRICKS_BASE_URI,
|
|
185
267
|
MERCHANT_ID: env.FINBRICKS_MERCHANT_ID,
|
|
186
268
|
PRIVATE_KEY_PEM: env.FINBRICKS_PRIVATE_KEY_PEM,
|
|
187
|
-
REDIRECT_URI: env.
|
|
188
|
-
|
|
269
|
+
REDIRECT_URI: env.REDIRECT_URI,
|
|
270
|
+
connectedAccounts
|
|
189
271
|
});
|
|
190
272
|
case "FIO":
|
|
191
273
|
return new FioConnector({
|
|
192
274
|
BASE_URI: env.FINBRICKS_BASE_URI,
|
|
193
275
|
MERCHANT_ID: env.FINBRICKS_MERCHANT_ID,
|
|
194
276
|
PRIVATE_KEY_PEM: env.FINBRICKS_PRIVATE_KEY_PEM,
|
|
195
|
-
REDIRECT_URI: env.
|
|
196
|
-
|
|
277
|
+
REDIRECT_URI: env.REDIRECT_URI,
|
|
278
|
+
connectedAccounts
|
|
197
279
|
});
|
|
198
280
|
case "MONETA":
|
|
199
281
|
return new MonetaConnector({
|
|
200
282
|
BASE_URI: env.FINBRICKS_BASE_URI,
|
|
201
283
|
MERCHANT_ID: env.FINBRICKS_MERCHANT_ID,
|
|
202
284
|
PRIVATE_KEY_PEM: env.FINBRICKS_PRIVATE_KEY_PEM,
|
|
203
|
-
REDIRECT_URI: env.
|
|
204
|
-
|
|
285
|
+
REDIRECT_URI: env.REDIRECT_URI,
|
|
286
|
+
connectedAccounts
|
|
205
287
|
});
|
|
206
288
|
default:
|
|
207
|
-
return new MockConnector(
|
|
289
|
+
return new MockConnector();
|
|
208
290
|
}
|
|
209
291
|
};
|
|
210
292
|
|
|
@@ -213,7 +295,7 @@ const useSync = (kv) => {
|
|
|
213
295
|
account
|
|
214
296
|
}) => {
|
|
215
297
|
const [rawSync, rawSyncError] = await useResult(
|
|
216
|
-
kv.get(`sync-log:${account.
|
|
298
|
+
kv.get(`sync-log:${account.iban}:${account.currency}`)
|
|
217
299
|
);
|
|
218
300
|
if (rawSyncError) throw createInternalError(rawSyncError);
|
|
219
301
|
if (!rawSync) return null;
|
|
@@ -225,7 +307,7 @@ const useSync = (kv) => {
|
|
|
225
307
|
}) => {
|
|
226
308
|
const [_, error] = await useResult(
|
|
227
309
|
kv.put(
|
|
228
|
-
`sync-log:${account.
|
|
310
|
+
`sync-log:${account.iban}:${account.currency}`,
|
|
229
311
|
superjson.stringify(log)
|
|
230
312
|
)
|
|
231
313
|
);
|
|
@@ -241,7 +323,7 @@ const seperateSupportedPayments = (mappedPayments, accounts) => {
|
|
|
241
323
|
const [supportedPayments, unsupportedPayments] = mappedPayments.reduce(
|
|
242
324
|
([valid, invalid], payment) => {
|
|
243
325
|
const isValid = accounts.some(
|
|
244
|
-
(acc) => acc.
|
|
326
|
+
(acc) => acc.iban === payment.debtorIban && acc.currency === payment.currency
|
|
245
327
|
);
|
|
246
328
|
if (isValid) {
|
|
247
329
|
valid.push(payment);
|
|
@@ -258,6 +340,91 @@ const seperateSupportedPayments = (mappedPayments, accounts) => {
|
|
|
258
340
|
};
|
|
259
341
|
};
|
|
260
342
|
|
|
343
|
+
const sendPaymentInputSchema = z.object({
|
|
344
|
+
refId: z.string(),
|
|
345
|
+
amount: z.number().positive(),
|
|
346
|
+
paymentType: z.enum(PAYMENT_TYPES),
|
|
347
|
+
currency: z.enum(CURRENCY_CODES),
|
|
348
|
+
vs: z.string().nullable().optional(),
|
|
349
|
+
ss: z.string().nullable().optional(),
|
|
350
|
+
ks: z.string().nullable().optional(),
|
|
351
|
+
message: z.string().nullable().optional(),
|
|
352
|
+
creditorHolderName: z.string(),
|
|
353
|
+
creditorAccountNumberWithBankCode: z.string(),
|
|
354
|
+
creditorIban: z.string(),
|
|
355
|
+
debtorHolderName: z.string(),
|
|
356
|
+
debtorAccountNumberWithBankCode: z.string(),
|
|
357
|
+
debtorIban: z.string()
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
const getAuthUriInputSchema = z.object({
|
|
361
|
+
connectorKey: z.enum(CONNECTOR_KEYS)
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
const authorizeAccountInputSchema = z.object({
|
|
365
|
+
ott: z.string(),
|
|
366
|
+
urlParams: z.string()
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
const simulateDepositInputSchema = z.object({
|
|
370
|
+
amount: z.number(),
|
|
371
|
+
currency: z.enum(CURRENCY_CODES),
|
|
372
|
+
bankingVs: z.string().max(10),
|
|
373
|
+
bankingSs: z.string().max(10).optional(),
|
|
374
|
+
bankingKs: z.string().max(10).optional(),
|
|
375
|
+
message: z.string(),
|
|
376
|
+
creditorIban: z.string().max(34),
|
|
377
|
+
creditorHolderName: z.string(),
|
|
378
|
+
debtorIban: z.string().max(34),
|
|
379
|
+
debtorHolderName: z.string(),
|
|
380
|
+
connectorKey: z.enum(CONNECTOR_KEYS)
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
const setLastSyncAtInputSchema = z.object({
|
|
384
|
+
iban: z.string(),
|
|
385
|
+
lastSyncedAt: z.coerce.date()
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
const initiateConnectorInputSchema = z.object({
|
|
389
|
+
connectorKey: z.enum(CONNECTOR_KEYS),
|
|
390
|
+
withAuth: z.boolean().default(true).optional()
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
const getBatchesInputSchema = z.object({
|
|
394
|
+
limit: z.number().positive().optional().default(100),
|
|
395
|
+
offset: z.number().min(0).optional().default(0)
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
const processBatchInputSchema = z.object({
|
|
399
|
+
connectorKey: z.enum(CONNECTOR_KEYS),
|
|
400
|
+
batch: z.custom()
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
const ALLOWED_PAYMENT_FILTERS = {
|
|
404
|
+
ACCOUNT_ID: "filterPaymentAccountId",
|
|
405
|
+
AMOUNT: "filterPaymentAmount",
|
|
406
|
+
CURRENCY: "filterPaymentCurrency",
|
|
407
|
+
DIRECTION: "filterPaymentyDirection",
|
|
408
|
+
FROM: "filterPaymentDateFrom",
|
|
409
|
+
TO: "filterPaymentDateTo",
|
|
410
|
+
STATUS: "filterPaymentStatus"
|
|
411
|
+
};
|
|
412
|
+
const getPaymentsInputSchema = z.object({
|
|
413
|
+
page: z.number().positive(),
|
|
414
|
+
limit: z.number().positive(),
|
|
415
|
+
sort: z.object({
|
|
416
|
+
column: z.enum(["createdAt", "updatedAt", "amount"]),
|
|
417
|
+
direction: z.enum(["asc", "desc"])
|
|
418
|
+
}),
|
|
419
|
+
[ALLOWED_PAYMENT_FILTERS.ACCOUNT_ID]: z.union([z.uuid(), z.uuid().array()]).optional(),
|
|
420
|
+
[ALLOWED_PAYMENT_FILTERS.AMOUNT]: z.union([z.number(), z.number().array()]).optional(),
|
|
421
|
+
[ALLOWED_PAYMENT_FILTERS.CURRENCY]: z.union([z.enum(CURRENCY_CODES), z.enum(CURRENCY_CODES).array()]).optional(),
|
|
422
|
+
[ALLOWED_PAYMENT_FILTERS.DIRECTION]: z.union([z.enum(PAYMENT_DIRECTIONS), z.enum(PAYMENT_DIRECTIONS).array()]).optional(),
|
|
423
|
+
[ALLOWED_PAYMENT_FILTERS.FROM]: z.date().optional(),
|
|
424
|
+
[ALLOWED_PAYMENT_FILTERS.TO]: z.date().optional(),
|
|
425
|
+
[ALLOWED_PAYMENT_FILTERS.STATUS]: z.union([z.enum(PAYMENT_STATUSES), z.enum(PAYMENT_STATUSES).array()]).optional()
|
|
426
|
+
});
|
|
427
|
+
|
|
261
428
|
var __defProp = Object.defineProperty;
|
|
262
429
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
263
430
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -269,13 +436,26 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
269
436
|
return result;
|
|
270
437
|
};
|
|
271
438
|
let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
272
|
-
constructor(ctx, env,
|
|
439
|
+
constructor(ctx, env, config) {
|
|
273
440
|
super(ctx, env);
|
|
274
|
-
this.
|
|
441
|
+
this.allowedProviders = [];
|
|
442
|
+
this.allowedProviders = config.allowedProviders;
|
|
275
443
|
this.db = drizzle(this.env.BANK_D1, { schema: tables });
|
|
276
444
|
}
|
|
277
|
-
|
|
278
|
-
return this.
|
|
445
|
+
getAllowedProviders() {
|
|
446
|
+
return this.allowedProviders;
|
|
447
|
+
}
|
|
448
|
+
async getAccounts() {
|
|
449
|
+
return await getAllAccountsQuery(this.db);
|
|
450
|
+
}
|
|
451
|
+
async getPayments(input) {
|
|
452
|
+
return this.handleAction(
|
|
453
|
+
{ data: input, schema: getPaymentsInputSchema },
|
|
454
|
+
{ successMessage: "Payments fetched successfully" },
|
|
455
|
+
async (pagination) => {
|
|
456
|
+
return await getPaymentsWithPaginationQuery(this.db, pagination);
|
|
457
|
+
}
|
|
458
|
+
);
|
|
279
459
|
}
|
|
280
460
|
accountFetchInterval(connectorKey) {
|
|
281
461
|
switch (connectorKey) {
|
|
@@ -293,16 +473,17 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
293
473
|
return this.handleAction(null, {}, async () => {
|
|
294
474
|
const accountsToSync = [];
|
|
295
475
|
const { getLastSync } = useSync(this.env.BANK_KV);
|
|
296
|
-
|
|
476
|
+
const accounts = await this.getAccounts();
|
|
477
|
+
for (const account of accounts.filter(
|
|
297
478
|
(acc) => !!!acc.connectorKey.includes("MOCK")
|
|
298
479
|
)) {
|
|
299
|
-
let lastSync = await getLastSync({ account });
|
|
480
|
+
let lastSync = await getLastSync({ account: { ...account, token: "" } });
|
|
300
481
|
if (!lastSync) {
|
|
301
482
|
await this.setLastSyncAt({
|
|
302
|
-
iban: account.
|
|
303
|
-
lastSyncedAt: account.
|
|
483
|
+
iban: account.iban,
|
|
484
|
+
lastSyncedAt: account.lastSyncedAt || /* @__PURE__ */ new Date()
|
|
304
485
|
});
|
|
305
|
-
lastSync = await getLastSync({ account });
|
|
486
|
+
lastSync = await getLastSync({ account: { ...account, token: "" } });
|
|
306
487
|
if (!lastSync) continue;
|
|
307
488
|
}
|
|
308
489
|
const accountFetchInterval = this.accountFetchInterval(
|
|
@@ -315,7 +496,8 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
315
496
|
if (!shouldFetch) continue;
|
|
316
497
|
accountsToSync.push({
|
|
317
498
|
...account,
|
|
318
|
-
lastSyncAt: lastSync
|
|
499
|
+
lastSyncAt: lastSync,
|
|
500
|
+
token: ""
|
|
319
501
|
});
|
|
320
502
|
}
|
|
321
503
|
console.log("ACCS TO SYNC", accountsToSync.length);
|
|
@@ -328,16 +510,95 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
328
510
|
console.log("Scheduled CRON payments processing");
|
|
329
511
|
await this.syncAccounts();
|
|
330
512
|
}
|
|
513
|
+
if (controller.cron === this.env.CRON_BATCH_STATUSES) {
|
|
514
|
+
console.log("Scheduled CRON batch statuses");
|
|
515
|
+
await this.updateBatchStatuses();
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
async updateBatchStatuses() {
|
|
519
|
+
const pendingBatches = await getAllPendingBatchesQuery(this.db);
|
|
520
|
+
const uniqueConnectors = /* @__PURE__ */ new Set();
|
|
521
|
+
const accounts = await this.getAccounts();
|
|
522
|
+
for (const batch of pendingBatches) {
|
|
523
|
+
const connectorKey = accounts.find(
|
|
524
|
+
(acc) => acc.id === batch.accountId
|
|
525
|
+
).connectorKey;
|
|
526
|
+
if (!uniqueConnectors.has(connectorKey)) {
|
|
527
|
+
uniqueConnectors.add(connectorKey);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
const finalBatches = [];
|
|
531
|
+
for (const connectorKey of uniqueConnectors) {
|
|
532
|
+
const accs = accounts.filter((acc) => acc.connectorKey === connectorKey);
|
|
533
|
+
const updatedBatches = await Promise.all(
|
|
534
|
+
accs.map(async (account) => {
|
|
535
|
+
const batch = pendingBatches.find((acc) => acc.id === account.id);
|
|
536
|
+
const newStatus = await this.bankConnector.getBatchStatus({
|
|
537
|
+
batchId: batch.id
|
|
538
|
+
});
|
|
539
|
+
return {
|
|
540
|
+
...batch,
|
|
541
|
+
status: newStatus
|
|
542
|
+
};
|
|
543
|
+
})
|
|
544
|
+
);
|
|
545
|
+
finalBatches.push(...updatedBatches);
|
|
546
|
+
}
|
|
547
|
+
const updateBatchesCommands = finalBatches.map((batch) => {
|
|
548
|
+
const { command } = upsertBatchCommand(this.db, {
|
|
549
|
+
batch: {
|
|
550
|
+
...batch
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
return command;
|
|
554
|
+
});
|
|
555
|
+
console.log("Updated batches", finalBatches);
|
|
556
|
+
await this.db.batch([
|
|
557
|
+
updateBatchesCommands[0],
|
|
558
|
+
...updateBatchesCommands.slice(1)
|
|
559
|
+
]);
|
|
560
|
+
console.log("Batch update completed");
|
|
331
561
|
}
|
|
332
562
|
// @action('initiate-bank-connector')
|
|
333
563
|
async initiateBankConnector(input) {
|
|
334
564
|
return this.handleAction(
|
|
335
565
|
{ data: input, schema: initiateConnectorInputSchema },
|
|
336
566
|
{ successMessage: "Bank connector initiated successfully" },
|
|
337
|
-
async ({ connectorKey }) => {
|
|
338
|
-
this.
|
|
339
|
-
|
|
340
|
-
|
|
567
|
+
async ({ connectorKey, withAuth }) => {
|
|
568
|
+
if (!this.allowedProviders.includes(connectorKey)) {
|
|
569
|
+
throw createInternalError(null, {
|
|
570
|
+
message: `Invalid connector key: ${connectorKey}`
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
const accounts = await this.getAccounts();
|
|
574
|
+
const accountsForConnector = accounts.filter(
|
|
575
|
+
(acc) => acc.connectorKey === connectorKey
|
|
576
|
+
);
|
|
577
|
+
const accountsWithCredentials = await Promise.all(
|
|
578
|
+
accountsForConnector.map(async (acc) => {
|
|
579
|
+
const credentials = await getCredentialsByAccountId(this.db, {
|
|
580
|
+
accountId: acc.id
|
|
581
|
+
});
|
|
582
|
+
if (!credentials) {
|
|
583
|
+
throw createInternalError(null, {
|
|
584
|
+
message: `No credentials found for account ${acc.id}`
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
return {
|
|
588
|
+
currency: acc.currency,
|
|
589
|
+
iban: acc.iban,
|
|
590
|
+
token: credentials.value,
|
|
591
|
+
id: acc.id,
|
|
592
|
+
connectorKey: acc.connectorKey
|
|
593
|
+
};
|
|
594
|
+
})
|
|
595
|
+
);
|
|
596
|
+
this.bankConnector = initiateConnector({
|
|
597
|
+
bank: connectorKey,
|
|
598
|
+
connectedAccounts: accountsWithCredentials,
|
|
599
|
+
env: this.env
|
|
600
|
+
});
|
|
601
|
+
if (!withAuth) return;
|
|
341
602
|
await this.bankConnector.authenticate();
|
|
342
603
|
}
|
|
343
604
|
);
|
|
@@ -350,7 +611,9 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
350
611
|
const mappedPayments = paymentsToBatch.map(
|
|
351
612
|
(payment) => ({
|
|
352
613
|
id: uuidv4(),
|
|
614
|
+
accountId: "",
|
|
353
615
|
refId: payment.refId,
|
|
616
|
+
connectorKey: "MOCK",
|
|
354
617
|
amount: payment.amount,
|
|
355
618
|
direction: "OUTGOING",
|
|
356
619
|
paymentType: payment.paymentType,
|
|
@@ -370,7 +633,10 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
370
633
|
debtorIban: payment.debtorIban
|
|
371
634
|
})
|
|
372
635
|
);
|
|
373
|
-
const { supportedPayments, unsupportedPayments } = seperateSupportedPayments(
|
|
636
|
+
const { supportedPayments, unsupportedPayments } = seperateSupportedPayments(
|
|
637
|
+
mappedPayments,
|
|
638
|
+
this.bankConnector.connectedAccounts
|
|
639
|
+
);
|
|
374
640
|
if (unsupportedPayments.length > 0) {
|
|
375
641
|
this.logError({ unsupportedPayments });
|
|
376
642
|
await this.pushToQueue(
|
|
@@ -396,15 +662,19 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
396
662
|
}))
|
|
397
663
|
);
|
|
398
664
|
}
|
|
399
|
-
for (const acc of this.
|
|
665
|
+
for (const acc of this.bankConnector.connectedAccounts) {
|
|
400
666
|
const newPayments = supportedPayments.filter(
|
|
401
|
-
(payment) => payment.debtorIban === acc.
|
|
402
|
-
)
|
|
667
|
+
(payment) => payment.debtorIban === acc.iban && payment.currency === acc.currency
|
|
668
|
+
).map((payment) => ({
|
|
669
|
+
...payment,
|
|
670
|
+
connectorKey: acc.connectorKey,
|
|
671
|
+
accountId: acc.id
|
|
672
|
+
}));
|
|
403
673
|
if (newPayments.length === 0) {
|
|
404
674
|
continue;
|
|
405
675
|
}
|
|
406
676
|
this.log({
|
|
407
|
-
message: `\u{1F4B0} Processing ${newPayments.length} payments for account
|
|
677
|
+
message: `\u{1F4B0} Processing ${newPayments.length} payments for account (${acc.iban}, ${acc.currency})`
|
|
408
678
|
});
|
|
409
679
|
const existingBatch = await getOpenBatchByAccountIdQuery(this.db, {
|
|
410
680
|
accountId: acc.id
|
|
@@ -576,26 +846,19 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
576
846
|
return this.handleAction(
|
|
577
847
|
{ data: input, schema: getAuthUriInputSchema },
|
|
578
848
|
{ successMessage: "Auth URI obtained." },
|
|
579
|
-
async ({
|
|
580
|
-
|
|
581
|
-
if (!account)
|
|
582
|
-
throw createInternalError(null, {
|
|
583
|
-
message: "Account not found",
|
|
584
|
-
code: "ACCOUNT_NOT_FOUND",
|
|
585
|
-
status: 404
|
|
586
|
-
});
|
|
587
|
-
this.bankConnector = initiateConnector(account.connectorKey, this.env);
|
|
849
|
+
async ({ connectorKey }) => {
|
|
850
|
+
await this.initiateBankConnector({ connectorKey, withAuth: false });
|
|
588
851
|
const ott = uuidv4();
|
|
589
|
-
const { command:
|
|
852
|
+
const { command: createOneTimeToken } = createOneTimeTokenCommand(
|
|
590
853
|
this.db,
|
|
591
854
|
{
|
|
592
855
|
ott,
|
|
593
|
-
|
|
856
|
+
refId: connectorKey,
|
|
594
857
|
tokenType: "ACCOUNT_AUTHORIZATION"
|
|
595
858
|
}
|
|
596
859
|
);
|
|
597
|
-
await
|
|
598
|
-
const uri = await this.bankConnector.getAuthUri({
|
|
860
|
+
await createOneTimeToken.execute();
|
|
861
|
+
const uri = await this.bankConnector.getAuthUri({ ott });
|
|
599
862
|
return { uri };
|
|
600
863
|
}
|
|
601
864
|
);
|
|
@@ -622,11 +885,50 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
622
885
|
status: 400
|
|
623
886
|
});
|
|
624
887
|
}
|
|
625
|
-
this.
|
|
626
|
-
|
|
888
|
+
await this.initiateBankConnector({
|
|
889
|
+
connectorKey: ottRow.refId
|
|
890
|
+
});
|
|
891
|
+
const { credentials, accounts } = await this.bankConnector.authorizeAccount({
|
|
627
892
|
urlParams
|
|
628
893
|
});
|
|
629
|
-
|
|
894
|
+
console.log("Bank connector initiated");
|
|
895
|
+
const alreadyExistingAccounts = (await this.getAccounts()).filter(
|
|
896
|
+
(acc) => acc.connectorKey === ottRow.refId && accounts.map((item) => item.iban).includes(acc.iban)
|
|
897
|
+
);
|
|
898
|
+
const upsertAccounts = accounts.map(
|
|
899
|
+
(acc) => upsertAccountCommand(this.db, {
|
|
900
|
+
account: acc
|
|
901
|
+
}).command
|
|
902
|
+
);
|
|
903
|
+
const deleteCredentials = alreadyExistingAccounts.map(
|
|
904
|
+
(acc) => deleteAccountCredentialsCommand(this.db, {
|
|
905
|
+
accountId: acc.id
|
|
906
|
+
}).command
|
|
907
|
+
);
|
|
908
|
+
const createAccountCredentials = credentials.map(
|
|
909
|
+
(cr) => createAccountCredentialsCommand(this.db, {
|
|
910
|
+
credentials: cr
|
|
911
|
+
}).command
|
|
912
|
+
);
|
|
913
|
+
const { command: updateOtt } = expireOneTimeTokenCommand(this.db, {
|
|
914
|
+
ott
|
|
915
|
+
});
|
|
916
|
+
await this.db.batch([
|
|
917
|
+
updateOtt,
|
|
918
|
+
...upsertAccounts,
|
|
919
|
+
...deleteCredentials,
|
|
920
|
+
...createAccountCredentials
|
|
921
|
+
]);
|
|
922
|
+
const fetchedAccounts = await this.getAccounts();
|
|
923
|
+
if (!fetchedAccounts)
|
|
924
|
+
throw createInternalError(null, {
|
|
925
|
+
message: "Account not found",
|
|
926
|
+
code: "NOT_FOUND",
|
|
927
|
+
status: 404
|
|
928
|
+
});
|
|
929
|
+
return {
|
|
930
|
+
accounts: fetchedAccounts
|
|
931
|
+
};
|
|
630
932
|
}
|
|
631
933
|
);
|
|
632
934
|
}
|
|
@@ -652,10 +954,7 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
652
954
|
if (!payments || payments.length === 0) continue;
|
|
653
955
|
this.log(payments);
|
|
654
956
|
payments.forEach((payment) => {
|
|
655
|
-
payment.direction = getPaymentDirection(
|
|
656
|
-
payment,
|
|
657
|
-
account.identification.iban
|
|
658
|
-
);
|
|
957
|
+
payment.direction = getPaymentDirection(payment, account.iban);
|
|
659
958
|
});
|
|
660
959
|
allFetchedPayments.push(...payments);
|
|
661
960
|
}
|
|
@@ -678,7 +977,7 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
678
977
|
console.log("FETCHEDPAYMANETS TO SYNC", allFetchedPayments.length);
|
|
679
978
|
for (const account of accounts) {
|
|
680
979
|
const paymentsForAccount = allFetchedPayments.filter(
|
|
681
|
-
(payment) => (payment.direction === "OUTGOING" ? payment.debtorIban : payment.creditorIban) === account.
|
|
980
|
+
(payment) => (payment.direction === "OUTGOING" ? payment.debtorIban : payment.creditorIban) === account.iban
|
|
682
981
|
);
|
|
683
982
|
let lastSyncPayment;
|
|
684
983
|
lastSyncPayment = paymentsForAccount.filter(({ status }) => status !== "COMPLETED").sort(
|
|
@@ -725,11 +1024,23 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
725
1024
|
creditorIban,
|
|
726
1025
|
creditorHolderName,
|
|
727
1026
|
debtorIban,
|
|
728
|
-
debtorHolderName
|
|
1027
|
+
debtorHolderName,
|
|
1028
|
+
connectorKey
|
|
729
1029
|
}) => {
|
|
1030
|
+
const account = await getAccountByIbanQuery(this.db, {
|
|
1031
|
+
iban: creditorIban
|
|
1032
|
+
});
|
|
1033
|
+
if (!account)
|
|
1034
|
+
throw createInternalError(null, {
|
|
1035
|
+
message: "Unsupported account",
|
|
1036
|
+
code: "UNSUPPORTED_ACCOUNT",
|
|
1037
|
+
status: 422
|
|
1038
|
+
});
|
|
730
1039
|
const payment = {
|
|
731
1040
|
id: uuidv4(),
|
|
732
1041
|
amount,
|
|
1042
|
+
connectorKey,
|
|
1043
|
+
accountId: account.id,
|
|
733
1044
|
direction: "INCOMING",
|
|
734
1045
|
paymentType: "DOMESTIC",
|
|
735
1046
|
currency,
|
|
@@ -767,10 +1078,10 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
767
1078
|
{ successMessage: "Last sync set." },
|
|
768
1079
|
async ({ iban, lastSyncedAt }) => {
|
|
769
1080
|
const { setLastSync } = useSync(this.env.BANK_KV);
|
|
770
|
-
const
|
|
771
|
-
|
|
772
|
-
);
|
|
773
|
-
if (!
|
|
1081
|
+
const account = await getAccountByIbanQuery(this.db, {
|
|
1082
|
+
iban
|
|
1083
|
+
});
|
|
1084
|
+
if (!account) {
|
|
774
1085
|
throw createInternalError(null, {
|
|
775
1086
|
status: 404,
|
|
776
1087
|
message: "Account for this organization does not exist."
|
|
@@ -780,7 +1091,7 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
780
1091
|
log: {
|
|
781
1092
|
lastSyncedAt
|
|
782
1093
|
},
|
|
783
|
-
account:
|
|
1094
|
+
account: { ...account, token: "" }
|
|
784
1095
|
});
|
|
785
1096
|
return {};
|
|
786
1097
|
}
|
|
@@ -800,7 +1111,7 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
800
1111
|
}
|
|
801
1112
|
async getBankAccounts() {
|
|
802
1113
|
return RPCResponse.ok("Bank accounts retrieved successfully", {
|
|
803
|
-
data: this.
|
|
1114
|
+
data: await this.getAccounts()
|
|
804
1115
|
});
|
|
805
1116
|
}
|
|
806
1117
|
async getBatches(input) {
|
|
@@ -821,12 +1132,18 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
821
1132
|
);
|
|
822
1133
|
}
|
|
823
1134
|
};
|
|
1135
|
+
__decorateClass([
|
|
1136
|
+
action("get-payments")
|
|
1137
|
+
], BankServiceBase.prototype, "getPayments", 1);
|
|
824
1138
|
__decorateClass([
|
|
825
1139
|
action("synchronize-accounts")
|
|
826
1140
|
], BankServiceBase.prototype, "syncAccounts", 1);
|
|
827
1141
|
__decorateClass([
|
|
828
1142
|
action("scheduled")
|
|
829
1143
|
], BankServiceBase.prototype, "scheduled", 1);
|
|
1144
|
+
__decorateClass([
|
|
1145
|
+
action("update-batch-statuses")
|
|
1146
|
+
], BankServiceBase.prototype, "updateBatchStatuses", 1);
|
|
830
1147
|
__decorateClass([
|
|
831
1148
|
action("add-payments-to-batch")
|
|
832
1149
|
], BankServiceBase.prototype, "addPaymentsToBatch", 1);
|
|
@@ -864,433 +1181,429 @@ BankServiceBase = __decorateClass([
|
|
|
864
1181
|
service("bank")
|
|
865
1182
|
], BankServiceBase);
|
|
866
1183
|
function defineBankService({
|
|
867
|
-
|
|
1184
|
+
config
|
|
868
1185
|
}) {
|
|
869
1186
|
return class BankService extends BankServiceBase {
|
|
870
1187
|
constructor(ctx, env) {
|
|
871
|
-
super(ctx, env,
|
|
1188
|
+
super(ctx, env, config);
|
|
872
1189
|
}
|
|
873
1190
|
};
|
|
874
1191
|
}
|
|
875
1192
|
|
|
876
|
-
const monthAgo = new Date(
|
|
877
|
-
Date.now() - 30 * 24 * 60 * 60 * 1e3
|
|
878
|
-
// 30 days ago
|
|
879
|
-
);
|
|
880
1193
|
const BankService = defineBankService({
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
],
|
|
948
|
-
productionAccounts: [
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
]
|
|
1194
|
+
config: {
|
|
1195
|
+
allowedProviders: []
|
|
1196
|
+
// {
|
|
1197
|
+
// connectorKey: 'MOCK_COBS',
|
|
1198
|
+
// id: 'staging-czk',
|
|
1199
|
+
// identification: {
|
|
1200
|
+
// number: '1234567890',
|
|
1201
|
+
// bankCode: '5051',
|
|
1202
|
+
// iban: 'CZ0350510000000000000449',
|
|
1203
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1204
|
+
// },
|
|
1205
|
+
// fallbackLastSync: monthAgo,
|
|
1206
|
+
// currency: 'CZK',
|
|
1207
|
+
// production: false,
|
|
1208
|
+
// },
|
|
1209
|
+
// {
|
|
1210
|
+
// connectorKey: 'MOCK_COBS',
|
|
1211
|
+
// id: 'staging-eur',
|
|
1212
|
+
// identification: {
|
|
1213
|
+
// number: '2345678901',
|
|
1214
|
+
// bankCode: '5051',
|
|
1215
|
+
// iban: 'CZ0750510000000000000668',
|
|
1216
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1217
|
+
// },
|
|
1218
|
+
// fallbackLastSync: monthAgo,
|
|
1219
|
+
// currency: 'EUR',
|
|
1220
|
+
// production: false,
|
|
1221
|
+
// },
|
|
1222
|
+
// {
|
|
1223
|
+
// connectorKey: 'FIO',
|
|
1224
|
+
// id: 'kleinpetr-test',
|
|
1225
|
+
// identification: {
|
|
1226
|
+
// number: '2502130437',
|
|
1227
|
+
// bankCode: '2010',
|
|
1228
|
+
// iban: 'CZ8520100000002502130437',
|
|
1229
|
+
// holderName: 'Petr Klein',
|
|
1230
|
+
// },
|
|
1231
|
+
// fallbackLastSync: monthAgo,
|
|
1232
|
+
// currency: 'CZK',
|
|
1233
|
+
// production: true,
|
|
1234
|
+
// },
|
|
1235
|
+
// {
|
|
1236
|
+
// connectorKey: 'MOCK',
|
|
1237
|
+
// id: 'id-test',
|
|
1238
|
+
// identification: {
|
|
1239
|
+
// number: '777777777',
|
|
1240
|
+
// bankCode: '0800',
|
|
1241
|
+
// iban: 'PL0000000000002444430437',
|
|
1242
|
+
// holderName: 'Test Test',
|
|
1243
|
+
// },
|
|
1244
|
+
// fallbackLastSync: monthAgo,
|
|
1245
|
+
// currency: 'PLN',
|
|
1246
|
+
// production: false,
|
|
1247
|
+
// },
|
|
1248
|
+
// {
|
|
1249
|
+
// connectorKey: 'MOCK_COBS',
|
|
1250
|
+
// id: 'staging-usd',
|
|
1251
|
+
// identification: {
|
|
1252
|
+
// iban: 'CZ3456789012345678901234',
|
|
1253
|
+
// accountNumberWithBankCode: '3456789012/3456',
|
|
1254
|
+
// },
|
|
1255
|
+
// currency: 'USD',
|
|
1256
|
+
// bankCode: '0800',
|
|
1257
|
+
// accountNumber: '3456789012',
|
|
1258
|
+
// production: false,
|
|
1259
|
+
// },
|
|
1260
|
+
// ],
|
|
1261
|
+
// productionAccounts: [
|
|
1262
|
+
// // Banka CREDITAS (2250)
|
|
1263
|
+
// {
|
|
1264
|
+
// connectorKey: 'CREDITAS',
|
|
1265
|
+
// id: '2250-CZK',
|
|
1266
|
+
// identification: {
|
|
1267
|
+
// number: '100602391',
|
|
1268
|
+
// bankCode: '2250',
|
|
1269
|
+
// iban: 'CZ5122500000000100602391',
|
|
1270
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1271
|
+
// },
|
|
1272
|
+
// fallbackLastSync: monthAgo,
|
|
1273
|
+
// currency: 'CZK',
|
|
1274
|
+
// production: true,
|
|
1275
|
+
// },
|
|
1276
|
+
// {
|
|
1277
|
+
// connectorKey: 'CREDITAS',
|
|
1278
|
+
// id: '2250-EUR',
|
|
1279
|
+
// identification: {
|
|
1280
|
+
// number: '100602404',
|
|
1281
|
+
// bankCode: '2250',
|
|
1282
|
+
// iban: 'CZ8822500000000100602404',
|
|
1283
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1284
|
+
// },
|
|
1285
|
+
// fallbackLastSync: monthAgo,
|
|
1286
|
+
// currency: 'EUR',
|
|
1287
|
+
// production: true,
|
|
1288
|
+
// },
|
|
1289
|
+
// {
|
|
1290
|
+
// connectorKey: 'CREDITAS',
|
|
1291
|
+
// id: '2250-USD',
|
|
1292
|
+
// identification: {
|
|
1293
|
+
// number: '100602412',
|
|
1294
|
+
// bankCode: '2250',
|
|
1295
|
+
// iban: 'CZ6622500000000100602412',
|
|
1296
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1297
|
+
// },
|
|
1298
|
+
// fallbackLastSync: monthAgo,
|
|
1299
|
+
// currency: 'USD',
|
|
1300
|
+
// production: true,
|
|
1301
|
+
// },
|
|
1302
|
+
// {
|
|
1303
|
+
// connectorKey: 'CREDITAS',
|
|
1304
|
+
// id: '2250-GBP',
|
|
1305
|
+
// identification: {
|
|
1306
|
+
// number: '100602420',
|
|
1307
|
+
// bankCode: '2250',
|
|
1308
|
+
// iban: 'CZ4422500000000100602420',
|
|
1309
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1310
|
+
// },
|
|
1311
|
+
// fallbackLastSync: monthAgo,
|
|
1312
|
+
// currency: 'GBP',
|
|
1313
|
+
// production: true,
|
|
1314
|
+
// },
|
|
1315
|
+
// {
|
|
1316
|
+
// connectorKey: 'CREDITAS',
|
|
1317
|
+
// id: '2250-CHF',
|
|
1318
|
+
// identification: {
|
|
1319
|
+
// number: '100602439',
|
|
1320
|
+
// bankCode: '2250',
|
|
1321
|
+
// iban: 'CZ1622500000000100602439',
|
|
1322
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1323
|
+
// },
|
|
1324
|
+
// fallbackLastSync: monthAgo,
|
|
1325
|
+
// currency: 'CHF',
|
|
1326
|
+
// production: true,
|
|
1327
|
+
// },
|
|
1328
|
+
// {
|
|
1329
|
+
// connectorKey: 'CREDITAS',
|
|
1330
|
+
// id: '2250-PLN',
|
|
1331
|
+
// identification: {
|
|
1332
|
+
// number: '100602447',
|
|
1333
|
+
// bankCode: '2250',
|
|
1334
|
+
// iban: 'CZ9122500000000100602447',
|
|
1335
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1336
|
+
// },
|
|
1337
|
+
// fallbackLastSync: monthAgo,
|
|
1338
|
+
// currency: 'PLN',
|
|
1339
|
+
// production: true,
|
|
1340
|
+
// },
|
|
1341
|
+
// // Fio banka (2010)
|
|
1342
|
+
// {
|
|
1343
|
+
// connectorKey: 'FINBRICKS',
|
|
1344
|
+
// id: '2010-CZK',
|
|
1345
|
+
// identification: {
|
|
1346
|
+
// number: '2500845869',
|
|
1347
|
+
// bankCode: '2010',
|
|
1348
|
+
// iban: 'CZ0420100000002500845869',
|
|
1349
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1350
|
+
// },
|
|
1351
|
+
// fallbackLastSync: monthAgo,
|
|
1352
|
+
// currency: 'CZK',
|
|
1353
|
+
// production: true,
|
|
1354
|
+
// },
|
|
1355
|
+
// {
|
|
1356
|
+
// connectorKey: 'FINBRICKS',
|
|
1357
|
+
// id: '2010-EUR',
|
|
1358
|
+
// identification: {
|
|
1359
|
+
// number: '2600884128',
|
|
1360
|
+
// bankCode: '2010',
|
|
1361
|
+
// iban: 'CZ0820100000002600884128',
|
|
1362
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1363
|
+
// },
|
|
1364
|
+
// fallbackLastSync: monthAgo,
|
|
1365
|
+
// currency: 'EUR',
|
|
1366
|
+
// production: true,
|
|
1367
|
+
// },
|
|
1368
|
+
// {
|
|
1369
|
+
// connectorKey: 'FINBRICKS',
|
|
1370
|
+
// id: '2010-USD',
|
|
1371
|
+
// identification: {
|
|
1372
|
+
// number: '2700884133',
|
|
1373
|
+
// bankCode: '2010',
|
|
1374
|
+
// iban: 'CZ1420100000002700884133',
|
|
1375
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1376
|
+
// },
|
|
1377
|
+
// fallbackLastSync: monthAgo,
|
|
1378
|
+
// currency: 'USD',
|
|
1379
|
+
// production: true,
|
|
1380
|
+
// },
|
|
1381
|
+
// {
|
|
1382
|
+
// connectorKey: 'FINBRICKS',
|
|
1383
|
+
// id: '2010-CHF',
|
|
1384
|
+
// identification: {
|
|
1385
|
+
// number: '2401098351',
|
|
1386
|
+
// bankCode: '2010',
|
|
1387
|
+
// iban: 'CZ0920100000002401098351',
|
|
1388
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1389
|
+
// },
|
|
1390
|
+
// fallbackLastSync: monthAgo,
|
|
1391
|
+
// currency: 'CHF',
|
|
1392
|
+
// production: true,
|
|
1393
|
+
// },
|
|
1394
|
+
// {
|
|
1395
|
+
// connectorKey: 'FINBRICKS',
|
|
1396
|
+
// id: '2010-GBP',
|
|
1397
|
+
// identification: {
|
|
1398
|
+
// number: '2400884131',
|
|
1399
|
+
// bankCode: '2010',
|
|
1400
|
+
// iban: 'CZ3320100000002400884131',
|
|
1401
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1402
|
+
// },
|
|
1403
|
+
// fallbackLastSync: monthAgo,
|
|
1404
|
+
// currency: 'GBP',
|
|
1405
|
+
// production: true,
|
|
1406
|
+
// },
|
|
1407
|
+
// {
|
|
1408
|
+
// connectorKey: 'FINBRICKS',
|
|
1409
|
+
// id: '2010-PLN',
|
|
1410
|
+
// identification: {
|
|
1411
|
+
// number: '2701098353',
|
|
1412
|
+
// bankCode: '2010',
|
|
1413
|
+
// iban: 'CZ8720100000002701098353',
|
|
1414
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1415
|
+
// },
|
|
1416
|
+
// fallbackLastSync: monthAgo,
|
|
1417
|
+
// currency: 'PLN',
|
|
1418
|
+
// production: true,
|
|
1419
|
+
// },
|
|
1420
|
+
// {
|
|
1421
|
+
// connectorKey: 'FINBRICKS',
|
|
1422
|
+
// id: '2010-CAD',
|
|
1423
|
+
// identification: {
|
|
1424
|
+
// number: '2701478102',
|
|
1425
|
+
// bankCode: '2010',
|
|
1426
|
+
// iban: 'CZ5520100000002701478102',
|
|
1427
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1428
|
+
// },
|
|
1429
|
+
// fallbackLastSync: monthAgo,
|
|
1430
|
+
// currency: 'CAD',
|
|
1431
|
+
// production: true,
|
|
1432
|
+
// },
|
|
1433
|
+
// // Komerční banka (0100)
|
|
1434
|
+
// {
|
|
1435
|
+
// connectorKey: 'FINBRICKS',
|
|
1436
|
+
// id: '0100-CZK',
|
|
1437
|
+
// identification: {
|
|
1438
|
+
// number: '115-1483630297',
|
|
1439
|
+
// bankCode: '0100',
|
|
1440
|
+
// iban: 'CZ5901000001151483630297',
|
|
1441
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1442
|
+
// },
|
|
1443
|
+
// fallbackLastSync: monthAgo,
|
|
1444
|
+
// currency: 'CZK',
|
|
1445
|
+
// production: true,
|
|
1446
|
+
// },
|
|
1447
|
+
// {
|
|
1448
|
+
// connectorKey: 'FINBRICKS',
|
|
1449
|
+
// id: '0100-EUR',
|
|
1450
|
+
// identification: {
|
|
1451
|
+
// number: '115-1484940297',
|
|
1452
|
+
// bankCode: '0100',
|
|
1453
|
+
// iban: 'CZ4201000001151484940297',
|
|
1454
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1455
|
+
// },
|
|
1456
|
+
// fallbackLastSync: monthAgo,
|
|
1457
|
+
// currency: 'EUR',
|
|
1458
|
+
// production: true,
|
|
1459
|
+
// },
|
|
1460
|
+
// {
|
|
1461
|
+
// connectorKey: 'FINBRICKS',
|
|
1462
|
+
// id: '0100-USD',
|
|
1463
|
+
// identification: {
|
|
1464
|
+
// number: '115-1483960237',
|
|
1465
|
+
// bankCode: '0100',
|
|
1466
|
+
// iban: 'CZ6201000001151483960237',
|
|
1467
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1468
|
+
// },
|
|
1469
|
+
// fallbackLastSync: monthAgo,
|
|
1470
|
+
// currency: 'USD',
|
|
1471
|
+
// production: true,
|
|
1472
|
+
// },
|
|
1473
|
+
// {
|
|
1474
|
+
// connectorKey: 'FINBRICKS',
|
|
1475
|
+
// id: '0100-PLN',
|
|
1476
|
+
// identification: {
|
|
1477
|
+
// number: '115-6674290267',
|
|
1478
|
+
// bankCode: '0100',
|
|
1479
|
+
// iban: 'CZ3501000001156674290267',
|
|
1480
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1481
|
+
// },
|
|
1482
|
+
// fallbackLastSync: monthAgo,
|
|
1483
|
+
// currency: 'PLN',
|
|
1484
|
+
// production: true,
|
|
1485
|
+
// },
|
|
1486
|
+
// {
|
|
1487
|
+
// connectorKey: 'FINBRICKS',
|
|
1488
|
+
// id: '0100-SEK',
|
|
1489
|
+
// identification: {
|
|
1490
|
+
// number: '115-9578110207',
|
|
1491
|
+
// bankCode: '0100',
|
|
1492
|
+
// iban: 'CZ2401000001159578110207',
|
|
1493
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1494
|
+
// },
|
|
1495
|
+
// fallbackLastSync: monthAgo,
|
|
1496
|
+
// currency: 'SEK',
|
|
1497
|
+
// production: true,
|
|
1498
|
+
// },
|
|
1499
|
+
// // Česká spořitelna (0800)
|
|
1500
|
+
// {
|
|
1501
|
+
// connectorKey: 'ERSTE',
|
|
1502
|
+
// id: '0800-CZK',
|
|
1503
|
+
// identification: {
|
|
1504
|
+
// number: '4413926379',
|
|
1505
|
+
// bankCode: '0800',
|
|
1506
|
+
// iban: 'CZ7908000000004413926379',
|
|
1507
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1508
|
+
// },
|
|
1509
|
+
// fallbackLastSync: monthAgo,
|
|
1510
|
+
// currency: 'CZK',
|
|
1511
|
+
// production: true,
|
|
1512
|
+
// },
|
|
1513
|
+
// {
|
|
1514
|
+
// connectorKey: 'ERSTE',
|
|
1515
|
+
// id: '0800-EUR',
|
|
1516
|
+
// identification: {
|
|
1517
|
+
// number: '1966646293',
|
|
1518
|
+
// bankCode: '0800',
|
|
1519
|
+
// iban: 'CZ2308000000001966646293',
|
|
1520
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1521
|
+
// },
|
|
1522
|
+
// fallbackLastSync: monthAgo,
|
|
1523
|
+
// currency: 'EUR',
|
|
1524
|
+
// production: true,
|
|
1525
|
+
// },
|
|
1526
|
+
// {
|
|
1527
|
+
// connectorKey: 'ERSTE',
|
|
1528
|
+
// id: '0800-USD',
|
|
1529
|
+
// identification: {
|
|
1530
|
+
// number: '1978982243',
|
|
1531
|
+
// bankCode: '0800',
|
|
1532
|
+
// iban: 'CZ1908000000001978982243',
|
|
1533
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1534
|
+
// },
|
|
1535
|
+
// fallbackLastSync: monthAgo,
|
|
1536
|
+
// currency: 'USD',
|
|
1537
|
+
// production: true,
|
|
1538
|
+
// },
|
|
1539
|
+
// {
|
|
1540
|
+
// connectorKey: 'ERSTE',
|
|
1541
|
+
// id: '0800-HUF',
|
|
1542
|
+
// identification: {
|
|
1543
|
+
// number: '13461252',
|
|
1544
|
+
// bankCode: '0800',
|
|
1545
|
+
// iban: 'CZ1908000000000013461252',
|
|
1546
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1547
|
+
// },
|
|
1548
|
+
// fallbackLastSync: monthAgo,
|
|
1549
|
+
// currency: 'HUF',
|
|
1550
|
+
// production: true,
|
|
1551
|
+
// },
|
|
1552
|
+
// // MONETA Money Bank (0600)
|
|
1553
|
+
// {
|
|
1554
|
+
// connectorKey: 'FINBRICKS',
|
|
1555
|
+
// id: '0600-CZK',
|
|
1556
|
+
// identification: {
|
|
1557
|
+
// number: '224252186',
|
|
1558
|
+
// bankCode: '0600',
|
|
1559
|
+
// iban: 'CZ5906000000000224252186',
|
|
1560
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1561
|
+
// },
|
|
1562
|
+
// fallbackLastSync: monthAgo,
|
|
1563
|
+
// currency: 'CZK',
|
|
1564
|
+
// production: true,
|
|
1565
|
+
// },
|
|
1566
|
+
// {
|
|
1567
|
+
// connectorKey: 'FINBRICKS',
|
|
1568
|
+
// id: '0600-EUR',
|
|
1569
|
+
// identification: {
|
|
1570
|
+
// number: '224252231',
|
|
1571
|
+
// bankCode: '0600',
|
|
1572
|
+
// iban: 'CZ0806000000000224252231',
|
|
1573
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1574
|
+
// },
|
|
1575
|
+
// fallbackLastSync: monthAgo,
|
|
1576
|
+
// currency: 'EUR',
|
|
1577
|
+
// production: true,
|
|
1578
|
+
// },
|
|
1579
|
+
// {
|
|
1580
|
+
// connectorKey: 'FINBRICKS',
|
|
1581
|
+
// id: '0600-USD',
|
|
1582
|
+
// identification: {
|
|
1583
|
+
// number: '224252290',
|
|
1584
|
+
// bankCode: '0600',
|
|
1585
|
+
// iban: 'CZ6406000000000224252290',
|
|
1586
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1587
|
+
// },
|
|
1588
|
+
// fallbackLastSync: monthAgo,
|
|
1589
|
+
// currency: 'USD',
|
|
1590
|
+
// production: true,
|
|
1591
|
+
// },
|
|
1592
|
+
// // NEY spořitelní družstvo (2260)
|
|
1593
|
+
// {
|
|
1594
|
+
// connectorKey: 'FINBRICKS',
|
|
1595
|
+
// id: '2260-CZK',
|
|
1596
|
+
// identification: {
|
|
1597
|
+
// number: '1702700014',
|
|
1598
|
+
// bankCode: '2260',
|
|
1599
|
+
// iban: 'CZ7422600000001702700014',
|
|
1600
|
+
// holderName: 'Devizová Burza a.s.',
|
|
1601
|
+
// },
|
|
1602
|
+
// fallbackLastSync: monthAgo,
|
|
1603
|
+
// currency: 'CZK',
|
|
1604
|
+
// production: true,
|
|
1605
|
+
// },
|
|
1606
|
+
// ],
|
|
1294
1607
|
}
|
|
1295
1608
|
});
|
|
1296
1609
|
|