@develit-services/bank 0.0.18 → 0.0.19

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 { c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.BuNG2S8h.cjs';
1
+ export { c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.mGCkS7Y9.cjs';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import 'zod';
@@ -1,4 +1,4 @@
1
- export { c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.BuNG2S8h.mjs';
1
+ export { c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.mGCkS7Y9.mjs';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import 'zod';
@@ -1,4 +1,4 @@
1
- export { c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.BuNG2S8h.js';
1
+ export { c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.mGCkS7Y9.js';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import 'zod';
@@ -135,10 +135,6 @@ const getOpenBatchByAccountIdQuery = async (db$1, { accountId }) => {
135
135
  return batch;
136
136
  };
137
137
 
138
- const getAllOpenBatchesQuery = async (db$1) => {
139
- return await db$1.select().from(db.tables.batch).where(drizzleOrm.eq(db.tables.batch.status, "OPEN"));
140
- };
141
-
142
138
  const getPaymentsByBankRefIdsQuery = async (db$1, { ids }) => {
143
139
  return await db$1.select().from(db.tables.payment).where(drizzleOrm.inArray(db.tables.payment.bankRefId, ids));
144
140
  };
@@ -331,28 +327,6 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
331
327
  });
332
328
  }
333
329
  async scheduled(controller) {
334
- if (controller.cron === this.env.CRON_BATCHES_PROCESSING) {
335
- console.log("Scheduled CRON batches processing");
336
- const openBatches = await getAllOpenBatchesQuery(this.db);
337
- if (!openBatches.length) return;
338
- for (const batch of openBatches) {
339
- const connectorKey = this.accounts.find(
340
- (acc) => acc.id === batch.accountId
341
- )?.connectorKey;
342
- if (!connectorKey) {
343
- this.logError({
344
- message: "Failed to find connector key",
345
- batch,
346
- connectorKey
347
- });
348
- continue;
349
- }
350
- await this.processBatch({
351
- batch,
352
- connectorKey
353
- });
354
- }
355
- }
356
330
  if (controller.cron === this.env.CRON_PAYMENTS_PROCESSING) {
357
331
  console.log("Scheduled CRON payments processing");
358
332
  await this.syncAccounts();
@@ -481,6 +455,12 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
481
455
  }).command.execute();
482
456
  await this.initiateBankConnector({ connectorKey });
483
457
  if (!this.bankConnector) {
458
+ await upsertBatchCommand(this.db, {
459
+ batch: {
460
+ ...batch,
461
+ status: "FAILED"
462
+ }
463
+ }).command.execute();
484
464
  throw backendSdk.createInternalError(null, {
485
465
  message: `\u274C Failed to initialize ${connectorKey} bank connector`
486
466
  });
@@ -522,6 +502,12 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
522
502
  (p) => createPaymentCommand(this.db, { payment: p }).command.execute()
523
503
  )
524
504
  ]);
505
+ await upsertBatchCommand(this.db, {
506
+ batch: {
507
+ ...batch,
508
+ status: "PREPARED"
509
+ }
510
+ }).command.execute();
525
511
  const { authorizationUrls, payments, metadata } = await this.bankConnector.initiateBatchFromPayments({
526
512
  payments: [
527
513
  ...preparedBatch.newlyPreparedPayments,
@@ -530,6 +516,12 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
530
516
  });
531
517
  if (!authorizationUrls) {
532
518
  this.logError({ message: "Failed to retrieve signing URI" });
519
+ await upsertBatchCommand(this.db, {
520
+ batch: {
521
+ ...batch,
522
+ status: "FAILED"
523
+ }
524
+ }).command.execute();
533
525
  return;
534
526
  }
535
527
  const { command: upsertBatch } = upsertBatchCommand(this.db, {
@@ -556,7 +548,7 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
556
548
  type: "email",
557
549
  payload: {
558
550
  email: {
559
- to: ["petr@develit.io"],
551
+ to: [this.env.BANK_AUTH_RECIPIENT],
560
552
  subject: "Payment Authorization",
561
553
  text: authorizationUrls[0] || "No Authorization Url"
562
554
  }
@@ -1,10 +1,10 @@
1
1
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
2
2
  import { IRPCResponse } from '@develit-io/backend-sdk';
3
- import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.BuNG2S8h.cjs';
3
+ import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.mGCkS7Y9.cjs';
4
4
  import { WorkerEntrypoint } from 'cloudflare:workers';
5
5
  import { DrizzleD1Database } from 'drizzle-orm/d1';
6
6
  import { z } from 'zod';
7
- import { C as ConfigEnvironmentBankAccount, I as IBankConnector, a as ConfigBankAccount, b as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.DmypH3Au.cjs';
7
+ import { C as ConfigEnvironmentBankAccount, I as IBankConnector, a as ConfigBankAccount, b as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.TyzHNrzR.cjs';
8
8
  import 'drizzle-orm/sqlite-core';
9
9
  import 'drizzle-orm';
10
10
  import '@develit-io/general-codes';
@@ -226,10 +226,10 @@ declare class BankServiceBase extends BankServiceBase_base {
226
226
  addPaymentsToBatch({ paymentsToBatch, }: {
227
227
  paymentsToBatch: SendPaymentInput[];
228
228
  }): Promise<IRPCResponse<{
229
- status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
230
229
  batchPaymentInitiatedAt: Date | null;
231
230
  authorizationUrls: string | string[] | null;
232
231
  accountId: string | null;
232
+ status: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED" | null;
233
233
  payments: PaymentInsertType[];
234
234
  metadata: object | null;
235
235
  id: string;
@@ -1,10 +1,10 @@
1
1
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
2
2
  import { IRPCResponse } from '@develit-io/backend-sdk';
3
- import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.BuNG2S8h.mjs';
3
+ import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.mGCkS7Y9.mjs';
4
4
  import { WorkerEntrypoint } from 'cloudflare:workers';
5
5
  import { DrizzleD1Database } from 'drizzle-orm/d1';
6
6
  import { z } from 'zod';
7
- import { C as ConfigEnvironmentBankAccount, I as IBankConnector, a as ConfigBankAccount, b as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.DWVLVMDa.mjs';
7
+ import { C as ConfigEnvironmentBankAccount, I as IBankConnector, a as ConfigBankAccount, b as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.C8aShbaN.mjs';
8
8
  import 'drizzle-orm/sqlite-core';
9
9
  import 'drizzle-orm';
10
10
  import '@develit-io/general-codes';
@@ -226,10 +226,10 @@ declare class BankServiceBase extends BankServiceBase_base {
226
226
  addPaymentsToBatch({ paymentsToBatch, }: {
227
227
  paymentsToBatch: SendPaymentInput[];
228
228
  }): Promise<IRPCResponse<{
229
- status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
230
229
  batchPaymentInitiatedAt: Date | null;
231
230
  authorizationUrls: string | string[] | null;
232
231
  accountId: string | null;
232
+ status: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED" | null;
233
233
  payments: PaymentInsertType[];
234
234
  metadata: object | null;
235
235
  id: string;
@@ -1,10 +1,10 @@
1
1
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
2
2
  import { IRPCResponse } from '@develit-io/backend-sdk';
3
- import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.BuNG2S8h.js';
3
+ import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.mGCkS7Y9.js';
4
4
  import { WorkerEntrypoint } from 'cloudflare:workers';
5
5
  import { DrizzleD1Database } from 'drizzle-orm/d1';
6
6
  import { z } from 'zod';
7
- import { C as ConfigEnvironmentBankAccount, I as IBankConnector, a as ConfigBankAccount, b as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.BkLncGmL.js';
7
+ import { C as ConfigEnvironmentBankAccount, I as IBankConnector, a as ConfigBankAccount, b as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.zK_DX1oe.js';
8
8
  import 'drizzle-orm/sqlite-core';
9
9
  import 'drizzle-orm';
10
10
  import '@develit-io/general-codes';
@@ -226,10 +226,10 @@ declare class BankServiceBase extends BankServiceBase_base {
226
226
  addPaymentsToBatch({ paymentsToBatch, }: {
227
227
  paymentsToBatch: SendPaymentInput[];
228
228
  }): Promise<IRPCResponse<{
229
- status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
230
229
  batchPaymentInitiatedAt: Date | null;
231
230
  authorizationUrls: string | string[] | null;
232
231
  accountId: string | null;
232
+ status: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED" | null;
233
233
  payments: PaymentInsertType[];
234
234
  metadata: object | null;
235
235
  id: string;
@@ -127,10 +127,6 @@ const getOpenBatchByAccountIdQuery = async (db, { accountId }) => {
127
127
  return batch;
128
128
  };
129
129
 
130
- const getAllOpenBatchesQuery = async (db) => {
131
- return await db.select().from(tables.batch).where(eq(tables.batch.status, "OPEN"));
132
- };
133
-
134
130
  const getPaymentsByBankRefIdsQuery = async (db, { ids }) => {
135
131
  return await db.select().from(tables.payment).where(inArray(tables.payment.bankRefId, ids));
136
132
  };
@@ -323,28 +319,6 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
323
319
  });
324
320
  }
325
321
  async scheduled(controller) {
326
- if (controller.cron === this.env.CRON_BATCHES_PROCESSING) {
327
- console.log("Scheduled CRON batches processing");
328
- const openBatches = await getAllOpenBatchesQuery(this.db);
329
- if (!openBatches.length) return;
330
- for (const batch of openBatches) {
331
- const connectorKey = this.accounts.find(
332
- (acc) => acc.id === batch.accountId
333
- )?.connectorKey;
334
- if (!connectorKey) {
335
- this.logError({
336
- message: "Failed to find connector key",
337
- batch,
338
- connectorKey
339
- });
340
- continue;
341
- }
342
- await this.processBatch({
343
- batch,
344
- connectorKey
345
- });
346
- }
347
- }
348
322
  if (controller.cron === this.env.CRON_PAYMENTS_PROCESSING) {
349
323
  console.log("Scheduled CRON payments processing");
350
324
  await this.syncAccounts();
@@ -473,6 +447,12 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
473
447
  }).command.execute();
474
448
  await this.initiateBankConnector({ connectorKey });
475
449
  if (!this.bankConnector) {
450
+ await upsertBatchCommand(this.db, {
451
+ batch: {
452
+ ...batch,
453
+ status: "FAILED"
454
+ }
455
+ }).command.execute();
476
456
  throw createInternalError(null, {
477
457
  message: `\u274C Failed to initialize ${connectorKey} bank connector`
478
458
  });
@@ -514,6 +494,12 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
514
494
  (p) => createPaymentCommand(this.db, { payment: p }).command.execute()
515
495
  )
516
496
  ]);
497
+ await upsertBatchCommand(this.db, {
498
+ batch: {
499
+ ...batch,
500
+ status: "PREPARED"
501
+ }
502
+ }).command.execute();
517
503
  const { authorizationUrls, payments, metadata } = await this.bankConnector.initiateBatchFromPayments({
518
504
  payments: [
519
505
  ...preparedBatch.newlyPreparedPayments,
@@ -522,6 +508,12 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
522
508
  });
523
509
  if (!authorizationUrls) {
524
510
  this.logError({ message: "Failed to retrieve signing URI" });
511
+ await upsertBatchCommand(this.db, {
512
+ batch: {
513
+ ...batch,
514
+ status: "FAILED"
515
+ }
516
+ }).command.execute();
525
517
  return;
526
518
  }
527
519
  const { command: upsertBatch } = upsertBatchCommand(this.db, {
@@ -548,7 +540,7 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
548
540
  type: "email",
549
541
  payload: {
550
542
  email: {
551
- to: ["petr@develit.io"],
543
+ to: [this.env.BANK_AUTH_RECIPIENT],
552
544
  subject: "Payment Authorization",
553
545
  text: authorizationUrls[0] || "No Authorization Url"
554
546
  }
@@ -26,7 +26,8 @@ function defineBankServiceWrangler(config) {
26
26
  FINBRICKS_BASE_URI: "https://api.sandbox.finbricks.com",
27
27
  FINBRICKS_MERCHANT_ID: "10435c82-84b4-4efa-b5bf-ae6cd723e653",
28
28
  CRON_BATCHES_PROCESSING: "* * * * *",
29
- CRON_PAYMENTS_PROCESSING: "* * * * *"
29
+ CRON_PAYMENTS_PROCESSING: "* * * * *",
30
+ BANK_AUTH_RECIPIENT: "petr@develit.io"
30
31
  },
31
32
  triggers: envs.local.triggers,
32
33
  kv_namespaces: [
@@ -1,4 +1,4 @@
1
- import { B as BankServiceWranglerConfig } from '../shared/bank.CJFy17-g.cjs';
1
+ import { B as BankServiceWranglerConfig } from '../shared/bank.CEZKAEiY.cjs';
2
2
 
3
3
  declare function defineBankServiceWrangler(config: BankServiceWranglerConfig): {
4
4
  vars: {
@@ -12,6 +12,7 @@ declare function defineBankServiceWrangler(config: BankServiceWranglerConfig): {
12
12
  FINBRICKS_MERCHANT_ID: string;
13
13
  CRON_BATCHES_PROCESSING: string;
14
14
  CRON_PAYMENTS_PROCESSING: string;
15
+ BANK_AUTH_RECIPIENT: string;
15
16
  ERSTE_REDIRECT_URI: string;
16
17
  FINBRICKS_PRIVATE_KEY_PEM: string;
17
18
  ERSTE_API_KEY: string;
@@ -1,4 +1,4 @@
1
- import { B as BankServiceWranglerConfig } from '../shared/bank.CJFy17-g.mjs';
1
+ import { B as BankServiceWranglerConfig } from '../shared/bank.CEZKAEiY.mjs';
2
2
 
3
3
  declare function defineBankServiceWrangler(config: BankServiceWranglerConfig): {
4
4
  vars: {
@@ -12,6 +12,7 @@ declare function defineBankServiceWrangler(config: BankServiceWranglerConfig): {
12
12
  FINBRICKS_MERCHANT_ID: string;
13
13
  CRON_BATCHES_PROCESSING: string;
14
14
  CRON_PAYMENTS_PROCESSING: string;
15
+ BANK_AUTH_RECIPIENT: string;
15
16
  ERSTE_REDIRECT_URI: string;
16
17
  FINBRICKS_PRIVATE_KEY_PEM: string;
17
18
  ERSTE_API_KEY: string;
@@ -1,4 +1,4 @@
1
- import { B as BankServiceWranglerConfig } from '../shared/bank.CJFy17-g.js';
1
+ import { B as BankServiceWranglerConfig } from '../shared/bank.CEZKAEiY.js';
2
2
 
3
3
  declare function defineBankServiceWrangler(config: BankServiceWranglerConfig): {
4
4
  vars: {
@@ -12,6 +12,7 @@ declare function defineBankServiceWrangler(config: BankServiceWranglerConfig): {
12
12
  FINBRICKS_MERCHANT_ID: string;
13
13
  CRON_BATCHES_PROCESSING: string;
14
14
  CRON_PAYMENTS_PROCESSING: string;
15
+ BANK_AUTH_RECIPIENT: string;
15
16
  ERSTE_REDIRECT_URI: string;
16
17
  FINBRICKS_PRIVATE_KEY_PEM: string;
17
18
  ERSTE_API_KEY: string;
@@ -24,7 +24,8 @@ function defineBankServiceWrangler(config) {
24
24
  FINBRICKS_BASE_URI: "https://api.sandbox.finbricks.com",
25
25
  FINBRICKS_MERCHANT_ID: "10435c82-84b4-4efa-b5bf-ae6cd723e653",
26
26
  CRON_BATCHES_PROCESSING: "* * * * *",
27
- CRON_PAYMENTS_PROCESSING: "* * * * *"
27
+ CRON_PAYMENTS_PROCESSING: "* * * * *",
28
+ BANK_AUTH_RECIPIENT: "petr@develit.io"
28
29
  },
29
30
  triggers: envs.local.triggers,
30
31
  kv_namespaces: [
@@ -1,6 +1,6 @@
1
1
  import { Environment } from '@develit-io/backend-sdk';
2
2
  import { BANK_CODES, CURRENCY_CODES, CODES } from '@develit-io/general-codes';
3
- import { a as PaymentInsertType, t as tables } from './bank.BuNG2S8h.mjs';
3
+ import { a as PaymentInsertType, t as tables } from './bank.mGCkS7Y9.mjs';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
5
 
6
6
  declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "IFSC", "DOMESTIC"];
@@ -22,6 +22,7 @@ interface BankServiceEnvironmentConfig {
22
22
  FINBRICKS_MERCHANT_ID: string;
23
23
  CRON_BATCHES_PROCESSING: string;
24
24
  CRON_PAYMENTS_PROCESSING: string;
25
+ BANK_AUTH_RECIPIENT: string;
25
26
  };
26
27
  }
27
28
  interface BankServiceWranglerConfig {
@@ -22,6 +22,7 @@ interface BankServiceEnvironmentConfig {
22
22
  FINBRICKS_MERCHANT_ID: string;
23
23
  CRON_BATCHES_PROCESSING: string;
24
24
  CRON_PAYMENTS_PROCESSING: string;
25
+ BANK_AUTH_RECIPIENT: string;
25
26
  };
26
27
  }
27
28
  interface BankServiceWranglerConfig {
@@ -22,6 +22,7 @@ interface BankServiceEnvironmentConfig {
22
22
  FINBRICKS_MERCHANT_ID: string;
23
23
  CRON_BATCHES_PROCESSING: string;
24
24
  CRON_PAYMENTS_PROCESSING: string;
25
+ BANK_AUTH_RECIPIENT: string;
25
26
  };
26
27
  }
27
28
  interface BankServiceWranglerConfig {
@@ -1,6 +1,6 @@
1
1
  import { Environment } from '@develit-io/backend-sdk';
2
2
  import { BANK_CODES, CURRENCY_CODES, CODES } from '@develit-io/general-codes';
3
- import { a as PaymentInsertType, t as tables } from './bank.BuNG2S8h.cjs';
3
+ import { a as PaymentInsertType, t as tables } from './bank.mGCkS7Y9.cjs';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
5
 
6
6
  declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "IFSC", "DOMESTIC"];
@@ -82,10 +82,10 @@ declare const paymentInsertTypeZod: z.ZodObject<{
82
82
  }>;
83
83
  status: z.ZodEnum<{
84
84
  PREPARED: "PREPARED";
85
- INITIALIZED: "INITIALIZED";
85
+ COMPLETED: "COMPLETED";
86
86
  FAILED: "FAILED";
87
+ INITIALIZED: "INITIALIZED";
87
88
  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: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
168
+ data: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
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: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
181
+ $type: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
182
182
  }>;
183
183
  payments: drizzle_orm_sqlite_core.SQLiteColumn<{
184
184
  name: "payments";
@@ -416,7 +416,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
416
416
  tableName: "payment";
417
417
  dataType: "string";
418
418
  columnType: "SQLiteText";
419
- data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
419
+ data: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
420
420
  driverParam: string;
421
421
  notNull: true;
422
422
  hasDefault: false;
@@ -429,7 +429,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
429
429
  generated: undefined;
430
430
  }, {}, {
431
431
  length: number | undefined;
432
- $type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
432
+ $type: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
433
433
  }>;
434
434
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
435
435
  name: "status_reason";
@@ -82,10 +82,10 @@ declare const paymentInsertTypeZod: z.ZodObject<{
82
82
  }>;
83
83
  status: z.ZodEnum<{
84
84
  PREPARED: "PREPARED";
85
- INITIALIZED: "INITIALIZED";
85
+ COMPLETED: "COMPLETED";
86
86
  FAILED: "FAILED";
87
+ INITIALIZED: "INITIALIZED";
87
88
  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: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
168
+ data: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
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: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
181
+ $type: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
182
182
  }>;
183
183
  payments: drizzle_orm_sqlite_core.SQLiteColumn<{
184
184
  name: "payments";
@@ -416,7 +416,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
416
416
  tableName: "payment";
417
417
  dataType: "string";
418
418
  columnType: "SQLiteText";
419
- data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
419
+ data: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
420
420
  driverParam: string;
421
421
  notNull: true;
422
422
  hasDefault: false;
@@ -429,7 +429,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
429
429
  generated: undefined;
430
430
  }, {}, {
431
431
  length: number | undefined;
432
- $type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
432
+ $type: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
433
433
  }>;
434
434
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
435
435
  name: "status_reason";
@@ -82,10 +82,10 @@ declare const paymentInsertTypeZod: z.ZodObject<{
82
82
  }>;
83
83
  status: z.ZodEnum<{
84
84
  PREPARED: "PREPARED";
85
- INITIALIZED: "INITIALIZED";
85
+ COMPLETED: "COMPLETED";
86
86
  FAILED: "FAILED";
87
+ INITIALIZED: "INITIALIZED";
87
88
  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: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
168
+ data: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
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: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
181
+ $type: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
182
182
  }>;
183
183
  payments: drizzle_orm_sqlite_core.SQLiteColumn<{
184
184
  name: "payments";
@@ -416,7 +416,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
416
416
  tableName: "payment";
417
417
  dataType: "string";
418
418
  columnType: "SQLiteText";
419
- data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
419
+ data: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
420
420
  driverParam: string;
421
421
  notNull: true;
422
422
  hasDefault: false;
@@ -429,7 +429,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
429
429
  generated: undefined;
430
430
  }, {}, {
431
431
  length: number | undefined;
432
- $type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
432
+ $type: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
433
433
  }>;
434
434
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
435
435
  name: "status_reason";
@@ -1,6 +1,6 @@
1
1
  import { Environment } from '@develit-io/backend-sdk';
2
2
  import { BANK_CODES, CURRENCY_CODES, CODES } from '@develit-io/general-codes';
3
- import { a as PaymentInsertType, t as tables } from './bank.BuNG2S8h.js';
3
+ import { a as PaymentInsertType, t as tables } from './bank.mGCkS7Y9.js';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
5
 
6
6
  declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "IFSC", "DOMESTIC"];
package/dist/types.d.cts CHANGED
@@ -1,10 +1,10 @@
1
- import { c as CurrencyCode, d as BankCode, e as CountryCode, I as IBankConnector, b as ConnectorKey, A as AuthInput, f as IncomingPaymentMessage, P as PaymentPreparedInsertType, g as InitiatedBatch, h as InitiatedPayment, a as ConfigBankAccount, S as SyncLog, i as PaymentStatus, j as BatchStatus, k as BatchMetadata, l as Currency } from './shared/bank.DmypH3Au.cjs';
2
- export { n as BATCH_STATUES, n as BATCH_STATUSES, B as BankAccountWithLastSync, v as CONNECTOR_KEYS, u as COUNTRY_CODES, C as ConfigEnvironmentBankAccount, O as OutgoingPaymentMessage, s as PAYMENT_DIRECTIONS, r as PAYMENT_STATUSES, o as PAYMENT_TYPES, t as PaymentDirection, m as PaymentFailedInsertType, q as PaymentType, T as TOKEN_TYPES, w as TokenType, p as paymentInitializedInsertType } from './shared/bank.DmypH3Au.cjs';
3
- import { t as tables, a as PaymentInsertType, P as PaymentSelectType } from './shared/bank.BuNG2S8h.cjs';
4
- export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.BuNG2S8h.cjs';
1
+ import { c as CurrencyCode, d as BankCode, e as CountryCode, I as IBankConnector, b as ConnectorKey, A as AuthInput, f as IncomingPaymentMessage, P as PaymentPreparedInsertType, g as InitiatedBatch, h as InitiatedPayment, a as ConfigBankAccount, S as SyncLog, i as PaymentStatus, j as BatchStatus, k as BatchMetadata, l as Currency } from './shared/bank.TyzHNrzR.cjs';
2
+ export { n as BATCH_STATUES, n as BATCH_STATUSES, B as BankAccountWithLastSync, v as CONNECTOR_KEYS, u as COUNTRY_CODES, C as ConfigEnvironmentBankAccount, O as OutgoingPaymentMessage, s as PAYMENT_DIRECTIONS, r as PAYMENT_STATUSES, o as PAYMENT_TYPES, t as PaymentDirection, m as PaymentFailedInsertType, q as PaymentType, T as TOKEN_TYPES, w as TokenType, p as paymentInitializedInsertType } from './shared/bank.TyzHNrzR.cjs';
3
+ import { t as tables, a as PaymentInsertType, P as PaymentSelectType } from './shared/bank.mGCkS7Y9.cjs';
4
+ export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.mGCkS7Y9.cjs';
5
5
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
6
6
  import { DrizzleD1Database } from 'drizzle-orm/d1';
7
- export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CJFy17-g.cjs';
7
+ export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CEZKAEiY.cjs';
8
8
  export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
9
9
  import 'drizzle-orm/sqlite-core';
10
10
  import 'drizzle-orm';
package/dist/types.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- import { c as CurrencyCode, d as BankCode, e as CountryCode, I as IBankConnector, b as ConnectorKey, A as AuthInput, f as IncomingPaymentMessage, P as PaymentPreparedInsertType, g as InitiatedBatch, h as InitiatedPayment, a as ConfigBankAccount, S as SyncLog, i as PaymentStatus, j as BatchStatus, k as BatchMetadata, l as Currency } from './shared/bank.DWVLVMDa.mjs';
2
- export { n as BATCH_STATUES, n as BATCH_STATUSES, B as BankAccountWithLastSync, v as CONNECTOR_KEYS, u as COUNTRY_CODES, C as ConfigEnvironmentBankAccount, O as OutgoingPaymentMessage, s as PAYMENT_DIRECTIONS, r as PAYMENT_STATUSES, o as PAYMENT_TYPES, t as PaymentDirection, m as PaymentFailedInsertType, q as PaymentType, T as TOKEN_TYPES, w as TokenType, p as paymentInitializedInsertType } from './shared/bank.DWVLVMDa.mjs';
3
- import { t as tables, a as PaymentInsertType, P as PaymentSelectType } from './shared/bank.BuNG2S8h.mjs';
4
- export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.BuNG2S8h.mjs';
1
+ import { c as CurrencyCode, d as BankCode, e as CountryCode, I as IBankConnector, b as ConnectorKey, A as AuthInput, f as IncomingPaymentMessage, P as PaymentPreparedInsertType, g as InitiatedBatch, h as InitiatedPayment, a as ConfigBankAccount, S as SyncLog, i as PaymentStatus, j as BatchStatus, k as BatchMetadata, l as Currency } from './shared/bank.C8aShbaN.mjs';
2
+ export { n as BATCH_STATUES, n as BATCH_STATUSES, B as BankAccountWithLastSync, v as CONNECTOR_KEYS, u as COUNTRY_CODES, C as ConfigEnvironmentBankAccount, O as OutgoingPaymentMessage, s as PAYMENT_DIRECTIONS, r as PAYMENT_STATUSES, o as PAYMENT_TYPES, t as PaymentDirection, m as PaymentFailedInsertType, q as PaymentType, T as TOKEN_TYPES, w as TokenType, p as paymentInitializedInsertType } from './shared/bank.C8aShbaN.mjs';
3
+ import { t as tables, a as PaymentInsertType, P as PaymentSelectType } from './shared/bank.mGCkS7Y9.mjs';
4
+ export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.mGCkS7Y9.mjs';
5
5
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
6
6
  import { DrizzleD1Database } from 'drizzle-orm/d1';
7
- export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CJFy17-g.mjs';
7
+ export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CEZKAEiY.mjs';
8
8
  export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
9
9
  import 'drizzle-orm/sqlite-core';
10
10
  import 'drizzle-orm';
package/dist/types.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { c as CurrencyCode, d as BankCode, e as CountryCode, I as IBankConnector, b as ConnectorKey, A as AuthInput, f as IncomingPaymentMessage, P as PaymentPreparedInsertType, g as InitiatedBatch, h as InitiatedPayment, a as ConfigBankAccount, S as SyncLog, i as PaymentStatus, j as BatchStatus, k as BatchMetadata, l as Currency } from './shared/bank.BkLncGmL.js';
2
- export { n as BATCH_STATUES, n as BATCH_STATUSES, B as BankAccountWithLastSync, v as CONNECTOR_KEYS, u as COUNTRY_CODES, C as ConfigEnvironmentBankAccount, O as OutgoingPaymentMessage, s as PAYMENT_DIRECTIONS, r as PAYMENT_STATUSES, o as PAYMENT_TYPES, t as PaymentDirection, m as PaymentFailedInsertType, q as PaymentType, T as TOKEN_TYPES, w as TokenType, p as paymentInitializedInsertType } from './shared/bank.BkLncGmL.js';
3
- import { t as tables, a as PaymentInsertType, P as PaymentSelectType } from './shared/bank.BuNG2S8h.js';
4
- export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.BuNG2S8h.js';
1
+ import { c as CurrencyCode, d as BankCode, e as CountryCode, I as IBankConnector, b as ConnectorKey, A as AuthInput, f as IncomingPaymentMessage, P as PaymentPreparedInsertType, g as InitiatedBatch, h as InitiatedPayment, a as ConfigBankAccount, S as SyncLog, i as PaymentStatus, j as BatchStatus, k as BatchMetadata, l as Currency } from './shared/bank.zK_DX1oe.js';
2
+ export { n as BATCH_STATUES, n as BATCH_STATUSES, B as BankAccountWithLastSync, v as CONNECTOR_KEYS, u as COUNTRY_CODES, C as ConfigEnvironmentBankAccount, O as OutgoingPaymentMessage, s as PAYMENT_DIRECTIONS, r as PAYMENT_STATUSES, o as PAYMENT_TYPES, t as PaymentDirection, m as PaymentFailedInsertType, q as PaymentType, T as TOKEN_TYPES, w as TokenType, p as paymentInitializedInsertType } from './shared/bank.zK_DX1oe.js';
3
+ import { t as tables, a as PaymentInsertType, P as PaymentSelectType } from './shared/bank.mGCkS7Y9.js';
4
+ export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.mGCkS7Y9.js';
5
5
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
6
6
  import { DrizzleD1Database } from 'drizzle-orm/d1';
7
- export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CJFy17-g.js';
7
+ export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CEZKAEiY.js';
8
8
  export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
9
9
  import 'drizzle-orm/sqlite-core';
10
10
  import 'drizzle-orm';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/bank",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {