@develit-services/bank 4.3.0 → 5.0.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.
Files changed (39) hide show
  1. package/dist/{export/worker.cjs → base.cjs} +27 -27
  2. package/dist/{export/worker.d.ts → base.d.cts} +4 -4
  3. package/dist/{export/worker.d.mts → base.d.mts} +4 -4
  4. package/dist/{export/worker.d.cts → base.d.ts} +4 -4
  5. package/dist/{export/worker.mjs → base.mjs} +4 -4
  6. package/dist/database/schema.d.cts +1 -1
  7. package/dist/database/schema.d.mts +1 -1
  8. package/dist/database/schema.d.ts +1 -1
  9. package/dist/export/workflows.cjs +2 -2
  10. package/dist/export/workflows.mjs +2 -2
  11. package/dist/service.cjs +40 -0
  12. package/dist/service.d.cts +222 -0
  13. package/dist/service.d.mts +222 -0
  14. package/dist/service.d.ts +222 -0
  15. package/dist/service.mjs +37 -0
  16. package/dist/shared/{bank.NjHGMD3j.cjs → bank.BSX82jhx.cjs} +67 -22
  17. package/dist/shared/{bank.DyueVCXo.mjs → bank.BdTj54NO.mjs} +1 -1
  18. package/dist/shared/{bank.CkSgCZ-W.d.cts → bank.C-edstpR.d.cts} +1 -1
  19. package/dist/shared/{bank.tefvLkrJ.d.mts → bank.C6BQDtpF.d.mts} +1 -1
  20. package/dist/shared/{bank.BmDlJzUz.mjs → bank.CZ8MQDPa.mjs} +67 -22
  21. package/dist/shared/{bank.C-XeuTid.cjs → bank.CibQRM2D.cjs} +1 -1
  22. package/dist/shared/{bank.d4sMg6i0.d.cts → bank.Do1KUeDr.d.cts} +1 -1
  23. package/dist/shared/{bank.d4sMg6i0.d.mts → bank.Do1KUeDr.d.mts} +1 -1
  24. package/dist/shared/{bank.d4sMg6i0.d.ts → bank.Do1KUeDr.d.ts} +1 -1
  25. package/dist/shared/{bank.B2FLbr0c.d.ts → bank.pZQAWlIB.d.ts} +1 -1
  26. package/dist/types.cjs +1 -1
  27. package/dist/types.d.cts +4 -5
  28. package/dist/types.d.mts +4 -5
  29. package/dist/types.d.ts +4 -5
  30. package/dist/types.mjs +1 -1
  31. package/package.json +13 -12
  32. package/dist/export/wrangler.cjs +0 -75
  33. package/dist/export/wrangler.d.cts +0 -80
  34. package/dist/export/wrangler.d.mts +0 -80
  35. package/dist/export/wrangler.d.ts +0 -80
  36. package/dist/export/wrangler.mjs +0 -73
  37. package/dist/shared/bank.DyZBd2qL.d.cts +0 -43
  38. package/dist/shared/bank.DyZBd2qL.d.mts +0 -43
  39. package/dist/shared/bank.DyZBd2qL.d.ts +0 -43
@@ -0,0 +1,222 @@
1
+ import * as _develit_io_platform_sdk from '@develit-io/platform-sdk';
2
+ import { Deployment } from '@develit-io/platform-sdk';
3
+ import { BindingsFromDescriptor } from '@develit-io/platform-sdk/service-config';
4
+
5
+ interface BankServiceVariables {
6
+ ERSTE_AUTH_URI: string;
7
+ ERSTE_PAYMENTS_URI: string;
8
+ ERSTE_ACCOUNTS_URI: string;
9
+ FINBRICKS_BASE_URI: string;
10
+ FINBRICKS_MERCHANT_ID: string;
11
+ CRON_PAYMENT_STATUSES: string;
12
+ CRON_SYNC_WORKFLOW_HEARTBEAT: string;
13
+ BANK_AUTH_RECIPIENT: string;
14
+ DBUCS_BASE_URI: string;
15
+ DBUCS_USERNAME: string;
16
+ DBUCS_APPLICATION_CODE: string;
17
+ DBUCS_TX_AUTH_URI: string;
18
+ REDIRECT_URI: string;
19
+ SYNC_WORKFLOW_RESET_AFTER_ITERATIONS: string;
20
+ [key: string]: string | number | boolean;
21
+ }
22
+ declare const BANK_SERVICE_BINDINGS: {
23
+ readonly SECRETS_STORE: {
24
+ readonly kind: "service";
25
+ readonly target: "secrets-store";
26
+ };
27
+ readonly BANK_KV: {
28
+ readonly kind: "kv";
29
+ readonly suffix: "bank";
30
+ };
31
+ readonly BANK_D1: {
32
+ readonly kind: "d1";
33
+ readonly suffix: "bank";
34
+ };
35
+ readonly QUEUE_BUS_QUEUE: {
36
+ readonly kind: "queueProducer";
37
+ readonly suffix: "queue-bus";
38
+ };
39
+ readonly NOTIFICATIONS_QUEUE: {
40
+ readonly kind: "queueProducer";
41
+ readonly suffix: "notifications";
42
+ };
43
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
44
+ readonly kind: "workflow";
45
+ readonly class: "BankSyncAccountPayments";
46
+ readonly suffix: "bank-sync-account-payments";
47
+ readonly limits: {
48
+ readonly steps: 25000;
49
+ };
50
+ };
51
+ readonly PROCESS_BATCH_WORKFLOW: {
52
+ readonly kind: "workflow";
53
+ readonly class: "BankProcessBatch";
54
+ readonly suffix: "bank-process-batch";
55
+ };
56
+ readonly DBU_CBS_BACKOFFICE_DEV: {
57
+ readonly kind: "vpc";
58
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
59
+ };
60
+ };
61
+ declare const baseBankServiceConfig: (project: string, version: string, options?: _develit_io_platform_sdk.ServiceConfigOptions<BankServiceVariables, _develit_io_platform_sdk.MiniflareIds<{
62
+ readonly SECRETS_STORE: {
63
+ readonly kind: "service";
64
+ readonly target: "secrets-store";
65
+ };
66
+ readonly BANK_KV: {
67
+ readonly kind: "kv";
68
+ readonly suffix: "bank";
69
+ };
70
+ readonly BANK_D1: {
71
+ readonly kind: "d1";
72
+ readonly suffix: "bank";
73
+ };
74
+ readonly QUEUE_BUS_QUEUE: {
75
+ readonly kind: "queueProducer";
76
+ readonly suffix: "queue-bus";
77
+ };
78
+ readonly NOTIFICATIONS_QUEUE: {
79
+ readonly kind: "queueProducer";
80
+ readonly suffix: "notifications";
81
+ };
82
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
83
+ readonly kind: "workflow";
84
+ readonly class: "BankSyncAccountPayments";
85
+ readonly suffix: "bank-sync-account-payments";
86
+ readonly limits: {
87
+ readonly steps: 25000;
88
+ };
89
+ };
90
+ readonly PROCESS_BATCH_WORKFLOW: {
91
+ readonly kind: "workflow";
92
+ readonly class: "BankProcessBatch";
93
+ readonly suffix: "bank-process-batch";
94
+ };
95
+ readonly DBU_CBS_BACKOFFICE_DEV: {
96
+ readonly kind: "vpc";
97
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
98
+ };
99
+ }>> | undefined) => _develit_io_platform_sdk.ServiceConfigWithBindings<BankServiceVariables, {
100
+ readonly SECRETS_STORE: {
101
+ readonly kind: "service";
102
+ readonly target: "secrets-store";
103
+ };
104
+ readonly BANK_KV: {
105
+ readonly kind: "kv";
106
+ readonly suffix: "bank";
107
+ };
108
+ readonly BANK_D1: {
109
+ readonly kind: "d1";
110
+ readonly suffix: "bank";
111
+ };
112
+ readonly QUEUE_BUS_QUEUE: {
113
+ readonly kind: "queueProducer";
114
+ readonly suffix: "queue-bus";
115
+ };
116
+ readonly NOTIFICATIONS_QUEUE: {
117
+ readonly kind: "queueProducer";
118
+ readonly suffix: "notifications";
119
+ };
120
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
121
+ readonly kind: "workflow";
122
+ readonly class: "BankSyncAccountPayments";
123
+ readonly suffix: "bank-sync-account-payments";
124
+ readonly limits: {
125
+ readonly steps: 25000;
126
+ };
127
+ };
128
+ readonly PROCESS_BATCH_WORKFLOW: {
129
+ readonly kind: "workflow";
130
+ readonly class: "BankProcessBatch";
131
+ readonly suffix: "bank-process-batch";
132
+ };
133
+ readonly DBU_CBS_BACKOFFICE_DEV: {
134
+ readonly kind: "vpc";
135
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
136
+ };
137
+ }, readonly []>;
138
+ declare function bankServiceConfig(project: string, version: string, options?: Parameters<typeof baseBankServiceConfig>[2]): ((deployment: Deployment, bindings: BindingsFromDescriptor<typeof BANK_SERVICE_BINDINGS>) => {
139
+ resourceName: "bank";
140
+ variables: BankServiceVariables;
141
+ bindings: BindingsFromDescriptor<{
142
+ readonly SECRETS_STORE: {
143
+ readonly kind: "service";
144
+ readonly target: "secrets-store";
145
+ };
146
+ readonly BANK_KV: {
147
+ readonly kind: "kv";
148
+ readonly suffix: "bank";
149
+ };
150
+ readonly BANK_D1: {
151
+ readonly kind: "d1";
152
+ readonly suffix: "bank";
153
+ };
154
+ readonly QUEUE_BUS_QUEUE: {
155
+ readonly kind: "queueProducer";
156
+ readonly suffix: "queue-bus";
157
+ };
158
+ readonly NOTIFICATIONS_QUEUE: {
159
+ readonly kind: "queueProducer";
160
+ readonly suffix: "notifications";
161
+ };
162
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
163
+ readonly kind: "workflow";
164
+ readonly class: "BankSyncAccountPayments";
165
+ readonly suffix: "bank-sync-account-payments";
166
+ readonly limits: {
167
+ readonly steps: 25000;
168
+ };
169
+ };
170
+ readonly PROCESS_BATCH_WORKFLOW: {
171
+ readonly kind: "workflow";
172
+ readonly class: "BankProcessBatch";
173
+ readonly suffix: "bank-process-batch";
174
+ };
175
+ readonly DBU_CBS_BACKOFFICE_DEV: {
176
+ readonly kind: "vpc";
177
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
178
+ };
179
+ }>;
180
+ crons: string[];
181
+ }) & _develit_io_platform_sdk.ServiceConfigWithBindings<BankServiceVariables, {
182
+ readonly SECRETS_STORE: {
183
+ readonly kind: "service";
184
+ readonly target: "secrets-store";
185
+ };
186
+ readonly BANK_KV: {
187
+ readonly kind: "kv";
188
+ readonly suffix: "bank";
189
+ };
190
+ readonly BANK_D1: {
191
+ readonly kind: "d1";
192
+ readonly suffix: "bank";
193
+ };
194
+ readonly QUEUE_BUS_QUEUE: {
195
+ readonly kind: "queueProducer";
196
+ readonly suffix: "queue-bus";
197
+ };
198
+ readonly NOTIFICATIONS_QUEUE: {
199
+ readonly kind: "queueProducer";
200
+ readonly suffix: "notifications";
201
+ };
202
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
203
+ readonly kind: "workflow";
204
+ readonly class: "BankSyncAccountPayments";
205
+ readonly suffix: "bank-sync-account-payments";
206
+ readonly limits: {
207
+ readonly steps: 25000;
208
+ };
209
+ };
210
+ readonly PROCESS_BATCH_WORKFLOW: {
211
+ readonly kind: "workflow";
212
+ readonly class: "BankProcessBatch";
213
+ readonly suffix: "bank-process-batch";
214
+ };
215
+ readonly DBU_CBS_BACKOFFICE_DEV: {
216
+ readonly kind: "vpc";
217
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
218
+ };
219
+ }, readonly []>;
220
+
221
+ export { BANK_SERVICE_BINDINGS, bankServiceConfig };
222
+ export type { BankServiceVariables };
@@ -0,0 +1,222 @@
1
+ import * as _develit_io_platform_sdk from '@develit-io/platform-sdk';
2
+ import { Deployment } from '@develit-io/platform-sdk';
3
+ import { BindingsFromDescriptor } from '@develit-io/platform-sdk/service-config';
4
+
5
+ interface BankServiceVariables {
6
+ ERSTE_AUTH_URI: string;
7
+ ERSTE_PAYMENTS_URI: string;
8
+ ERSTE_ACCOUNTS_URI: string;
9
+ FINBRICKS_BASE_URI: string;
10
+ FINBRICKS_MERCHANT_ID: string;
11
+ CRON_PAYMENT_STATUSES: string;
12
+ CRON_SYNC_WORKFLOW_HEARTBEAT: string;
13
+ BANK_AUTH_RECIPIENT: string;
14
+ DBUCS_BASE_URI: string;
15
+ DBUCS_USERNAME: string;
16
+ DBUCS_APPLICATION_CODE: string;
17
+ DBUCS_TX_AUTH_URI: string;
18
+ REDIRECT_URI: string;
19
+ SYNC_WORKFLOW_RESET_AFTER_ITERATIONS: string;
20
+ [key: string]: string | number | boolean;
21
+ }
22
+ declare const BANK_SERVICE_BINDINGS: {
23
+ readonly SECRETS_STORE: {
24
+ readonly kind: "service";
25
+ readonly target: "secrets-store";
26
+ };
27
+ readonly BANK_KV: {
28
+ readonly kind: "kv";
29
+ readonly suffix: "bank";
30
+ };
31
+ readonly BANK_D1: {
32
+ readonly kind: "d1";
33
+ readonly suffix: "bank";
34
+ };
35
+ readonly QUEUE_BUS_QUEUE: {
36
+ readonly kind: "queueProducer";
37
+ readonly suffix: "queue-bus";
38
+ };
39
+ readonly NOTIFICATIONS_QUEUE: {
40
+ readonly kind: "queueProducer";
41
+ readonly suffix: "notifications";
42
+ };
43
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
44
+ readonly kind: "workflow";
45
+ readonly class: "BankSyncAccountPayments";
46
+ readonly suffix: "bank-sync-account-payments";
47
+ readonly limits: {
48
+ readonly steps: 25000;
49
+ };
50
+ };
51
+ readonly PROCESS_BATCH_WORKFLOW: {
52
+ readonly kind: "workflow";
53
+ readonly class: "BankProcessBatch";
54
+ readonly suffix: "bank-process-batch";
55
+ };
56
+ readonly DBU_CBS_BACKOFFICE_DEV: {
57
+ readonly kind: "vpc";
58
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
59
+ };
60
+ };
61
+ declare const baseBankServiceConfig: (project: string, version: string, options?: _develit_io_platform_sdk.ServiceConfigOptions<BankServiceVariables, _develit_io_platform_sdk.MiniflareIds<{
62
+ readonly SECRETS_STORE: {
63
+ readonly kind: "service";
64
+ readonly target: "secrets-store";
65
+ };
66
+ readonly BANK_KV: {
67
+ readonly kind: "kv";
68
+ readonly suffix: "bank";
69
+ };
70
+ readonly BANK_D1: {
71
+ readonly kind: "d1";
72
+ readonly suffix: "bank";
73
+ };
74
+ readonly QUEUE_BUS_QUEUE: {
75
+ readonly kind: "queueProducer";
76
+ readonly suffix: "queue-bus";
77
+ };
78
+ readonly NOTIFICATIONS_QUEUE: {
79
+ readonly kind: "queueProducer";
80
+ readonly suffix: "notifications";
81
+ };
82
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
83
+ readonly kind: "workflow";
84
+ readonly class: "BankSyncAccountPayments";
85
+ readonly suffix: "bank-sync-account-payments";
86
+ readonly limits: {
87
+ readonly steps: 25000;
88
+ };
89
+ };
90
+ readonly PROCESS_BATCH_WORKFLOW: {
91
+ readonly kind: "workflow";
92
+ readonly class: "BankProcessBatch";
93
+ readonly suffix: "bank-process-batch";
94
+ };
95
+ readonly DBU_CBS_BACKOFFICE_DEV: {
96
+ readonly kind: "vpc";
97
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
98
+ };
99
+ }>> | undefined) => _develit_io_platform_sdk.ServiceConfigWithBindings<BankServiceVariables, {
100
+ readonly SECRETS_STORE: {
101
+ readonly kind: "service";
102
+ readonly target: "secrets-store";
103
+ };
104
+ readonly BANK_KV: {
105
+ readonly kind: "kv";
106
+ readonly suffix: "bank";
107
+ };
108
+ readonly BANK_D1: {
109
+ readonly kind: "d1";
110
+ readonly suffix: "bank";
111
+ };
112
+ readonly QUEUE_BUS_QUEUE: {
113
+ readonly kind: "queueProducer";
114
+ readonly suffix: "queue-bus";
115
+ };
116
+ readonly NOTIFICATIONS_QUEUE: {
117
+ readonly kind: "queueProducer";
118
+ readonly suffix: "notifications";
119
+ };
120
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
121
+ readonly kind: "workflow";
122
+ readonly class: "BankSyncAccountPayments";
123
+ readonly suffix: "bank-sync-account-payments";
124
+ readonly limits: {
125
+ readonly steps: 25000;
126
+ };
127
+ };
128
+ readonly PROCESS_BATCH_WORKFLOW: {
129
+ readonly kind: "workflow";
130
+ readonly class: "BankProcessBatch";
131
+ readonly suffix: "bank-process-batch";
132
+ };
133
+ readonly DBU_CBS_BACKOFFICE_DEV: {
134
+ readonly kind: "vpc";
135
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
136
+ };
137
+ }, readonly []>;
138
+ declare function bankServiceConfig(project: string, version: string, options?: Parameters<typeof baseBankServiceConfig>[2]): ((deployment: Deployment, bindings: BindingsFromDescriptor<typeof BANK_SERVICE_BINDINGS>) => {
139
+ resourceName: "bank";
140
+ variables: BankServiceVariables;
141
+ bindings: BindingsFromDescriptor<{
142
+ readonly SECRETS_STORE: {
143
+ readonly kind: "service";
144
+ readonly target: "secrets-store";
145
+ };
146
+ readonly BANK_KV: {
147
+ readonly kind: "kv";
148
+ readonly suffix: "bank";
149
+ };
150
+ readonly BANK_D1: {
151
+ readonly kind: "d1";
152
+ readonly suffix: "bank";
153
+ };
154
+ readonly QUEUE_BUS_QUEUE: {
155
+ readonly kind: "queueProducer";
156
+ readonly suffix: "queue-bus";
157
+ };
158
+ readonly NOTIFICATIONS_QUEUE: {
159
+ readonly kind: "queueProducer";
160
+ readonly suffix: "notifications";
161
+ };
162
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
163
+ readonly kind: "workflow";
164
+ readonly class: "BankSyncAccountPayments";
165
+ readonly suffix: "bank-sync-account-payments";
166
+ readonly limits: {
167
+ readonly steps: 25000;
168
+ };
169
+ };
170
+ readonly PROCESS_BATCH_WORKFLOW: {
171
+ readonly kind: "workflow";
172
+ readonly class: "BankProcessBatch";
173
+ readonly suffix: "bank-process-batch";
174
+ };
175
+ readonly DBU_CBS_BACKOFFICE_DEV: {
176
+ readonly kind: "vpc";
177
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
178
+ };
179
+ }>;
180
+ crons: string[];
181
+ }) & _develit_io_platform_sdk.ServiceConfigWithBindings<BankServiceVariables, {
182
+ readonly SECRETS_STORE: {
183
+ readonly kind: "service";
184
+ readonly target: "secrets-store";
185
+ };
186
+ readonly BANK_KV: {
187
+ readonly kind: "kv";
188
+ readonly suffix: "bank";
189
+ };
190
+ readonly BANK_D1: {
191
+ readonly kind: "d1";
192
+ readonly suffix: "bank";
193
+ };
194
+ readonly QUEUE_BUS_QUEUE: {
195
+ readonly kind: "queueProducer";
196
+ readonly suffix: "queue-bus";
197
+ };
198
+ readonly NOTIFICATIONS_QUEUE: {
199
+ readonly kind: "queueProducer";
200
+ readonly suffix: "notifications";
201
+ };
202
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
203
+ readonly kind: "workflow";
204
+ readonly class: "BankSyncAccountPayments";
205
+ readonly suffix: "bank-sync-account-payments";
206
+ readonly limits: {
207
+ readonly steps: 25000;
208
+ };
209
+ };
210
+ readonly PROCESS_BATCH_WORKFLOW: {
211
+ readonly kind: "workflow";
212
+ readonly class: "BankProcessBatch";
213
+ readonly suffix: "bank-process-batch";
214
+ };
215
+ readonly DBU_CBS_BACKOFFICE_DEV: {
216
+ readonly kind: "vpc";
217
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
218
+ };
219
+ }, readonly []>;
220
+
221
+ export { BANK_SERVICE_BINDINGS, bankServiceConfig };
222
+ export type { BankServiceVariables };
@@ -0,0 +1,37 @@
1
+ import { createTypedServiceConfigFactory, configKeyFor } from '@develit-io/platform-sdk/service-config';
2
+
3
+ const BANK_SERVICE_BINDINGS = {
4
+ SECRETS_STORE: { kind: "service", target: "secrets-store" },
5
+ BANK_KV: { kind: "kv", suffix: "bank" },
6
+ BANK_D1: { kind: "d1", suffix: "bank" },
7
+ QUEUE_BUS_QUEUE: { kind: "queueProducer", suffix: "queue-bus" },
8
+ NOTIFICATIONS_QUEUE: { kind: "queueProducer", suffix: "notifications" },
9
+ SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
10
+ kind: "workflow",
11
+ class: "BankSyncAccountPayments",
12
+ suffix: "bank-sync-account-payments",
13
+ limits: { steps: 25e3 }
14
+ },
15
+ PROCESS_BATCH_WORKFLOW: {
16
+ kind: "workflow",
17
+ class: "BankProcessBatch",
18
+ suffix: "bank-process-batch"
19
+ },
20
+ DBU_CBS_BACKOFFICE_DEV: {
21
+ kind: "vpc",
22
+ serviceId: "019c2962-172c-75a2-a000-b76e246d25d7"
23
+ }
24
+ };
25
+ const baseBankServiceConfig = createTypedServiceConfigFactory()(BANK_SERVICE_BINDINGS);
26
+ function bankServiceConfig(project, version, options) {
27
+ const config = baseBankServiceConfig(project, version, options);
28
+ const callable = (deployment, bindings) => ({
29
+ resourceName: "bank",
30
+ variables: config.vars[configKeyFor(deployment.environment)],
31
+ bindings,
32
+ crons: config.triggers.crons[configKeyFor(deployment.environment)]
33
+ });
34
+ return Object.assign(callable, config);
35
+ }
36
+
37
+ export { BANK_SERVICE_BINDINGS, bankServiceConfig };
@@ -322,12 +322,40 @@ function toBatchedPaymentFromPaymentRequest(sp) {
322
322
  };
323
323
  }
324
324
 
325
+ const MAX_REFERENCE_LENGTH = 30;
326
+ function buildPaymentReference(symbols) {
327
+ const parts = [
328
+ symbols.vs && `VS${symbols.vs}`,
329
+ symbols.ss && `SS${symbols.ss}`,
330
+ symbols.ks && `KS${symbols.ks}`
331
+ ].filter(Boolean);
332
+ return parts.join("").slice(0, MAX_REFERENCE_LENGTH);
333
+ }
334
+
335
+ const SYMBOL_LIMITS = { vs: 10, ss: 10, ks: 4 };
336
+ function assertSymbolLength(symbol, value) {
337
+ const max = SYMBOL_LIMITS[symbol];
338
+ if (value.length > max) {
339
+ throw new Error(
340
+ `buildEndToEndId: ${symbol.toUpperCase()} exceeds SEPA limit (${value.length} > ${max} chars): "${value}"`
341
+ );
342
+ }
343
+ }
325
344
  function buildEndToEndId(payment, options = {}) {
326
345
  const { separator = "/" } = options;
327
346
  const parts = [];
328
- if (payment.vs) parts.push(`VS${payment.vs}`);
329
- if (payment.ss) parts.push(`SS${payment.ss}`);
330
- if (payment.ks) parts.push(`KS${payment.ks}`);
347
+ if (payment.vs) {
348
+ assertSymbolLength("vs", payment.vs);
349
+ parts.push(`VS${payment.vs}`);
350
+ }
351
+ if (payment.ss) {
352
+ assertSymbolLength("ss", payment.ss);
353
+ parts.push(`SS${payment.ss}`);
354
+ }
355
+ if (payment.ks) {
356
+ assertSymbolLength("ks", payment.ks);
357
+ parts.push(`KS${payment.ks}`);
358
+ }
331
359
  if (parts.length === 0) {
332
360
  return payment.id.replace(/-/g, "");
333
361
  }
@@ -488,6 +516,10 @@ const mapFinbricksAccountInsert = ({
488
516
  iban: account.identification.iban
489
517
  });
490
518
 
519
+ const VS_REGEX = /VS[:/\s]*(\d+)/i;
520
+ const SS_REGEX = /SS[:/\s]*(\d+)/i;
521
+ const KS_REGEX = /KS[:/\s]*(\d+)/i;
522
+ const extract = (haystack, regex) => haystack.match(regex)?.[1];
491
523
  const mapReferencesToPayment = (reference) => {
492
524
  const symbols = {
493
525
  vs: void 0,
@@ -495,19 +527,10 @@ const mapReferencesToPayment = (reference) => {
495
527
  ks: void 0
496
528
  };
497
529
  if (!reference) return symbols;
498
- if (Array.isArray(reference) && reference.length > 0) {
499
- symbols.vs = reference.find((ref) => ref.includes("VS")) || void 0;
500
- symbols.ss = reference.find((ref) => ref.includes("SS")) || void 0;
501
- symbols.ks = reference.find((ref) => ref.includes("KS")) || void 0;
502
- }
503
- if (typeof reference === "string") {
504
- const vsMatch = reference.match(/VS[:\s]*(\d+)/i);
505
- const ssMatch = reference.match(/SS[:\s]*(\d+)/i);
506
- const ksMatch = reference.match(/KS[:\s]*(\d+)/i);
507
- if (vsMatch) symbols.vs = vsMatch[1];
508
- if (ssMatch) symbols.ss = ssMatch[1];
509
- if (ksMatch) symbols.ks = ksMatch[1];
510
- }
530
+ const haystack = Array.isArray(reference) ? reference.join(" ") : reference;
531
+ symbols.vs = extract(haystack, VS_REGEX);
532
+ symbols.ss = extract(haystack, SS_REGEX);
533
+ symbols.ks = extract(haystack, KS_REGEX);
511
534
  return symbols;
512
535
  };
513
536
 
@@ -590,8 +613,23 @@ function detectPaymentType(tx, isIncoming) {
590
613
  const mapFinbricksTransactionToPayment = (tx, account) => {
591
614
  const isIncoming = tx.creditDebitIndicator === "CRDT";
592
615
  const related = tx.entryDetails?.transactionDetails?.relatedParties;
593
- const endToEndId = tx.entryDetails.transactionDetails?.references?.endToEndIdentification;
594
- const symbolsRegex = /^\/?VS\d+/;
616
+ const td = tx.entryDetails?.transactionDetails;
617
+ const referenceSources = [
618
+ td?.remittanceInformation?.structured?.creditorReferenceInformation?.reference,
619
+ td?.references?.endToEndIdentification,
620
+ td?.remittanceInformation?.unstructured,
621
+ td?.additionalRemittanceInformation,
622
+ td?.additionalTransactionInformation
623
+ ];
624
+ const symbols = referenceSources.reduce((acc, src) => {
625
+ if (acc.vs && acc.ss && acc.ks) return acc;
626
+ const parsed = mapReferencesToPayment(src);
627
+ return {
628
+ vs: acc.vs ?? parsed.vs,
629
+ ss: acc.ss ?? parsed.ss,
630
+ ks: acc.ks ?? parsed.ks
631
+ };
632
+ }, {});
595
633
  const debtorParsed = parseOtherIdentification(
596
634
  related?.debtorAccount?.identification?.other?.identification
597
635
  );
@@ -608,11 +646,9 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
608
646
  currency: tx.amount?.currency || "CZK",
609
647
  paymentType: detectPaymentType(tx, isIncoming),
610
648
  status: mapFinbricksStatus(tx.status, !!tx.bookingDate?.date),
611
- message: tx.entryDetails.transactionDetails?.remittanceInformation?.unstructured || tx.entryDetails.transactionDetails?.additionalRemittanceInformation || tx.entryDetails.transactionDetails?.additionalTransactionInformation || null,
649
+ message: td?.remittanceInformation?.unstructured || td?.additionalRemittanceInformation || td?.additionalTransactionInformation || null,
612
650
  processedAt: new Date(tx.bookingDate.date),
613
- ...mapReferencesToPayment(
614
- tx.entryDetails.transactionDetails?.remittanceInformation?.structured?.creditorReferenceInformation?.reference || (endToEndId && symbolsRegex.test(endToEndId) ? endToEndId : void 0)
615
- ),
651
+ ...symbols,
616
652
  creditor: {
617
653
  holderName: related?.creditorAccount?.name || related?.creditor?.name || "Unknown",
618
654
  iban: isIncoming ? account.iban || void 0 : related?.creditorAccount?.identification?.iban || creditorParsed.iban || void 0,
@@ -935,6 +971,12 @@ class FinbricksConnector extends IBankConnector {
935
971
  const creditorAgent = creditorIdentification.type === "BBAN" && creditorBic ? {
936
972
  financialInstitutionIdentification: { bic: creditorBic }
937
973
  } : void 0;
974
+ const reference = buildPaymentReference({
975
+ vs: payment.vs,
976
+ ss: payment.ss,
977
+ ks: payment.ks
978
+ });
979
+ const unstructured = [reference, payment.message?.trim()].filter(Boolean).join(" ").slice(0, 140) || void 0;
938
980
  const bankRefId = backendSdk.uuidv4();
939
981
  const [response, error] = await backendSdk.useResult(
940
982
  this.finbricks.request({
@@ -964,6 +1006,7 @@ class FinbricksConnector extends IBankConnector {
964
1006
  ...creditorAddress && { postalAddress: creditorAddress }
965
1007
  },
966
1008
  ...creditorAgent && { creditorAgent },
1009
+ ...unstructured && { remittanceInformation: { unstructured } },
967
1010
  callbackUrl: `${this.finbricks.REDIRECT_URI}?type=paymentRequest&paymentRequestId=${payment.id}`
968
1011
  }
969
1012
  })
@@ -1065,6 +1108,8 @@ class FinbricksConnector extends IBankConnector {
1065
1108
  creditorName: payment.creditor.holderName,
1066
1109
  description: payment.message,
1067
1110
  variableSymbol: payment.vs ?? (payment.ss ? void 0 : autoVariableSymbol(payment.id)),
1111
+ specificSymbol: payment.ss,
1112
+ constantSymbol: payment.ks,
1068
1113
  callbackUrl: `${this.finbricks.REDIRECT_URI}?type=paymentRequest&paymentRequestId=${payment.id}`,
1069
1114
  paymentProvider: this.PROVIDER
1070
1115
  }
@@ -1,5 +1,5 @@
1
1
  import { sql, and, eq, isNull } from 'drizzle-orm';
2
- import { G as tables } from './bank.BmDlJzUz.mjs';
2
+ import { G as tables } from './bank.CZ8MQDPa.mjs';
3
3
  import { uuidv4 } from '@develit-io/backend-sdk';
4
4
  import './bank.BzDNLxB_.mjs';
5
5
  import 'date-fns';
@@ -1,4 +1,4 @@
1
- import { e as CurrencyCode, R as BankCode, a1 as CountryCode, P as PaymentRequestSelectType } from './bank.d4sMg6i0.cjs';
1
+ import { e as CurrencyCode, R as BankCode, a1 as CountryCode, P as PaymentRequestSelectType } from './bank.Do1KUeDr.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.d4sMg6i0.mjs';
1
+ import { e as CurrencyCode, R as BankCode, a1 as CountryCode, P as PaymentRequestSelectType } from './bank.Do1KUeDr.mjs';
2
2
  import { z } from 'zod';
3
3
 
4
4
  type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;