@develit-services/bank 1.1.11 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -396,4 +396,10 @@ Format: `{CATEGORY}-B-{NUMBER}`
396
396
  | `VALID-B-011` | 422 | Batch: debtor IBAN/currency mismatch |
397
397
  | `VALID-B-012` | 422 | Batch: payment type mismatch |
398
398
  | `VALID-B-013` | 422 | Batch: size limit exceeded |
399
+ | `VALID-B-014` | 404 | Account not found (balance) |
400
+ | `VALID-B-016` | 400 | Account configuration incomplete |
399
401
  | `SYS-B-001` | 501 | Not implemented |
402
+ | `SYS-B-002` | 400 | Account has no bankRefId |
403
+ | `SYS-B-003` | 503 | Balance data unavailable |
404
+ | `SYS-B-004` | 501 | Balance not supported by connector |
405
+ | `SYS-B-005` | 500 | Backoffice API request failed |
@@ -1,4 +1,4 @@
1
- export { az as account, aA as accountCredentials, aB as batch, aC as ott, aD as payment, aE as paymentRelations, aF as paymentRequest, aG as paymentRequestRelations } from '../shared/bank.BdPwLsVN.cjs';
1
+ export { az as account, aA as accountCredentials, aB as batch, aC as ott, aD as payment, aE as paymentRelations, aF as paymentRequest, aG as paymentRequestRelations } from '../shared/bank.seypMpK4.cjs';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import '@develit-io/backend-sdk';
@@ -1,4 +1,4 @@
1
- export { az as account, aA as accountCredentials, aB as batch, aC as ott, aD as payment, aE as paymentRelations, aF as paymentRequest, aG as paymentRequestRelations } from '../shared/bank.BdPwLsVN.mjs';
1
+ export { az as account, aA as accountCredentials, aB as batch, aC as ott, aD as payment, aE as paymentRelations, aF as paymentRequest, aG as paymentRequestRelations } from '../shared/bank.seypMpK4.mjs';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import '@develit-io/backend-sdk';
@@ -1,4 +1,4 @@
1
- export { az as account, aA as accountCredentials, aB as batch, aC as ott, aD as payment, aE as paymentRelations, aF as paymentRequest, aG as paymentRequestRelations } from '../shared/bank.BdPwLsVN.js';
1
+ export { az as account, aA as accountCredentials, aB as batch, aC as ott, aD as payment, aE as paymentRelations, aF as paymentRequest, aG as paymentRequestRelations } from '../shared/bank.seypMpK4.js';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import '@develit-io/backend-sdk';
@@ -5,7 +5,7 @@ const database_schema = require('../shared/bank.CIWYI18z.cjs');
5
5
  const drizzleOrm = require('drizzle-orm');
6
6
  const cloudflare_workers = require('cloudflare:workers');
7
7
  const d1 = require('drizzle-orm/d1');
8
- const mock_connector = require('../shared/bank.CpEGzmAr.cjs');
8
+ const mock_connector = require('../shared/bank.CSwUy2gs.cjs');
9
9
  require('jose');
10
10
  const zod = require('zod');
11
11
  const generalCodes = require('@develit-io/general-codes');
@@ -576,6 +576,10 @@ const getPaymentRequestsInputSchema = zod.z.object({
576
576
  // filterDirection: removed — payment_request is always OUTGOING
577
577
  });
578
578
 
579
+ const getAccountBalanceInputSchema = zod.z.object({
580
+ accountId: zod.z.string().uuid()
581
+ });
582
+
579
583
  var __defProp = Object.defineProperty;
580
584
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
581
585
  var __decorateClass = (decorators, target, key, kind) => {
@@ -1564,6 +1568,36 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
1564
1568
  }
1565
1569
  );
1566
1570
  }
1571
+ async getAccountBalance(input) {
1572
+ return this.handleAction(
1573
+ { data: input, schema: getAccountBalanceInputSchema },
1574
+ { successMessage: "Account balance retrieved successfully" },
1575
+ async (data) => {
1576
+ const account = await credentialsResolver.getAccountByIdQuery(this.db, {
1577
+ accountId: data.accountId
1578
+ });
1579
+ if (!account) {
1580
+ throw backendSdk.createInternalError(null, {
1581
+ message: "Account not found",
1582
+ code: "VALID-B-014",
1583
+ status: 404
1584
+ });
1585
+ }
1586
+ if (!account.bankRefId) {
1587
+ throw backendSdk.createInternalError(null, {
1588
+ message: "Account configuration incomplete",
1589
+ code: "VALID-B-016",
1590
+ status: 400
1591
+ });
1592
+ }
1593
+ const connector = await this._initiateBankConnector({
1594
+ connectorKey: account.connectorKey,
1595
+ skipAccounts: false
1596
+ });
1597
+ return await connector.getAccountBalance({ account });
1598
+ }
1599
+ );
1600
+ }
1567
1601
  async updateAccount(input) {
1568
1602
  return this.handleAction(
1569
1603
  {
@@ -1767,6 +1801,9 @@ __decorateClass([
1767
1801
  __decorateClass([
1768
1802
  backendSdk.action("get-bank-accounts")
1769
1803
  ], BankServiceBase.prototype, "getBankAccounts", 1);
1804
+ __decorateClass([
1805
+ backendSdk.action("get-account-balance")
1806
+ ], BankServiceBase.prototype, "getAccountBalance", 1);
1770
1807
  __decorateClass([
1771
1808
  backendSdk.action("update-account")
1772
1809
  ], BankServiceBase.prototype, "updateAccount", 1);
@@ -1,5 +1,5 @@
1
- import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, b as ConnectorKey, I as IBankConnector, c as PaymentType, d as CurrencyCode, H as HandleAuthorizationCallbackInput, e as HandleAuthorizationCallbackOutput } from '../shared/bank.BdPwLsVN.cjs';
2
- import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from '../shared/bank.DC_KeizP.cjs';
1
+ import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, b as ConnectorKey, I as IBankConnector, c as PaymentType, d as CurrencyCode, H as HandleAuthorizationCallbackInput, e as HandleAuthorizationCallbackOutput } from '../shared/bank.seypMpK4.cjs';
2
+ import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from '../shared/bank.Cp1MNkxw.cjs';
3
3
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
4
4
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
5
5
  import { WorkerEntrypoint } from 'cloudflare:workers';
@@ -2703,15 +2703,15 @@ declare const getBatchesInputSchema: z.ZodObject<{
2703
2703
  filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
2704
2704
  filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2705
2705
  AUTHORIZED: "AUTHORIZED";
2706
+ COMPLETED: "COMPLETED";
2706
2707
  PROCESSING: "PROCESSING";
2707
2708
  READY_TO_SIGN: "READY_TO_SIGN";
2708
- COMPLETED: "COMPLETED";
2709
2709
  FAILED: "FAILED";
2710
2710
  }>, z.ZodArray<z.ZodEnum<{
2711
2711
  AUTHORIZED: "AUTHORIZED";
2712
+ COMPLETED: "COMPLETED";
2712
2713
  PROCESSING: "PROCESSING";
2713
2714
  READY_TO_SIGN: "READY_TO_SIGN";
2714
- COMPLETED: "COMPLETED";
2715
2715
  FAILED: "FAILED";
2716
2716
  }>>]>>;
2717
2717
  }, z.core.$strip>;
@@ -2948,20 +2948,20 @@ declare const getPaymentsInputSchema: z.ZodObject<{
2948
2948
  filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
2949
2949
  filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
2950
2950
  filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2951
- PROCESSING: "PROCESSING";
2952
- PENDING: "PENDING";
2953
2951
  BOOKED: "BOOKED";
2954
- CANCELLED: "CANCELLED";
2955
2952
  REJECTED: "REJECTED";
2953
+ PENDING: "PENDING";
2954
+ PROCESSING: "PROCESSING";
2955
+ CANCELLED: "CANCELLED";
2956
2956
  SCHEDULED: "SCHEDULED";
2957
2957
  HOLD: "HOLD";
2958
2958
  INFO: "INFO";
2959
2959
  }>, z.ZodArray<z.ZodEnum<{
2960
- PROCESSING: "PROCESSING";
2961
- PENDING: "PENDING";
2962
2960
  BOOKED: "BOOKED";
2963
- CANCELLED: "CANCELLED";
2964
2961
  REJECTED: "REJECTED";
2962
+ PENDING: "PENDING";
2963
+ PROCESSING: "PROCESSING";
2964
+ CANCELLED: "CANCELLED";
2965
2965
  SCHEDULED: "SCHEDULED";
2966
2966
  HOLD: "HOLD";
2967
2967
  INFO: "INFO";
@@ -3914,19 +3914,19 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
3914
3914
  filterAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
3915
3915
  filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
3916
3916
  AUTHORIZED: "AUTHORIZED";
3917
+ OPENED: "OPENED";
3917
3918
  COMPLETED: "COMPLETED";
3918
3919
  BOOKED: "BOOKED";
3919
- REJECTED: "REJECTED";
3920
- OPENED: "OPENED";
3921
3920
  SETTLED: "SETTLED";
3921
+ REJECTED: "REJECTED";
3922
3922
  CLOSED: "CLOSED";
3923
3923
  }>, z.ZodArray<z.ZodEnum<{
3924
3924
  AUTHORIZED: "AUTHORIZED";
3925
+ OPENED: "OPENED";
3925
3926
  COMPLETED: "COMPLETED";
3926
3927
  BOOKED: "BOOKED";
3927
- REJECTED: "REJECTED";
3928
- OPENED: "OPENED";
3929
3928
  SETTLED: "SETTLED";
3929
+ REJECTED: "REJECTED";
3930
3930
  CLOSED: "CLOSED";
3931
3931
  }>>]>>;
3932
3932
  filterPaymentType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
@@ -4072,6 +4072,21 @@ type GetPaymentRequestOutput = {
4072
4072
  paymentRequest: PaymentRequestSelectType;
4073
4073
  };
4074
4074
 
4075
+ declare const getAccountBalanceInputSchema: z.ZodObject<{
4076
+ accountId: z.ZodString;
4077
+ }, z.core.$strip>;
4078
+ type GetAccountBalanceInput = z.input<typeof getAccountBalanceInputSchema>;
4079
+ type GetAccountBalanceOutput = {
4080
+ balances: Array<{
4081
+ amount: {
4082
+ value: number;
4083
+ currency: string;
4084
+ };
4085
+ balanceType: 'AVAILABLE' | 'VALUTA' | 'GPE_AVAILABLE' | 'MULTI_AVAILABLE';
4086
+ balanceDate: Date;
4087
+ }>;
4088
+ };
4089
+
4075
4090
  declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
4076
4091
  declare class BankServiceBase extends BankServiceBase_base {
4077
4092
  readonly db: DrizzleD1Database<typeof tables>;
@@ -4228,6 +4243,7 @@ declare class BankServiceBase extends BankServiceBase_base {
4228
4243
  */
4229
4244
  sendBatch(input: SendBatchInput): Promise<IRPCResponse<SendBatchOutput>>;
4230
4245
  getBankAccounts(input: GetBankAccountsInput): Promise<IRPCResponse<GetBankAccountsOutput>>;
4246
+ getAccountBalance(input: GetAccountBalanceInput): Promise<IRPCResponse<GetAccountBalanceOutput>>;
4231
4247
  updateAccount(input: UpdateAccountInput): Promise<IRPCResponse<UpdateAccountOutput>>;
4232
4248
  disconnectAccount(input: DisconnectAccountInput): Promise<IRPCResponse<DisconnectAccountOutput>>;
4233
4249
  getBatches(input: GetBatchesInput): Promise<IRPCResponse<GetBatchesOutput>>;
@@ -4239,6 +4255,6 @@ declare class BankServiceBase extends BankServiceBase_base {
4239
4255
  }
4240
4256
  declare function defineBankService({ config, }: {
4241
4257
  config: ConfigEnvironmentBank;
4242
- }): new (ctx: ExecutionContext, env: BankEnv) => BankServiceBase;
4258
+ }): typeof BankServiceBase;
4243
4259
 
4244
4260
  export { defineBankService };
@@ -1,5 +1,5 @@
1
- import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, b as ConnectorKey, I as IBankConnector, c as PaymentType, d as CurrencyCode, H as HandleAuthorizationCallbackInput, e as HandleAuthorizationCallbackOutput } from '../shared/bank.BdPwLsVN.mjs';
2
- import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from '../shared/bank.0qMwPptW.mjs';
1
+ import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, b as ConnectorKey, I as IBankConnector, c as PaymentType, d as CurrencyCode, H as HandleAuthorizationCallbackInput, e as HandleAuthorizationCallbackOutput } from '../shared/bank.seypMpK4.mjs';
2
+ import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from '../shared/bank.BW-Ts5Zr.mjs';
3
3
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
4
4
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
5
5
  import { WorkerEntrypoint } from 'cloudflare:workers';
@@ -2703,15 +2703,15 @@ declare const getBatchesInputSchema: z.ZodObject<{
2703
2703
  filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
2704
2704
  filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2705
2705
  AUTHORIZED: "AUTHORIZED";
2706
+ COMPLETED: "COMPLETED";
2706
2707
  PROCESSING: "PROCESSING";
2707
2708
  READY_TO_SIGN: "READY_TO_SIGN";
2708
- COMPLETED: "COMPLETED";
2709
2709
  FAILED: "FAILED";
2710
2710
  }>, z.ZodArray<z.ZodEnum<{
2711
2711
  AUTHORIZED: "AUTHORIZED";
2712
+ COMPLETED: "COMPLETED";
2712
2713
  PROCESSING: "PROCESSING";
2713
2714
  READY_TO_SIGN: "READY_TO_SIGN";
2714
- COMPLETED: "COMPLETED";
2715
2715
  FAILED: "FAILED";
2716
2716
  }>>]>>;
2717
2717
  }, z.core.$strip>;
@@ -2948,20 +2948,20 @@ declare const getPaymentsInputSchema: z.ZodObject<{
2948
2948
  filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
2949
2949
  filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
2950
2950
  filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2951
- PROCESSING: "PROCESSING";
2952
- PENDING: "PENDING";
2953
2951
  BOOKED: "BOOKED";
2954
- CANCELLED: "CANCELLED";
2955
2952
  REJECTED: "REJECTED";
2953
+ PENDING: "PENDING";
2954
+ PROCESSING: "PROCESSING";
2955
+ CANCELLED: "CANCELLED";
2956
2956
  SCHEDULED: "SCHEDULED";
2957
2957
  HOLD: "HOLD";
2958
2958
  INFO: "INFO";
2959
2959
  }>, z.ZodArray<z.ZodEnum<{
2960
- PROCESSING: "PROCESSING";
2961
- PENDING: "PENDING";
2962
2960
  BOOKED: "BOOKED";
2963
- CANCELLED: "CANCELLED";
2964
2961
  REJECTED: "REJECTED";
2962
+ PENDING: "PENDING";
2963
+ PROCESSING: "PROCESSING";
2964
+ CANCELLED: "CANCELLED";
2965
2965
  SCHEDULED: "SCHEDULED";
2966
2966
  HOLD: "HOLD";
2967
2967
  INFO: "INFO";
@@ -3914,19 +3914,19 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
3914
3914
  filterAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
3915
3915
  filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
3916
3916
  AUTHORIZED: "AUTHORIZED";
3917
+ OPENED: "OPENED";
3917
3918
  COMPLETED: "COMPLETED";
3918
3919
  BOOKED: "BOOKED";
3919
- REJECTED: "REJECTED";
3920
- OPENED: "OPENED";
3921
3920
  SETTLED: "SETTLED";
3921
+ REJECTED: "REJECTED";
3922
3922
  CLOSED: "CLOSED";
3923
3923
  }>, z.ZodArray<z.ZodEnum<{
3924
3924
  AUTHORIZED: "AUTHORIZED";
3925
+ OPENED: "OPENED";
3925
3926
  COMPLETED: "COMPLETED";
3926
3927
  BOOKED: "BOOKED";
3927
- REJECTED: "REJECTED";
3928
- OPENED: "OPENED";
3929
3928
  SETTLED: "SETTLED";
3929
+ REJECTED: "REJECTED";
3930
3930
  CLOSED: "CLOSED";
3931
3931
  }>>]>>;
3932
3932
  filterPaymentType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
@@ -4072,6 +4072,21 @@ type GetPaymentRequestOutput = {
4072
4072
  paymentRequest: PaymentRequestSelectType;
4073
4073
  };
4074
4074
 
4075
+ declare const getAccountBalanceInputSchema: z.ZodObject<{
4076
+ accountId: z.ZodString;
4077
+ }, z.core.$strip>;
4078
+ type GetAccountBalanceInput = z.input<typeof getAccountBalanceInputSchema>;
4079
+ type GetAccountBalanceOutput = {
4080
+ balances: Array<{
4081
+ amount: {
4082
+ value: number;
4083
+ currency: string;
4084
+ };
4085
+ balanceType: 'AVAILABLE' | 'VALUTA' | 'GPE_AVAILABLE' | 'MULTI_AVAILABLE';
4086
+ balanceDate: Date;
4087
+ }>;
4088
+ };
4089
+
4075
4090
  declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
4076
4091
  declare class BankServiceBase extends BankServiceBase_base {
4077
4092
  readonly db: DrizzleD1Database<typeof tables>;
@@ -4228,6 +4243,7 @@ declare class BankServiceBase extends BankServiceBase_base {
4228
4243
  */
4229
4244
  sendBatch(input: SendBatchInput): Promise<IRPCResponse<SendBatchOutput>>;
4230
4245
  getBankAccounts(input: GetBankAccountsInput): Promise<IRPCResponse<GetBankAccountsOutput>>;
4246
+ getAccountBalance(input: GetAccountBalanceInput): Promise<IRPCResponse<GetAccountBalanceOutput>>;
4231
4247
  updateAccount(input: UpdateAccountInput): Promise<IRPCResponse<UpdateAccountOutput>>;
4232
4248
  disconnectAccount(input: DisconnectAccountInput): Promise<IRPCResponse<DisconnectAccountOutput>>;
4233
4249
  getBatches(input: GetBatchesInput): Promise<IRPCResponse<GetBatchesOutput>>;
@@ -4239,6 +4255,6 @@ declare class BankServiceBase extends BankServiceBase_base {
4239
4255
  }
4240
4256
  declare function defineBankService({ config, }: {
4241
4257
  config: ConfigEnvironmentBank;
4242
- }): new (ctx: ExecutionContext, env: BankEnv) => BankServiceBase;
4258
+ }): typeof BankServiceBase;
4243
4259
 
4244
4260
  export { defineBankService };
@@ -1,5 +1,5 @@
1
- import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, b as ConnectorKey, I as IBankConnector, c as PaymentType, d as CurrencyCode, H as HandleAuthorizationCallbackInput, e as HandleAuthorizationCallbackOutput } from '../shared/bank.BdPwLsVN.js';
2
- import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from '../shared/bank.pwjbFn6Q.js';
1
+ import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, b as ConnectorKey, I as IBankConnector, c as PaymentType, d as CurrencyCode, H as HandleAuthorizationCallbackInput, e as HandleAuthorizationCallbackOutput } from '../shared/bank.seypMpK4.js';
2
+ import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from '../shared/bank.Cwj4uNY5.js';
3
3
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
4
4
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
5
5
  import { WorkerEntrypoint } from 'cloudflare:workers';
@@ -2703,15 +2703,15 @@ declare const getBatchesInputSchema: z.ZodObject<{
2703
2703
  filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
2704
2704
  filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2705
2705
  AUTHORIZED: "AUTHORIZED";
2706
+ COMPLETED: "COMPLETED";
2706
2707
  PROCESSING: "PROCESSING";
2707
2708
  READY_TO_SIGN: "READY_TO_SIGN";
2708
- COMPLETED: "COMPLETED";
2709
2709
  FAILED: "FAILED";
2710
2710
  }>, z.ZodArray<z.ZodEnum<{
2711
2711
  AUTHORIZED: "AUTHORIZED";
2712
+ COMPLETED: "COMPLETED";
2712
2713
  PROCESSING: "PROCESSING";
2713
2714
  READY_TO_SIGN: "READY_TO_SIGN";
2714
- COMPLETED: "COMPLETED";
2715
2715
  FAILED: "FAILED";
2716
2716
  }>>]>>;
2717
2717
  }, z.core.$strip>;
@@ -2948,20 +2948,20 @@ declare const getPaymentsInputSchema: z.ZodObject<{
2948
2948
  filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
2949
2949
  filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
2950
2950
  filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2951
- PROCESSING: "PROCESSING";
2952
- PENDING: "PENDING";
2953
2951
  BOOKED: "BOOKED";
2954
- CANCELLED: "CANCELLED";
2955
2952
  REJECTED: "REJECTED";
2953
+ PENDING: "PENDING";
2954
+ PROCESSING: "PROCESSING";
2955
+ CANCELLED: "CANCELLED";
2956
2956
  SCHEDULED: "SCHEDULED";
2957
2957
  HOLD: "HOLD";
2958
2958
  INFO: "INFO";
2959
2959
  }>, z.ZodArray<z.ZodEnum<{
2960
- PROCESSING: "PROCESSING";
2961
- PENDING: "PENDING";
2962
2960
  BOOKED: "BOOKED";
2963
- CANCELLED: "CANCELLED";
2964
2961
  REJECTED: "REJECTED";
2962
+ PENDING: "PENDING";
2963
+ PROCESSING: "PROCESSING";
2964
+ CANCELLED: "CANCELLED";
2965
2965
  SCHEDULED: "SCHEDULED";
2966
2966
  HOLD: "HOLD";
2967
2967
  INFO: "INFO";
@@ -3914,19 +3914,19 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
3914
3914
  filterAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
3915
3915
  filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
3916
3916
  AUTHORIZED: "AUTHORIZED";
3917
+ OPENED: "OPENED";
3917
3918
  COMPLETED: "COMPLETED";
3918
3919
  BOOKED: "BOOKED";
3919
- REJECTED: "REJECTED";
3920
- OPENED: "OPENED";
3921
3920
  SETTLED: "SETTLED";
3921
+ REJECTED: "REJECTED";
3922
3922
  CLOSED: "CLOSED";
3923
3923
  }>, z.ZodArray<z.ZodEnum<{
3924
3924
  AUTHORIZED: "AUTHORIZED";
3925
+ OPENED: "OPENED";
3925
3926
  COMPLETED: "COMPLETED";
3926
3927
  BOOKED: "BOOKED";
3927
- REJECTED: "REJECTED";
3928
- OPENED: "OPENED";
3929
3928
  SETTLED: "SETTLED";
3929
+ REJECTED: "REJECTED";
3930
3930
  CLOSED: "CLOSED";
3931
3931
  }>>]>>;
3932
3932
  filterPaymentType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
@@ -4072,6 +4072,21 @@ type GetPaymentRequestOutput = {
4072
4072
  paymentRequest: PaymentRequestSelectType;
4073
4073
  };
4074
4074
 
4075
+ declare const getAccountBalanceInputSchema: z.ZodObject<{
4076
+ accountId: z.ZodString;
4077
+ }, z.core.$strip>;
4078
+ type GetAccountBalanceInput = z.input<typeof getAccountBalanceInputSchema>;
4079
+ type GetAccountBalanceOutput = {
4080
+ balances: Array<{
4081
+ amount: {
4082
+ value: number;
4083
+ currency: string;
4084
+ };
4085
+ balanceType: 'AVAILABLE' | 'VALUTA' | 'GPE_AVAILABLE' | 'MULTI_AVAILABLE';
4086
+ balanceDate: Date;
4087
+ }>;
4088
+ };
4089
+
4075
4090
  declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
4076
4091
  declare class BankServiceBase extends BankServiceBase_base {
4077
4092
  readonly db: DrizzleD1Database<typeof tables>;
@@ -4228,6 +4243,7 @@ declare class BankServiceBase extends BankServiceBase_base {
4228
4243
  */
4229
4244
  sendBatch(input: SendBatchInput): Promise<IRPCResponse<SendBatchOutput>>;
4230
4245
  getBankAccounts(input: GetBankAccountsInput): Promise<IRPCResponse<GetBankAccountsOutput>>;
4246
+ getAccountBalance(input: GetAccountBalanceInput): Promise<IRPCResponse<GetAccountBalanceOutput>>;
4231
4247
  updateAccount(input: UpdateAccountInput): Promise<IRPCResponse<UpdateAccountOutput>>;
4232
4248
  disconnectAccount(input: DisconnectAccountInput): Promise<IRPCResponse<DisconnectAccountOutput>>;
4233
4249
  getBatches(input: GetBatchesInput): Promise<IRPCResponse<GetBatchesOutput>>;
@@ -4239,6 +4255,6 @@ declare class BankServiceBase extends BankServiceBase_base {
4239
4255
  }
4240
4256
  declare function defineBankService({ config, }: {
4241
4257
  config: ConfigEnvironmentBank;
4242
- }): new (ctx: ExecutionContext, env: BankEnv) => BankServiceBase;
4258
+ }): typeof BankServiceBase;
4243
4259
 
4244
4260
  export { defineBankService };
@@ -3,7 +3,7 @@ import { v as tables, I as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, g as PAY
3
3
  import { eq, sql, and, like, asc, desc, inArray, gte, lte, isNull, count } from 'drizzle-orm';
4
4
  import { WorkerEntrypoint } from 'cloudflare:workers';
5
5
  import { drizzle } from 'drizzle-orm/d1';
6
- import { j as initiateConnector, g as toIncomingPayment, d as assignAccount, t as toBatchedPayment, h as toPaymentRequestInsert, a as FinbricksClient, F as FINBRICKS_ENDPOINTS } from '../shared/bank.BsKwYyaC.mjs';
6
+ import { j as initiateConnector, g as toIncomingPayment, d as assignAccount, t as toBatchedPayment, h as toPaymentRequestInsert, a as FinbricksClient, F as FINBRICKS_ENDPOINTS } from '../shared/bank.BohzZXQu.mjs';
7
7
  import 'jose';
8
8
  import { z } from 'zod';
9
9
  import { CURRENCY_CODES } from '@develit-io/general-codes';
@@ -574,6 +574,10 @@ const getPaymentRequestsInputSchema = z.object({
574
574
  // filterDirection: removed — payment_request is always OUTGOING
575
575
  });
576
576
 
577
+ const getAccountBalanceInputSchema = z.object({
578
+ accountId: z.string().uuid()
579
+ });
580
+
577
581
  var __defProp = Object.defineProperty;
578
582
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
579
583
  var __decorateClass = (decorators, target, key, kind) => {
@@ -1562,6 +1566,36 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
1562
1566
  }
1563
1567
  );
1564
1568
  }
1569
+ async getAccountBalance(input) {
1570
+ return this.handleAction(
1571
+ { data: input, schema: getAccountBalanceInputSchema },
1572
+ { successMessage: "Account balance retrieved successfully" },
1573
+ async (data) => {
1574
+ const account = await getAccountByIdQuery(this.db, {
1575
+ accountId: data.accountId
1576
+ });
1577
+ if (!account) {
1578
+ throw createInternalError(null, {
1579
+ message: "Account not found",
1580
+ code: "VALID-B-014",
1581
+ status: 404
1582
+ });
1583
+ }
1584
+ if (!account.bankRefId) {
1585
+ throw createInternalError(null, {
1586
+ message: "Account configuration incomplete",
1587
+ code: "VALID-B-016",
1588
+ status: 400
1589
+ });
1590
+ }
1591
+ const connector = await this._initiateBankConnector({
1592
+ connectorKey: account.connectorKey,
1593
+ skipAccounts: false
1594
+ });
1595
+ return await connector.getAccountBalance({ account });
1596
+ }
1597
+ );
1598
+ }
1565
1599
  async updateAccount(input) {
1566
1600
  return this.handleAction(
1567
1601
  {
@@ -1765,6 +1799,9 @@ __decorateClass([
1765
1799
  __decorateClass([
1766
1800
  action("get-bank-accounts")
1767
1801
  ], BankServiceBase.prototype, "getBankAccounts", 1);
1802
+ __decorateClass([
1803
+ action("get-account-balance")
1804
+ ], BankServiceBase.prototype, "getAccountBalance", 1);
1768
1805
  __decorateClass([
1769
1806
  action("update-account")
1770
1807
  ], BankServiceBase.prototype, "updateAccount", 1);
@@ -3,7 +3,7 @@
3
3
  const backendSdk = require('@develit-io/backend-sdk');
4
4
  const database_schema = require('../shared/bank.CIWYI18z.cjs');
5
5
  const batchLifecycle = require('../shared/bank.NF8bZBy0.cjs');
6
- const mock_connector = require('../shared/bank.CpEGzmAr.cjs');
6
+ const mock_connector = require('../shared/bank.CSwUy2gs.cjs');
7
7
  const drizzleOrm = require('drizzle-orm');
8
8
  const credentialsResolver = require('../shared/bank.B0EWZbAs.cjs');
9
9
  const cloudflare_workers = require('cloudflare:workers');
@@ -1,7 +1,7 @@
1
1
  import { first, uuidv4, asNonEmpty } from '@develit-io/backend-sdk';
2
2
  import { v as tables, o as isPaymentCompleted } from '../shared/bank.C7MA33AX.mjs';
3
3
  import { i as isBatchAuthorized, b as isBatchFailed, d as isBatchProcessing } from '../shared/bank.XqSw509X.mjs';
4
- import { e as toBatchedPaymentFromPaymentRequest, i as toPreparedPayment, j as initiateConnector } from '../shared/bank.BsKwYyaC.mjs';
4
+ import { e as toBatchedPaymentFromPaymentRequest, i as toPreparedPayment, j as initiateConnector } from '../shared/bank.BohzZXQu.mjs';
5
5
  import { eq, and, inArray } from 'drizzle-orm';
6
6
  import { g as getBatchByIdQuery, a as getPaymentRequestsByBatchIdQuery, c as checksum, u as upsertBatchCommand, b as getAccountByIdQuery, d as createCredentialsResolver, e as updatePaymentRequestStatusCommand, f as createPaymentCommand } from '../shared/bank.UBWdag5k.mjs';
7
7
  import { WorkflowEntrypoint } from 'cloudflare:workers';
@@ -1,4 +1,4 @@
1
- import { d as CurrencyCode, O as BankCode, $ as CountryCode, P as PaymentRequestSelectType } from './bank.BdPwLsVN.mjs';
1
+ import { d as CurrencyCode, O as BankCode, $ as CountryCode, P as PaymentRequestSelectType } from './bank.seypMpK4.mjs';
2
2
  import { z } from 'zod';
3
3
 
4
4
  type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
@@ -201,6 +201,19 @@ class IBankConnector {
201
201
  }
202
202
  return this.initiateForeignBatchImpl({ batchId, payments });
203
203
  }
204
+ /**
205
+ * Gets current account balance.
206
+ * Optional - not all connectors support this.
207
+ * @param account - Bank account
208
+ * @returns Balance information or throws NOT_IMPLEMENTED
209
+ */
210
+ getAccountBalance({ account }) {
211
+ throw createInternalError(null, {
212
+ message: `Balance not supported for ${this.connectorKey} connector`,
213
+ code: "SYS-B-004",
214
+ status: 501
215
+ });
216
+ }
204
217
  }
205
218
 
206
219
  function buildEndToEndId(payment) {
@@ -1320,7 +1333,7 @@ class DbuConnector extends IBankConnector {
1320
1333
  this.sessionId = uuidv4();
1321
1334
  this.allowedPostEndpoints = [
1322
1335
  "/required-transactions",
1323
- "/required-transactions/instant-payments",
1336
+ "/required-transactions/payments/instant",
1324
1337
  "/import/data"
1325
1338
  ];
1326
1339
  }
@@ -1579,7 +1592,7 @@ class DbuConnector extends IBankConnector {
1579
1592
  applicationCode: this.applicationCode
1580
1593
  };
1581
1594
  const response = await this.makeRequest(
1582
- "/required-transactions/instant-payments",
1595
+ "/required-transactions/payments/instant",
1583
1596
  payment.correlationId,
1584
1597
  {
1585
1598
  method: "POST",
@@ -1739,6 +1752,59 @@ class DbuConnector extends IBankConnector {
1739
1752
  );
1740
1753
  return this.mapDbuStatusToPaymentRequestStatus(response.status);
1741
1754
  }
1755
+ async getAccountBalance({
1756
+ account
1757
+ }) {
1758
+ if (!account.bankRefId) {
1759
+ throw createInternalError(null, {
1760
+ message: "Account configuration incomplete",
1761
+ code: "SYS-B-002",
1762
+ status: 400
1763
+ });
1764
+ }
1765
+ const requestId = uuidv4();
1766
+ let response;
1767
+ try {
1768
+ response = await this.makeRequest(
1769
+ `/accounts/${account.bankRefId}/balance`,
1770
+ requestId,
1771
+ {
1772
+ method: "GET",
1773
+ query: {
1774
+ balanceType: "AVAILABLE"
1775
+ }
1776
+ }
1777
+ );
1778
+ } catch (error) {
1779
+ throw createInternalError(error, {
1780
+ message: `Failed to fetch account balance from Backoffice API for ${account.iban}`,
1781
+ code: "SYS-B-005",
1782
+ status: 500
1783
+ });
1784
+ }
1785
+ const balanceRecord = response.balances?.balance?.find(
1786
+ (b) => b.balanceType === "AVAILABLE"
1787
+ );
1788
+ if (!balanceRecord) {
1789
+ throw createInternalError(null, {
1790
+ message: "Available balance not found",
1791
+ code: "SYS-B-003",
1792
+ status: 503
1793
+ });
1794
+ }
1795
+ return {
1796
+ balances: [
1797
+ {
1798
+ amount: {
1799
+ value: balanceRecord.accountBalance,
1800
+ currency: balanceRecord.currencyCode
1801
+ },
1802
+ balanceType: balanceRecord.balanceType,
1803
+ balanceDate: /* @__PURE__ */ new Date()
1804
+ }
1805
+ ]
1806
+ };
1807
+ }
1742
1808
  parseAuthorizationCallback(callbackUrl) {
1743
1809
  const url = new URL(callbackUrl);
1744
1810
  const params = url.searchParams;
@@ -203,6 +203,19 @@ class IBankConnector {
203
203
  }
204
204
  return this.initiateForeignBatchImpl({ batchId, payments });
205
205
  }
206
+ /**
207
+ * Gets current account balance.
208
+ * Optional - not all connectors support this.
209
+ * @param account - Bank account
210
+ * @returns Balance information or throws NOT_IMPLEMENTED
211
+ */
212
+ getAccountBalance({ account }) {
213
+ throw backendSdk.createInternalError(null, {
214
+ message: `Balance not supported for ${this.connectorKey} connector`,
215
+ code: "SYS-B-004",
216
+ status: 501
217
+ });
218
+ }
206
219
  }
207
220
 
208
221
  function buildEndToEndId(payment) {
@@ -1322,7 +1335,7 @@ class DbuConnector extends IBankConnector {
1322
1335
  this.sessionId = backendSdk.uuidv4();
1323
1336
  this.allowedPostEndpoints = [
1324
1337
  "/required-transactions",
1325
- "/required-transactions/instant-payments",
1338
+ "/required-transactions/payments/instant",
1326
1339
  "/import/data"
1327
1340
  ];
1328
1341
  }
@@ -1581,7 +1594,7 @@ class DbuConnector extends IBankConnector {
1581
1594
  applicationCode: this.applicationCode
1582
1595
  };
1583
1596
  const response = await this.makeRequest(
1584
- "/required-transactions/instant-payments",
1597
+ "/required-transactions/payments/instant",
1585
1598
  payment.correlationId,
1586
1599
  {
1587
1600
  method: "POST",
@@ -1741,6 +1754,59 @@ class DbuConnector extends IBankConnector {
1741
1754
  );
1742
1755
  return this.mapDbuStatusToPaymentRequestStatus(response.status);
1743
1756
  }
1757
+ async getAccountBalance({
1758
+ account
1759
+ }) {
1760
+ if (!account.bankRefId) {
1761
+ throw backendSdk.createInternalError(null, {
1762
+ message: "Account configuration incomplete",
1763
+ code: "SYS-B-002",
1764
+ status: 400
1765
+ });
1766
+ }
1767
+ const requestId = backendSdk.uuidv4();
1768
+ let response;
1769
+ try {
1770
+ response = await this.makeRequest(
1771
+ `/accounts/${account.bankRefId}/balance`,
1772
+ requestId,
1773
+ {
1774
+ method: "GET",
1775
+ query: {
1776
+ balanceType: "AVAILABLE"
1777
+ }
1778
+ }
1779
+ );
1780
+ } catch (error) {
1781
+ throw backendSdk.createInternalError(error, {
1782
+ message: `Failed to fetch account balance from Backoffice API for ${account.iban}`,
1783
+ code: "SYS-B-005",
1784
+ status: 500
1785
+ });
1786
+ }
1787
+ const balanceRecord = response.balances?.balance?.find(
1788
+ (b) => b.balanceType === "AVAILABLE"
1789
+ );
1790
+ if (!balanceRecord) {
1791
+ throw backendSdk.createInternalError(null, {
1792
+ message: "Available balance not found",
1793
+ code: "SYS-B-003",
1794
+ status: 503
1795
+ });
1796
+ }
1797
+ return {
1798
+ balances: [
1799
+ {
1800
+ amount: {
1801
+ value: balanceRecord.accountBalance,
1802
+ currency: balanceRecord.currencyCode
1803
+ },
1804
+ balanceType: balanceRecord.balanceType,
1805
+ balanceDate: /* @__PURE__ */ new Date()
1806
+ }
1807
+ ]
1808
+ };
1809
+ }
1744
1810
  parseAuthorizationCallback(callbackUrl) {
1745
1811
  const url = new URL(callbackUrl);
1746
1812
  const params = url.searchParams;
@@ -1,4 +1,4 @@
1
- import { d as CurrencyCode, O as BankCode, $ as CountryCode, P as PaymentRequestSelectType } from './bank.BdPwLsVN.cjs';
1
+ import { d as CurrencyCode, O as BankCode, $ as CountryCode, P as PaymentRequestSelectType } from './bank.seypMpK4.cjs';
2
2
  import { z } from 'zod';
3
3
 
4
4
  type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
@@ -1,4 +1,4 @@
1
- import { d as CurrencyCode, O as BankCode, $ as CountryCode, P as PaymentRequestSelectType } from './bank.BdPwLsVN.js';
1
+ import { d as CurrencyCode, O as BankCode, $ as CountryCode, P as PaymentRequestSelectType } from './bank.seypMpK4.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
@@ -271,6 +271,24 @@ declare abstract class IBankConnector {
271
271
  * @returns Parsed result — either success (with paymentRequestId or batchId) or error
272
272
  */
273
273
  abstract parseAuthorizationCallback(callbackUrl: string): AuthorizationCallbackResult;
274
+ /**
275
+ * Gets current account balance.
276
+ * Optional - not all connectors support this.
277
+ * @param account - Bank account
278
+ * @returns Balance information or throws NOT_IMPLEMENTED
279
+ */
280
+ getAccountBalance({ account }: {
281
+ account: AccountSelectType;
282
+ }): Promise<{
283
+ balances: Array<{
284
+ amount: {
285
+ value: number;
286
+ currency: string;
287
+ };
288
+ balanceType: 'AVAILABLE' | 'VALUTA' | 'GPE_AVAILABLE' | 'MULTI_AVAILABLE';
289
+ balanceDate: Date;
290
+ }>;
291
+ }>;
274
292
  }
275
293
 
276
294
  declare const accountCredentialsInsertSchema: drizzle_zod.BuildSchema<"insert", {
@@ -3317,7 +3335,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3317
3335
  tableName: "batch";
3318
3336
  dataType: "string";
3319
3337
  columnType: "SQLiteText";
3320
- data: "AUTHORIZED" | "PROCESSING" | "READY_TO_SIGN" | "COMPLETED" | "FAILED";
3338
+ data: "AUTHORIZED" | "COMPLETED" | "PROCESSING" | "READY_TO_SIGN" | "FAILED";
3321
3339
  driverParam: string;
3322
3340
  notNull: false;
3323
3341
  hasDefault: false;
@@ -3330,7 +3348,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3330
3348
  generated: undefined;
3331
3349
  }, {}, {
3332
3350
  length: number | undefined;
3333
- $type: "AUTHORIZED" | "PROCESSING" | "READY_TO_SIGN" | "COMPLETED" | "FAILED";
3351
+ $type: "AUTHORIZED" | "COMPLETED" | "PROCESSING" | "READY_TO_SIGN" | "FAILED";
3334
3352
  }>;
3335
3353
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
3336
3354
  name: "status_reason";
@@ -3761,7 +3779,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3761
3779
  tableName: "payment";
3762
3780
  dataType: "string";
3763
3781
  columnType: "SQLiteText";
3764
- data: "PROCESSING" | "PENDING" | "BOOKED" | "CANCELLED" | "REJECTED" | "SCHEDULED" | "HOLD" | "INFO";
3782
+ data: "BOOKED" | "REJECTED" | "PENDING" | "PROCESSING" | "CANCELLED" | "SCHEDULED" | "HOLD" | "INFO";
3765
3783
  driverParam: string;
3766
3784
  notNull: true;
3767
3785
  hasDefault: false;
@@ -3774,7 +3792,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3774
3792
  generated: undefined;
3775
3793
  }, {}, {
3776
3794
  length: number | undefined;
3777
- $type: "PROCESSING" | "PENDING" | "BOOKED" | "CANCELLED" | "REJECTED" | "SCHEDULED" | "HOLD" | "INFO";
3795
+ $type: "BOOKED" | "REJECTED" | "PENDING" | "PROCESSING" | "CANCELLED" | "SCHEDULED" | "HOLD" | "INFO";
3778
3796
  }>;
3779
3797
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
3780
3798
  name: "status_reason";
@@ -4355,7 +4373,7 @@ declare const paymentRequest: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
4355
4373
  tableName: "payment_request";
4356
4374
  dataType: "string";
4357
4375
  columnType: "SQLiteText";
4358
- data: "AUTHORIZED" | "COMPLETED" | "BOOKED" | "REJECTED" | "OPENED" | "SETTLED" | "CLOSED";
4376
+ data: "AUTHORIZED" | "OPENED" | "COMPLETED" | "BOOKED" | "SETTLED" | "REJECTED" | "CLOSED";
4359
4377
  driverParam: string;
4360
4378
  notNull: true;
4361
4379
  hasDefault: false;
@@ -4368,7 +4386,7 @@ declare const paymentRequest: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
4368
4386
  generated: undefined;
4369
4387
  }, {}, {
4370
4388
  length: number | undefined;
4371
- $type: "AUTHORIZED" | "COMPLETED" | "BOOKED" | "REJECTED" | "OPENED" | "SETTLED" | "CLOSED";
4389
+ $type: "AUTHORIZED" | "OPENED" | "COMPLETED" | "BOOKED" | "SETTLED" | "REJECTED" | "CLOSED";
4372
4390
  }>;
4373
4391
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
4374
4392
  name: "status_reason";
@@ -271,6 +271,24 @@ declare abstract class IBankConnector {
271
271
  * @returns Parsed result — either success (with paymentRequestId or batchId) or error
272
272
  */
273
273
  abstract parseAuthorizationCallback(callbackUrl: string): AuthorizationCallbackResult;
274
+ /**
275
+ * Gets current account balance.
276
+ * Optional - not all connectors support this.
277
+ * @param account - Bank account
278
+ * @returns Balance information or throws NOT_IMPLEMENTED
279
+ */
280
+ getAccountBalance({ account }: {
281
+ account: AccountSelectType;
282
+ }): Promise<{
283
+ balances: Array<{
284
+ amount: {
285
+ value: number;
286
+ currency: string;
287
+ };
288
+ balanceType: 'AVAILABLE' | 'VALUTA' | 'GPE_AVAILABLE' | 'MULTI_AVAILABLE';
289
+ balanceDate: Date;
290
+ }>;
291
+ }>;
274
292
  }
275
293
 
276
294
  declare const accountCredentialsInsertSchema: drizzle_zod.BuildSchema<"insert", {
@@ -3317,7 +3335,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3317
3335
  tableName: "batch";
3318
3336
  dataType: "string";
3319
3337
  columnType: "SQLiteText";
3320
- data: "AUTHORIZED" | "PROCESSING" | "READY_TO_SIGN" | "COMPLETED" | "FAILED";
3338
+ data: "AUTHORIZED" | "COMPLETED" | "PROCESSING" | "READY_TO_SIGN" | "FAILED";
3321
3339
  driverParam: string;
3322
3340
  notNull: false;
3323
3341
  hasDefault: false;
@@ -3330,7 +3348,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3330
3348
  generated: undefined;
3331
3349
  }, {}, {
3332
3350
  length: number | undefined;
3333
- $type: "AUTHORIZED" | "PROCESSING" | "READY_TO_SIGN" | "COMPLETED" | "FAILED";
3351
+ $type: "AUTHORIZED" | "COMPLETED" | "PROCESSING" | "READY_TO_SIGN" | "FAILED";
3334
3352
  }>;
3335
3353
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
3336
3354
  name: "status_reason";
@@ -3761,7 +3779,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3761
3779
  tableName: "payment";
3762
3780
  dataType: "string";
3763
3781
  columnType: "SQLiteText";
3764
- data: "PROCESSING" | "PENDING" | "BOOKED" | "CANCELLED" | "REJECTED" | "SCHEDULED" | "HOLD" | "INFO";
3782
+ data: "BOOKED" | "REJECTED" | "PENDING" | "PROCESSING" | "CANCELLED" | "SCHEDULED" | "HOLD" | "INFO";
3765
3783
  driverParam: string;
3766
3784
  notNull: true;
3767
3785
  hasDefault: false;
@@ -3774,7 +3792,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3774
3792
  generated: undefined;
3775
3793
  }, {}, {
3776
3794
  length: number | undefined;
3777
- $type: "PROCESSING" | "PENDING" | "BOOKED" | "CANCELLED" | "REJECTED" | "SCHEDULED" | "HOLD" | "INFO";
3795
+ $type: "BOOKED" | "REJECTED" | "PENDING" | "PROCESSING" | "CANCELLED" | "SCHEDULED" | "HOLD" | "INFO";
3778
3796
  }>;
3779
3797
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
3780
3798
  name: "status_reason";
@@ -4355,7 +4373,7 @@ declare const paymentRequest: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
4355
4373
  tableName: "payment_request";
4356
4374
  dataType: "string";
4357
4375
  columnType: "SQLiteText";
4358
- data: "AUTHORIZED" | "COMPLETED" | "BOOKED" | "REJECTED" | "OPENED" | "SETTLED" | "CLOSED";
4376
+ data: "AUTHORIZED" | "OPENED" | "COMPLETED" | "BOOKED" | "SETTLED" | "REJECTED" | "CLOSED";
4359
4377
  driverParam: string;
4360
4378
  notNull: true;
4361
4379
  hasDefault: false;
@@ -4368,7 +4386,7 @@ declare const paymentRequest: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
4368
4386
  generated: undefined;
4369
4387
  }, {}, {
4370
4388
  length: number | undefined;
4371
- $type: "AUTHORIZED" | "COMPLETED" | "BOOKED" | "REJECTED" | "OPENED" | "SETTLED" | "CLOSED";
4389
+ $type: "AUTHORIZED" | "OPENED" | "COMPLETED" | "BOOKED" | "SETTLED" | "REJECTED" | "CLOSED";
4372
4390
  }>;
4373
4391
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
4374
4392
  name: "status_reason";
@@ -271,6 +271,24 @@ declare abstract class IBankConnector {
271
271
  * @returns Parsed result — either success (with paymentRequestId or batchId) or error
272
272
  */
273
273
  abstract parseAuthorizationCallback(callbackUrl: string): AuthorizationCallbackResult;
274
+ /**
275
+ * Gets current account balance.
276
+ * Optional - not all connectors support this.
277
+ * @param account - Bank account
278
+ * @returns Balance information or throws NOT_IMPLEMENTED
279
+ */
280
+ getAccountBalance({ account }: {
281
+ account: AccountSelectType;
282
+ }): Promise<{
283
+ balances: Array<{
284
+ amount: {
285
+ value: number;
286
+ currency: string;
287
+ };
288
+ balanceType: 'AVAILABLE' | 'VALUTA' | 'GPE_AVAILABLE' | 'MULTI_AVAILABLE';
289
+ balanceDate: Date;
290
+ }>;
291
+ }>;
274
292
  }
275
293
 
276
294
  declare const accountCredentialsInsertSchema: drizzle_zod.BuildSchema<"insert", {
@@ -3317,7 +3335,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3317
3335
  tableName: "batch";
3318
3336
  dataType: "string";
3319
3337
  columnType: "SQLiteText";
3320
- data: "AUTHORIZED" | "PROCESSING" | "READY_TO_SIGN" | "COMPLETED" | "FAILED";
3338
+ data: "AUTHORIZED" | "COMPLETED" | "PROCESSING" | "READY_TO_SIGN" | "FAILED";
3321
3339
  driverParam: string;
3322
3340
  notNull: false;
3323
3341
  hasDefault: false;
@@ -3330,7 +3348,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3330
3348
  generated: undefined;
3331
3349
  }, {}, {
3332
3350
  length: number | undefined;
3333
- $type: "AUTHORIZED" | "PROCESSING" | "READY_TO_SIGN" | "COMPLETED" | "FAILED";
3351
+ $type: "AUTHORIZED" | "COMPLETED" | "PROCESSING" | "READY_TO_SIGN" | "FAILED";
3334
3352
  }>;
3335
3353
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
3336
3354
  name: "status_reason";
@@ -3761,7 +3779,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3761
3779
  tableName: "payment";
3762
3780
  dataType: "string";
3763
3781
  columnType: "SQLiteText";
3764
- data: "PROCESSING" | "PENDING" | "BOOKED" | "CANCELLED" | "REJECTED" | "SCHEDULED" | "HOLD" | "INFO";
3782
+ data: "BOOKED" | "REJECTED" | "PENDING" | "PROCESSING" | "CANCELLED" | "SCHEDULED" | "HOLD" | "INFO";
3765
3783
  driverParam: string;
3766
3784
  notNull: true;
3767
3785
  hasDefault: false;
@@ -3774,7 +3792,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3774
3792
  generated: undefined;
3775
3793
  }, {}, {
3776
3794
  length: number | undefined;
3777
- $type: "PROCESSING" | "PENDING" | "BOOKED" | "CANCELLED" | "REJECTED" | "SCHEDULED" | "HOLD" | "INFO";
3795
+ $type: "BOOKED" | "REJECTED" | "PENDING" | "PROCESSING" | "CANCELLED" | "SCHEDULED" | "HOLD" | "INFO";
3778
3796
  }>;
3779
3797
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
3780
3798
  name: "status_reason";
@@ -4355,7 +4373,7 @@ declare const paymentRequest: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
4355
4373
  tableName: "payment_request";
4356
4374
  dataType: "string";
4357
4375
  columnType: "SQLiteText";
4358
- data: "AUTHORIZED" | "COMPLETED" | "BOOKED" | "REJECTED" | "OPENED" | "SETTLED" | "CLOSED";
4376
+ data: "AUTHORIZED" | "OPENED" | "COMPLETED" | "BOOKED" | "SETTLED" | "REJECTED" | "CLOSED";
4359
4377
  driverParam: string;
4360
4378
  notNull: true;
4361
4379
  hasDefault: false;
@@ -4368,7 +4386,7 @@ declare const paymentRequest: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
4368
4386
  generated: undefined;
4369
4387
  }, {}, {
4370
4388
  length: number | undefined;
4371
- $type: "AUTHORIZED" | "COMPLETED" | "BOOKED" | "REJECTED" | "OPENED" | "SETTLED" | "CLOSED";
4389
+ $type: "AUTHORIZED" | "OPENED" | "COMPLETED" | "BOOKED" | "SETTLED" | "REJECTED" | "CLOSED";
4372
4390
  }>;
4373
4391
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
4374
4392
  name: "status_reason";
package/dist/types.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const mock_connector = require('./shared/bank.CpEGzmAr.cjs');
3
+ const mock_connector = require('./shared/bank.CSwUy2gs.cjs');
4
4
  const database_schema = require('./shared/bank.CIWYI18z.cjs');
5
5
  const batchLifecycle = require('./shared/bank.NF8bZBy0.cjs');
6
6
  const generalCodes = require('@develit-io/general-codes');
package/dist/types.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, s as AccountAssignedPayment, u as PreparedPayment, v as CompletedPayment, w as PaymentRequestInsertType } from './shared/bank.BdPwLsVN.cjs';
2
- export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted, aw as isPendingStatus, ax as isProcessedStatus, ay as isTerminalStatus } from './shared/bank.BdPwLsVN.cjs';
3
- import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.DC_KeizP.cjs';
4
- export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.DC_KeizP.cjs';
1
+ import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, s as AccountAssignedPayment, u as PreparedPayment, v as CompletedPayment, w as PaymentRequestInsertType } from './shared/bank.seypMpK4.cjs';
2
+ export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted, aw as isPendingStatus, ax as isProcessedStatus, ay as isTerminalStatus } from './shared/bank.seypMpK4.cjs';
3
+ import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.Cp1MNkxw.cjs';
4
+ export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.Cp1MNkxw.cjs';
5
5
  export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CVJosema.cjs';
6
6
  import { BaseEvent } from '@develit-io/backend-sdk';
7
7
  import * as drizzle_zod from 'drizzle-zod';
@@ -368,6 +368,18 @@ declare class DbuConnector extends IBankConnector {
368
368
  getPaymentStatus({ paymentId, }: {
369
369
  paymentId: string;
370
370
  }): Promise<PaymentRequestStatus>;
371
+ getAccountBalance({ account, }: {
372
+ account: AccountSelectType;
373
+ }): Promise<{
374
+ balances: Array<{
375
+ amount: {
376
+ value: number;
377
+ currency: string;
378
+ };
379
+ balanceType: 'AVAILABLE' | 'VALUTA' | 'GPE_AVAILABLE' | 'MULTI_AVAILABLE';
380
+ balanceDate: Date;
381
+ }>;
382
+ }>;
371
383
  parseAuthorizationCallback(callbackUrl: string): AuthorizationCallbackResult;
372
384
  }
373
385
 
package/dist/types.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, s as AccountAssignedPayment, u as PreparedPayment, v as CompletedPayment, w as PaymentRequestInsertType } from './shared/bank.BdPwLsVN.mjs';
2
- export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted, aw as isPendingStatus, ax as isProcessedStatus, ay as isTerminalStatus } from './shared/bank.BdPwLsVN.mjs';
3
- import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.0qMwPptW.mjs';
4
- export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.0qMwPptW.mjs';
1
+ import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, s as AccountAssignedPayment, u as PreparedPayment, v as CompletedPayment, w as PaymentRequestInsertType } from './shared/bank.seypMpK4.mjs';
2
+ export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted, aw as isPendingStatus, ax as isProcessedStatus, ay as isTerminalStatus } from './shared/bank.seypMpK4.mjs';
3
+ import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.BW-Ts5Zr.mjs';
4
+ export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.BW-Ts5Zr.mjs';
5
5
  export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CVJosema.mjs';
6
6
  import { BaseEvent } from '@develit-io/backend-sdk';
7
7
  import * as drizzle_zod from 'drizzle-zod';
@@ -368,6 +368,18 @@ declare class DbuConnector extends IBankConnector {
368
368
  getPaymentStatus({ paymentId, }: {
369
369
  paymentId: string;
370
370
  }): Promise<PaymentRequestStatus>;
371
+ getAccountBalance({ account, }: {
372
+ account: AccountSelectType;
373
+ }): Promise<{
374
+ balances: Array<{
375
+ amount: {
376
+ value: number;
377
+ currency: string;
378
+ };
379
+ balanceType: 'AVAILABLE' | 'VALUTA' | 'GPE_AVAILABLE' | 'MULTI_AVAILABLE';
380
+ balanceDate: Date;
381
+ }>;
382
+ }>;
371
383
  parseAuthorizationCallback(callbackUrl: string): AuthorizationCallbackResult;
372
384
  }
373
385
 
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, s as AccountAssignedPayment, u as PreparedPayment, v as CompletedPayment, w as PaymentRequestInsertType } from './shared/bank.BdPwLsVN.js';
2
- export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted, aw as isPendingStatus, ax as isProcessedStatus, ay as isTerminalStatus } from './shared/bank.BdPwLsVN.js';
3
- import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.pwjbFn6Q.js';
4
- export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.pwjbFn6Q.js';
1
+ import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, s as AccountAssignedPayment, u as PreparedPayment, v as CompletedPayment, w as PaymentRequestInsertType } from './shared/bank.seypMpK4.js';
2
+ export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted, aw as isPendingStatus, ax as isProcessedStatus, ay as isTerminalStatus } from './shared/bank.seypMpK4.js';
3
+ import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.Cwj4uNY5.js';
4
+ export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.Cwj4uNY5.js';
5
5
  export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CVJosema.js';
6
6
  import { BaseEvent } from '@develit-io/backend-sdk';
7
7
  import * as drizzle_zod from 'drizzle-zod';
@@ -368,6 +368,18 @@ declare class DbuConnector extends IBankConnector {
368
368
  getPaymentStatus({ paymentId, }: {
369
369
  paymentId: string;
370
370
  }): Promise<PaymentRequestStatus>;
371
+ getAccountBalance({ account, }: {
372
+ account: AccountSelectType;
373
+ }): Promise<{
374
+ balances: Array<{
375
+ amount: {
376
+ value: number;
377
+ currency: string;
378
+ };
379
+ balanceType: 'AVAILABLE' | 'VALUTA' | 'GPE_AVAILABLE' | 'MULTI_AVAILABLE';
380
+ balanceDate: Date;
381
+ }>;
382
+ }>;
371
383
  parseAuthorizationCallback(callbackUrl: string): AuthorizationCallbackResult;
372
384
  }
373
385
 
package/dist/types.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { C as CsobConnector, D as DbuConnector, E as ErsteConnector, F as FINBRICKS_ENDPOINTS, a as FinbricksClient, b as FinbricksConnector, I as IBankConnector, K as KBConnector, M as MockCobsConnector, c as MockConnector, d as assignAccount, s as signFinbricksJws, t as toBatchedPayment, e as toBatchedPaymentFromPaymentRequest, f as toCompletedPayment, g as toIncomingPayment, h as toPaymentRequestInsert, i as toPreparedPayment, u as useFinbricksFetch } from './shared/bank.BsKwYyaC.mjs';
1
+ export { C as CsobConnector, D as DbuConnector, E as ErsteConnector, F as FINBRICKS_ENDPOINTS, a as FinbricksClient, b as FinbricksConnector, I as IBankConnector, K as KBConnector, M as MockCobsConnector, c as MockConnector, d as assignAccount, s as signFinbricksJws, t as toBatchedPayment, e as toBatchedPaymentFromPaymentRequest, f as toCompletedPayment, g as toIncomingPayment, h as toPaymentRequestInsert, i as toPreparedPayment, u as useFinbricksFetch } from './shared/bank.BohzZXQu.mjs';
2
2
  export { A as ACCOUNT_STATUSES, B as BATCH_MODES, a as BATCH_STATUES, a as BATCH_STATUSES, C as CHARGE_BEARERS, b as CONNECTOR_KEYS, c as COUNTRY_CODES, d as CREDENTIALS_TYPES, I as INSTRUCTION_PRIORITIES, P as PAYMENT_DIRECTIONS, e as PAYMENT_REQUEST_STATUSES, f as PAYMENT_STATUSES, g as PAYMENT_TYPES, T as TOKEN_TYPES, h as accountCredentialsInsertSchema, i as accountCredentialsSelectSchema, j as accountCredentialsUpdateSchema, k as accountInsertSchema, l as accountSelectSchema, m as accountUpdateSchema, n as hasPaymentAccountAssigned, o as isPaymentCompleted, p as isPendingStatus, q as isProcessedStatus, r as isTerminalStatus, s as ottInsertSchema, t as ottSelectSchema, u as ottUpdateSchema } from './shared/bank.C7MA33AX.mjs';
3
3
  export { i as isBatchAuthorized, a as isBatchCompleted, b as isBatchFailed, c as isBatchInitiated, d as isBatchProcessing, e as isBatchReadyToSign } from './shared/bank.XqSw509X.mjs';
4
4
  export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/bank",
3
- "version": "1.1.11",
3
+ "version": "2.1.0",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {