@develit-services/bank 5.0.1 → 5.2.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/base.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const backendSdk = require('@develit-io/backend-sdk');
4
- const ott_zod = require('./shared/bank.BSX82jhx.cjs');
4
+ const bank = require('./shared/bank.BkctD4hR.cjs');
5
5
  const drizzleOrm = require('drizzle-orm');
6
6
  const cloudflare_workers = require('cloudflare:workers');
7
7
  const d1 = require('drizzle-orm/d1');
@@ -11,7 +11,7 @@ const database_schema = require('./shared/bank.9Yw4KHyl.cjs');
11
11
  const generalCodes = require('@develit-io/general-codes');
12
12
  require('date-fns');
13
13
  require('node:crypto');
14
- const credentialsResolver = require('./shared/bank.CibQRM2D.cjs');
14
+ const credentialsResolver = require('./shared/bank.Bgz1SSIP.cjs');
15
15
  require('drizzle-orm/zod');
16
16
  require('drizzle-orm/sqlite-core');
17
17
 
@@ -73,82 +73,11 @@ async function heartbeatSyncWorkflows({
73
73
  );
74
74
  }
75
75
 
76
- const sendPaymentInputSchema = zod.z.object({
77
- correlationId: zod.z.string().min(1),
78
- refId: zod.z.string().optional(),
79
- amount: zod.z.number().positive(),
80
- paymentType: zod.z.enum(database_schema.PAYMENT_TYPES),
81
- chargeBearer: zod.z.enum(database_schema.CHARGE_BEARERS).optional(),
82
- instructionPriority: zod.z.enum(database_schema.INSTRUCTION_PRIORITIES).optional(),
83
- currency: zod.z.enum(generalCodes.CURRENCY_CODES),
84
- vs: zod.z.string().optional(),
85
- ss: zod.z.string().optional(),
86
- ks: zod.z.string().optional(),
87
- message: zod.z.string().optional(),
88
- creditor: backendSdk.bankAccountMetadataSchema,
89
- debtor: backendSdk.bankAccountMetadataSchema,
90
- sendAsSinglePayment: zod.z.boolean().optional()
91
- }).superRefine((data, ctx) => {
92
- if (data.paymentType === "UNKNOWN") {
93
- ctx.addIssue({
94
- code: "custom",
95
- message: "paymentType=UNKNOWN is not supported. Use DOMESTIC, SEPA, or SWIFT.",
96
- path: ["paymentType"]
97
- });
98
- return;
99
- }
100
- if (!data.debtor.iban) {
101
- ctx.addIssue({
102
- code: "custom",
103
- message: "debtor.iban is required",
104
- path: ["debtor", "iban"]
105
- });
106
- }
107
- if (data.paymentType === "DOMESTIC" || data.paymentType === "SEPA") {
108
- if (!data.creditor.iban) {
109
- ctx.addIssue({
110
- code: "custom",
111
- message: `creditor.iban is required for ${data.paymentType} payments`,
112
- path: ["creditor", "iban"]
113
- });
114
- }
115
- return;
116
- }
117
- if (data.paymentType === "SWIFT") {
118
- const hasIban = !!data.creditor.iban;
119
- const hasBban = !!data.creditor.number && !!(data.creditor.swiftBic ?? data.creditor.bicCor);
120
- if (!hasIban && !hasBban) {
121
- ctx.addIssue({
122
- code: "custom",
123
- message: "SWIFT creditor requires either iban OR (number + swiftBic/bicCor)",
124
- path: ["creditor"]
125
- });
126
- }
127
- }
128
- });
129
-
130
- const sendBatchInputSchema = zod.z.object({
131
- payments: zod.z.array(sendPaymentInputSchema).min(1)
132
- });
133
-
134
- const getAuthUriInputSchema = zod.z.object({
135
- connectorKey: zod.z.enum(database_schema.CONNECTOR_KEYS)
136
- });
137
-
138
- const authorizeAccountInputSchema = zod.z.object({
139
- ott: zod.z.string(),
140
- urlParams: zod.z.string(),
141
- syncIntervalS: zod.z.number().int().positive().optional(),
142
- startSync: zod.z.boolean().optional(),
143
- lastSyncAt: zod.z.date().optional(),
144
- address: backendSdk.structuredAddressSchema.optional()
145
- });
146
-
147
76
  const upsertAccountCommand = (db, { account }) => {
148
77
  const id = account.id || backendSdk.uuidv4();
149
78
  const { id: _id, ...accountWithoutId } = account;
150
- const command = db.insert(ott_zod.tables.account).values({ ...account, id }).onConflictDoUpdate({
151
- target: ott_zod.tables.account.iban,
79
+ const command = db.insert(bank.tables.account).values({ ...account, id }).onConflictDoUpdate({
80
+ target: bank.tables.account.iban,
152
81
  set: accountWithoutId
153
82
  // preserve existing id on re-auth
154
83
  }).returning();
@@ -165,7 +94,7 @@ const createOneTimeTokenCommand = (db, {
165
94
  }) => {
166
95
  const id = backendSdk.uuidv4();
167
96
  const expiresAt = new Date(Date.now() + 1e3 * 60 * 60) ;
168
- const command = db.insert(ott_zod.tables.ott).values({
97
+ const command = db.insert(bank.tables.ott).values({
169
98
  id,
170
99
  oneTimeToken: ott,
171
100
  tokenType,
@@ -177,7 +106,7 @@ const createOneTimeTokenCommand = (db, {
177
106
 
178
107
  const updateAccountCommand = (db, { account }) => {
179
108
  return {
180
- command: db.update(ott_zod.tables.account).set({ ...account }).where(drizzleOrm.eq(ott_zod.tables.account.id, account.id)).returning()
109
+ command: db.update(bank.tables.account).set({ ...account }).where(drizzleOrm.eq(bank.tables.account.id, account.id)).returning()
181
110
  };
182
111
  };
183
112
 
@@ -185,16 +114,16 @@ const expireOneTimeTokenCommand = (db, {
185
114
  ott
186
115
  }) => {
187
116
  return {
188
- command: db.update(ott_zod.tables.ott).set({
117
+ command: db.update(bank.tables.ott).set({
189
118
  expiresAt: /* @__PURE__ */ new Date()
190
- }).where(drizzleOrm.eq(ott_zod.tables.ott.oneTimeToken, ott))
119
+ }).where(drizzleOrm.eq(bank.tables.ott.oneTimeToken, ott))
191
120
  };
192
121
  };
193
122
 
194
123
  const createAccountCredentialsCommand = async (db, encryptionKey, { credentials }) => {
195
124
  const id = credentials.id || backendSdk.uuidv4();
196
125
  const encryptedValue = await credentialsResolver.encrypt(credentials.value, encryptionKey);
197
- const command = db.insert(ott_zod.tables.accountCredentials).values({
126
+ const command = db.insert(bank.tables.accountCredentials).values({
198
127
  ...credentials,
199
128
  id,
200
129
  value: encryptedValue
@@ -206,16 +135,16 @@ const createAccountCredentialsCommand = async (db, encryptionKey, { credentials
206
135
  };
207
136
 
208
137
  const deleteAccountCredentialsCommand = (db, { accountId }) => {
209
- const command = db.delete(ott_zod.tables.accountCredentials).where(drizzleOrm.eq(ott_zod.tables.accountCredentials.accountId, accountId));
138
+ const command = db.delete(bank.tables.accountCredentials).where(drizzleOrm.eq(bank.tables.accountCredentials.accountId, accountId));
210
139
  return {
211
140
  command
212
141
  };
213
142
  };
214
143
 
215
144
  const deletePaymentsByAccountCommand = (db, { accountId }) => {
216
- const command = db.update(ott_zod.tables.payment).set({
145
+ const command = db.update(bank.tables.payment).set({
217
146
  deletedAt: /* @__PURE__ */ new Date()
218
- }).where(drizzleOrm.eq(ott_zod.tables.payment.accountId, accountId));
147
+ }).where(drizzleOrm.eq(bank.tables.payment.accountId, accountId));
219
148
  return {
220
149
  command
221
150
  };
@@ -223,7 +152,7 @@ const deletePaymentsByAccountCommand = (db, { accountId }) => {
223
152
 
224
153
  const createPaymentRequestCommand = (db, { paymentRequest }) => {
225
154
  return {
226
- command: db.insert(ott_zod.tables.paymentRequest).values({
155
+ command: db.insert(bank.tables.paymentRequest).values({
227
156
  ...paymentRequest,
228
157
  creditorIban: paymentRequest.creditor.iban,
229
158
  debtorIban: paymentRequest.debtor.iban
@@ -234,16 +163,16 @@ const createPaymentRequestCommand = (db, { paymentRequest }) => {
234
163
  const getAccountBatchCountsQuery = async (db, { accountId }) => {
235
164
  const result = await db.select({
236
165
  totalCount: drizzleOrm.sql`COUNT(*)`.as("totalCount"),
237
- processingCount: drizzleOrm.sql`SUM(CASE WHEN ${ott_zod.tables.batch.status} = 'PROCESSING' THEN 1 ELSE 0 END)`.as(
166
+ processingCount: drizzleOrm.sql`SUM(CASE WHEN ${bank.tables.batch.status} = 'PROCESSING' THEN 1 ELSE 0 END)`.as(
238
167
  "processingCount"
239
168
  ),
240
- readyToSignCount: drizzleOrm.sql`SUM(CASE WHEN ${ott_zod.tables.batch.status} = 'READY_TO_SIGN' THEN 1 ELSE 0 END)`.as(
169
+ readyToSignCount: drizzleOrm.sql`SUM(CASE WHEN ${bank.tables.batch.status} = 'READY_TO_SIGN' THEN 1 ELSE 0 END)`.as(
241
170
  "readyToSignCount"
242
171
  ),
243
- failedCount: drizzleOrm.sql`SUM(CASE WHEN ${ott_zod.tables.batch.status} = 'FAILED' THEN 1 ELSE 0 END)`.as(
172
+ failedCount: drizzleOrm.sql`SUM(CASE WHEN ${bank.tables.batch.status} = 'FAILED' THEN 1 ELSE 0 END)`.as(
244
173
  "failedCount"
245
174
  )
246
- }).from(ott_zod.tables.batch).where(drizzleOrm.eq(ott_zod.tables.batch.accountId, accountId)).then(backendSdk.first);
175
+ }).from(bank.tables.batch).where(drizzleOrm.eq(bank.tables.batch.accountId, accountId)).then(backendSdk.first);
247
176
  return result || {
248
177
  totalCount: 0,
249
178
  processingCount: 0,
@@ -253,18 +182,18 @@ const getAccountBatchCountsQuery = async (db, { accountId }) => {
253
182
  };
254
183
 
255
184
  const getAccountByIbanQuery = async (db, { iban }) => {
256
- return await db.select().from(ott_zod.tables.account).where(drizzleOrm.eq(ott_zod.tables.account.iban, iban)).get();
185
+ return await db.select().from(bank.tables.account).where(drizzleOrm.eq(bank.tables.account.iban, iban)).get();
257
186
  };
258
187
 
259
188
  const getAllAccountsQuery = async (db, filters) => {
260
189
  const whereConditions = drizzleOrm.and(
261
- backendSdk.buildMultiFilterConditions(ott_zod.tables.account.iban, filters?.filterIbans),
190
+ backendSdk.buildMultiFilterConditions(bank.tables.account.iban, filters?.filterIbans),
262
191
  backendSdk.buildMultiFilterConditions(
263
- ott_zod.tables.account.currency,
192
+ bank.tables.account.currency,
264
193
  filters?.filterCurrencies
265
194
  ),
266
195
  backendSdk.buildMultiFilterConditions(
267
- ott_zod.tables.account.bankRefId,
196
+ bank.tables.account.bankRefId,
268
197
  filters?.filterBankRefIds
269
198
  )
270
199
  );
@@ -272,11 +201,11 @@ const getAllAccountsQuery = async (db, filters) => {
272
201
  const limit = filters?.limit ?? 20;
273
202
  const offset = (page - 1) * limit;
274
203
  const [accountsWithExpiration, countResult] = await Promise.all([
275
- db.select().from(ott_zod.tables.account).leftJoin(
276
- ott_zod.tables.accountCredentials,
277
- drizzleOrm.eq(ott_zod.tables.accountCredentials.accountId, ott_zod.tables.account.id)
204
+ db.select().from(bank.tables.account).leftJoin(
205
+ bank.tables.accountCredentials,
206
+ drizzleOrm.eq(bank.tables.accountCredentials.accountId, bank.tables.account.id)
278
207
  ).where(whereConditions).limit(limit).offset(offset),
279
- db.select({ count: drizzleOrm.sql`count(*)` }).from(ott_zod.tables.account).where(whereConditions)
208
+ db.select({ count: drizzleOrm.sql`count(*)` }).from(bank.tables.account).where(whereConditions)
280
209
  ]);
281
210
  return {
282
211
  accounts: accountsWithExpiration.map(
@@ -338,42 +267,42 @@ const getPaymentsWithPaginationQuery = async (db, {
338
267
  }) => {
339
268
  const whereConditions = drizzleOrm.and(
340
269
  buildMultiFilterConditions(
341
- ott_zod.tables.payment.accountId,
270
+ bank.tables.payment.accountId,
342
271
  filterPaymentAccountId
343
272
  ),
344
- buildMultiFilterConditions(ott_zod.tables.payment.amount, filterPaymentAmount),
345
- buildMultiFilterConditions(ott_zod.tables.payment.currency, filterPaymentCurrency),
273
+ buildMultiFilterConditions(bank.tables.payment.amount, filterPaymentAmount),
274
+ buildMultiFilterConditions(bank.tables.payment.currency, filterPaymentCurrency),
346
275
  buildRangeFilterConditions(
347
- ott_zod.tables.payment.createdAt,
276
+ bank.tables.payment.createdAt,
348
277
  filterPaymentDateFrom,
349
278
  filterPaymentDateTo
350
279
  ),
351
- buildMultiFilterConditions(ott_zod.tables.payment.status, filterPaymentStatus),
280
+ buildMultiFilterConditions(bank.tables.payment.status, filterPaymentStatus),
352
281
  buildMultiFilterConditions(
353
- ott_zod.tables.payment.direction,
282
+ bank.tables.payment.direction,
354
283
  filterPaymentDirection
355
284
  ),
356
- buildMultiFilterConditions(ott_zod.tables.payment.id, ids),
357
- buildMultiFilterConditions(ott_zod.tables.payment.paymentType, filterPaymentType),
285
+ buildMultiFilterConditions(bank.tables.payment.id, ids),
286
+ buildMultiFilterConditions(bank.tables.payment.paymentType, filterPaymentType),
358
287
  buildRangeFilterConditions(
359
- ott_zod.tables.payment.amount,
288
+ bank.tables.payment.amount,
360
289
  filterPaymentMinAmount,
361
290
  filterPaymentMaxAmount
362
291
  ),
363
- filterPaymentVariableSymbol !== void 0 ? drizzleOrm.eq(ott_zod.tables.payment.vs, filterPaymentVariableSymbol) : void 0,
364
- filterPaymentSpecificSymbol !== void 0 ? drizzleOrm.eq(ott_zod.tables.payment.ss, filterPaymentSpecificSymbol) : void 0,
365
- filterPaymentConstantSymbol !== void 0 ? drizzleOrm.eq(ott_zod.tables.payment.ks, filterPaymentConstantSymbol) : void 0,
366
- filterPaymentMessage !== void 0 ? drizzleOrm.like(ott_zod.tables.payment.message, `%${filterPaymentMessage}%`) : void 0,
367
- filterPaymentCreditorIban !== void 0 ? drizzleOrm.eq(ott_zod.tables.payment.creditorIban, filterPaymentCreditorIban) : void 0,
368
- filterPaymentDebtorIban !== void 0 ? drizzleOrm.eq(ott_zod.tables.payment.debtorIban, filterPaymentDebtorIban) : void 0,
369
- filterPaymentBatchId !== void 0 ? drizzleOrm.eq(ott_zod.tables.payment.batchId, filterPaymentBatchId) : void 0,
370
- filterPaymentBankRefId !== void 0 ? drizzleOrm.eq(ott_zod.tables.payment.bankRefId, filterPaymentBankRefId) : void 0
292
+ filterPaymentVariableSymbol !== void 0 ? drizzleOrm.eq(bank.tables.payment.vs, filterPaymentVariableSymbol) : void 0,
293
+ filterPaymentSpecificSymbol !== void 0 ? drizzleOrm.eq(bank.tables.payment.ss, filterPaymentSpecificSymbol) : void 0,
294
+ filterPaymentConstantSymbol !== void 0 ? drizzleOrm.eq(bank.tables.payment.ks, filterPaymentConstantSymbol) : void 0,
295
+ filterPaymentMessage !== void 0 ? drizzleOrm.like(bank.tables.payment.message, `%${filterPaymentMessage}%`) : void 0,
296
+ filterPaymentCreditorIban !== void 0 ? drizzleOrm.eq(bank.tables.payment.creditorIban, filterPaymentCreditorIban) : void 0,
297
+ filterPaymentDebtorIban !== void 0 ? drizzleOrm.eq(bank.tables.payment.debtorIban, filterPaymentDebtorIban) : void 0,
298
+ filterPaymentBatchId !== void 0 ? drizzleOrm.eq(bank.tables.payment.batchId, filterPaymentBatchId) : void 0,
299
+ filterPaymentBankRefId !== void 0 ? drizzleOrm.eq(bank.tables.payment.bankRefId, filterPaymentBankRefId) : void 0
371
300
  );
372
- const sortColumn = resolveColumn(ott_zod.tables.payment, sort.column);
301
+ const sortColumn = resolveColumn(bank.tables.payment, sort.column);
373
302
  const [{ totalCount }] = await db.select({
374
303
  totalCount: drizzleOrm.sql`count(*)`
375
- }).from(ott_zod.tables.payment).where(whereConditions);
376
- const payments = await db.select().from(ott_zod.tables.payment).where(whereConditions).limit(limit).offset((page - 1) * limit).orderBy(sort.direction === "asc" ? drizzleOrm.asc(sortColumn) : drizzleOrm.desc(sortColumn));
304
+ }).from(bank.tables.payment).where(whereConditions);
305
+ const payments = await db.select().from(bank.tables.payment).where(whereConditions).limit(limit).offset((page - 1) * limit).orderBy(sort.direction === "asc" ? drizzleOrm.asc(sortColumn) : drizzleOrm.desc(sortColumn));
377
306
  return {
378
307
  payments,
379
308
  totalCount
@@ -388,20 +317,20 @@ const getBatchesQuery = async (db, {
388
317
  filterBatchStatus
389
318
  }) => {
390
319
  const whereConditions = drizzleOrm.and(
391
- drizzleOrm.isNull(ott_zod.tables.batch.deletedAt),
392
- buildMultiFilterConditions(ott_zod.tables.batch.accountId, filterBatchAccountId),
393
- buildMultiFilterConditions(ott_zod.tables.batch.status, filterBatchStatus)
320
+ drizzleOrm.isNull(bank.tables.batch.deletedAt),
321
+ buildMultiFilterConditions(bank.tables.batch.accountId, filterBatchAccountId),
322
+ buildMultiFilterConditions(bank.tables.batch.status, filterBatchStatus)
394
323
  );
395
- const sortColumn = resolveColumn(ott_zod.tables.batch, sort.column);
324
+ const sortColumn = resolveColumn(bank.tables.batch, sort.column);
396
325
  const [{ totalCount }] = await db.select({
397
326
  totalCount: drizzleOrm.sql`count(*)`
398
- }).from(ott_zod.tables.batch).where(whereConditions);
399
- const batches = await db.select().from(ott_zod.tables.batch).where(whereConditions).limit(limit).offset((page - 1) * limit).orderBy(sort.direction === "asc" ? drizzleOrm.asc(sortColumn) : drizzleOrm.desc(sortColumn));
327
+ }).from(bank.tables.batch).where(whereConditions);
328
+ const batches = await db.select().from(bank.tables.batch).where(whereConditions).limit(limit).offset((page - 1) * limit).orderBy(sort.direction === "asc" ? drizzleOrm.asc(sortColumn) : drizzleOrm.desc(sortColumn));
400
329
  const batchIds = batches.map((b) => b.id);
401
- const paymentRequests = batchIds.length > 0 ? await db.select().from(ott_zod.tables.paymentRequest).where(
330
+ const paymentRequests = batchIds.length > 0 ? await db.select().from(bank.tables.paymentRequest).where(
402
331
  drizzleOrm.and(
403
- drizzleOrm.inArray(ott_zod.tables.paymentRequest.batchId, batchIds),
404
- drizzleOrm.isNull(ott_zod.tables.paymentRequest.deletedAt)
332
+ drizzleOrm.inArray(bank.tables.paymentRequest.batchId, batchIds),
333
+ drizzleOrm.isNull(bank.tables.paymentRequest.deletedAt)
405
334
  )
406
335
  ) : [];
407
336
  const paymentRequestsByBatchId = Map.groupBy(
@@ -419,14 +348,50 @@ const getBatchesQuery = async (db, {
419
348
  };
420
349
 
421
350
  const getOttQuery = async (db, { ott }) => {
422
- return await db.select().from(ott_zod.tables.ott).where(drizzleOrm.eq(ott_zod.tables.ott.oneTimeToken, ott)).get();
351
+ return await db.select().from(bank.tables.ott).where(drizzleOrm.eq(bank.tables.ott.oneTimeToken, ott)).get();
352
+ };
353
+
354
+ const CHUNK_SIZE = 90;
355
+ const getPaymentsByPaymentRequestIdsQuery = async (db, { paymentRequestIds }) => {
356
+ if (paymentRequestIds.length === 0) return [];
357
+ const paymentRequests = [];
358
+ for (let i = 0; i < paymentRequestIds.length; i += CHUNK_SIZE) {
359
+ const chunkIds = paymentRequestIds.slice(i, i + CHUNK_SIZE);
360
+ const rows = await db.select({
361
+ id: bank.tables.paymentRequest.id,
362
+ correlationId: bank.tables.paymentRequest.correlationId,
363
+ status: bank.tables.paymentRequest.status,
364
+ amount: bank.tables.paymentRequest.amount,
365
+ currency: bank.tables.paymentRequest.currency,
366
+ creditor: bank.tables.paymentRequest.creditor,
367
+ createdAt: bank.tables.paymentRequest.createdAt,
368
+ updatedAt: bank.tables.paymentRequest.updatedAt
369
+ }).from(bank.tables.paymentRequest).where(drizzleOrm.inArray(bank.tables.paymentRequest.id, chunkIds));
370
+ paymentRequests.push(...rows);
371
+ }
372
+ return paymentRequests.map((pr) => {
373
+ const creditor = typeof pr.creditor === "string" ? JSON.parse(pr.creditor) : pr.creditor || {};
374
+ return {
375
+ paymentRequestId: pr.id,
376
+ payment: {
377
+ id: pr.id,
378
+ correlationId: pr.correlationId,
379
+ status: pr.status,
380
+ amount: pr.amount,
381
+ currency: pr.currency,
382
+ creditor,
383
+ createdAt: pr.createdAt,
384
+ updatedAt: pr.updatedAt
385
+ }
386
+ };
387
+ });
423
388
  };
424
389
 
425
390
  const getPaymentRequestByIdQuery = async (db, { paymentRequestId }) => {
426
- const result = await db.select().from(ott_zod.tables.paymentRequest).where(
391
+ const result = await db.select().from(bank.tables.paymentRequest).where(
427
392
  drizzleOrm.and(
428
- drizzleOrm.eq(ott_zod.tables.paymentRequest.id, paymentRequestId),
429
- drizzleOrm.isNull(ott_zod.tables.paymentRequest.deletedAt)
393
+ drizzleOrm.eq(bank.tables.paymentRequest.id, paymentRequestId),
394
+ drizzleOrm.isNull(bank.tables.paymentRequest.deletedAt)
430
395
  )
431
396
  ).limit(1);
432
397
  return backendSdk.first(result);
@@ -436,30 +401,30 @@ const getPaymentRequestsQuery = async (db, params) => {
436
401
  const limit = params.limit;
437
402
  const offset = (params.page - 1) * params.limit;
438
403
  const orderDir = params.sort.direction === "asc" ? drizzleOrm.asc : drizzleOrm.desc;
439
- const orderCol = params.sort.column === "amount" ? ott_zod.tables.paymentRequest.amount : params.sort.column === "updatedAt" ? ott_zod.tables.paymentRequest.updatedAt : ott_zod.tables.paymentRequest.createdAt;
404
+ const orderCol = params.sort.column === "amount" ? bank.tables.paymentRequest.amount : params.sort.column === "updatedAt" ? bank.tables.paymentRequest.updatedAt : bank.tables.paymentRequest.createdAt;
440
405
  const where = drizzleOrm.and(
441
- drizzleOrm.isNull(ott_zod.tables.paymentRequest.deletedAt),
442
- params.filterAccountId ? Array.isArray(params.filterAccountId) ? drizzleOrm.inArray(ott_zod.tables.paymentRequest.accountId, params.filterAccountId) : drizzleOrm.eq(ott_zod.tables.paymentRequest.accountId, params.filterAccountId) : void 0,
443
- params.filterStatus ? Array.isArray(params.filterStatus) ? drizzleOrm.inArray(ott_zod.tables.paymentRequest.status, params.filterStatus) : drizzleOrm.eq(ott_zod.tables.paymentRequest.status, params.filterStatus) : void 0,
444
- params.filterPaymentType ? Array.isArray(params.filterPaymentType) ? drizzleOrm.inArray(ott_zod.tables.paymentRequest.paymentType, params.filterPaymentType) : drizzleOrm.eq(ott_zod.tables.paymentRequest.paymentType, params.filterPaymentType) : void 0,
445
- params.filterCurrency ? Array.isArray(params.filterCurrency) ? drizzleOrm.inArray(ott_zod.tables.paymentRequest.currency, params.filterCurrency) : drizzleOrm.eq(ott_zod.tables.paymentRequest.currency, params.filterCurrency) : void 0,
446
- params.filterBatchId ? drizzleOrm.eq(ott_zod.tables.paymentRequest.batchId, params.filterBatchId) : void 0,
447
- params.filterDateFrom ? drizzleOrm.gte(ott_zod.tables.paymentRequest.createdAt, params.filterDateFrom) : void 0,
448
- params.filterDateTo ? drizzleOrm.lte(ott_zod.tables.paymentRequest.createdAt, params.filterDateTo) : void 0,
449
- params.filterMinAmount !== void 0 ? drizzleOrm.gte(ott_zod.tables.paymentRequest.amount, params.filterMinAmount) : void 0,
450
- params.filterMaxAmount !== void 0 ? drizzleOrm.lte(ott_zod.tables.paymentRequest.amount, params.filterMaxAmount) : void 0,
451
- params.filterVariableSymbol ? drizzleOrm.eq(ott_zod.tables.paymentRequest.vs, params.filterVariableSymbol) : void 0,
452
- params.filterSpecificSymbol ? drizzleOrm.eq(ott_zod.tables.paymentRequest.ss, params.filterSpecificSymbol) : void 0,
453
- params.filterConstantSymbol ? drizzleOrm.eq(ott_zod.tables.paymentRequest.ks, params.filterConstantSymbol) : void 0,
454
- params.filterMessage ? drizzleOrm.like(ott_zod.tables.paymentRequest.message, `%${params.filterMessage}%`) : void 0,
455
- params.filterBankRefId ? drizzleOrm.eq(ott_zod.tables.paymentRequest.bankRefId, params.filterBankRefId) : void 0,
456
- params.filterCreditorIban ? drizzleOrm.eq(ott_zod.tables.paymentRequest.creditorIban, params.filterCreditorIban) : void 0,
457
- params.filterDebtorIban ? drizzleOrm.eq(ott_zod.tables.paymentRequest.debtorIban, params.filterDebtorIban) : void 0,
458
- params.ids?.length ? drizzleOrm.inArray(ott_zod.tables.paymentRequest.id, params.ids) : void 0
406
+ drizzleOrm.isNull(bank.tables.paymentRequest.deletedAt),
407
+ params.filterAccountId ? Array.isArray(params.filterAccountId) ? drizzleOrm.inArray(bank.tables.paymentRequest.accountId, params.filterAccountId) : drizzleOrm.eq(bank.tables.paymentRequest.accountId, params.filterAccountId) : void 0,
408
+ params.filterStatus ? Array.isArray(params.filterStatus) ? drizzleOrm.inArray(bank.tables.paymentRequest.status, params.filterStatus) : drizzleOrm.eq(bank.tables.paymentRequest.status, params.filterStatus) : void 0,
409
+ params.filterPaymentType ? Array.isArray(params.filterPaymentType) ? drizzleOrm.inArray(bank.tables.paymentRequest.paymentType, params.filterPaymentType) : drizzleOrm.eq(bank.tables.paymentRequest.paymentType, params.filterPaymentType) : void 0,
410
+ params.filterCurrency ? Array.isArray(params.filterCurrency) ? drizzleOrm.inArray(bank.tables.paymentRequest.currency, params.filterCurrency) : drizzleOrm.eq(bank.tables.paymentRequest.currency, params.filterCurrency) : void 0,
411
+ params.filterBatchId ? drizzleOrm.eq(bank.tables.paymentRequest.batchId, params.filterBatchId) : void 0,
412
+ params.filterDateFrom ? drizzleOrm.gte(bank.tables.paymentRequest.createdAt, params.filterDateFrom) : void 0,
413
+ params.filterDateTo ? drizzleOrm.lte(bank.tables.paymentRequest.createdAt, params.filterDateTo) : void 0,
414
+ params.filterMinAmount !== void 0 ? drizzleOrm.gte(bank.tables.paymentRequest.amount, params.filterMinAmount) : void 0,
415
+ params.filterMaxAmount !== void 0 ? drizzleOrm.lte(bank.tables.paymentRequest.amount, params.filterMaxAmount) : void 0,
416
+ params.filterVariableSymbol ? drizzleOrm.eq(bank.tables.paymentRequest.vs, params.filterVariableSymbol) : void 0,
417
+ params.filterSpecificSymbol ? drizzleOrm.eq(bank.tables.paymentRequest.ss, params.filterSpecificSymbol) : void 0,
418
+ params.filterConstantSymbol ? drizzleOrm.eq(bank.tables.paymentRequest.ks, params.filterConstantSymbol) : void 0,
419
+ params.filterMessage ? drizzleOrm.like(bank.tables.paymentRequest.message, `%${params.filterMessage}%`) : void 0,
420
+ params.filterBankRefId ? drizzleOrm.eq(bank.tables.paymentRequest.bankRefId, params.filterBankRefId) : void 0,
421
+ params.filterCreditorIban ? drizzleOrm.eq(bank.tables.paymentRequest.creditorIban, params.filterCreditorIban) : void 0,
422
+ params.filterDebtorIban ? drizzleOrm.eq(bank.tables.paymentRequest.debtorIban, params.filterDebtorIban) : void 0,
423
+ params.ids?.length ? drizzleOrm.inArray(bank.tables.paymentRequest.id, params.ids) : void 0
459
424
  );
460
425
  const [paymentRequests, [{ value: totalCount }]] = await Promise.all([
461
- db.select().from(ott_zod.tables.paymentRequest).where(where).orderBy(orderDir(orderCol)).limit(limit).offset(offset),
462
- db.select({ value: drizzleOrm.count() }).from(ott_zod.tables.paymentRequest).where(where)
426
+ db.select().from(bank.tables.paymentRequest).where(where).orderBy(orderDir(orderCol)).limit(limit).offset(offset),
427
+ db.select({ value: drizzleOrm.count() }).from(bank.tables.paymentRequest).where(where)
463
428
  ]);
464
429
  return { paymentRequests, totalCount };
465
430
  };
@@ -486,6 +451,79 @@ function buildPaymentRequestEvent(pr) {
486
451
  };
487
452
  }
488
453
 
454
+ const sendPaymentInputSchema = zod.z.object({
455
+ correlationId: zod.z.string().min(1),
456
+ refId: zod.z.string().optional(),
457
+ amount: zod.z.number().positive(),
458
+ paymentType: zod.z.enum(database_schema.PAYMENT_TYPES),
459
+ chargeBearer: zod.z.enum(database_schema.CHARGE_BEARERS).optional(),
460
+ instructionPriority: zod.z.enum(database_schema.INSTRUCTION_PRIORITIES).optional(),
461
+ currency: zod.z.enum(generalCodes.CURRENCY_CODES),
462
+ vs: zod.z.string().optional(),
463
+ ss: zod.z.string().optional(),
464
+ ks: zod.z.string().optional(),
465
+ message: zod.z.string().optional(),
466
+ creditor: backendSdk.bankAccountMetadataSchema,
467
+ debtor: backendSdk.bankAccountMetadataSchema,
468
+ sendAsSinglePayment: zod.z.boolean().optional()
469
+ }).superRefine((data, ctx) => {
470
+ if (data.paymentType === "UNKNOWN") {
471
+ ctx.addIssue({
472
+ code: "custom",
473
+ message: "paymentType=UNKNOWN is not supported. Use DOMESTIC, SEPA, or SWIFT.",
474
+ path: ["paymentType"]
475
+ });
476
+ return;
477
+ }
478
+ if (!data.debtor.iban) {
479
+ ctx.addIssue({
480
+ code: "custom",
481
+ message: "debtor.iban is required",
482
+ path: ["debtor", "iban"]
483
+ });
484
+ }
485
+ if (data.paymentType === "DOMESTIC" || data.paymentType === "SEPA") {
486
+ const hasIban = !!data.creditor.iban;
487
+ const hasAccountNumber = !!data.creditor.number && !!data.creditor.bankCode;
488
+ if (!hasIban && !hasAccountNumber) {
489
+ ctx.addIssue({
490
+ code: "custom",
491
+ message: `creditor must have either iban OR (number + bankCode) for ${data.paymentType} payments`,
492
+ path: ["creditor"]
493
+ });
494
+ }
495
+ return;
496
+ }
497
+ if (data.paymentType === "SWIFT") {
498
+ const hasIban = !!data.creditor.iban;
499
+ const hasBban = !!data.creditor.number && !!(data.creditor.swiftBic ?? data.creditor.bicCor);
500
+ if (!hasIban && !hasBban) {
501
+ ctx.addIssue({
502
+ code: "custom",
503
+ message: "SWIFT creditor requires either iban OR (number + swiftBic/bicCor)",
504
+ path: ["creditor"]
505
+ });
506
+ }
507
+ }
508
+ });
509
+
510
+ const sendBatchInputSchema = zod.z.object({
511
+ payments: zod.z.array(sendPaymentInputSchema).min(1)
512
+ });
513
+
514
+ const getAuthUriInputSchema = zod.z.object({
515
+ connectorKey: zod.z.enum(database_schema.CONNECTOR_KEYS)
516
+ });
517
+
518
+ const authorizeAccountInputSchema = zod.z.object({
519
+ ott: zod.z.string(),
520
+ urlParams: zod.z.string(),
521
+ syncIntervalS: zod.z.number().int().positive().optional(),
522
+ startSync: zod.z.boolean().optional(),
523
+ lastSyncAt: zod.z.date().optional(),
524
+ address: backendSdk.structuredAddressSchema.optional()
525
+ });
526
+
489
527
  const simulateDepositInputSchema = zod.z.object({
490
528
  amount: zod.z.number(),
491
529
  currency: zod.z.enum(generalCodes.CURRENCY_CODES),
@@ -585,6 +623,10 @@ const getPaymentsInputSchema = zod.z.object({
585
623
  [ALLOWED_PAYMENT_FILTERS.BANK_REF_ID]: zod.z.string().optional()
586
624
  });
587
625
 
626
+ const getPaymentsByRequestIdsInputSchema = zod.z.object({
627
+ paymentRequestIds: zod.z.array(zod.z.string().uuid()).min(1, "At least one payment request ID is required").max(100, "Maximum 100 payment request IDs per request")
628
+ });
629
+
588
630
  const syncAccountInputSchema = zod.z.object({
589
631
  accountId: zod.z.uuid()
590
632
  });
@@ -617,7 +659,7 @@ zod.z.object({
617
659
  });
618
660
 
619
661
  const updateAccountInputSchema = zod.z.object({
620
- account: ott_zod.accountInsertSchema
662
+ account: bank.accountInsertSchema
621
663
  });
622
664
 
623
665
  const getBankAccountsInputSchema = zod.z.object({
@@ -693,7 +735,7 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
693
735
  // 14 days
694
736
  this.COMPLETED_POLLING_WINDOW_MS = 7 * 24 * 60 * 60 * 1e3;
695
737
  this.allowedProviders = config.allowedProviders;
696
- this.db = d1.drizzle(this.env.BANK_D1, { schema: ott_zod.tables, relations: ott_zod.relations });
738
+ this.db = d1.drizzle(this.env.BANK_D1, { schema: bank.tables, relations: bank.relations });
697
739
  }
698
740
  async _getAccounts(filters) {
699
741
  return await getAllAccountsQuery(this.db, filters);
@@ -729,7 +771,7 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
729
771
  }));
730
772
  resolveCredentials = await credentialsResolver.createCredentialsResolver(this.db, this.env);
731
773
  }
732
- return ott_zod.initiateConnector({
774
+ return bank.initiateConnector({
733
775
  bank: connectorKey,
734
776
  connectedAccounts,
735
777
  resolveCredentials,
@@ -766,6 +808,18 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
766
808
  }
767
809
  );
768
810
  }
811
+ async getPaymentsByRequestIds(input) {
812
+ return this.handleAction(
813
+ { data: input, schema: getPaymentsByRequestIdsInputSchema },
814
+ { successMessage: "Payments retrieved successfully" },
815
+ async (validated) => {
816
+ const payments = await getPaymentsByPaymentRequestIdsQuery(this.db, {
817
+ paymentRequestIds: validated.paymentRequestIds
818
+ });
819
+ return { payments };
820
+ }
821
+ );
822
+ }
769
823
  async syncAccount(input) {
770
824
  return this.handleAction(
771
825
  { data: input, schema: syncAccountInputSchema },
@@ -892,7 +946,7 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
892
946
  await credentialsResolver.updatePaymentRequestStatusCommand(this.db, {
893
947
  id: pr.id,
894
948
  status: newStatus,
895
- processedAt: ott_zod.isProcessedStatus(newStatus) ? /* @__PURE__ */ new Date() : void 0
949
+ processedAt: bank.isProcessedStatus(newStatus) ? /* @__PURE__ */ new Date() : void 0
896
950
  }).command.execute();
897
951
  statusChanged++;
898
952
  eventsToEmit.push(
@@ -978,7 +1032,7 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
978
1032
  if (allPRs.length === 0) return;
979
1033
  const connectorKey = allPRs[0]?.connectorKey;
980
1034
  const allTerminal = allPRs.every(
981
- (pr) => ott_zod.isTerminalStatus(pr.status, connectorKey)
1035
+ (pr) => bank.isTerminalStatus(pr.status, connectorKey)
982
1036
  );
983
1037
  const allAuthorizedOrHigher = allPRs.every((pr) => pr.status !== "OPENED");
984
1038
  if (allTerminal) {
@@ -1003,7 +1057,7 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
1003
1057
  console.log("[updatePaymentRequestStatuses] Starting", {
1004
1058
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
1005
1059
  });
1006
- const nonTerminalPRs = await ott_zod.getNonTerminalPaymentRequestsQuery(this.db);
1060
+ const nonTerminalPRs = await bank.getNonTerminalPaymentRequestsQuery(this.db);
1007
1061
  if (nonTerminalPRs.length === 0) {
1008
1062
  console.log(
1009
1063
  "[updatePaymentRequestStatuses] No non-terminal PRs found",
@@ -1026,7 +1080,7 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
1026
1080
  const pollableIds = [];
1027
1081
  for (const pr of nonTerminalPRs) {
1028
1082
  const status = pr.status;
1029
- if (ott_zod.isTerminalStatus(status, pr.connectorKey)) {
1083
+ if (bank.isTerminalStatus(status, pr.connectorKey)) {
1030
1084
  continue;
1031
1085
  }
1032
1086
  if (status === "OPENED" || status === "AUTHORIZED") {
@@ -1081,9 +1135,9 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
1081
1135
  }
1082
1136
  async heartbeatSyncWorkflows() {
1083
1137
  const accounts = await this.db.select({
1084
- id: ott_zod.tables.account.id,
1085
- lastSyncMetadata: ott_zod.tables.account.lastSyncMetadata
1086
- }).from(ott_zod.tables.account).where(drizzleOrm.eq(ott_zod.tables.account.status, "AUTHORIZED")).all();
1138
+ id: bank.tables.account.id,
1139
+ lastSyncMetadata: bank.tables.account.lastSyncMetadata
1140
+ }).from(bank.tables.account).where(drizzleOrm.eq(bank.tables.account.status, "AUTHORIZED")).all();
1087
1141
  const resetAfterIterations = Number(
1088
1142
  this.env.SYNC_WORKFLOW_RESET_AFTER_ITERATIONS
1089
1143
  );
@@ -1441,12 +1495,21 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
1441
1495
  { data: input, schema: sendPaymentInputSchema },
1442
1496
  { successMessage: "Payment initiated successfully" },
1443
1497
  async (data) => {
1444
- const incomingPayment = ott_zod.toIncomingPayment(data);
1498
+ const incomingPayment = bank.toIncomingPayment(data);
1445
1499
  this._validatePaymentTypeAndCurrency(
1446
1500
  data.paymentType,
1447
1501
  data.currency,
1448
1502
  data.creditor
1449
1503
  );
1504
+ if (data.creditor.bankCode?.length === 4 && !data.creditor.iban && data.creditor.number) {
1505
+ try {
1506
+ data.creditor.iban = bank.calculateCzechIban(
1507
+ data.creditor.number,
1508
+ data.creditor.bankCode
1509
+ );
1510
+ } catch (_error) {
1511
+ }
1512
+ }
1450
1513
  const { accounts } = await this._getAccounts({
1451
1514
  filterIbans: [incomingPayment.debtorIban]
1452
1515
  });
@@ -1482,11 +1545,11 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
1482
1545
  status: 422
1483
1546
  });
1484
1547
  }
1485
- const accountAssigned = ott_zod.assignAccount(incomingPayment, account);
1486
- const batchedPayment = ott_zod.toBatchedPayment(accountAssigned);
1548
+ const accountAssigned = bank.assignAccount(incomingPayment, account);
1549
+ const batchedPayment = bank.toBatchedPayment(accountAssigned);
1487
1550
  const { command: insertPaymentRequest } = createPaymentRequestCommand(
1488
1551
  this.db,
1489
- { paymentRequest: ott_zod.toPaymentRequestInsert(accountAssigned, null) }
1552
+ { paymentRequest: bank.toPaymentRequestInsert(accountAssigned, null) }
1490
1553
  );
1491
1554
  await insertPaymentRequest.execute();
1492
1555
  const initiate = () => {
@@ -1521,7 +1584,7 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
1521
1584
  bankRefId: initiated.payment.bankRefId,
1522
1585
  initiatedAt: initiated.payment.initiatedAt,
1523
1586
  authorizationUrl: initiated.authorizationUrl,
1524
- processedAt: ott_zod.isProcessedStatus(initiated.payment.status) ? /* @__PURE__ */ new Date() : void 0
1587
+ processedAt: bank.isProcessedStatus(initiated.payment.status) ? /* @__PURE__ */ new Date() : void 0
1525
1588
  }).command.execute();
1526
1589
  const paymentRequest = await getPaymentRequestByIdQuery(this.db, {
1527
1590
  paymentRequestId: incomingPayment.id
@@ -1627,9 +1690,9 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
1627
1690
  status: 422
1628
1691
  });
1629
1692
  }
1630
- const incomingPayments = paymentInputs.map(ott_zod.toIncomingPayment);
1693
+ const incomingPayments = paymentInputs.map(bank.toIncomingPayment);
1631
1694
  const batchedPayments = incomingPayments.map(
1632
- (p) => ott_zod.toBatchedPayment(ott_zod.assignAccount(p, account))
1695
+ (p) => bank.toBatchedPayment(bank.assignAccount(p, account))
1633
1696
  );
1634
1697
  const batchId = backendSdk.uuidv4();
1635
1698
  const batchMode = connector.supportsBatch(paymentType) ? "NATIVE" : "SINGLE";
@@ -1646,8 +1709,8 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
1646
1709
  }).command;
1647
1710
  const prCmds = incomingPayments.map(
1648
1711
  (p) => createPaymentRequestCommand(this.db, {
1649
- paymentRequest: ott_zod.toPaymentRequestInsert(
1650
- ott_zod.assignAccount(p, account),
1712
+ paymentRequest: bank.toPaymentRequestInsert(
1713
+ bank.assignAccount(p, account),
1651
1714
  batchId
1652
1715
  )
1653
1716
  }).command
@@ -1696,7 +1759,7 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
1696
1759
  bankRefId: pp.bankRefId,
1697
1760
  initiatedAt: pp.initiatedAt,
1698
1761
  authorizationUrl: isPerPaymentFallback ? authorizationUrls[i] : authorizationUrls[0],
1699
- processedAt: ott_zod.isProcessedStatus(pp.status) ? /* @__PURE__ */ new Date() : void 0
1762
+ processedAt: bank.isProcessedStatus(pp.status) ? /* @__PURE__ */ new Date() : void 0
1700
1763
  }).command
1701
1764
  );
1702
1765
  const updateBatchCmd = credentialsResolver.upsertBatchCommand(this.db, {
@@ -1785,11 +1848,11 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
1785
1848
  if (includePendingPaymentRequestCount) {
1786
1849
  const [row] = await this.db.select({
1787
1850
  count: drizzleOrm.sql`count(*)`
1788
- }).from(ott_zod.tables.paymentRequest).where(
1851
+ }).from(bank.tables.paymentRequest).where(
1789
1852
  drizzleOrm.and(
1790
- drizzleOrm.eq(ott_zod.tables.paymentRequest.accountId, a.id),
1791
- drizzleOrm.eq(ott_zod.tables.paymentRequest.status, "OPENED"),
1792
- drizzleOrm.isNull(ott_zod.tables.paymentRequest.deletedAt)
1853
+ drizzleOrm.eq(bank.tables.paymentRequest.accountId, a.id),
1854
+ drizzleOrm.eq(bank.tables.paymentRequest.status, "OPENED"),
1855
+ drizzleOrm.isNull(bank.tables.paymentRequest.deletedAt)
1793
1856
  )
1794
1857
  );
1795
1858
  result.pendingPaymentRequestCount = row?.count ?? 0;
@@ -1980,14 +2043,14 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
1980
2043
  const privateKeyPem = (await this.env.SECRETS_STORE.get({
1981
2044
  secretName: "BANK_SERVICE_FINBRICKS_PRIVATE_KEY_PEM"
1982
2045
  })).data?.secretValue || "";
1983
- const client = new ott_zod.FinbricksClient(
2046
+ const client = new bank.FinbricksClient(
1984
2047
  this.env.FINBRICKS_BASE_URI,
1985
2048
  this.env.FINBRICKS_MERCHANT_ID,
1986
2049
  privateKeyPem,
1987
2050
  this.env.REDIRECT_URI
1988
2051
  );
1989
2052
  return client.request({
1990
- endpoint: ott_zod.FINBRICKS_ENDPOINTS.BANK_INFO,
2053
+ endpoint: bank.FINBRICKS_ENDPOINTS.BANK_INFO,
1991
2054
  method: "GET",
1992
2055
  query: {
1993
2056
  merchantId: this.env.FINBRICKS_MERCHANT_ID
@@ -1998,6 +2061,9 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
1998
2061
  __decorateClass([
1999
2062
  backendSdk.action("get-payments")
2000
2063
  ], exports.BankServiceBase.prototype, "getPayments", 1);
2064
+ __decorateClass([
2065
+ backendSdk.action("get-payments-by-request-ids")
2066
+ ], exports.BankServiceBase.prototype, "getPaymentsByRequestIds", 1);
2001
2067
  __decorateClass([
2002
2068
  backendSdk.action("sync-account")
2003
2069
  ], exports.BankServiceBase.prototype, "syncAccount", 1);