@develit-services/bank 0.0.36 → 0.0.38

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.
@@ -1,4 +1,4 @@
1
- export { f as account, g as accountCredentials, c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.e_XSg9KV.cjs';
1
+ export { f as account, g as accountCredentials, c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.B1d_PE1-.cjs';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import 'zod';
@@ -1,4 +1,4 @@
1
- export { f as account, g as accountCredentials, c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.e_XSg9KV.mjs';
1
+ export { f as account, g as accountCredentials, c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.B1d_PE1-.mjs';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import 'zod';
@@ -1,4 +1,4 @@
1
- export { f as account, g as accountCredentials, c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.e_XSg9KV.js';
1
+ export { f as account, g as accountCredentials, c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.B1d_PE1-.js';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import 'zod';
@@ -233,14 +233,13 @@ const getCredentialsByAccountId = async (db, { accountId }) => {
233
233
  return cred;
234
234
  };
235
235
 
236
- const getOpenBatchByAccountIdQuery = async (db, { accountId }) => {
237
- const batch = await db.select().from(database_schema.tables.batch).where(
236
+ const getAccountOpenBatchesQuery = async (db, { accountId }) => {
237
+ return await db.select().from(database_schema.tables.batch).where(
238
238
  drizzleOrm.and(
239
239
  drizzleOrm.eq(database_schema.tables.batch.accountId, accountId),
240
240
  drizzleOrm.eq(database_schema.tables.batch.status, "OPEN")
241
241
  )
242
- ).limit(1).get();
243
- return batch;
242
+ );
244
243
  };
245
244
 
246
245
  const getOttQuery = async (db, { ott }) => {
@@ -637,35 +636,40 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
637
636
  }
638
637
  );
639
638
  }
639
+ batchLimit(connectorKey) {
640
+ return 50;
641
+ }
640
642
  async addPaymentsToBatch({
641
643
  paymentsToBatch
642
644
  }) {
643
645
  return this.handleAction(null, {}, async () => {
644
646
  this.logInput({ paymentsToBatch });
645
647
  const mappedPayments = paymentsToBatch.map(
646
- (payment) => ({
647
- id: backendSdk.uuidv4(),
648
- accountId: "",
649
- refId: payment.refId,
650
- connectorKey: "MOCK",
651
- amount: payment.amount,
652
- direction: "OUTGOING",
653
- paymentType: payment.paymentType,
654
- currency: payment.currency,
655
- status: "CREATED",
656
- initiatedAt: /* @__PURE__ */ new Date(),
657
- processedAt: null,
658
- vs: payment.vs || null,
659
- ss: payment.ss || null,
660
- ks: payment.ks || null,
661
- message: payment.message || null,
662
- creditorHolderName: payment.creditorHolderName,
663
- creditorAccountNumberWithBankCode: payment.creditorAccountNumberWithBankCode,
664
- creditorIban: payment.creditorIban,
665
- debtorHolderName: payment.debtorHolderName,
666
- debtorAccountNumberWithBankCode: payment.debtorAccountNumberWithBankCode,
667
- debtorIban: payment.debtorIban
668
- })
648
+ (payment) => {
649
+ return {
650
+ id: backendSdk.uuidv4(),
651
+ accountId: "",
652
+ refId: payment.refId,
653
+ connectorKey: "MOCK",
654
+ amount: payment.amount,
655
+ direction: "OUTGOING",
656
+ paymentType: payment.paymentType,
657
+ currency: payment.currency,
658
+ status: "CREATED",
659
+ initiatedAt: /* @__PURE__ */ new Date(),
660
+ processedAt: null,
661
+ vs: payment.vs || null,
662
+ ss: payment.ss || null,
663
+ ks: payment.ks || null,
664
+ message: payment.message || null,
665
+ creditorHolderName: payment.creditorHolderName,
666
+ creditorAccountNumberWithBankCode: payment.creditorAccountNumberWithBankCode,
667
+ creditorIban: payment.creditorIban,
668
+ debtorHolderName: payment.debtorHolderName,
669
+ debtorAccountNumberWithBankCode: payment.debtorAccountNumberWithBankCode,
670
+ debtorIban: payment.debtorIban
671
+ };
672
+ }
669
673
  );
670
674
  const { supportedPayments, unsupportedPayments } = seperateSupportedPayments(
671
675
  mappedPayments,
@@ -696,7 +700,7 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
696
700
  }))
697
701
  );
698
702
  }
699
- for (const acc of this.bankConnector.connectedAccounts) {
703
+ for (const acc of await this.getAccounts()) {
700
704
  const newPayments = supportedPayments.filter(
701
705
  (payment) => payment.debtorIban === acc.iban && payment.currency === acc.currency
702
706
  ).map((payment) => ({
@@ -710,22 +714,19 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
710
714
  this.log({
711
715
  message: `\u{1F4B0} Processing ${newPayments.length} payments for account (${acc.iban}, ${acc.currency})`
712
716
  });
713
- const existingBatch = await getOpenBatchByAccountIdQuery(this.db, {
717
+ const openBatches = await getAccountOpenBatchesQuery(this.db, {
714
718
  accountId: acc.id
715
719
  });
716
- if (existingBatch) {
717
- this.log({
718
- message: `\u{1F504} Found existing OPEN batch for account ${acc.id}, merging ${existingBatch.payments.length} existing + ${newPayments.length} new payments`
719
- });
720
- } else {
721
- this.log({
722
- message: `\u2728 Creating new batch for account ${acc.id} with ${newPayments.length} payments`
723
- });
724
- }
720
+ const availableBatch = openBatches.find(
721
+ (batch) => batch.payments.length >= this.batchLimit(acc.connectorKey)
722
+ );
723
+ this.log({
724
+ message: availableBatch ? `\u{1F504} Found existing OPEN batches for account ${acc.id}, merging ${availableBatch.payments.length} existing + ${newPayments.length} new payments` : `\u2728 Creating new batch for account ${acc.id} with ${newPayments.length} payments`
725
+ });
725
726
  const { command } = upsertBatchCommand(this.db, {
726
- batch: existingBatch ? {
727
- ...existingBatch,
728
- payments: [...existingBatch.payments, ...newPayments]
727
+ batch: availableBatch ? {
728
+ ...availableBatch,
729
+ payments: [...availableBatch.payments, ...newPayments]
729
730
  } : {
730
731
  id: backendSdk.uuidv4(),
731
732
  authorizationUrls: [],
@@ -2,8 +2,8 @@ import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
2
2
  import { IRPCResponse } from '@develit-io/backend-sdk';
3
3
  import { WorkerEntrypoint } from 'cloudflare:workers';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
- import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.e_XSg9KV.cjs';
6
- import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey } from '../shared/bank.CELgdPJI.cjs';
5
+ import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.B1d_PE1-.cjs';
6
+ import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey } from '../shared/bank.DkPy9YWm.cjs';
7
7
  import { z } from 'zod';
8
8
  import 'drizzle-orm/sqlite-core';
9
9
  import 'drizzle-orm';
@@ -236,21 +236,21 @@ declare const getBatchesInputSchema: z.ZodObject<{
236
236
  }, z.core.$strip>;
237
237
  filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
238
238
  filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
239
+ PREPARED: "PREPARED";
240
+ FAILED: "FAILED";
241
+ COMPLETED: "COMPLETED";
239
242
  OPEN: "OPEN";
240
243
  PROCESSING: "PROCESSING";
241
244
  READY_TO_SIGN: "READY_TO_SIGN";
242
245
  WAITING_FOR_PROCESSING: "WAITING_FOR_PROCESSING";
246
+ }>, z.ZodArray<z.ZodEnum<{
243
247
  PREPARED: "PREPARED";
244
- COMPLETED: "COMPLETED";
245
248
  FAILED: "FAILED";
246
- }>, z.ZodArray<z.ZodEnum<{
249
+ COMPLETED: "COMPLETED";
247
250
  OPEN: "OPEN";
248
251
  PROCESSING: "PROCESSING";
249
252
  READY_TO_SIGN: "READY_TO_SIGN";
250
253
  WAITING_FOR_PROCESSING: "WAITING_FOR_PROCESSING";
251
- PREPARED: "PREPARED";
252
- COMPLETED: "COMPLETED";
253
- FAILED: "FAILED";
254
254
  }>>]>>;
255
255
  }, z.core.$strip>;
256
256
  type GetBatchesInput = z.input<typeof getBatchesInputSchema>;
@@ -410,17 +410,17 @@ declare const getPaymentsInputSchema: z.ZodObject<{
410
410
  filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
411
411
  filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
412
412
  PREPARED: "PREPARED";
413
- COMPLETED: "COMPLETED";
414
- FAILED: "FAILED";
415
413
  INITIALIZED: "INITIALIZED";
414
+ FAILED: "FAILED";
416
415
  PENDING: "PENDING";
416
+ COMPLETED: "COMPLETED";
417
417
  CREATED: "CREATED";
418
418
  }>, z.ZodArray<z.ZodEnum<{
419
419
  PREPARED: "PREPARED";
420
- COMPLETED: "COMPLETED";
421
- FAILED: "FAILED";
422
420
  INITIALIZED: "INITIALIZED";
421
+ FAILED: "FAILED";
423
422
  PENDING: "PENDING";
423
+ COMPLETED: "COMPLETED";
424
424
  CREATED: "CREATED";
425
425
  }>>]>>;
426
426
  }, z.core.$strip>;
@@ -475,10 +475,11 @@ declare class BankServiceBase extends BankServiceBase_base {
475
475
  scheduled(controller: ScheduledController): Promise<void>;
476
476
  updateBatchStatuses(): Promise<void>;
477
477
  initiateBankConnector(input: initiateConnectorInput): Promise<initiateConnectorOutput>;
478
+ batchLimit(connectorKey: ConnectorKey): number;
478
479
  addPaymentsToBatch({ paymentsToBatch, }: {
479
480
  paymentsToBatch: SendPaymentInput[];
480
481
  }): Promise<IRPCResponse<{
481
- status: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | "PREPARED" | "COMPLETED" | "FAILED" | null;
482
+ status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | null;
482
483
  id: string;
483
484
  createdAt: Date | null;
484
485
  updatedAt: Date | null;
@@ -2,8 +2,8 @@ import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
2
2
  import { IRPCResponse } from '@develit-io/backend-sdk';
3
3
  import { WorkerEntrypoint } from 'cloudflare:workers';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
- import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.e_XSg9KV.mjs';
6
- import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey } from '../shared/bank.BmcSkaZh.mjs';
5
+ import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.B1d_PE1-.mjs';
6
+ import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey } from '../shared/bank.DyYQf_QJ.mjs';
7
7
  import { z } from 'zod';
8
8
  import 'drizzle-orm/sqlite-core';
9
9
  import 'drizzle-orm';
@@ -236,21 +236,21 @@ declare const getBatchesInputSchema: z.ZodObject<{
236
236
  }, z.core.$strip>;
237
237
  filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
238
238
  filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
239
+ PREPARED: "PREPARED";
240
+ FAILED: "FAILED";
241
+ COMPLETED: "COMPLETED";
239
242
  OPEN: "OPEN";
240
243
  PROCESSING: "PROCESSING";
241
244
  READY_TO_SIGN: "READY_TO_SIGN";
242
245
  WAITING_FOR_PROCESSING: "WAITING_FOR_PROCESSING";
246
+ }>, z.ZodArray<z.ZodEnum<{
243
247
  PREPARED: "PREPARED";
244
- COMPLETED: "COMPLETED";
245
248
  FAILED: "FAILED";
246
- }>, z.ZodArray<z.ZodEnum<{
249
+ COMPLETED: "COMPLETED";
247
250
  OPEN: "OPEN";
248
251
  PROCESSING: "PROCESSING";
249
252
  READY_TO_SIGN: "READY_TO_SIGN";
250
253
  WAITING_FOR_PROCESSING: "WAITING_FOR_PROCESSING";
251
- PREPARED: "PREPARED";
252
- COMPLETED: "COMPLETED";
253
- FAILED: "FAILED";
254
254
  }>>]>>;
255
255
  }, z.core.$strip>;
256
256
  type GetBatchesInput = z.input<typeof getBatchesInputSchema>;
@@ -410,17 +410,17 @@ declare const getPaymentsInputSchema: z.ZodObject<{
410
410
  filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
411
411
  filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
412
412
  PREPARED: "PREPARED";
413
- COMPLETED: "COMPLETED";
414
- FAILED: "FAILED";
415
413
  INITIALIZED: "INITIALIZED";
414
+ FAILED: "FAILED";
416
415
  PENDING: "PENDING";
416
+ COMPLETED: "COMPLETED";
417
417
  CREATED: "CREATED";
418
418
  }>, z.ZodArray<z.ZodEnum<{
419
419
  PREPARED: "PREPARED";
420
- COMPLETED: "COMPLETED";
421
- FAILED: "FAILED";
422
420
  INITIALIZED: "INITIALIZED";
421
+ FAILED: "FAILED";
423
422
  PENDING: "PENDING";
423
+ COMPLETED: "COMPLETED";
424
424
  CREATED: "CREATED";
425
425
  }>>]>>;
426
426
  }, z.core.$strip>;
@@ -475,10 +475,11 @@ declare class BankServiceBase extends BankServiceBase_base {
475
475
  scheduled(controller: ScheduledController): Promise<void>;
476
476
  updateBatchStatuses(): Promise<void>;
477
477
  initiateBankConnector(input: initiateConnectorInput): Promise<initiateConnectorOutput>;
478
+ batchLimit(connectorKey: ConnectorKey): number;
478
479
  addPaymentsToBatch({ paymentsToBatch, }: {
479
480
  paymentsToBatch: SendPaymentInput[];
480
481
  }): Promise<IRPCResponse<{
481
- status: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | "PREPARED" | "COMPLETED" | "FAILED" | null;
482
+ status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | null;
482
483
  id: string;
483
484
  createdAt: Date | null;
484
485
  updatedAt: Date | null;
@@ -2,8 +2,8 @@ import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
2
2
  import { IRPCResponse } from '@develit-io/backend-sdk';
3
3
  import { WorkerEntrypoint } from 'cloudflare:workers';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
- import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.e_XSg9KV.js';
6
- import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey } from '../shared/bank.C_BFyEi4.js';
5
+ import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.B1d_PE1-.js';
6
+ import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey } from '../shared/bank.CgnrZfJy.js';
7
7
  import { z } from 'zod';
8
8
  import 'drizzle-orm/sqlite-core';
9
9
  import 'drizzle-orm';
@@ -236,21 +236,21 @@ declare const getBatchesInputSchema: z.ZodObject<{
236
236
  }, z.core.$strip>;
237
237
  filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
238
238
  filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
239
+ PREPARED: "PREPARED";
240
+ FAILED: "FAILED";
241
+ COMPLETED: "COMPLETED";
239
242
  OPEN: "OPEN";
240
243
  PROCESSING: "PROCESSING";
241
244
  READY_TO_SIGN: "READY_TO_SIGN";
242
245
  WAITING_FOR_PROCESSING: "WAITING_FOR_PROCESSING";
246
+ }>, z.ZodArray<z.ZodEnum<{
243
247
  PREPARED: "PREPARED";
244
- COMPLETED: "COMPLETED";
245
248
  FAILED: "FAILED";
246
- }>, z.ZodArray<z.ZodEnum<{
249
+ COMPLETED: "COMPLETED";
247
250
  OPEN: "OPEN";
248
251
  PROCESSING: "PROCESSING";
249
252
  READY_TO_SIGN: "READY_TO_SIGN";
250
253
  WAITING_FOR_PROCESSING: "WAITING_FOR_PROCESSING";
251
- PREPARED: "PREPARED";
252
- COMPLETED: "COMPLETED";
253
- FAILED: "FAILED";
254
254
  }>>]>>;
255
255
  }, z.core.$strip>;
256
256
  type GetBatchesInput = z.input<typeof getBatchesInputSchema>;
@@ -410,17 +410,17 @@ declare const getPaymentsInputSchema: z.ZodObject<{
410
410
  filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
411
411
  filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
412
412
  PREPARED: "PREPARED";
413
- COMPLETED: "COMPLETED";
414
- FAILED: "FAILED";
415
413
  INITIALIZED: "INITIALIZED";
414
+ FAILED: "FAILED";
416
415
  PENDING: "PENDING";
416
+ COMPLETED: "COMPLETED";
417
417
  CREATED: "CREATED";
418
418
  }>, z.ZodArray<z.ZodEnum<{
419
419
  PREPARED: "PREPARED";
420
- COMPLETED: "COMPLETED";
421
- FAILED: "FAILED";
422
420
  INITIALIZED: "INITIALIZED";
421
+ FAILED: "FAILED";
423
422
  PENDING: "PENDING";
423
+ COMPLETED: "COMPLETED";
424
424
  CREATED: "CREATED";
425
425
  }>>]>>;
426
426
  }, z.core.$strip>;
@@ -475,10 +475,11 @@ declare class BankServiceBase extends BankServiceBase_base {
475
475
  scheduled(controller: ScheduledController): Promise<void>;
476
476
  updateBatchStatuses(): Promise<void>;
477
477
  initiateBankConnector(input: initiateConnectorInput): Promise<initiateConnectorOutput>;
478
+ batchLimit(connectorKey: ConnectorKey): number;
478
479
  addPaymentsToBatch({ paymentsToBatch, }: {
479
480
  paymentsToBatch: SendPaymentInput[];
480
481
  }): Promise<IRPCResponse<{
481
- status: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | "PREPARED" | "COMPLETED" | "FAILED" | null;
482
+ status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | null;
482
483
  id: string;
483
484
  createdAt: Date | null;
484
485
  updatedAt: Date | null;
@@ -229,14 +229,13 @@ const getCredentialsByAccountId = async (db, { accountId }) => {
229
229
  return cred;
230
230
  };
231
231
 
232
- const getOpenBatchByAccountIdQuery = async (db, { accountId }) => {
233
- const batch = await db.select().from(tables.batch).where(
232
+ const getAccountOpenBatchesQuery = async (db, { accountId }) => {
233
+ return await db.select().from(tables.batch).where(
234
234
  and(
235
235
  eq(tables.batch.accountId, accountId),
236
236
  eq(tables.batch.status, "OPEN")
237
237
  )
238
- ).limit(1).get();
239
- return batch;
238
+ );
240
239
  };
241
240
 
242
241
  const getOttQuery = async (db, { ott }) => {
@@ -633,35 +632,40 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
633
632
  }
634
633
  );
635
634
  }
635
+ batchLimit(connectorKey) {
636
+ return 50;
637
+ }
636
638
  async addPaymentsToBatch({
637
639
  paymentsToBatch
638
640
  }) {
639
641
  return this.handleAction(null, {}, async () => {
640
642
  this.logInput({ paymentsToBatch });
641
643
  const mappedPayments = paymentsToBatch.map(
642
- (payment) => ({
643
- id: uuidv4(),
644
- accountId: "",
645
- refId: payment.refId,
646
- connectorKey: "MOCK",
647
- amount: payment.amount,
648
- direction: "OUTGOING",
649
- paymentType: payment.paymentType,
650
- currency: payment.currency,
651
- status: "CREATED",
652
- initiatedAt: /* @__PURE__ */ new Date(),
653
- processedAt: null,
654
- vs: payment.vs || null,
655
- ss: payment.ss || null,
656
- ks: payment.ks || null,
657
- message: payment.message || null,
658
- creditorHolderName: payment.creditorHolderName,
659
- creditorAccountNumberWithBankCode: payment.creditorAccountNumberWithBankCode,
660
- creditorIban: payment.creditorIban,
661
- debtorHolderName: payment.debtorHolderName,
662
- debtorAccountNumberWithBankCode: payment.debtorAccountNumberWithBankCode,
663
- debtorIban: payment.debtorIban
664
- })
644
+ (payment) => {
645
+ return {
646
+ id: uuidv4(),
647
+ accountId: "",
648
+ refId: payment.refId,
649
+ connectorKey: "MOCK",
650
+ amount: payment.amount,
651
+ direction: "OUTGOING",
652
+ paymentType: payment.paymentType,
653
+ currency: payment.currency,
654
+ status: "CREATED",
655
+ initiatedAt: /* @__PURE__ */ new Date(),
656
+ processedAt: null,
657
+ vs: payment.vs || null,
658
+ ss: payment.ss || null,
659
+ ks: payment.ks || null,
660
+ message: payment.message || null,
661
+ creditorHolderName: payment.creditorHolderName,
662
+ creditorAccountNumberWithBankCode: payment.creditorAccountNumberWithBankCode,
663
+ creditorIban: payment.creditorIban,
664
+ debtorHolderName: payment.debtorHolderName,
665
+ debtorAccountNumberWithBankCode: payment.debtorAccountNumberWithBankCode,
666
+ debtorIban: payment.debtorIban
667
+ };
668
+ }
665
669
  );
666
670
  const { supportedPayments, unsupportedPayments } = seperateSupportedPayments(
667
671
  mappedPayments,
@@ -692,7 +696,7 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
692
696
  }))
693
697
  );
694
698
  }
695
- for (const acc of this.bankConnector.connectedAccounts) {
699
+ for (const acc of await this.getAccounts()) {
696
700
  const newPayments = supportedPayments.filter(
697
701
  (payment) => payment.debtorIban === acc.iban && payment.currency === acc.currency
698
702
  ).map((payment) => ({
@@ -706,22 +710,19 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
706
710
  this.log({
707
711
  message: `\u{1F4B0} Processing ${newPayments.length} payments for account (${acc.iban}, ${acc.currency})`
708
712
  });
709
- const existingBatch = await getOpenBatchByAccountIdQuery(this.db, {
713
+ const openBatches = await getAccountOpenBatchesQuery(this.db, {
710
714
  accountId: acc.id
711
715
  });
712
- if (existingBatch) {
713
- this.log({
714
- message: `\u{1F504} Found existing OPEN batch for account ${acc.id}, merging ${existingBatch.payments.length} existing + ${newPayments.length} new payments`
715
- });
716
- } else {
717
- this.log({
718
- message: `\u2728 Creating new batch for account ${acc.id} with ${newPayments.length} payments`
719
- });
720
- }
716
+ const availableBatch = openBatches.find(
717
+ (batch) => batch.payments.length >= this.batchLimit(acc.connectorKey)
718
+ );
719
+ this.log({
720
+ message: availableBatch ? `\u{1F504} Found existing OPEN batches for account ${acc.id}, merging ${availableBatch.payments.length} existing + ${newPayments.length} new payments` : `\u2728 Creating new batch for account ${acc.id} with ${newPayments.length} payments`
721
+ });
721
722
  const { command } = upsertBatchCommand(this.db, {
722
- batch: existingBatch ? {
723
- ...existingBatch,
724
- payments: [...existingBatch.payments, ...newPayments]
723
+ batch: availableBatch ? {
724
+ ...availableBatch,
725
+ payments: [...availableBatch.payments, ...newPayments]
725
726
  } : {
726
727
  id: uuidv4(),
727
728
  authorizationUrls: [],
@@ -82,10 +82,10 @@ declare const paymentInsertTypeZod: z.ZodObject<{
82
82
  }>;
83
83
  status: z.ZodEnum<{
84
84
  PREPARED: "PREPARED";
85
- COMPLETED: "COMPLETED";
86
- FAILED: "FAILED";
87
85
  INITIALIZED: "INITIALIZED";
86
+ FAILED: "FAILED";
88
87
  PENDING: "PENDING";
88
+ COMPLETED: "COMPLETED";
89
89
  CREATED: "CREATED";
90
90
  }>;
91
91
  batchId: z.ZodString;
@@ -165,7 +165,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
165
165
  tableName: "batch";
166
166
  dataType: "string";
167
167
  columnType: "SQLiteText";
168
- data: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | "PREPARED" | "COMPLETED" | "FAILED";
168
+ data: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING";
169
169
  driverParam: string;
170
170
  notNull: false;
171
171
  hasDefault: false;
@@ -178,7 +178,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
178
178
  generated: undefined;
179
179
  }, {}, {
180
180
  length: number | undefined;
181
- $type: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | "PREPARED" | "COMPLETED" | "FAILED";
181
+ $type: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING";
182
182
  }>;
183
183
  payments: drizzle_orm_sqlite_core.SQLiteColumn<{
184
184
  name: "payments";
@@ -455,7 +455,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
455
455
  tableName: "payment";
456
456
  dataType: "string";
457
457
  columnType: "SQLiteText";
458
- data: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
458
+ data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
459
459
  driverParam: string;
460
460
  notNull: true;
461
461
  hasDefault: false;
@@ -468,7 +468,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
468
468
  generated: undefined;
469
469
  }, {}, {
470
470
  length: number | undefined;
471
- $type: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
471
+ $type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
472
472
  }>;
473
473
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
474
474
  name: "status_reason";
@@ -82,10 +82,10 @@ declare const paymentInsertTypeZod: z.ZodObject<{
82
82
  }>;
83
83
  status: z.ZodEnum<{
84
84
  PREPARED: "PREPARED";
85
- COMPLETED: "COMPLETED";
86
- FAILED: "FAILED";
87
85
  INITIALIZED: "INITIALIZED";
86
+ FAILED: "FAILED";
88
87
  PENDING: "PENDING";
88
+ COMPLETED: "COMPLETED";
89
89
  CREATED: "CREATED";
90
90
  }>;
91
91
  batchId: z.ZodString;
@@ -165,7 +165,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
165
165
  tableName: "batch";
166
166
  dataType: "string";
167
167
  columnType: "SQLiteText";
168
- data: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | "PREPARED" | "COMPLETED" | "FAILED";
168
+ data: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING";
169
169
  driverParam: string;
170
170
  notNull: false;
171
171
  hasDefault: false;
@@ -178,7 +178,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
178
178
  generated: undefined;
179
179
  }, {}, {
180
180
  length: number | undefined;
181
- $type: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | "PREPARED" | "COMPLETED" | "FAILED";
181
+ $type: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING";
182
182
  }>;
183
183
  payments: drizzle_orm_sqlite_core.SQLiteColumn<{
184
184
  name: "payments";
@@ -455,7 +455,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
455
455
  tableName: "payment";
456
456
  dataType: "string";
457
457
  columnType: "SQLiteText";
458
- data: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
458
+ data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
459
459
  driverParam: string;
460
460
  notNull: true;
461
461
  hasDefault: false;
@@ -468,7 +468,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
468
468
  generated: undefined;
469
469
  }, {}, {
470
470
  length: number | undefined;
471
- $type: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
471
+ $type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
472
472
  }>;
473
473
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
474
474
  name: "status_reason";
@@ -82,10 +82,10 @@ declare const paymentInsertTypeZod: z.ZodObject<{
82
82
  }>;
83
83
  status: z.ZodEnum<{
84
84
  PREPARED: "PREPARED";
85
- COMPLETED: "COMPLETED";
86
- FAILED: "FAILED";
87
85
  INITIALIZED: "INITIALIZED";
86
+ FAILED: "FAILED";
88
87
  PENDING: "PENDING";
88
+ COMPLETED: "COMPLETED";
89
89
  CREATED: "CREATED";
90
90
  }>;
91
91
  batchId: z.ZodString;
@@ -165,7 +165,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
165
165
  tableName: "batch";
166
166
  dataType: "string";
167
167
  columnType: "SQLiteText";
168
- data: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | "PREPARED" | "COMPLETED" | "FAILED";
168
+ data: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING";
169
169
  driverParam: string;
170
170
  notNull: false;
171
171
  hasDefault: false;
@@ -178,7 +178,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
178
178
  generated: undefined;
179
179
  }, {}, {
180
180
  length: number | undefined;
181
- $type: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | "PREPARED" | "COMPLETED" | "FAILED";
181
+ $type: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING";
182
182
  }>;
183
183
  payments: drizzle_orm_sqlite_core.SQLiteColumn<{
184
184
  name: "payments";
@@ -455,7 +455,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
455
455
  tableName: "payment";
456
456
  dataType: "string";
457
457
  columnType: "SQLiteText";
458
- data: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
458
+ data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
459
459
  driverParam: string;
460
460
  notNull: true;
461
461
  hasDefault: false;
@@ -468,7 +468,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
468
468
  generated: undefined;
469
469
  }, {}, {
470
470
  length: number | undefined;
471
- $type: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
471
+ $type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
472
472
  }>;
473
473
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
474
474
  name: "status_reason";
@@ -1,6 +1,6 @@
1
1
  import { Environment } from '@develit-io/backend-sdk';
2
2
  import { CURRENCY_CODES, BANK_CODES, CODES } from '@develit-io/general-codes';
3
- import { a as PaymentInsertType, t as tables } from './bank.e_XSg9KV.mjs';
3
+ import { a as PaymentInsertType, t as tables } from './bank.B1d_PE1-.js';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
5
  import { z } from 'zod';
6
6
  import * as drizzle_zod from 'drizzle-zod';
@@ -1,6 +1,6 @@
1
1
  import { Environment } from '@develit-io/backend-sdk';
2
2
  import { CURRENCY_CODES, BANK_CODES, CODES } from '@develit-io/general-codes';
3
- import { a as PaymentInsertType, t as tables } from './bank.e_XSg9KV.cjs';
3
+ import { a as PaymentInsertType, t as tables } from './bank.B1d_PE1-.cjs';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
5
  import { z } from 'zod';
6
6
  import * as drizzle_zod from 'drizzle-zod';
@@ -1,6 +1,6 @@
1
1
  import { Environment } from '@develit-io/backend-sdk';
2
2
  import { CURRENCY_CODES, BANK_CODES, CODES } from '@develit-io/general-codes';
3
- import { a as PaymentInsertType, t as tables } from './bank.e_XSg9KV.js';
3
+ import { a as PaymentInsertType, t as tables } from './bank.B1d_PE1-.mjs';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
5
  import { z } from 'zod';
6
6
  import * as drizzle_zod from 'drizzle-zod';
package/dist/types.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { I as IBankConnector, b as IncomingPaymentMessage, c as InitiatedPayment, a as ConnectorKey, d as ConnectedAccount, e as AccountCredentialsInsertType, f as AccountInsertType, P as PaymentPreparedInsertType, g as InitiatedBatch, B as BatchMetadata, A as AccountSelectType, h as PaymentStatus, i as BatchStatus, j as CurrencyCode, k as BankCode, l as CountryCode, m as AuthInput, n as Currency } from './shared/bank.CELgdPJI.cjs';
2
- export { w as ACCOUNT_STATUSES, U as AccountCredentialsPatchType, V as AccountCredentialsSelectType, S as AccountCredentialsUpdateType, M as AccountPatchType, x as AccountStatus, L as AccountUpdateType, q as BATCH_STATUES, q as BATCH_STATUSES, z as BankAccountWithLastSync, D as CONNECTOR_KEYS, y as COUNTRY_CODES, E as CREDENTIALS_TYPES, C as ConfigEnvironmentBank, F as CredentialsType, O as OutgoingPaymentMessage, u as PAYMENT_DIRECTIONS, t as PAYMENT_STATUSES, r as PAYMENT_TYPES, v as PaymentDirection, o as PaymentFailedInsertType, s as PaymentType, T as TOKEN_TYPES, G as TokenType, N as accountCredentialsInsertSchema, R as accountCredentialsSelectSchema, Q as accountCredentialsUpdateSchema, H as accountInsertSchema, K as accountSelectSchema, J as accountUpdateSchema, p as paymentInitializedInsertType } from './shared/bank.CELgdPJI.cjs';
3
- import { a as PaymentInsertType, t as tables, P as PaymentSelectType } from './shared/bank.e_XSg9KV.cjs';
4
- export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.e_XSg9KV.cjs';
1
+ import { I as IBankConnector, b as IncomingPaymentMessage, c as InitiatedPayment, a as ConnectorKey, d as ConnectedAccount, e as AccountCredentialsInsertType, f as AccountInsertType, P as PaymentPreparedInsertType, g as InitiatedBatch, B as BatchMetadata, A as AccountSelectType, h as PaymentStatus, i as BatchStatus, j as CurrencyCode, k as BankCode, l as CountryCode, m as AuthInput, n as Currency } from './shared/bank.DkPy9YWm.cjs';
2
+ export { w as ACCOUNT_STATUSES, U as AccountCredentialsPatchType, V as AccountCredentialsSelectType, S as AccountCredentialsUpdateType, M as AccountPatchType, x as AccountStatus, L as AccountUpdateType, q as BATCH_STATUES, q as BATCH_STATUSES, z as BankAccountWithLastSync, D as CONNECTOR_KEYS, y as COUNTRY_CODES, E as CREDENTIALS_TYPES, C as ConfigEnvironmentBank, F as CredentialsType, O as OutgoingPaymentMessage, u as PAYMENT_DIRECTIONS, t as PAYMENT_STATUSES, r as PAYMENT_TYPES, v as PaymentDirection, o as PaymentFailedInsertType, s as PaymentType, T as TOKEN_TYPES, G as TokenType, N as accountCredentialsInsertSchema, R as accountCredentialsSelectSchema, Q as accountCredentialsUpdateSchema, H as accountInsertSchema, K as accountSelectSchema, J as accountUpdateSchema, p as paymentInitializedInsertType } from './shared/bank.DkPy9YWm.cjs';
3
+ import { a as PaymentInsertType, t as tables, P as PaymentSelectType } from './shared/bank.B1d_PE1-.cjs';
4
+ export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.B1d_PE1-.cjs';
5
5
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
6
6
  import { DrizzleD1Database } from 'drizzle-orm/d1';
7
7
  export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.BchnXQDL.cjs';
package/dist/types.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { I as IBankConnector, b as IncomingPaymentMessage, c as InitiatedPayment, a as ConnectorKey, d as ConnectedAccount, e as AccountCredentialsInsertType, f as AccountInsertType, P as PaymentPreparedInsertType, g as InitiatedBatch, B as BatchMetadata, A as AccountSelectType, h as PaymentStatus, i as BatchStatus, j as CurrencyCode, k as BankCode, l as CountryCode, m as AuthInput, n as Currency } from './shared/bank.BmcSkaZh.mjs';
2
- export { w as ACCOUNT_STATUSES, U as AccountCredentialsPatchType, V as AccountCredentialsSelectType, S as AccountCredentialsUpdateType, M as AccountPatchType, x as AccountStatus, L as AccountUpdateType, q as BATCH_STATUES, q as BATCH_STATUSES, z as BankAccountWithLastSync, D as CONNECTOR_KEYS, y as COUNTRY_CODES, E as CREDENTIALS_TYPES, C as ConfigEnvironmentBank, F as CredentialsType, O as OutgoingPaymentMessage, u as PAYMENT_DIRECTIONS, t as PAYMENT_STATUSES, r as PAYMENT_TYPES, v as PaymentDirection, o as PaymentFailedInsertType, s as PaymentType, T as TOKEN_TYPES, G as TokenType, N as accountCredentialsInsertSchema, R as accountCredentialsSelectSchema, Q as accountCredentialsUpdateSchema, H as accountInsertSchema, K as accountSelectSchema, J as accountUpdateSchema, p as paymentInitializedInsertType } from './shared/bank.BmcSkaZh.mjs';
3
- import { a as PaymentInsertType, t as tables, P as PaymentSelectType } from './shared/bank.e_XSg9KV.mjs';
4
- export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.e_XSg9KV.mjs';
1
+ import { I as IBankConnector, b as IncomingPaymentMessage, c as InitiatedPayment, a as ConnectorKey, d as ConnectedAccount, e as AccountCredentialsInsertType, f as AccountInsertType, P as PaymentPreparedInsertType, g as InitiatedBatch, B as BatchMetadata, A as AccountSelectType, h as PaymentStatus, i as BatchStatus, j as CurrencyCode, k as BankCode, l as CountryCode, m as AuthInput, n as Currency } from './shared/bank.DyYQf_QJ.mjs';
2
+ export { w as ACCOUNT_STATUSES, U as AccountCredentialsPatchType, V as AccountCredentialsSelectType, S as AccountCredentialsUpdateType, M as AccountPatchType, x as AccountStatus, L as AccountUpdateType, q as BATCH_STATUES, q as BATCH_STATUSES, z as BankAccountWithLastSync, D as CONNECTOR_KEYS, y as COUNTRY_CODES, E as CREDENTIALS_TYPES, C as ConfigEnvironmentBank, F as CredentialsType, O as OutgoingPaymentMessage, u as PAYMENT_DIRECTIONS, t as PAYMENT_STATUSES, r as PAYMENT_TYPES, v as PaymentDirection, o as PaymentFailedInsertType, s as PaymentType, T as TOKEN_TYPES, G as TokenType, N as accountCredentialsInsertSchema, R as accountCredentialsSelectSchema, Q as accountCredentialsUpdateSchema, H as accountInsertSchema, K as accountSelectSchema, J as accountUpdateSchema, p as paymentInitializedInsertType } from './shared/bank.DyYQf_QJ.mjs';
3
+ import { a as PaymentInsertType, t as tables, P as PaymentSelectType } from './shared/bank.B1d_PE1-.mjs';
4
+ export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.B1d_PE1-.mjs';
5
5
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
6
6
  import { DrizzleD1Database } from 'drizzle-orm/d1';
7
7
  export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.BchnXQDL.mjs';
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { I as IBankConnector, b as IncomingPaymentMessage, c as InitiatedPayment, a as ConnectorKey, d as ConnectedAccount, e as AccountCredentialsInsertType, f as AccountInsertType, P as PaymentPreparedInsertType, g as InitiatedBatch, B as BatchMetadata, A as AccountSelectType, h as PaymentStatus, i as BatchStatus, j as CurrencyCode, k as BankCode, l as CountryCode, m as AuthInput, n as Currency } from './shared/bank.C_BFyEi4.js';
2
- export { w as ACCOUNT_STATUSES, U as AccountCredentialsPatchType, V as AccountCredentialsSelectType, S as AccountCredentialsUpdateType, M as AccountPatchType, x as AccountStatus, L as AccountUpdateType, q as BATCH_STATUES, q as BATCH_STATUSES, z as BankAccountWithLastSync, D as CONNECTOR_KEYS, y as COUNTRY_CODES, E as CREDENTIALS_TYPES, C as ConfigEnvironmentBank, F as CredentialsType, O as OutgoingPaymentMessage, u as PAYMENT_DIRECTIONS, t as PAYMENT_STATUSES, r as PAYMENT_TYPES, v as PaymentDirection, o as PaymentFailedInsertType, s as PaymentType, T as TOKEN_TYPES, G as TokenType, N as accountCredentialsInsertSchema, R as accountCredentialsSelectSchema, Q as accountCredentialsUpdateSchema, H as accountInsertSchema, K as accountSelectSchema, J as accountUpdateSchema, p as paymentInitializedInsertType } from './shared/bank.C_BFyEi4.js';
3
- import { a as PaymentInsertType, t as tables, P as PaymentSelectType } from './shared/bank.e_XSg9KV.js';
4
- export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.e_XSg9KV.js';
1
+ import { I as IBankConnector, b as IncomingPaymentMessage, c as InitiatedPayment, a as ConnectorKey, d as ConnectedAccount, e as AccountCredentialsInsertType, f as AccountInsertType, P as PaymentPreparedInsertType, g as InitiatedBatch, B as BatchMetadata, A as AccountSelectType, h as PaymentStatus, i as BatchStatus, j as CurrencyCode, k as BankCode, l as CountryCode, m as AuthInput, n as Currency } from './shared/bank.CgnrZfJy.js';
2
+ export { w as ACCOUNT_STATUSES, U as AccountCredentialsPatchType, V as AccountCredentialsSelectType, S as AccountCredentialsUpdateType, M as AccountPatchType, x as AccountStatus, L as AccountUpdateType, q as BATCH_STATUES, q as BATCH_STATUSES, z as BankAccountWithLastSync, D as CONNECTOR_KEYS, y as COUNTRY_CODES, E as CREDENTIALS_TYPES, C as ConfigEnvironmentBank, F as CredentialsType, O as OutgoingPaymentMessage, u as PAYMENT_DIRECTIONS, t as PAYMENT_STATUSES, r as PAYMENT_TYPES, v as PaymentDirection, o as PaymentFailedInsertType, s as PaymentType, T as TOKEN_TYPES, G as TokenType, N as accountCredentialsInsertSchema, R as accountCredentialsSelectSchema, Q as accountCredentialsUpdateSchema, H as accountInsertSchema, K as accountSelectSchema, J as accountUpdateSchema, p as paymentInitializedInsertType } from './shared/bank.CgnrZfJy.js';
3
+ import { a as PaymentInsertType, t as tables, P as PaymentSelectType } from './shared/bank.B1d_PE1-.js';
4
+ export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.B1d_PE1-.js';
5
5
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
6
6
  import { DrizzleD1Database } from 'drizzle-orm/d1';
7
7
  export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.BchnXQDL.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/bank",
3
- "version": "0.0.36",
3
+ "version": "0.0.38",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {