@develit-services/bank 5.2.1 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.cjs +2 -2
- package/dist/base.d.cts +7 -7
- package/dist/base.d.mts +7 -7
- package/dist/base.d.ts +7 -7
- package/dist/base.mjs +2 -2
- package/dist/database/schema.d.cts +1 -1
- package/dist/database/schema.d.mts +1 -1
- package/dist/database/schema.d.ts +1 -1
- package/dist/export/workflows.cjs +119 -193
- package/dist/export/workflows.mjs +119 -193
- package/dist/shared/{bank.CdkOsZE8.d.ts → bank.BrBu52ls.d.cts} +1 -1
- package/dist/shared/{bank.CdkOsZE8.d.cts → bank.BrBu52ls.d.mts} +1 -1
- package/dist/shared/{bank.CdkOsZE8.d.mts → bank.BrBu52ls.d.ts} +1 -1
- package/dist/shared/{bank.5RiBQTe0.mjs → bank.C5Dk8wUR.mjs} +1 -1
- package/dist/shared/{bank.IAc8kIC-.d.ts → bank.Cfz0frnc.d.ts} +1 -1
- package/dist/shared/{bank.R64Uwo7k.cjs → bank.DBnfwy06.cjs} +36 -3
- package/dist/shared/{bank.BuwSQL_7.d.mts → bank.Dzk9ABBs.d.cts} +1 -1
- package/dist/shared/{bank.D__RVhfE.d.cts → bank.o3KC69CF.d.mts} +1 -1
- package/dist/shared/{bank.d0MTVrcR.cjs → bank.rcR4x1zh.cjs} +1 -1
- package/dist/shared/{bank.Cg2epnnD.mjs → bank.s-kUzZ-_.mjs} +36 -3
- package/dist/types.cjs +1 -1
- package/dist/types.d.cts +4 -4
- package/dist/types.d.mts +4 -4
- package/dist/types.d.ts +4 -4
- package/dist/types.mjs +1 -1
- package/package.json +1 -1
package/dist/base.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
|
-
const bank = require('./shared/bank.
|
|
4
|
+
const bank = require('./shared/bank.DBnfwy06.cjs');
|
|
5
5
|
const drizzleOrm = require('drizzle-orm');
|
|
6
6
|
const cloudflare_workers = require('cloudflare:workers');
|
|
7
7
|
const d1 = require('drizzle-orm/d1');
|
|
@@ -11,7 +11,7 @@ const database_schema = require('./shared/bank.9Yw4KHyl.cjs');
|
|
|
11
11
|
const generalCodes = require('@develit-io/general-codes');
|
|
12
12
|
require('date-fns');
|
|
13
13
|
require('node:crypto');
|
|
14
|
-
const credentialsResolver = require('./shared/bank.
|
|
14
|
+
const credentialsResolver = require('./shared/bank.rcR4x1zh.cjs');
|
|
15
15
|
require('drizzle-orm/zod');
|
|
16
16
|
require('drizzle-orm/sqlite-core');
|
|
17
17
|
|
package/dist/base.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.
|
|
2
|
-
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.
|
|
1
|
+
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.BrBu52ls.cjs';
|
|
2
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.Dzk9ABBs.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';
|
|
@@ -2699,9 +2699,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
2699
2699
|
limit: z.ZodNumber;
|
|
2700
2700
|
sort: z.ZodObject<{
|
|
2701
2701
|
column: z.ZodEnum<{
|
|
2702
|
+
batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
|
|
2702
2703
|
createdAt: "createdAt";
|
|
2703
2704
|
updatedAt: "updatedAt";
|
|
2704
|
-
batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
|
|
2705
2705
|
}>;
|
|
2706
2706
|
direction: z.ZodEnum<{
|
|
2707
2707
|
asc: "asc";
|
|
@@ -2825,9 +2825,9 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2825
2825
|
limit: z.ZodNumber;
|
|
2826
2826
|
sort: z.ZodObject<{
|
|
2827
2827
|
column: z.ZodEnum<{
|
|
2828
|
+
amount: "amount";
|
|
2828
2829
|
createdAt: "createdAt";
|
|
2829
2830
|
updatedAt: "updatedAt";
|
|
2830
|
-
amount: "amount";
|
|
2831
2831
|
}>;
|
|
2832
2832
|
direction: z.ZodEnum<{
|
|
2833
2833
|
asc: "asc";
|
|
@@ -2958,8 +2958,8 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2958
2958
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
2959
2959
|
BOOKED: "BOOKED";
|
|
2960
2960
|
REJECTED: "REJECTED";
|
|
2961
|
-
PENDING: "PENDING";
|
|
2962
2961
|
PROCESSING: "PROCESSING";
|
|
2962
|
+
PENDING: "PENDING";
|
|
2963
2963
|
CANCELLED: "CANCELLED";
|
|
2964
2964
|
SCHEDULED: "SCHEDULED";
|
|
2965
2965
|
HOLD: "HOLD";
|
|
@@ -2967,8 +2967,8 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2967
2967
|
}>, z.ZodArray<z.ZodEnum<{
|
|
2968
2968
|
BOOKED: "BOOKED";
|
|
2969
2969
|
REJECTED: "REJECTED";
|
|
2970
|
-
PENDING: "PENDING";
|
|
2971
2970
|
PROCESSING: "PROCESSING";
|
|
2971
|
+
PENDING: "PENDING";
|
|
2972
2972
|
CANCELLED: "CANCELLED";
|
|
2973
2973
|
SCHEDULED: "SCHEDULED";
|
|
2974
2974
|
HOLD: "HOLD";
|
|
@@ -3875,9 +3875,9 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
|
|
|
3875
3875
|
limit: z.ZodNumber;
|
|
3876
3876
|
sort: z.ZodObject<{
|
|
3877
3877
|
column: z.ZodEnum<{
|
|
3878
|
+
amount: "amount";
|
|
3878
3879
|
createdAt: "createdAt";
|
|
3879
3880
|
updatedAt: "updatedAt";
|
|
3880
|
-
amount: "amount";
|
|
3881
3881
|
}>;
|
|
3882
3882
|
direction: z.ZodEnum<{
|
|
3883
3883
|
asc: "asc";
|
package/dist/base.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.
|
|
2
|
-
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.
|
|
1
|
+
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.BrBu52ls.mjs';
|
|
2
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.o3KC69CF.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';
|
|
@@ -2699,9 +2699,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
2699
2699
|
limit: z.ZodNumber;
|
|
2700
2700
|
sort: z.ZodObject<{
|
|
2701
2701
|
column: z.ZodEnum<{
|
|
2702
|
+
batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
|
|
2702
2703
|
createdAt: "createdAt";
|
|
2703
2704
|
updatedAt: "updatedAt";
|
|
2704
|
-
batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
|
|
2705
2705
|
}>;
|
|
2706
2706
|
direction: z.ZodEnum<{
|
|
2707
2707
|
asc: "asc";
|
|
@@ -2825,9 +2825,9 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2825
2825
|
limit: z.ZodNumber;
|
|
2826
2826
|
sort: z.ZodObject<{
|
|
2827
2827
|
column: z.ZodEnum<{
|
|
2828
|
+
amount: "amount";
|
|
2828
2829
|
createdAt: "createdAt";
|
|
2829
2830
|
updatedAt: "updatedAt";
|
|
2830
|
-
amount: "amount";
|
|
2831
2831
|
}>;
|
|
2832
2832
|
direction: z.ZodEnum<{
|
|
2833
2833
|
asc: "asc";
|
|
@@ -2958,8 +2958,8 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2958
2958
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
2959
2959
|
BOOKED: "BOOKED";
|
|
2960
2960
|
REJECTED: "REJECTED";
|
|
2961
|
-
PENDING: "PENDING";
|
|
2962
2961
|
PROCESSING: "PROCESSING";
|
|
2962
|
+
PENDING: "PENDING";
|
|
2963
2963
|
CANCELLED: "CANCELLED";
|
|
2964
2964
|
SCHEDULED: "SCHEDULED";
|
|
2965
2965
|
HOLD: "HOLD";
|
|
@@ -2967,8 +2967,8 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2967
2967
|
}>, z.ZodArray<z.ZodEnum<{
|
|
2968
2968
|
BOOKED: "BOOKED";
|
|
2969
2969
|
REJECTED: "REJECTED";
|
|
2970
|
-
PENDING: "PENDING";
|
|
2971
2970
|
PROCESSING: "PROCESSING";
|
|
2971
|
+
PENDING: "PENDING";
|
|
2972
2972
|
CANCELLED: "CANCELLED";
|
|
2973
2973
|
SCHEDULED: "SCHEDULED";
|
|
2974
2974
|
HOLD: "HOLD";
|
|
@@ -3875,9 +3875,9 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
|
|
|
3875
3875
|
limit: z.ZodNumber;
|
|
3876
3876
|
sort: z.ZodObject<{
|
|
3877
3877
|
column: z.ZodEnum<{
|
|
3878
|
+
amount: "amount";
|
|
3878
3879
|
createdAt: "createdAt";
|
|
3879
3880
|
updatedAt: "updatedAt";
|
|
3880
|
-
amount: "amount";
|
|
3881
3881
|
}>;
|
|
3882
3882
|
direction: z.ZodEnum<{
|
|
3883
3883
|
asc: "asc";
|
package/dist/base.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.
|
|
2
|
-
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.
|
|
1
|
+
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.BrBu52ls.js';
|
|
2
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.Cfz0frnc.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';
|
|
@@ -2699,9 +2699,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
2699
2699
|
limit: z.ZodNumber;
|
|
2700
2700
|
sort: z.ZodObject<{
|
|
2701
2701
|
column: z.ZodEnum<{
|
|
2702
|
+
batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
|
|
2702
2703
|
createdAt: "createdAt";
|
|
2703
2704
|
updatedAt: "updatedAt";
|
|
2704
|
-
batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
|
|
2705
2705
|
}>;
|
|
2706
2706
|
direction: z.ZodEnum<{
|
|
2707
2707
|
asc: "asc";
|
|
@@ -2825,9 +2825,9 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2825
2825
|
limit: z.ZodNumber;
|
|
2826
2826
|
sort: z.ZodObject<{
|
|
2827
2827
|
column: z.ZodEnum<{
|
|
2828
|
+
amount: "amount";
|
|
2828
2829
|
createdAt: "createdAt";
|
|
2829
2830
|
updatedAt: "updatedAt";
|
|
2830
|
-
amount: "amount";
|
|
2831
2831
|
}>;
|
|
2832
2832
|
direction: z.ZodEnum<{
|
|
2833
2833
|
asc: "asc";
|
|
@@ -2958,8 +2958,8 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2958
2958
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
2959
2959
|
BOOKED: "BOOKED";
|
|
2960
2960
|
REJECTED: "REJECTED";
|
|
2961
|
-
PENDING: "PENDING";
|
|
2962
2961
|
PROCESSING: "PROCESSING";
|
|
2962
|
+
PENDING: "PENDING";
|
|
2963
2963
|
CANCELLED: "CANCELLED";
|
|
2964
2964
|
SCHEDULED: "SCHEDULED";
|
|
2965
2965
|
HOLD: "HOLD";
|
|
@@ -2967,8 +2967,8 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2967
2967
|
}>, z.ZodArray<z.ZodEnum<{
|
|
2968
2968
|
BOOKED: "BOOKED";
|
|
2969
2969
|
REJECTED: "REJECTED";
|
|
2970
|
-
PENDING: "PENDING";
|
|
2971
2970
|
PROCESSING: "PROCESSING";
|
|
2971
|
+
PENDING: "PENDING";
|
|
2972
2972
|
CANCELLED: "CANCELLED";
|
|
2973
2973
|
SCHEDULED: "SCHEDULED";
|
|
2974
2974
|
HOLD: "HOLD";
|
|
@@ -3875,9 +3875,9 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
|
|
|
3875
3875
|
limit: z.ZodNumber;
|
|
3876
3876
|
sort: z.ZodObject<{
|
|
3877
3877
|
column: z.ZodEnum<{
|
|
3878
|
+
amount: "amount";
|
|
3878
3879
|
createdAt: "createdAt";
|
|
3879
3880
|
updatedAt: "updatedAt";
|
|
3880
|
-
amount: "amount";
|
|
3881
3881
|
}>;
|
|
3882
3882
|
direction: z.ZodEnum<{
|
|
3883
3883
|
asc: "asc";
|
package/dist/base.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { uuidv4, first, buildMultiFilterConditions as buildMultiFilterConditions$1, bankAccountMetadataSchema, structuredAddressSchema, workflowInstanceStatusSchema, develitWorker, createInternalError, action, service } from '@develit-io/backend-sdk';
|
|
2
|
-
import { G as tables, g as accountInsertSchema, H as relations, J as initiateConnector, o as isProcessedStatus, p as isTerminalStatus, L as getNonTerminalPaymentRequestsQuery, x as toIncomingPayment, N as calculateCzechIban, j as assignAccount, u as toBatchedPayment, y as toPaymentRequestInsert, a as FinbricksClient, F as FINBRICKS_ENDPOINTS } from './shared/bank.
|
|
2
|
+
import { G as tables, g as accountInsertSchema, H as relations, J as initiateConnector, o as isProcessedStatus, p as isTerminalStatus, L as getNonTerminalPaymentRequestsQuery, x as toIncomingPayment, N as calculateCzechIban, j as assignAccount, u as toBatchedPayment, y as toPaymentRequestInsert, a as FinbricksClient, F as FINBRICKS_ENDPOINTS } from './shared/bank.s-kUzZ-_.mjs';
|
|
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';
|
|
@@ -9,7 +9,7 @@ import { I as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, g as PAYMENT_TYPES, b
|
|
|
9
9
|
import { CURRENCY_CODES } from '@develit-io/general-codes';
|
|
10
10
|
import 'date-fns';
|
|
11
11
|
import 'node:crypto';
|
|
12
|
-
import { h as encrypt, d as createCredentialsResolver, e as updatePaymentRequestStatusCommand, a as getPaymentRequestsByBatchIdQuery, g as getBatchByIdQuery, u as upsertBatchCommand, i as importAesKey, f as createPaymentCommand, b as getAccountByIdQuery } from './shared/bank.
|
|
12
|
+
import { h as encrypt, d as createCredentialsResolver, e as updatePaymentRequestStatusCommand, a as getPaymentRequestsByBatchIdQuery, g as getBatchByIdQuery, u as upsertBatchCommand, i as importAesKey, f as createPaymentCommand, b as getAccountByIdQuery } from './shared/bank.C5Dk8wUR.mjs';
|
|
13
13
|
import 'drizzle-orm/zod';
|
|
14
14
|
import 'drizzle-orm/sqlite-core';
|
|
15
15
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.
|
|
1
|
+
export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.BrBu52ls.cjs';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
3
|
import 'drizzle-orm';
|
|
4
4
|
import '@develit-io/general-codes';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.
|
|
1
|
+
export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.BrBu52ls.mjs';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
3
|
import 'drizzle-orm';
|
|
4
4
|
import '@develit-io/general-codes';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.
|
|
1
|
+
export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.BrBu52ls.js';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
3
|
import 'drizzle-orm';
|
|
4
4
|
import '@develit-io/general-codes';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
|
-
const bank = require('../shared/bank.
|
|
4
|
+
const bank = require('../shared/bank.DBnfwy06.cjs');
|
|
5
5
|
const batchLifecycle = require('../shared/bank.NF8bZBy0.cjs');
|
|
6
6
|
const drizzleOrm = require('drizzle-orm');
|
|
7
|
-
const credentialsResolver = require('../shared/bank.
|
|
7
|
+
const credentialsResolver = require('../shared/bank.rcR4x1zh.cjs');
|
|
8
8
|
const cloudflare_workers = require('cloudflare:workers');
|
|
9
9
|
const cloudflare_workflows = require('cloudflare:workflows');
|
|
10
10
|
const d1 = require('drizzle-orm/d1');
|
|
@@ -315,16 +315,12 @@ async function pushToQueue(queue, message) {
|
|
|
315
315
|
await queue.send(message, { contentType: "v8" });
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
contentType: "v8"
|
|
325
|
-
}))
|
|
326
|
-
);
|
|
327
|
-
}
|
|
318
|
+
await queue.sendBatch(
|
|
319
|
+
message.map((m) => ({
|
|
320
|
+
body: m,
|
|
321
|
+
contentType: "v8"
|
|
322
|
+
}))
|
|
323
|
+
);
|
|
328
324
|
}
|
|
329
325
|
class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
330
326
|
async run(event, step) {
|
|
@@ -350,13 +346,13 @@ class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
350
346
|
if (!account.lastSyncAt) {
|
|
351
347
|
throw new Error(`lastSyncedAt is not set for account: ${accountId}`);
|
|
352
348
|
}
|
|
353
|
-
await step.do(
|
|
354
|
-
"fetch
|
|
349
|
+
const payments = await step.do(
|
|
350
|
+
"fetch bank payments",
|
|
355
351
|
{
|
|
356
352
|
retries: { limit: 5, delay: "2 minutes", backoff: "exponential" },
|
|
357
|
-
timeout: "
|
|
353
|
+
timeout: "2 minutes"
|
|
358
354
|
},
|
|
359
|
-
async (
|
|
355
|
+
async () => {
|
|
360
356
|
try {
|
|
361
357
|
logger.info("payments.fetch.started", {
|
|
362
358
|
accountId,
|
|
@@ -379,192 +375,19 @@ class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
379
375
|
}
|
|
380
376
|
]
|
|
381
377
|
});
|
|
382
|
-
const
|
|
378
|
+
const result = await connector.getAllAccountPayments({
|
|
383
379
|
account,
|
|
384
380
|
filter: { dateFrom: account.lastSyncAt }
|
|
385
381
|
});
|
|
386
382
|
logger.info("payments.fetch.completed", {
|
|
387
383
|
accountId,
|
|
388
384
|
connectorKey: account.connectorKey,
|
|
389
|
-
paymentsCount:
|
|
390
|
-
});
|
|
391
|
-
const paymentsToProcess = payments.filter(
|
|
392
|
-
(p) => bank.isPaymentCompleted(p.parsed)
|
|
393
|
-
);
|
|
394
|
-
logger.info("payments.filtered.toProcess", {
|
|
395
|
-
accountId,
|
|
396
|
-
totalFetched: payments.length,
|
|
397
|
-
paymentsToProcess: paymentsToProcess.length,
|
|
398
|
-
sampleStatuses: payments.slice(0, 5).map((p) => ({
|
|
399
|
-
bankRefId: p.parsed.bankRefId,
|
|
400
|
-
status: p.parsed.status,
|
|
401
|
-
isCompleted: bank.isPaymentCompleted(p.parsed)
|
|
402
|
-
}))
|
|
403
|
-
});
|
|
404
|
-
const lastSyncBankRefIds = account.lastSyncMetadata?.lastSyncBankRefIds || [];
|
|
405
|
-
const paymentsToInsert = paymentsToProcess.filter(
|
|
406
|
-
(p) => !lastSyncBankRefIds.includes(p.parsed.bankRefId)
|
|
407
|
-
);
|
|
408
|
-
logger.info("payments.filtered.toInsert", {
|
|
409
|
-
accountId,
|
|
410
|
-
paymentsToProcess: paymentsToProcess.length,
|
|
411
|
-
paymentsToInsert: paymentsToInsert.length,
|
|
412
|
-
lastSyncBankRefIdsCount: lastSyncBankRefIds.length,
|
|
413
|
-
sampleLastSyncBankRefIds: lastSyncBankRefIds.slice(0, 10),
|
|
414
|
-
sampleToInsert: paymentsToInsert.slice(0, 5).map((p) => p.parsed.bankRefId)
|
|
415
|
-
});
|
|
416
|
-
const eventsToEmit = [];
|
|
417
|
-
const bankRefIds = paymentsToInsert.map((p) => p.parsed.bankRefId).filter((id) => id != null);
|
|
418
|
-
const BANK_REF_ID_CHUNK_SIZE = 90;
|
|
419
|
-
const matchingRequests = [];
|
|
420
|
-
for (let i = 0; i < bankRefIds.length; i += BANK_REF_ID_CHUNK_SIZE) {
|
|
421
|
-
const chunkIds = bankRefIds.slice(i, i + BANK_REF_ID_CHUNK_SIZE);
|
|
422
|
-
const rows = await db.select().from(bank.tables.paymentRequest).where(
|
|
423
|
-
drizzleOrm.and(
|
|
424
|
-
drizzleOrm.inArray(bank.tables.paymentRequest.bankRefId, chunkIds),
|
|
425
|
-
drizzleOrm.eq(bank.tables.paymentRequest.accountId, account.id),
|
|
426
|
-
drizzleOrm.eq(
|
|
427
|
-
bank.tables.paymentRequest.connectorKey,
|
|
428
|
-
account.connectorKey
|
|
429
|
-
)
|
|
430
|
-
)
|
|
431
|
-
);
|
|
432
|
-
matchingRequests.push(...rows);
|
|
433
|
-
}
|
|
434
|
-
const requestByBankRefId = Object.fromEntries(
|
|
435
|
-
matchingRequests.map((r) => [r.bankRefId, r])
|
|
436
|
-
);
|
|
437
|
-
const enrichedPayments = paymentsToInsert.map((p) => {
|
|
438
|
-
const req = p.parsed.bankRefId && requestByBankRefId[p.parsed.bankRefId] || null;
|
|
439
|
-
if (!req) return p;
|
|
440
|
-
return {
|
|
441
|
-
...p,
|
|
442
|
-
parsed: {
|
|
443
|
-
...p.parsed,
|
|
444
|
-
// queue-bus: transaction matching (DBU doesn't echo these in statements)
|
|
445
|
-
vs: p.parsed.vs ?? req.vs,
|
|
446
|
-
ss: p.parsed.ss ?? req.ss,
|
|
447
|
-
ks: p.parsed.ks ?? req.ks,
|
|
448
|
-
message: p.parsed.message ?? req.message,
|
|
449
|
-
// queue-bus: party creation
|
|
450
|
-
creditor: {
|
|
451
|
-
...p.parsed.creditor,
|
|
452
|
-
holderName: p.parsed.creditor?.holderName ?? req.creditor?.holderName
|
|
453
|
-
},
|
|
454
|
-
debtor: {
|
|
455
|
-
...p.parsed.debtor,
|
|
456
|
-
holderName: p.parsed.debtor?.holderName ?? req.debtor?.holderName
|
|
457
|
-
}
|
|
458
|
-
// NOT enriched: chargeBearer, instructionPriority, refId, batchId,
|
|
459
|
-
// createdAt, address, swiftBic — no downstream consumer in payment table
|
|
460
|
-
}
|
|
461
|
-
};
|
|
462
|
-
});
|
|
463
|
-
const createCommands = enrichedPayments.map(
|
|
464
|
-
(p) => credentialsResolver.createPaymentCommand(db, { payment: p.parsed }).command
|
|
465
|
-
);
|
|
466
|
-
logger.info("payments.commands.created", {
|
|
467
|
-
accountId,
|
|
468
|
-
createCommandsCount: createCommands.length,
|
|
469
|
-
enrichedPaymentsCount: enrichedPayments.length
|
|
470
|
-
});
|
|
471
|
-
eventsToEmit.push(
|
|
472
|
-
...enrichedPayments.map((p) => ({
|
|
473
|
-
eventType: "BANK_PAYMENT",
|
|
474
|
-
eventSignal: "paymentFetched",
|
|
475
|
-
bankPayment: p.parsed,
|
|
476
|
-
metadata: {
|
|
477
|
-
correlationId: p.parsed.correlationId,
|
|
478
|
-
entityId: p.parsed.id,
|
|
479
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
480
|
-
}
|
|
481
|
-
}))
|
|
482
|
-
);
|
|
483
|
-
const lastSyncMetadata = {
|
|
484
|
-
payments: payments.length,
|
|
485
|
-
paymentsToProcess: paymentsToProcess.length,
|
|
486
|
-
paymentsInserted: paymentsToInsert.length,
|
|
487
|
-
lastSyncBankRefIds: paymentsToProcess.filter((p) => p.parsed.status === "BOOKED").map((p) => p.parsed.bankRefId),
|
|
488
|
-
lastSyncPayments: lastSyncBankRefIds.length,
|
|
489
|
-
eventsEmitted: eventsToEmit.length,
|
|
490
|
-
iterationCount: getStepCount(ctx),
|
|
491
|
-
workflowStartedAt
|
|
492
|
-
};
|
|
493
|
-
const updateLastSyncCommand = updateAccountLastSyncCommand(db, {
|
|
494
|
-
accountId: account.id,
|
|
495
|
-
lastSyncAt: now,
|
|
496
|
-
lastSyncMetadata
|
|
497
|
-
}).command;
|
|
498
|
-
logger.info("payments.database.beforeBatch", {
|
|
499
|
-
accountId,
|
|
500
|
-
createCommandsCount: createCommands.length,
|
|
501
|
-
willUseBatch: createCommands.length > 0
|
|
385
|
+
paymentsCount: result.length
|
|
502
386
|
});
|
|
503
|
-
|
|
504
|
-
logger.info("payments.database.batchStart", {
|
|
505
|
-
accountId,
|
|
506
|
-
totalCommands: createCommands.length + 1,
|
|
507
|
-
paymentsToInsert: createCommands.length
|
|
508
|
-
});
|
|
509
|
-
const BATCH_CHUNK_SIZE = 90;
|
|
510
|
-
let totalInserted = 0;
|
|
511
|
-
for (let i = 0; i < createCommands.length; i += BATCH_CHUNK_SIZE) {
|
|
512
|
-
const chunkCommands = createCommands.slice(
|
|
513
|
-
i,
|
|
514
|
-
i + BATCH_CHUNK_SIZE
|
|
515
|
-
);
|
|
516
|
-
const isLastChunk = i + BATCH_CHUNK_SIZE >= createCommands.length;
|
|
517
|
-
const batchCommands = isLastChunk ? backendSdk.asNonEmpty([updateLastSyncCommand, ...chunkCommands]) : backendSdk.asNonEmpty(chunkCommands);
|
|
518
|
-
logger.info("payments.database.batchChunk", {
|
|
519
|
-
accountId,
|
|
520
|
-
chunkIndex: Math.floor(i / BATCH_CHUNK_SIZE),
|
|
521
|
-
chunkSize: chunkCommands.length,
|
|
522
|
-
isLastChunk
|
|
523
|
-
});
|
|
524
|
-
await db.batch(batchCommands);
|
|
525
|
-
totalInserted += chunkCommands.length;
|
|
526
|
-
}
|
|
527
|
-
logger.info("payments.database.batchComplete", {
|
|
528
|
-
accountId,
|
|
529
|
-
inserted: totalInserted,
|
|
530
|
-
chunks: Math.ceil(createCommands.length / BATCH_CHUNK_SIZE)
|
|
531
|
-
});
|
|
532
|
-
} else {
|
|
533
|
-
logger.info("payments.database.updateOnly", {
|
|
534
|
-
accountId,
|
|
535
|
-
reason: "no new payments to insert"
|
|
536
|
-
});
|
|
537
|
-
await updateLastSyncCommand.execute();
|
|
538
|
-
logger.info("payments.database.updateComplete", {
|
|
539
|
-
accountId
|
|
540
|
-
});
|
|
541
|
-
}
|
|
542
|
-
if (eventsToEmit.length) {
|
|
543
|
-
logger.info("payments.queue.sending", {
|
|
544
|
-
accountId,
|
|
545
|
-
eventsCount: eventsToEmit.length
|
|
546
|
-
});
|
|
547
|
-
await pushToQueue(
|
|
548
|
-
this.env.QUEUE_BUS_QUEUE,
|
|
549
|
-
eventsToEmit
|
|
550
|
-
);
|
|
551
|
-
logger.info("payments.queue.sent", {
|
|
552
|
-
accountId,
|
|
553
|
-
eventsCount: eventsToEmit.length
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
logger.info("payments.process.complete", {
|
|
557
|
-
accountId,
|
|
558
|
-
...lastSyncMetadata,
|
|
559
|
-
newLastSyncAt: now
|
|
560
|
-
});
|
|
561
|
-
return {
|
|
562
|
-
...lastSyncMetadata,
|
|
563
|
-
newLastSyncAt: now
|
|
564
|
-
};
|
|
387
|
+
return result;
|
|
565
388
|
} catch (err) {
|
|
566
389
|
const message = err instanceof Error ? err.message : typeof err === "object" && err !== null && "message" in err ? String(err.message) : JSON.stringify(err);
|
|
567
|
-
logger.error("payments.
|
|
390
|
+
logger.error("payments.fetch.failed", {
|
|
568
391
|
accountId,
|
|
569
392
|
connectorKey: account.connectorKey,
|
|
570
393
|
error: message
|
|
@@ -573,6 +396,109 @@ class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
573
396
|
}
|
|
574
397
|
}
|
|
575
398
|
);
|
|
399
|
+
const paymentsToProcess = payments.filter(
|
|
400
|
+
(p) => bank.isPaymentCompleted(p.parsed)
|
|
401
|
+
);
|
|
402
|
+
const lastSyncBankRefIds = account.lastSyncMetadata?.lastSyncBankRefIds || [];
|
|
403
|
+
const paymentsToInsert = paymentsToProcess.filter(
|
|
404
|
+
(p) => !lastSyncBankRefIds.includes(p.parsed.bankRefId)
|
|
405
|
+
);
|
|
406
|
+
await step.do(
|
|
407
|
+
"process new payments and update lastSyncAt",
|
|
408
|
+
async (ctx) => {
|
|
409
|
+
const eventsToEmit = [];
|
|
410
|
+
const bankRefIds = paymentsToInsert.map((p) => p.parsed.bankRefId).filter((id) => id != null);
|
|
411
|
+
const BANK_REF_ID_CHUNK_SIZE = 90;
|
|
412
|
+
const matchingRequests = [];
|
|
413
|
+
for (let i = 0; i < bankRefIds.length; i += BANK_REF_ID_CHUNK_SIZE) {
|
|
414
|
+
const chunkIds = bankRefIds.slice(i, i + BANK_REF_ID_CHUNK_SIZE);
|
|
415
|
+
const rows = await db.select().from(bank.tables.paymentRequest).where(
|
|
416
|
+
drizzleOrm.and(
|
|
417
|
+
drizzleOrm.inArray(bank.tables.paymentRequest.bankRefId, chunkIds),
|
|
418
|
+
drizzleOrm.eq(bank.tables.paymentRequest.accountId, account.id),
|
|
419
|
+
drizzleOrm.eq(bank.tables.paymentRequest.connectorKey, account.connectorKey)
|
|
420
|
+
)
|
|
421
|
+
);
|
|
422
|
+
matchingRequests.push(...rows);
|
|
423
|
+
}
|
|
424
|
+
const requestByBankRefId = Object.fromEntries(
|
|
425
|
+
matchingRequests.map((r) => [r.bankRefId, r])
|
|
426
|
+
);
|
|
427
|
+
const enrichedPayments = paymentsToInsert.map((p) => {
|
|
428
|
+
const req = p.parsed.bankRefId && requestByBankRefId[p.parsed.bankRefId] || null;
|
|
429
|
+
if (!req) return p;
|
|
430
|
+
return {
|
|
431
|
+
...p,
|
|
432
|
+
parsed: {
|
|
433
|
+
...p.parsed,
|
|
434
|
+
// queue-bus: transaction matching (DBU doesn't echo these in statements)
|
|
435
|
+
vs: p.parsed.vs ?? req.vs,
|
|
436
|
+
ss: p.parsed.ss ?? req.ss,
|
|
437
|
+
ks: p.parsed.ks ?? req.ks,
|
|
438
|
+
message: p.parsed.message ?? req.message,
|
|
439
|
+
// queue-bus: party creation
|
|
440
|
+
creditor: {
|
|
441
|
+
...p.parsed.creditor,
|
|
442
|
+
holderName: p.parsed.creditor?.holderName ?? req.creditor?.holderName
|
|
443
|
+
},
|
|
444
|
+
debtor: {
|
|
445
|
+
...p.parsed.debtor,
|
|
446
|
+
holderName: p.parsed.debtor?.holderName ?? req.debtor?.holderName
|
|
447
|
+
}
|
|
448
|
+
// NOT enriched: chargeBearer, instructionPriority, refId, batchId,
|
|
449
|
+
// createdAt, address, swiftBic — no downstream consumer in payment table
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
});
|
|
453
|
+
const createCommands = enrichedPayments.map(
|
|
454
|
+
(p) => credentialsResolver.createPaymentCommand(db, { payment: p.parsed }).command
|
|
455
|
+
);
|
|
456
|
+
eventsToEmit.push(
|
|
457
|
+
...enrichedPayments.map((p) => ({
|
|
458
|
+
eventType: "BANK_PAYMENT",
|
|
459
|
+
eventSignal: "paymentFetched",
|
|
460
|
+
bankPayment: p.parsed,
|
|
461
|
+
metadata: {
|
|
462
|
+
correlationId: p.parsed.correlationId,
|
|
463
|
+
entityId: p.parsed.id,
|
|
464
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
465
|
+
}
|
|
466
|
+
}))
|
|
467
|
+
);
|
|
468
|
+
const lastSyncMetadata = {
|
|
469
|
+
payments: payments.length,
|
|
470
|
+
paymentsToProcess: paymentsToProcess.length,
|
|
471
|
+
paymentsInserted: paymentsToInsert.length,
|
|
472
|
+
lastSyncBankRefIds: paymentsToProcess.filter((p) => p.parsed.status === "BOOKED").map((p) => p.parsed.bankRefId),
|
|
473
|
+
lastSyncPayments: lastSyncBankRefIds.length,
|
|
474
|
+
eventsEmitted: eventsToEmit.length,
|
|
475
|
+
iterationCount: getStepCount(ctx),
|
|
476
|
+
workflowStartedAt
|
|
477
|
+
};
|
|
478
|
+
const updateLastSyncCommand = updateAccountLastSyncCommand(db, {
|
|
479
|
+
accountId: account.id,
|
|
480
|
+
lastSyncAt: now,
|
|
481
|
+
lastSyncMetadata
|
|
482
|
+
}).command;
|
|
483
|
+
if (createCommands.length) {
|
|
484
|
+
await db.batch(
|
|
485
|
+
backendSdk.asNonEmpty([updateLastSyncCommand, ...createCommands])
|
|
486
|
+
);
|
|
487
|
+
} else {
|
|
488
|
+
await updateLastSyncCommand;
|
|
489
|
+
}
|
|
490
|
+
if (eventsToEmit.length) {
|
|
491
|
+
await pushToQueue(
|
|
492
|
+
this.env.QUEUE_BUS_QUEUE,
|
|
493
|
+
eventsToEmit
|
|
494
|
+
);
|
|
495
|
+
}
|
|
496
|
+
return {
|
|
497
|
+
...lastSyncMetadata,
|
|
498
|
+
newLastSyncAt: now
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
);
|
|
576
502
|
await step.sleep(
|
|
577
503
|
"Sleep for next sync",
|
|
578
504
|
`${account.syncIntervalS} seconds`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { first, uuidv4, asNonEmpty } from '@develit-io/backend-sdk';
|
|
2
|
-
import { G as tables, H as relations, v as toBatchedPaymentFromPaymentRequest, z as toPreparedPayment, J as initiateConnector, m as isPaymentCompleted } from '../shared/bank.
|
|
2
|
+
import { G as tables, H as relations, v as toBatchedPaymentFromPaymentRequest, z as toPreparedPayment, J as initiateConnector, m as isPaymentCompleted } from '../shared/bank.s-kUzZ-_.mjs';
|
|
3
3
|
import { i as isBatchAuthorized, b as isBatchFailed, d as isBatchProcessing } from '../shared/bank.XqSw509X.mjs';
|
|
4
4
|
import { eq, and, inArray } from 'drizzle-orm';
|
|
5
|
-
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.
|
|
5
|
+
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.C5Dk8wUR.mjs';
|
|
6
6
|
import { WorkflowEntrypoint } from 'cloudflare:workers';
|
|
7
7
|
import { NonRetryableError } from 'cloudflare:workflows';
|
|
8
8
|
import { drizzle } from 'drizzle-orm/d1';
|
|
@@ -313,16 +313,12 @@ async function pushToQueue(queue, message) {
|
|
|
313
313
|
await queue.send(message, { contentType: "v8" });
|
|
314
314
|
return;
|
|
315
315
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
contentType: "v8"
|
|
323
|
-
}))
|
|
324
|
-
);
|
|
325
|
-
}
|
|
316
|
+
await queue.sendBatch(
|
|
317
|
+
message.map((m) => ({
|
|
318
|
+
body: m,
|
|
319
|
+
contentType: "v8"
|
|
320
|
+
}))
|
|
321
|
+
);
|
|
326
322
|
}
|
|
327
323
|
class BankSyncAccountPayments extends WorkflowEntrypoint {
|
|
328
324
|
async run(event, step) {
|
|
@@ -348,13 +344,13 @@ class BankSyncAccountPayments extends WorkflowEntrypoint {
|
|
|
348
344
|
if (!account.lastSyncAt) {
|
|
349
345
|
throw new Error(`lastSyncedAt is not set for account: ${accountId}`);
|
|
350
346
|
}
|
|
351
|
-
await step.do(
|
|
352
|
-
"fetch
|
|
347
|
+
const payments = await step.do(
|
|
348
|
+
"fetch bank payments",
|
|
353
349
|
{
|
|
354
350
|
retries: { limit: 5, delay: "2 minutes", backoff: "exponential" },
|
|
355
|
-
timeout: "
|
|
351
|
+
timeout: "2 minutes"
|
|
356
352
|
},
|
|
357
|
-
async (
|
|
353
|
+
async () => {
|
|
358
354
|
try {
|
|
359
355
|
logger.info("payments.fetch.started", {
|
|
360
356
|
accountId,
|
|
@@ -377,192 +373,19 @@ class BankSyncAccountPayments extends WorkflowEntrypoint {
|
|
|
377
373
|
}
|
|
378
374
|
]
|
|
379
375
|
});
|
|
380
|
-
const
|
|
376
|
+
const result = await connector.getAllAccountPayments({
|
|
381
377
|
account,
|
|
382
378
|
filter: { dateFrom: account.lastSyncAt }
|
|
383
379
|
});
|
|
384
380
|
logger.info("payments.fetch.completed", {
|
|
385
381
|
accountId,
|
|
386
382
|
connectorKey: account.connectorKey,
|
|
387
|
-
paymentsCount:
|
|
388
|
-
});
|
|
389
|
-
const paymentsToProcess = payments.filter(
|
|
390
|
-
(p) => isPaymentCompleted(p.parsed)
|
|
391
|
-
);
|
|
392
|
-
logger.info("payments.filtered.toProcess", {
|
|
393
|
-
accountId,
|
|
394
|
-
totalFetched: payments.length,
|
|
395
|
-
paymentsToProcess: paymentsToProcess.length,
|
|
396
|
-
sampleStatuses: payments.slice(0, 5).map((p) => ({
|
|
397
|
-
bankRefId: p.parsed.bankRefId,
|
|
398
|
-
status: p.parsed.status,
|
|
399
|
-
isCompleted: isPaymentCompleted(p.parsed)
|
|
400
|
-
}))
|
|
401
|
-
});
|
|
402
|
-
const lastSyncBankRefIds = account.lastSyncMetadata?.lastSyncBankRefIds || [];
|
|
403
|
-
const paymentsToInsert = paymentsToProcess.filter(
|
|
404
|
-
(p) => !lastSyncBankRefIds.includes(p.parsed.bankRefId)
|
|
405
|
-
);
|
|
406
|
-
logger.info("payments.filtered.toInsert", {
|
|
407
|
-
accountId,
|
|
408
|
-
paymentsToProcess: paymentsToProcess.length,
|
|
409
|
-
paymentsToInsert: paymentsToInsert.length,
|
|
410
|
-
lastSyncBankRefIdsCount: lastSyncBankRefIds.length,
|
|
411
|
-
sampleLastSyncBankRefIds: lastSyncBankRefIds.slice(0, 10),
|
|
412
|
-
sampleToInsert: paymentsToInsert.slice(0, 5).map((p) => p.parsed.bankRefId)
|
|
413
|
-
});
|
|
414
|
-
const eventsToEmit = [];
|
|
415
|
-
const bankRefIds = paymentsToInsert.map((p) => p.parsed.bankRefId).filter((id) => id != null);
|
|
416
|
-
const BANK_REF_ID_CHUNK_SIZE = 90;
|
|
417
|
-
const matchingRequests = [];
|
|
418
|
-
for (let i = 0; i < bankRefIds.length; i += BANK_REF_ID_CHUNK_SIZE) {
|
|
419
|
-
const chunkIds = bankRefIds.slice(i, i + BANK_REF_ID_CHUNK_SIZE);
|
|
420
|
-
const rows = await db.select().from(tables.paymentRequest).where(
|
|
421
|
-
and(
|
|
422
|
-
inArray(tables.paymentRequest.bankRefId, chunkIds),
|
|
423
|
-
eq(tables.paymentRequest.accountId, account.id),
|
|
424
|
-
eq(
|
|
425
|
-
tables.paymentRequest.connectorKey,
|
|
426
|
-
account.connectorKey
|
|
427
|
-
)
|
|
428
|
-
)
|
|
429
|
-
);
|
|
430
|
-
matchingRequests.push(...rows);
|
|
431
|
-
}
|
|
432
|
-
const requestByBankRefId = Object.fromEntries(
|
|
433
|
-
matchingRequests.map((r) => [r.bankRefId, r])
|
|
434
|
-
);
|
|
435
|
-
const enrichedPayments = paymentsToInsert.map((p) => {
|
|
436
|
-
const req = p.parsed.bankRefId && requestByBankRefId[p.parsed.bankRefId] || null;
|
|
437
|
-
if (!req) return p;
|
|
438
|
-
return {
|
|
439
|
-
...p,
|
|
440
|
-
parsed: {
|
|
441
|
-
...p.parsed,
|
|
442
|
-
// queue-bus: transaction matching (DBU doesn't echo these in statements)
|
|
443
|
-
vs: p.parsed.vs ?? req.vs,
|
|
444
|
-
ss: p.parsed.ss ?? req.ss,
|
|
445
|
-
ks: p.parsed.ks ?? req.ks,
|
|
446
|
-
message: p.parsed.message ?? req.message,
|
|
447
|
-
// queue-bus: party creation
|
|
448
|
-
creditor: {
|
|
449
|
-
...p.parsed.creditor,
|
|
450
|
-
holderName: p.parsed.creditor?.holderName ?? req.creditor?.holderName
|
|
451
|
-
},
|
|
452
|
-
debtor: {
|
|
453
|
-
...p.parsed.debtor,
|
|
454
|
-
holderName: p.parsed.debtor?.holderName ?? req.debtor?.holderName
|
|
455
|
-
}
|
|
456
|
-
// NOT enriched: chargeBearer, instructionPriority, refId, batchId,
|
|
457
|
-
// createdAt, address, swiftBic — no downstream consumer in payment table
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
});
|
|
461
|
-
const createCommands = enrichedPayments.map(
|
|
462
|
-
(p) => createPaymentCommand(db, { payment: p.parsed }).command
|
|
463
|
-
);
|
|
464
|
-
logger.info("payments.commands.created", {
|
|
465
|
-
accountId,
|
|
466
|
-
createCommandsCount: createCommands.length,
|
|
467
|
-
enrichedPaymentsCount: enrichedPayments.length
|
|
468
|
-
});
|
|
469
|
-
eventsToEmit.push(
|
|
470
|
-
...enrichedPayments.map((p) => ({
|
|
471
|
-
eventType: "BANK_PAYMENT",
|
|
472
|
-
eventSignal: "paymentFetched",
|
|
473
|
-
bankPayment: p.parsed,
|
|
474
|
-
metadata: {
|
|
475
|
-
correlationId: p.parsed.correlationId,
|
|
476
|
-
entityId: p.parsed.id,
|
|
477
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
478
|
-
}
|
|
479
|
-
}))
|
|
480
|
-
);
|
|
481
|
-
const lastSyncMetadata = {
|
|
482
|
-
payments: payments.length,
|
|
483
|
-
paymentsToProcess: paymentsToProcess.length,
|
|
484
|
-
paymentsInserted: paymentsToInsert.length,
|
|
485
|
-
lastSyncBankRefIds: paymentsToProcess.filter((p) => p.parsed.status === "BOOKED").map((p) => p.parsed.bankRefId),
|
|
486
|
-
lastSyncPayments: lastSyncBankRefIds.length,
|
|
487
|
-
eventsEmitted: eventsToEmit.length,
|
|
488
|
-
iterationCount: getStepCount(ctx),
|
|
489
|
-
workflowStartedAt
|
|
490
|
-
};
|
|
491
|
-
const updateLastSyncCommand = updateAccountLastSyncCommand(db, {
|
|
492
|
-
accountId: account.id,
|
|
493
|
-
lastSyncAt: now,
|
|
494
|
-
lastSyncMetadata
|
|
495
|
-
}).command;
|
|
496
|
-
logger.info("payments.database.beforeBatch", {
|
|
497
|
-
accountId,
|
|
498
|
-
createCommandsCount: createCommands.length,
|
|
499
|
-
willUseBatch: createCommands.length > 0
|
|
383
|
+
paymentsCount: result.length
|
|
500
384
|
});
|
|
501
|
-
|
|
502
|
-
logger.info("payments.database.batchStart", {
|
|
503
|
-
accountId,
|
|
504
|
-
totalCommands: createCommands.length + 1,
|
|
505
|
-
paymentsToInsert: createCommands.length
|
|
506
|
-
});
|
|
507
|
-
const BATCH_CHUNK_SIZE = 90;
|
|
508
|
-
let totalInserted = 0;
|
|
509
|
-
for (let i = 0; i < createCommands.length; i += BATCH_CHUNK_SIZE) {
|
|
510
|
-
const chunkCommands = createCommands.slice(
|
|
511
|
-
i,
|
|
512
|
-
i + BATCH_CHUNK_SIZE
|
|
513
|
-
);
|
|
514
|
-
const isLastChunk = i + BATCH_CHUNK_SIZE >= createCommands.length;
|
|
515
|
-
const batchCommands = isLastChunk ? asNonEmpty([updateLastSyncCommand, ...chunkCommands]) : asNonEmpty(chunkCommands);
|
|
516
|
-
logger.info("payments.database.batchChunk", {
|
|
517
|
-
accountId,
|
|
518
|
-
chunkIndex: Math.floor(i / BATCH_CHUNK_SIZE),
|
|
519
|
-
chunkSize: chunkCommands.length,
|
|
520
|
-
isLastChunk
|
|
521
|
-
});
|
|
522
|
-
await db.batch(batchCommands);
|
|
523
|
-
totalInserted += chunkCommands.length;
|
|
524
|
-
}
|
|
525
|
-
logger.info("payments.database.batchComplete", {
|
|
526
|
-
accountId,
|
|
527
|
-
inserted: totalInserted,
|
|
528
|
-
chunks: Math.ceil(createCommands.length / BATCH_CHUNK_SIZE)
|
|
529
|
-
});
|
|
530
|
-
} else {
|
|
531
|
-
logger.info("payments.database.updateOnly", {
|
|
532
|
-
accountId,
|
|
533
|
-
reason: "no new payments to insert"
|
|
534
|
-
});
|
|
535
|
-
await updateLastSyncCommand.execute();
|
|
536
|
-
logger.info("payments.database.updateComplete", {
|
|
537
|
-
accountId
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
if (eventsToEmit.length) {
|
|
541
|
-
logger.info("payments.queue.sending", {
|
|
542
|
-
accountId,
|
|
543
|
-
eventsCount: eventsToEmit.length
|
|
544
|
-
});
|
|
545
|
-
await pushToQueue(
|
|
546
|
-
this.env.QUEUE_BUS_QUEUE,
|
|
547
|
-
eventsToEmit
|
|
548
|
-
);
|
|
549
|
-
logger.info("payments.queue.sent", {
|
|
550
|
-
accountId,
|
|
551
|
-
eventsCount: eventsToEmit.length
|
|
552
|
-
});
|
|
553
|
-
}
|
|
554
|
-
logger.info("payments.process.complete", {
|
|
555
|
-
accountId,
|
|
556
|
-
...lastSyncMetadata,
|
|
557
|
-
newLastSyncAt: now
|
|
558
|
-
});
|
|
559
|
-
return {
|
|
560
|
-
...lastSyncMetadata,
|
|
561
|
-
newLastSyncAt: now
|
|
562
|
-
};
|
|
385
|
+
return result;
|
|
563
386
|
} catch (err) {
|
|
564
387
|
const message = err instanceof Error ? err.message : typeof err === "object" && err !== null && "message" in err ? String(err.message) : JSON.stringify(err);
|
|
565
|
-
logger.error("payments.
|
|
388
|
+
logger.error("payments.fetch.failed", {
|
|
566
389
|
accountId,
|
|
567
390
|
connectorKey: account.connectorKey,
|
|
568
391
|
error: message
|
|
@@ -571,6 +394,109 @@ class BankSyncAccountPayments extends WorkflowEntrypoint {
|
|
|
571
394
|
}
|
|
572
395
|
}
|
|
573
396
|
);
|
|
397
|
+
const paymentsToProcess = payments.filter(
|
|
398
|
+
(p) => isPaymentCompleted(p.parsed)
|
|
399
|
+
);
|
|
400
|
+
const lastSyncBankRefIds = account.lastSyncMetadata?.lastSyncBankRefIds || [];
|
|
401
|
+
const paymentsToInsert = paymentsToProcess.filter(
|
|
402
|
+
(p) => !lastSyncBankRefIds.includes(p.parsed.bankRefId)
|
|
403
|
+
);
|
|
404
|
+
await step.do(
|
|
405
|
+
"process new payments and update lastSyncAt",
|
|
406
|
+
async (ctx) => {
|
|
407
|
+
const eventsToEmit = [];
|
|
408
|
+
const bankRefIds = paymentsToInsert.map((p) => p.parsed.bankRefId).filter((id) => id != null);
|
|
409
|
+
const BANK_REF_ID_CHUNK_SIZE = 90;
|
|
410
|
+
const matchingRequests = [];
|
|
411
|
+
for (let i = 0; i < bankRefIds.length; i += BANK_REF_ID_CHUNK_SIZE) {
|
|
412
|
+
const chunkIds = bankRefIds.slice(i, i + BANK_REF_ID_CHUNK_SIZE);
|
|
413
|
+
const rows = await db.select().from(tables.paymentRequest).where(
|
|
414
|
+
and(
|
|
415
|
+
inArray(tables.paymentRequest.bankRefId, chunkIds),
|
|
416
|
+
eq(tables.paymentRequest.accountId, account.id),
|
|
417
|
+
eq(tables.paymentRequest.connectorKey, account.connectorKey)
|
|
418
|
+
)
|
|
419
|
+
);
|
|
420
|
+
matchingRequests.push(...rows);
|
|
421
|
+
}
|
|
422
|
+
const requestByBankRefId = Object.fromEntries(
|
|
423
|
+
matchingRequests.map((r) => [r.bankRefId, r])
|
|
424
|
+
);
|
|
425
|
+
const enrichedPayments = paymentsToInsert.map((p) => {
|
|
426
|
+
const req = p.parsed.bankRefId && requestByBankRefId[p.parsed.bankRefId] || null;
|
|
427
|
+
if (!req) return p;
|
|
428
|
+
return {
|
|
429
|
+
...p,
|
|
430
|
+
parsed: {
|
|
431
|
+
...p.parsed,
|
|
432
|
+
// queue-bus: transaction matching (DBU doesn't echo these in statements)
|
|
433
|
+
vs: p.parsed.vs ?? req.vs,
|
|
434
|
+
ss: p.parsed.ss ?? req.ss,
|
|
435
|
+
ks: p.parsed.ks ?? req.ks,
|
|
436
|
+
message: p.parsed.message ?? req.message,
|
|
437
|
+
// queue-bus: party creation
|
|
438
|
+
creditor: {
|
|
439
|
+
...p.parsed.creditor,
|
|
440
|
+
holderName: p.parsed.creditor?.holderName ?? req.creditor?.holderName
|
|
441
|
+
},
|
|
442
|
+
debtor: {
|
|
443
|
+
...p.parsed.debtor,
|
|
444
|
+
holderName: p.parsed.debtor?.holderName ?? req.debtor?.holderName
|
|
445
|
+
}
|
|
446
|
+
// NOT enriched: chargeBearer, instructionPriority, refId, batchId,
|
|
447
|
+
// createdAt, address, swiftBic — no downstream consumer in payment table
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
});
|
|
451
|
+
const createCommands = enrichedPayments.map(
|
|
452
|
+
(p) => createPaymentCommand(db, { payment: p.parsed }).command
|
|
453
|
+
);
|
|
454
|
+
eventsToEmit.push(
|
|
455
|
+
...enrichedPayments.map((p) => ({
|
|
456
|
+
eventType: "BANK_PAYMENT",
|
|
457
|
+
eventSignal: "paymentFetched",
|
|
458
|
+
bankPayment: p.parsed,
|
|
459
|
+
metadata: {
|
|
460
|
+
correlationId: p.parsed.correlationId,
|
|
461
|
+
entityId: p.parsed.id,
|
|
462
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
463
|
+
}
|
|
464
|
+
}))
|
|
465
|
+
);
|
|
466
|
+
const lastSyncMetadata = {
|
|
467
|
+
payments: payments.length,
|
|
468
|
+
paymentsToProcess: paymentsToProcess.length,
|
|
469
|
+
paymentsInserted: paymentsToInsert.length,
|
|
470
|
+
lastSyncBankRefIds: paymentsToProcess.filter((p) => p.parsed.status === "BOOKED").map((p) => p.parsed.bankRefId),
|
|
471
|
+
lastSyncPayments: lastSyncBankRefIds.length,
|
|
472
|
+
eventsEmitted: eventsToEmit.length,
|
|
473
|
+
iterationCount: getStepCount(ctx),
|
|
474
|
+
workflowStartedAt
|
|
475
|
+
};
|
|
476
|
+
const updateLastSyncCommand = updateAccountLastSyncCommand(db, {
|
|
477
|
+
accountId: account.id,
|
|
478
|
+
lastSyncAt: now,
|
|
479
|
+
lastSyncMetadata
|
|
480
|
+
}).command;
|
|
481
|
+
if (createCommands.length) {
|
|
482
|
+
await db.batch(
|
|
483
|
+
asNonEmpty([updateLastSyncCommand, ...createCommands])
|
|
484
|
+
);
|
|
485
|
+
} else {
|
|
486
|
+
await updateLastSyncCommand;
|
|
487
|
+
}
|
|
488
|
+
if (eventsToEmit.length) {
|
|
489
|
+
await pushToQueue(
|
|
490
|
+
this.env.QUEUE_BUS_QUEUE,
|
|
491
|
+
eventsToEmit
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
return {
|
|
495
|
+
...lastSyncMetadata,
|
|
496
|
+
newLastSyncAt: now
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
);
|
|
574
500
|
await step.sleep(
|
|
575
501
|
"Sleep for next sync",
|
|
576
502
|
`${account.syncIntervalS} seconds`
|
|
@@ -3606,7 +3606,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
3606
3606
|
name: string;
|
|
3607
3607
|
tableName: "payment";
|
|
3608
3608
|
dataType: "string enum";
|
|
3609
|
-
data: "BOOKED" | "REJECTED" | "
|
|
3609
|
+
data: "BOOKED" | "REJECTED" | "PROCESSING" | "PENDING" | "CANCELLED" | "SCHEDULED" | "HOLD" | "INFO";
|
|
3610
3610
|
driverParam: string;
|
|
3611
3611
|
notNull: true;
|
|
3612
3612
|
hasDefault: false;
|
|
@@ -3606,7 +3606,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
3606
3606
|
name: string;
|
|
3607
3607
|
tableName: "payment";
|
|
3608
3608
|
dataType: "string enum";
|
|
3609
|
-
data: "BOOKED" | "REJECTED" | "
|
|
3609
|
+
data: "BOOKED" | "REJECTED" | "PROCESSING" | "PENDING" | "CANCELLED" | "SCHEDULED" | "HOLD" | "INFO";
|
|
3610
3610
|
driverParam: string;
|
|
3611
3611
|
notNull: true;
|
|
3612
3612
|
hasDefault: false;
|
|
@@ -3606,7 +3606,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
3606
3606
|
name: string;
|
|
3607
3607
|
tableName: "payment";
|
|
3608
3608
|
dataType: "string enum";
|
|
3609
|
-
data: "BOOKED" | "REJECTED" | "
|
|
3609
|
+
data: "BOOKED" | "REJECTED" | "PROCESSING" | "PENDING" | "CANCELLED" | "SCHEDULED" | "HOLD" | "INFO";
|
|
3610
3610
|
driverParam: string;
|
|
3611
3611
|
notNull: true;
|
|
3612
3612
|
hasDefault: false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as CurrencyCode, R as BankCode, a1 as CountryCode, P as PaymentRequestSelectType } from './bank.
|
|
1
|
+
import { e as CurrencyCode, R as BankCode, a1 as CountryCode, P as PaymentRequestSelectType } from './bank.BrBu52ls.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
|
|
@@ -332,6 +332,32 @@ function buildPaymentReference(symbols) {
|
|
|
332
332
|
return parts.join("").slice(0, MAX_REFERENCE_LENGTH);
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
+
const MAX_FIELD_LENGTH = 140;
|
|
336
|
+
const COUNTRY_NAMES = {
|
|
337
|
+
CZ: "\u010Cesk\xE1 republika",
|
|
338
|
+
SK: "Slovensko"
|
|
339
|
+
};
|
|
340
|
+
const stripDiacritics = (value) => value.normalize("NFD").replace(/\p{Diacritic}/gu, "");
|
|
341
|
+
function buildUltimateDebtor(debtor, options) {
|
|
342
|
+
const address = debtor.address;
|
|
343
|
+
const street = [address?.streetName, address?.buildingNumber].filter(Boolean).join(" ");
|
|
344
|
+
if (!debtor.holderName || !street) return void 0;
|
|
345
|
+
const cityLine = [address?.postalCode, address?.city].filter(Boolean).join(" ");
|
|
346
|
+
const countryCode = address?.countryCode ?? debtor.countryCode;
|
|
347
|
+
const country = countryCode ? COUNTRY_NAMES[countryCode] ?? countryCode : void 0;
|
|
348
|
+
const udt = `UDT: ${[debtor.holderName, street, cityLine, country].filter(Boolean).join("::")}`;
|
|
349
|
+
return options.stripDiacritics ? stripDiacritics(udt) : udt;
|
|
350
|
+
}
|
|
351
|
+
function composeWithUltimateDebtor(existing, debtor, options) {
|
|
352
|
+
const udt = buildUltimateDebtor(debtor, options);
|
|
353
|
+
if (!udt) return existing?.slice(0, MAX_FIELD_LENGTH) || void 0;
|
|
354
|
+
const prefix = existing?.trim();
|
|
355
|
+
if (!prefix) return udt.slice(0, MAX_FIELD_LENGTH);
|
|
356
|
+
const room = MAX_FIELD_LENGTH - udt.length - 2;
|
|
357
|
+
if (room <= 0) return udt.slice(0, MAX_FIELD_LENGTH);
|
|
358
|
+
return `${prefix.slice(0, room)}, ${udt}`;
|
|
359
|
+
}
|
|
360
|
+
|
|
335
361
|
const SYMBOL_LIMITS = { vs: 10, ss: 10, ks: 4 };
|
|
336
362
|
function assertSymbolLength(symbol, value) {
|
|
337
363
|
const max = SYMBOL_LIMITS[symbol];
|
|
@@ -931,7 +957,9 @@ class FinbricksConnector extends IBankConnector {
|
|
|
931
957
|
variableSymbol: p.vs ?? (p.ss ? void 0 : autoVariableSymbol(p.id)),
|
|
932
958
|
specificSymbol: p.ss,
|
|
933
959
|
constantSymbol: p.ks,
|
|
934
|
-
description: p.message
|
|
960
|
+
description: this.PROVIDER === "CSOB" ? composeWithUltimateDebtor(p.message, p.debtor, {
|
|
961
|
+
stripDiacritics: p.currency !== "CZK"
|
|
962
|
+
}) : p.message
|
|
935
963
|
// instructionPriority: 'NORM', todo(kleinpetr): pass payment priority
|
|
936
964
|
}))
|
|
937
965
|
}
|
|
@@ -976,7 +1004,10 @@ class FinbricksConnector extends IBankConnector {
|
|
|
976
1004
|
ss: payment.ss,
|
|
977
1005
|
ks: payment.ks
|
|
978
1006
|
});
|
|
979
|
-
const
|
|
1007
|
+
const remittanceBase = [reference, payment.message?.trim()].filter(Boolean).join(" ") || void 0;
|
|
1008
|
+
const unstructured = this.PROVIDER === "CSOB" ? composeWithUltimateDebtor(remittanceBase, payment.debtor, {
|
|
1009
|
+
stripDiacritics: payment.currency !== "CZK"
|
|
1010
|
+
}) : remittanceBase?.slice(0, 140) || void 0;
|
|
980
1011
|
const bankRefId = backendSdk.uuidv4();
|
|
981
1012
|
const [response, error] = await backendSdk.useResult(
|
|
982
1013
|
this.finbricks.request({
|
|
@@ -1106,7 +1137,9 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1106
1137
|
debtorAccountIban: payment.debtor.iban,
|
|
1107
1138
|
creditorAccountIban: payment.creditor.iban,
|
|
1108
1139
|
creditorName: payment.creditor.holderName,
|
|
1109
|
-
description: payment.message,
|
|
1140
|
+
description: this.PROVIDER === "CSOB" ? composeWithUltimateDebtor(payment.message, payment.debtor, {
|
|
1141
|
+
stripDiacritics: payment.currency !== "CZK"
|
|
1142
|
+
}) : payment.message,
|
|
1110
1143
|
variableSymbol: payment.vs ?? (payment.ss ? void 0 : autoVariableSymbol(payment.id)),
|
|
1111
1144
|
specificSymbol: payment.ss,
|
|
1112
1145
|
constantSymbol: payment.ks,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as CurrencyCode, R as BankCode, a1 as CountryCode, P as PaymentRequestSelectType } from './bank.
|
|
1
|
+
import { e as CurrencyCode, R as BankCode, a1 as CountryCode, P as PaymentRequestSelectType } from './bank.BrBu52ls.cjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as CurrencyCode, R as BankCode, a1 as CountryCode, P as PaymentRequestSelectType } from './bank.
|
|
1
|
+
import { e as CurrencyCode, R as BankCode, a1 as CountryCode, P as PaymentRequestSelectType } from './bank.BrBu52ls.mjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const drizzleOrm = require('drizzle-orm');
|
|
4
|
-
const bank = require('./bank.
|
|
4
|
+
const bank = require('./bank.DBnfwy06.cjs');
|
|
5
5
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
6
6
|
require('./bank.9Yw4KHyl.cjs');
|
|
7
7
|
require('date-fns');
|
|
@@ -330,6 +330,32 @@ function buildPaymentReference(symbols) {
|
|
|
330
330
|
return parts.join("").slice(0, MAX_REFERENCE_LENGTH);
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
+
const MAX_FIELD_LENGTH = 140;
|
|
334
|
+
const COUNTRY_NAMES = {
|
|
335
|
+
CZ: "\u010Cesk\xE1 republika",
|
|
336
|
+
SK: "Slovensko"
|
|
337
|
+
};
|
|
338
|
+
const stripDiacritics = (value) => value.normalize("NFD").replace(/\p{Diacritic}/gu, "");
|
|
339
|
+
function buildUltimateDebtor(debtor, options) {
|
|
340
|
+
const address = debtor.address;
|
|
341
|
+
const street = [address?.streetName, address?.buildingNumber].filter(Boolean).join(" ");
|
|
342
|
+
if (!debtor.holderName || !street) return void 0;
|
|
343
|
+
const cityLine = [address?.postalCode, address?.city].filter(Boolean).join(" ");
|
|
344
|
+
const countryCode = address?.countryCode ?? debtor.countryCode;
|
|
345
|
+
const country = countryCode ? COUNTRY_NAMES[countryCode] ?? countryCode : void 0;
|
|
346
|
+
const udt = `UDT: ${[debtor.holderName, street, cityLine, country].filter(Boolean).join("::")}`;
|
|
347
|
+
return options.stripDiacritics ? stripDiacritics(udt) : udt;
|
|
348
|
+
}
|
|
349
|
+
function composeWithUltimateDebtor(existing, debtor, options) {
|
|
350
|
+
const udt = buildUltimateDebtor(debtor, options);
|
|
351
|
+
if (!udt) return existing?.slice(0, MAX_FIELD_LENGTH) || void 0;
|
|
352
|
+
const prefix = existing?.trim();
|
|
353
|
+
if (!prefix) return udt.slice(0, MAX_FIELD_LENGTH);
|
|
354
|
+
const room = MAX_FIELD_LENGTH - udt.length - 2;
|
|
355
|
+
if (room <= 0) return udt.slice(0, MAX_FIELD_LENGTH);
|
|
356
|
+
return `${prefix.slice(0, room)}, ${udt}`;
|
|
357
|
+
}
|
|
358
|
+
|
|
333
359
|
const SYMBOL_LIMITS = { vs: 10, ss: 10, ks: 4 };
|
|
334
360
|
function assertSymbolLength(symbol, value) {
|
|
335
361
|
const max = SYMBOL_LIMITS[symbol];
|
|
@@ -929,7 +955,9 @@ class FinbricksConnector extends IBankConnector {
|
|
|
929
955
|
variableSymbol: p.vs ?? (p.ss ? void 0 : autoVariableSymbol(p.id)),
|
|
930
956
|
specificSymbol: p.ss,
|
|
931
957
|
constantSymbol: p.ks,
|
|
932
|
-
description: p.message
|
|
958
|
+
description: this.PROVIDER === "CSOB" ? composeWithUltimateDebtor(p.message, p.debtor, {
|
|
959
|
+
stripDiacritics: p.currency !== "CZK"
|
|
960
|
+
}) : p.message
|
|
933
961
|
// instructionPriority: 'NORM', todo(kleinpetr): pass payment priority
|
|
934
962
|
}))
|
|
935
963
|
}
|
|
@@ -974,7 +1002,10 @@ class FinbricksConnector extends IBankConnector {
|
|
|
974
1002
|
ss: payment.ss,
|
|
975
1003
|
ks: payment.ks
|
|
976
1004
|
});
|
|
977
|
-
const
|
|
1005
|
+
const remittanceBase = [reference, payment.message?.trim()].filter(Boolean).join(" ") || void 0;
|
|
1006
|
+
const unstructured = this.PROVIDER === "CSOB" ? composeWithUltimateDebtor(remittanceBase, payment.debtor, {
|
|
1007
|
+
stripDiacritics: payment.currency !== "CZK"
|
|
1008
|
+
}) : remittanceBase?.slice(0, 140) || void 0;
|
|
978
1009
|
const bankRefId = uuidv4();
|
|
979
1010
|
const [response, error] = await useResult(
|
|
980
1011
|
this.finbricks.request({
|
|
@@ -1104,7 +1135,9 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1104
1135
|
debtorAccountIban: payment.debtor.iban,
|
|
1105
1136
|
creditorAccountIban: payment.creditor.iban,
|
|
1106
1137
|
creditorName: payment.creditor.holderName,
|
|
1107
|
-
description: payment.message,
|
|
1138
|
+
description: this.PROVIDER === "CSOB" ? composeWithUltimateDebtor(payment.message, payment.debtor, {
|
|
1139
|
+
stripDiacritics: payment.currency !== "CZK"
|
|
1140
|
+
}) : payment.message,
|
|
1108
1141
|
variableSymbol: payment.vs ?? (payment.ss ? void 0 : autoVariableSymbol(payment.id)),
|
|
1109
1142
|
specificSymbol: payment.ss,
|
|
1110
1143
|
constantSymbol: payment.ks,
|
package/dist/types.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const bank = require('./shared/bank.
|
|
3
|
+
const bank = require('./shared/bank.DBnfwy06.cjs');
|
|
4
4
|
const database_schema = require('./shared/bank.9Yw4KHyl.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, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.
|
|
2
|
-
export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, E as AccountCredentialsUpdateType, F as AccountPatchType, G as AccountStatus, J as AccountUpdateType, K as AuthorizedBatch, M as BASE_TERMINAL_STATUSES, N as BATCH_MODES, O as BATCH_STATUES, O as BATCH_STATUSES, Q as BankAccountWithLastSync, R as BankCode, S as BatchInsertType, T as BatchLifecycle, U as BatchMode, V as BatchPayment, B as BatchSelectType, W as BatchStatus, X as CHARGE_BEARERS, Y as CONNECTOR_KEYS, Z as COUNTRY_CODES, _ as CREDENTIALS_TYPES, $ as ChargeBearer, a0 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a1 as CountryCode, a2 as CredentialsType, e as CurrencyCode, a3 as INSTRUCTION_PRIORITIES, a4 as InstructionPriority, L as LastSyncMetadata, a5 as PAYMENT_DIRECTIONS, a6 as PAYMENT_REQUEST_STATUSES, a7 as PAYMENT_STATUSES, a8 as PAYMENT_TYPES, a9 as PaymentDirection, aa as PaymentFailedInsertType, ab as PaymentInsertType, ac as PaymentLifecycle, ad as PaymentPreparedInsertType, ae as PaymentStatus, af as ProcessingBatch, ag as ReadyToSignBatch, ah as ResolvedCredentials, ai as TOKEN_TYPES, aj as TokenType, ak as accountCredentialsInsertSchema, al as accountCredentialsSelectSchema, am as accountCredentialsUpdateSchema, an as accountInsertSchema, ao as accountSelectSchema, ap as accountUpdateSchema, aq as hasPaymentAccountAssigned, ar as isBatchAuthorized, as as isBatchCompleted, at as isBatchFailed, au as isBatchInitiated, av as isBatchProcessing, aw as isBatchReadyToSign, ax as isPaymentCompleted, ay as isPendingStatus, az as isProcessedStatus, aA as isTerminalStatus } from './shared/bank.
|
|
3
|
-
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.
|
|
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.
|
|
1
|
+
import { I as IBankConnector, b as ConnectorKey, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.BrBu52ls.cjs';
|
|
2
|
+
export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, E as AccountCredentialsUpdateType, F as AccountPatchType, G as AccountStatus, J as AccountUpdateType, K as AuthorizedBatch, M as BASE_TERMINAL_STATUSES, N as BATCH_MODES, O as BATCH_STATUES, O as BATCH_STATUSES, Q as BankAccountWithLastSync, R as BankCode, S as BatchInsertType, T as BatchLifecycle, U as BatchMode, V as BatchPayment, B as BatchSelectType, W as BatchStatus, X as CHARGE_BEARERS, Y as CONNECTOR_KEYS, Z as COUNTRY_CODES, _ as CREDENTIALS_TYPES, $ as ChargeBearer, a0 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a1 as CountryCode, a2 as CredentialsType, e as CurrencyCode, a3 as INSTRUCTION_PRIORITIES, a4 as InstructionPriority, L as LastSyncMetadata, a5 as PAYMENT_DIRECTIONS, a6 as PAYMENT_REQUEST_STATUSES, a7 as PAYMENT_STATUSES, a8 as PAYMENT_TYPES, a9 as PaymentDirection, aa as PaymentFailedInsertType, ab as PaymentInsertType, ac as PaymentLifecycle, ad as PaymentPreparedInsertType, ae as PaymentStatus, af as ProcessingBatch, ag as ReadyToSignBatch, ah as ResolvedCredentials, ai as TOKEN_TYPES, aj as TokenType, ak as accountCredentialsInsertSchema, al as accountCredentialsSelectSchema, am as accountCredentialsUpdateSchema, an as accountInsertSchema, ao as accountSelectSchema, ap as accountUpdateSchema, aq as hasPaymentAccountAssigned, ar as isBatchAuthorized, as as isBatchCompleted, at as isBatchFailed, au as isBatchInitiated, av as isBatchProcessing, aw as isBatchReadyToSign, ax as isPaymentCompleted, ay as isPendingStatus, az as isProcessedStatus, aA as isTerminalStatus } from './shared/bank.BrBu52ls.cjs';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.Dzk9ABBs.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.Dzk9ABBs.cjs';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_orm_zod from 'drizzle-orm/zod';
|
package/dist/types.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as IBankConnector, b as ConnectorKey, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.
|
|
2
|
-
export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, E as AccountCredentialsUpdateType, F as AccountPatchType, G as AccountStatus, J as AccountUpdateType, K as AuthorizedBatch, M as BASE_TERMINAL_STATUSES, N as BATCH_MODES, O as BATCH_STATUES, O as BATCH_STATUSES, Q as BankAccountWithLastSync, R as BankCode, S as BatchInsertType, T as BatchLifecycle, U as BatchMode, V as BatchPayment, B as BatchSelectType, W as BatchStatus, X as CHARGE_BEARERS, Y as CONNECTOR_KEYS, Z as COUNTRY_CODES, _ as CREDENTIALS_TYPES, $ as ChargeBearer, a0 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a1 as CountryCode, a2 as CredentialsType, e as CurrencyCode, a3 as INSTRUCTION_PRIORITIES, a4 as InstructionPriority, L as LastSyncMetadata, a5 as PAYMENT_DIRECTIONS, a6 as PAYMENT_REQUEST_STATUSES, a7 as PAYMENT_STATUSES, a8 as PAYMENT_TYPES, a9 as PaymentDirection, aa as PaymentFailedInsertType, ab as PaymentInsertType, ac as PaymentLifecycle, ad as PaymentPreparedInsertType, ae as PaymentStatus, af as ProcessingBatch, ag as ReadyToSignBatch, ah as ResolvedCredentials, ai as TOKEN_TYPES, aj as TokenType, ak as accountCredentialsInsertSchema, al as accountCredentialsSelectSchema, am as accountCredentialsUpdateSchema, an as accountInsertSchema, ao as accountSelectSchema, ap as accountUpdateSchema, aq as hasPaymentAccountAssigned, ar as isBatchAuthorized, as as isBatchCompleted, at as isBatchFailed, au as isBatchInitiated, av as isBatchProcessing, aw as isBatchReadyToSign, ax as isPaymentCompleted, ay as isPendingStatus, az as isProcessedStatus, aA as isTerminalStatus } from './shared/bank.
|
|
3
|
-
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.
|
|
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.
|
|
1
|
+
import { I as IBankConnector, b as ConnectorKey, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.BrBu52ls.mjs';
|
|
2
|
+
export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, E as AccountCredentialsUpdateType, F as AccountPatchType, G as AccountStatus, J as AccountUpdateType, K as AuthorizedBatch, M as BASE_TERMINAL_STATUSES, N as BATCH_MODES, O as BATCH_STATUES, O as BATCH_STATUSES, Q as BankAccountWithLastSync, R as BankCode, S as BatchInsertType, T as BatchLifecycle, U as BatchMode, V as BatchPayment, B as BatchSelectType, W as BatchStatus, X as CHARGE_BEARERS, Y as CONNECTOR_KEYS, Z as COUNTRY_CODES, _ as CREDENTIALS_TYPES, $ as ChargeBearer, a0 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a1 as CountryCode, a2 as CredentialsType, e as CurrencyCode, a3 as INSTRUCTION_PRIORITIES, a4 as InstructionPriority, L as LastSyncMetadata, a5 as PAYMENT_DIRECTIONS, a6 as PAYMENT_REQUEST_STATUSES, a7 as PAYMENT_STATUSES, a8 as PAYMENT_TYPES, a9 as PaymentDirection, aa as PaymentFailedInsertType, ab as PaymentInsertType, ac as PaymentLifecycle, ad as PaymentPreparedInsertType, ae as PaymentStatus, af as ProcessingBatch, ag as ReadyToSignBatch, ah as ResolvedCredentials, ai as TOKEN_TYPES, aj as TokenType, ak as accountCredentialsInsertSchema, al as accountCredentialsSelectSchema, am as accountCredentialsUpdateSchema, an as accountInsertSchema, ao as accountSelectSchema, ap as accountUpdateSchema, aq as hasPaymentAccountAssigned, ar as isBatchAuthorized, as as isBatchCompleted, at as isBatchFailed, au as isBatchInitiated, av as isBatchProcessing, aw as isBatchReadyToSign, ax as isPaymentCompleted, ay as isPendingStatus, az as isProcessedStatus, aA as isTerminalStatus } from './shared/bank.BrBu52ls.mjs';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.o3KC69CF.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.o3KC69CF.mjs';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_orm_zod from 'drizzle-orm/zod';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as IBankConnector, b as ConnectorKey, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.
|
|
2
|
-
export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, E as AccountCredentialsUpdateType, F as AccountPatchType, G as AccountStatus, J as AccountUpdateType, K as AuthorizedBatch, M as BASE_TERMINAL_STATUSES, N as BATCH_MODES, O as BATCH_STATUES, O as BATCH_STATUSES, Q as BankAccountWithLastSync, R as BankCode, S as BatchInsertType, T as BatchLifecycle, U as BatchMode, V as BatchPayment, B as BatchSelectType, W as BatchStatus, X as CHARGE_BEARERS, Y as CONNECTOR_KEYS, Z as COUNTRY_CODES, _ as CREDENTIALS_TYPES, $ as ChargeBearer, a0 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a1 as CountryCode, a2 as CredentialsType, e as CurrencyCode, a3 as INSTRUCTION_PRIORITIES, a4 as InstructionPriority, L as LastSyncMetadata, a5 as PAYMENT_DIRECTIONS, a6 as PAYMENT_REQUEST_STATUSES, a7 as PAYMENT_STATUSES, a8 as PAYMENT_TYPES, a9 as PaymentDirection, aa as PaymentFailedInsertType, ab as PaymentInsertType, ac as PaymentLifecycle, ad as PaymentPreparedInsertType, ae as PaymentStatus, af as ProcessingBatch, ag as ReadyToSignBatch, ah as ResolvedCredentials, ai as TOKEN_TYPES, aj as TokenType, ak as accountCredentialsInsertSchema, al as accountCredentialsSelectSchema, am as accountCredentialsUpdateSchema, an as accountInsertSchema, ao as accountSelectSchema, ap as accountUpdateSchema, aq as hasPaymentAccountAssigned, ar as isBatchAuthorized, as as isBatchCompleted, at as isBatchFailed, au as isBatchInitiated, av as isBatchProcessing, aw as isBatchReadyToSign, ax as isPaymentCompleted, ay as isPendingStatus, az as isProcessedStatus, aA as isTerminalStatus } from './shared/bank.
|
|
3
|
-
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.
|
|
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.
|
|
1
|
+
import { I as IBankConnector, b as ConnectorKey, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.BrBu52ls.js';
|
|
2
|
+
export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, E as AccountCredentialsUpdateType, F as AccountPatchType, G as AccountStatus, J as AccountUpdateType, K as AuthorizedBatch, M as BASE_TERMINAL_STATUSES, N as BATCH_MODES, O as BATCH_STATUES, O as BATCH_STATUSES, Q as BankAccountWithLastSync, R as BankCode, S as BatchInsertType, T as BatchLifecycle, U as BatchMode, V as BatchPayment, B as BatchSelectType, W as BatchStatus, X as CHARGE_BEARERS, Y as CONNECTOR_KEYS, Z as COUNTRY_CODES, _ as CREDENTIALS_TYPES, $ as ChargeBearer, a0 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a1 as CountryCode, a2 as CredentialsType, e as CurrencyCode, a3 as INSTRUCTION_PRIORITIES, a4 as InstructionPriority, L as LastSyncMetadata, a5 as PAYMENT_DIRECTIONS, a6 as PAYMENT_REQUEST_STATUSES, a7 as PAYMENT_STATUSES, a8 as PAYMENT_TYPES, a9 as PaymentDirection, aa as PaymentFailedInsertType, ab as PaymentInsertType, ac as PaymentLifecycle, ad as PaymentPreparedInsertType, ae as PaymentStatus, af as ProcessingBatch, ag as ReadyToSignBatch, ah as ResolvedCredentials, ai as TOKEN_TYPES, aj as TokenType, ak as accountCredentialsInsertSchema, al as accountCredentialsSelectSchema, am as accountCredentialsUpdateSchema, an as accountInsertSchema, ao as accountSelectSchema, ap as accountUpdateSchema, aq as hasPaymentAccountAssigned, ar as isBatchAuthorized, as as isBatchCompleted, at as isBatchFailed, au as isBatchInitiated, av as isBatchProcessing, aw as isBatchReadyToSign, ax as isPaymentCompleted, ay as isPendingStatus, az as isProcessedStatus, aA as isTerminalStatus } from './shared/bank.BrBu52ls.js';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.Cfz0frnc.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.Cfz0frnc.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_orm_zod from 'drizzle-orm/zod';
|
package/dist/types.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BASE_TERMINAL_STATUSES, 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 accountCredentialsInsertSchema, e as accountCredentialsSelectSchema, f as accountCredentialsUpdateSchema, g as accountInsertSchema, h as accountSelectSchema, i as accountUpdateSchema, j as assignAccount, k as dbuAccountConfigSchema, l as hasPaymentAccountAssigned, m as isPaymentCompleted, n as isPendingStatus, o as isProcessedStatus, p as isTerminalStatus, q as ottInsertSchema, r as ottSelectSchema, s as ottUpdateSchema, t as signFinbricksJws, u as toBatchedPayment, v as toBatchedPaymentFromPaymentRequest, w as toCompletedPayment, x as toIncomingPayment, y as toPaymentRequestInsert, z as toPreparedPayment, A as useFinbricksFetch } from './shared/bank.
|
|
1
|
+
export { B as BASE_TERMINAL_STATUSES, 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 accountCredentialsInsertSchema, e as accountCredentialsSelectSchema, f as accountCredentialsUpdateSchema, g as accountInsertSchema, h as accountSelectSchema, i as accountUpdateSchema, j as assignAccount, k as dbuAccountConfigSchema, l as hasPaymentAccountAssigned, m as isPaymentCompleted, n as isPendingStatus, o as isProcessedStatus, p as isTerminalStatus, q as ottInsertSchema, r as ottSelectSchema, s as ottUpdateSchema, t as signFinbricksJws, u as toBatchedPayment, v as toBatchedPaymentFromPaymentRequest, w as toCompletedPayment, x as toIncomingPayment, y as toPaymentRequestInsert, z as toPreparedPayment, A as useFinbricksFetch } from './shared/bank.s-kUzZ-_.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 } from './shared/bank.BzDNLxB_.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';
|