@develit-services/bank 0.0.41 → 0.0.43
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/database/schema.cjs +2 -2
- package/dist/database/schema.d.cts +2 -1
- package/dist/database/schema.d.mts +2 -1
- package/dist/database/schema.d.ts +2 -1
- package/dist/database/schema.mjs +2 -2
- package/dist/export/worker.cjs +229 -224
- package/dist/export/worker.d.cts +1825 -46
- package/dist/export/worker.d.mts +1825 -46
- package/dist/export/worker.d.ts +1825 -46
- package/dist/export/worker.mjs +230 -225
- package/dist/shared/{bank.E-nyO12E.mjs → bank.6WoCPIFy.mjs} +1 -1
- package/dist/shared/{bank.e_XSg9KV.d.cts → bank.B7uB4cyW.d.cts} +154 -60
- package/dist/shared/{bank.e_XSg9KV.d.mts → bank.B7uB4cyW.d.mts} +154 -60
- package/dist/shared/{bank.e_XSg9KV.d.ts → bank.B7uB4cyW.d.ts} +154 -60
- package/dist/shared/{bank.DBgpADhg.cjs → bank.BPcrbUBa.cjs} +1 -1
- package/dist/shared/{bank.C2tmTjwq.cjs → bank.BVzOzXdX.cjs} +85 -51
- package/dist/shared/{bank.HuMp6uP6.mjs → bank.BWcFhTu1.mjs} +84 -52
- package/dist/shared/{bank.BmcSkaZh.d.mts → bank.B_JR9YGK.d.cts} +359 -19
- package/dist/shared/{bank.CELgdPJI.d.cts → bank.C9Z9B0Po.d.ts} +359 -19
- package/dist/shared/{bank.C_BFyEi4.d.ts → bank.Dadvg35r.d.mts} +359 -19
- package/dist/types.cjs +5 -3
- package/dist/types.d.cts +5 -4
- package/dist/types.d.mts +5 -4
- package/dist/types.d.ts +5 -4
- package/dist/types.mjs +3 -3
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
|
2
2
|
import * as drizzle_orm from 'drizzle-orm';
|
|
3
3
|
import { InferInsertModel, InferSelectModel } from 'drizzle-orm';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
+
import { BankAccountMetadata } from '@develit-io/backend-sdk';
|
|
5
6
|
|
|
6
7
|
interface PaymentSelectType extends InferSelectModel<typeof tables.payment> {
|
|
7
8
|
}
|
|
@@ -296,6 +297,25 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
296
297
|
name: "payment";
|
|
297
298
|
schema: undefined;
|
|
298
299
|
columns: {
|
|
300
|
+
correlationId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
301
|
+
name: "correlation_id";
|
|
302
|
+
tableName: "payment";
|
|
303
|
+
dataType: "string";
|
|
304
|
+
columnType: "SQLiteText";
|
|
305
|
+
data: string;
|
|
306
|
+
driverParam: string;
|
|
307
|
+
notNull: true;
|
|
308
|
+
hasDefault: false;
|
|
309
|
+
isPrimaryKey: false;
|
|
310
|
+
isAutoincrement: false;
|
|
311
|
+
hasRuntimeDefault: false;
|
|
312
|
+
enumValues: [string, ...string[]];
|
|
313
|
+
baseColumn: never;
|
|
314
|
+
identity: undefined;
|
|
315
|
+
generated: undefined;
|
|
316
|
+
}, {}, {
|
|
317
|
+
length: number | undefined;
|
|
318
|
+
}>;
|
|
299
319
|
refId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
300
320
|
name: "ref_id";
|
|
301
321
|
tableName: "payment";
|
|
@@ -618,43 +638,24 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
618
638
|
identity: undefined;
|
|
619
639
|
generated: undefined;
|
|
620
640
|
}, {}, {}>;
|
|
621
|
-
|
|
622
|
-
name: "
|
|
641
|
+
creditor: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
642
|
+
name: "creditor";
|
|
623
643
|
tableName: "payment";
|
|
624
|
-
dataType: "
|
|
625
|
-
columnType: "
|
|
626
|
-
data:
|
|
644
|
+
dataType: "json";
|
|
645
|
+
columnType: "SQLiteTextJson";
|
|
646
|
+
data: BankAccountMetadata;
|
|
627
647
|
driverParam: string;
|
|
628
648
|
notNull: true;
|
|
629
649
|
hasDefault: false;
|
|
630
650
|
isPrimaryKey: false;
|
|
631
651
|
isAutoincrement: false;
|
|
632
652
|
hasRuntimeDefault: false;
|
|
633
|
-
enumValues:
|
|
634
|
-
baseColumn: never;
|
|
635
|
-
identity: undefined;
|
|
636
|
-
generated: undefined;
|
|
637
|
-
}, {}, {
|
|
638
|
-
length: number | undefined;
|
|
639
|
-
}>;
|
|
640
|
-
creditorAccountNumberWithBankCode: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
641
|
-
name: "creditor_account_number_with_bank_code";
|
|
642
|
-
tableName: "payment";
|
|
643
|
-
dataType: "string";
|
|
644
|
-
columnType: "SQLiteText";
|
|
645
|
-
data: string;
|
|
646
|
-
driverParam: string;
|
|
647
|
-
notNull: false;
|
|
648
|
-
hasDefault: false;
|
|
649
|
-
isPrimaryKey: false;
|
|
650
|
-
isAutoincrement: false;
|
|
651
|
-
hasRuntimeDefault: false;
|
|
652
|
-
enumValues: [string, ...string[]];
|
|
653
|
+
enumValues: undefined;
|
|
653
654
|
baseColumn: never;
|
|
654
655
|
identity: undefined;
|
|
655
656
|
generated: undefined;
|
|
656
657
|
}, {}, {
|
|
657
|
-
|
|
658
|
+
$type: BankAccountMetadata;
|
|
658
659
|
}>;
|
|
659
660
|
creditorIban: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
660
661
|
name: "creditor_iban";
|
|
@@ -675,46 +676,27 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
675
676
|
}, {}, {
|
|
676
677
|
length: number | undefined;
|
|
677
678
|
}>;
|
|
678
|
-
|
|
679
|
-
name: "
|
|
680
|
-
tableName: "payment";
|
|
681
|
-
dataType: "string";
|
|
682
|
-
columnType: "SQLiteText";
|
|
683
|
-
data: string;
|
|
684
|
-
driverParam: string;
|
|
685
|
-
notNull: false;
|
|
686
|
-
hasDefault: false;
|
|
687
|
-
isPrimaryKey: false;
|
|
688
|
-
isAutoincrement: false;
|
|
689
|
-
hasRuntimeDefault: false;
|
|
690
|
-
enumValues: [string, ...string[]];
|
|
691
|
-
baseColumn: never;
|
|
692
|
-
identity: undefined;
|
|
693
|
-
generated: undefined;
|
|
694
|
-
}, {}, {
|
|
695
|
-
length: number | undefined;
|
|
696
|
-
}>;
|
|
697
|
-
debtorHolderName: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
698
|
-
name: "debtor_holder_name";
|
|
679
|
+
debtor: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
680
|
+
name: "debtor";
|
|
699
681
|
tableName: "payment";
|
|
700
|
-
dataType: "
|
|
701
|
-
columnType: "
|
|
702
|
-
data:
|
|
682
|
+
dataType: "json";
|
|
683
|
+
columnType: "SQLiteTextJson";
|
|
684
|
+
data: BankAccountMetadata;
|
|
703
685
|
driverParam: string;
|
|
704
|
-
notNull:
|
|
686
|
+
notNull: true;
|
|
705
687
|
hasDefault: false;
|
|
706
688
|
isPrimaryKey: false;
|
|
707
689
|
isAutoincrement: false;
|
|
708
690
|
hasRuntimeDefault: false;
|
|
709
|
-
enumValues:
|
|
691
|
+
enumValues: undefined;
|
|
710
692
|
baseColumn: never;
|
|
711
693
|
identity: undefined;
|
|
712
694
|
generated: undefined;
|
|
713
695
|
}, {}, {
|
|
714
|
-
|
|
696
|
+
$type: BankAccountMetadata;
|
|
715
697
|
}>;
|
|
716
|
-
|
|
717
|
-
name: "
|
|
698
|
+
debtorIban: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
699
|
+
name: "debtor_iban";
|
|
718
700
|
tableName: "payment";
|
|
719
701
|
dataType: "string";
|
|
720
702
|
columnType: "SQLiteText";
|
|
@@ -1025,6 +1007,23 @@ declare const account: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1025
1007
|
}, {}, {
|
|
1026
1008
|
length: number | undefined;
|
|
1027
1009
|
}>;
|
|
1010
|
+
batchSizeLimit: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1011
|
+
name: "batch_size_limit";
|
|
1012
|
+
tableName: "account";
|
|
1013
|
+
dataType: "number";
|
|
1014
|
+
columnType: "SQLiteInteger";
|
|
1015
|
+
data: number;
|
|
1016
|
+
driverParam: number;
|
|
1017
|
+
notNull: true;
|
|
1018
|
+
hasDefault: true;
|
|
1019
|
+
isPrimaryKey: false;
|
|
1020
|
+
isAutoincrement: false;
|
|
1021
|
+
hasRuntimeDefault: false;
|
|
1022
|
+
enumValues: undefined;
|
|
1023
|
+
baseColumn: never;
|
|
1024
|
+
identity: undefined;
|
|
1025
|
+
generated: undefined;
|
|
1026
|
+
}, {}, {}>;
|
|
1028
1027
|
sync: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1029
1028
|
name: "sync";
|
|
1030
1029
|
tableName: "account";
|
|
@@ -1102,7 +1101,7 @@ declare const account: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1102
1101
|
columnType: "SQLiteText";
|
|
1103
1102
|
data: string;
|
|
1104
1103
|
driverParam: string;
|
|
1105
|
-
notNull:
|
|
1104
|
+
notNull: false;
|
|
1106
1105
|
hasDefault: false;
|
|
1107
1106
|
isPrimaryKey: false;
|
|
1108
1107
|
isAutoincrement: false;
|
|
@@ -1121,7 +1120,7 @@ declare const account: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1121
1120
|
columnType: "SQLiteText";
|
|
1122
1121
|
data: "5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500";
|
|
1123
1122
|
driverParam: string;
|
|
1124
|
-
notNull:
|
|
1123
|
+
notNull: false;
|
|
1125
1124
|
hasDefault: false;
|
|
1126
1125
|
isPrimaryKey: false;
|
|
1127
1126
|
isAutoincrement: false;
|
|
@@ -1140,7 +1139,7 @@ declare const account: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1140
1139
|
columnType: "SQLiteText";
|
|
1141
1140
|
data: string;
|
|
1142
1141
|
driverParam: string;
|
|
1143
|
-
notNull:
|
|
1142
|
+
notNull: false;
|
|
1144
1143
|
hasDefault: false;
|
|
1145
1144
|
isPrimaryKey: false;
|
|
1146
1145
|
isAutoincrement: false;
|
|
@@ -1233,14 +1232,109 @@ declare const account: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1233
1232
|
tableName: "account";
|
|
1234
1233
|
dataType: "string";
|
|
1235
1234
|
columnType: "SQLiteText";
|
|
1236
|
-
data: "AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "
|
|
1235
|
+
data: "EC" | "AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW";
|
|
1237
1236
|
driverParam: string;
|
|
1238
1237
|
notNull: true;
|
|
1239
1238
|
hasDefault: false;
|
|
1240
1239
|
isPrimaryKey: false;
|
|
1241
1240
|
isAutoincrement: false;
|
|
1242
1241
|
hasRuntimeDefault: false;
|
|
1243
|
-
enumValues: ["AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "
|
|
1242
|
+
enumValues: ["EC" | "AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW", ...("EC" | "AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW")[]];
|
|
1243
|
+
baseColumn: never;
|
|
1244
|
+
identity: undefined;
|
|
1245
|
+
generated: undefined;
|
|
1246
|
+
}, {}, {
|
|
1247
|
+
length: number | undefined;
|
|
1248
|
+
}>;
|
|
1249
|
+
routingNumber: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1250
|
+
name: "routing_number";
|
|
1251
|
+
tableName: "account";
|
|
1252
|
+
dataType: "string";
|
|
1253
|
+
columnType: "SQLiteText";
|
|
1254
|
+
data: string;
|
|
1255
|
+
driverParam: string;
|
|
1256
|
+
notNull: false;
|
|
1257
|
+
hasDefault: false;
|
|
1258
|
+
isPrimaryKey: false;
|
|
1259
|
+
isAutoincrement: false;
|
|
1260
|
+
hasRuntimeDefault: false;
|
|
1261
|
+
enumValues: [string, ...string[]];
|
|
1262
|
+
baseColumn: never;
|
|
1263
|
+
identity: undefined;
|
|
1264
|
+
generated: undefined;
|
|
1265
|
+
}, {}, {
|
|
1266
|
+
length: number | undefined;
|
|
1267
|
+
}>;
|
|
1268
|
+
sortCode: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1269
|
+
name: "sort_code";
|
|
1270
|
+
tableName: "account";
|
|
1271
|
+
dataType: "string";
|
|
1272
|
+
columnType: "SQLiteText";
|
|
1273
|
+
data: string;
|
|
1274
|
+
driverParam: string;
|
|
1275
|
+
notNull: false;
|
|
1276
|
+
hasDefault: false;
|
|
1277
|
+
isPrimaryKey: false;
|
|
1278
|
+
isAutoincrement: false;
|
|
1279
|
+
hasRuntimeDefault: false;
|
|
1280
|
+
enumValues: [string, ...string[]];
|
|
1281
|
+
baseColumn: never;
|
|
1282
|
+
identity: undefined;
|
|
1283
|
+
generated: undefined;
|
|
1284
|
+
}, {}, {
|
|
1285
|
+
length: number | undefined;
|
|
1286
|
+
}>;
|
|
1287
|
+
clabe: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1288
|
+
name: "clabe";
|
|
1289
|
+
tableName: "account";
|
|
1290
|
+
dataType: "string";
|
|
1291
|
+
columnType: "SQLiteText";
|
|
1292
|
+
data: string;
|
|
1293
|
+
driverParam: string;
|
|
1294
|
+
notNull: false;
|
|
1295
|
+
hasDefault: false;
|
|
1296
|
+
isPrimaryKey: false;
|
|
1297
|
+
isAutoincrement: false;
|
|
1298
|
+
hasRuntimeDefault: false;
|
|
1299
|
+
enumValues: [string, ...string[]];
|
|
1300
|
+
baseColumn: never;
|
|
1301
|
+
identity: undefined;
|
|
1302
|
+
generated: undefined;
|
|
1303
|
+
}, {}, {
|
|
1304
|
+
length: number | undefined;
|
|
1305
|
+
}>;
|
|
1306
|
+
bsb: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1307
|
+
name: "bsb";
|
|
1308
|
+
tableName: "account";
|
|
1309
|
+
dataType: "string";
|
|
1310
|
+
columnType: "SQLiteText";
|
|
1311
|
+
data: string;
|
|
1312
|
+
driverParam: string;
|
|
1313
|
+
notNull: false;
|
|
1314
|
+
hasDefault: false;
|
|
1315
|
+
isPrimaryKey: false;
|
|
1316
|
+
isAutoincrement: false;
|
|
1317
|
+
hasRuntimeDefault: false;
|
|
1318
|
+
enumValues: [string, ...string[]];
|
|
1319
|
+
baseColumn: never;
|
|
1320
|
+
identity: undefined;
|
|
1321
|
+
generated: undefined;
|
|
1322
|
+
}, {}, {
|
|
1323
|
+
length: number | undefined;
|
|
1324
|
+
}>;
|
|
1325
|
+
brBankNumber: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1326
|
+
name: "br_bank_number";
|
|
1327
|
+
tableName: "account";
|
|
1328
|
+
dataType: "string";
|
|
1329
|
+
columnType: "SQLiteText";
|
|
1330
|
+
data: string;
|
|
1331
|
+
driverParam: string;
|
|
1332
|
+
notNull: false;
|
|
1333
|
+
hasDefault: false;
|
|
1334
|
+
isPrimaryKey: false;
|
|
1335
|
+
isAutoincrement: false;
|
|
1336
|
+
hasRuntimeDefault: false;
|
|
1337
|
+
enumValues: [string, ...string[]];
|
|
1244
1338
|
baseColumn: never;
|
|
1245
1339
|
identity: undefined;
|
|
1246
1340
|
generated: undefined;
|
|
@@ -2,17 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
4
|
const sqliteCore = require('drizzle-orm/sqlite-core');
|
|
5
|
+
const dateFns = require('date-fns');
|
|
5
6
|
const drizzleOrm = require('drizzle-orm');
|
|
6
7
|
const generalCodes = require('@develit-io/general-codes');
|
|
7
8
|
const zod = require('zod');
|
|
8
9
|
const jose = require('jose');
|
|
9
10
|
const drizzleZod = require('drizzle-zod');
|
|
10
|
-
const dateFns = require('date-fns');
|
|
11
11
|
const relations = require('drizzle-orm/relations');
|
|
12
12
|
|
|
13
13
|
class IBankConnector {
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
const mapReferencesToPayment = (reference) => {
|
|
17
|
+
const symbols = {
|
|
18
|
+
vs: void 0,
|
|
19
|
+
ss: void 0,
|
|
20
|
+
ks: void 0
|
|
21
|
+
};
|
|
22
|
+
if (!reference) return symbols;
|
|
23
|
+
if (Array.isArray(reference) && reference.length > 0) {
|
|
24
|
+
symbols.vs = reference.find((ref) => ref.includes("VS")) || void 0;
|
|
25
|
+
symbols.ss = reference.find((ref) => ref.includes("SS")) || void 0;
|
|
26
|
+
symbols.ks = reference.find((ref) => ref.includes("KS")) || void 0;
|
|
27
|
+
}
|
|
28
|
+
if (typeof reference === "string") {
|
|
29
|
+
const vsMatch = reference.match(/VS[:\s]*(\d+)/i);
|
|
30
|
+
const ssMatch = reference.match(/SS[:\s]*(\d+)/i);
|
|
31
|
+
const ksMatch = reference.match(/KS[:\s]*(\d+)/i);
|
|
32
|
+
if (vsMatch) symbols.vs = vsMatch[1];
|
|
33
|
+
if (ssMatch) symbols.ss = ssMatch[1];
|
|
34
|
+
if (ksMatch) symbols.ks = ksMatch[1];
|
|
35
|
+
}
|
|
36
|
+
return symbols;
|
|
37
|
+
};
|
|
38
|
+
|
|
16
39
|
async function signFinbricksJws({
|
|
17
40
|
privateKeyPem,
|
|
18
41
|
merchantId,
|
|
@@ -113,29 +136,6 @@ const FINBRICKS_ENDPOINTS = {
|
|
|
113
136
|
BATCH_STATUS: "/transaction/platform/batchPayment/status"
|
|
114
137
|
};
|
|
115
138
|
|
|
116
|
-
const mapReferencesToPayment = (reference) => {
|
|
117
|
-
const symbols = {
|
|
118
|
-
vs: void 0,
|
|
119
|
-
ss: void 0,
|
|
120
|
-
ks: void 0
|
|
121
|
-
};
|
|
122
|
-
if (!reference) return symbols;
|
|
123
|
-
if (Array.isArray(reference) && reference.length > 0) {
|
|
124
|
-
symbols.vs = reference.find((ref) => ref.includes("VS")) || void 0;
|
|
125
|
-
symbols.ss = reference.find((ref) => ref.includes("SS")) || void 0;
|
|
126
|
-
symbols.ks = reference.find((ref) => ref.includes("KS")) || void 0;
|
|
127
|
-
}
|
|
128
|
-
if (typeof reference === "string") {
|
|
129
|
-
const vsMatch = reference.match(/VS[:\s]*(\d+)/i);
|
|
130
|
-
const ssMatch = reference.match(/SS[:\s]*(\d+)/i);
|
|
131
|
-
const ksMatch = reference.match(/KS[:\s]*(\d+)/i);
|
|
132
|
-
if (vsMatch) symbols.vs = vsMatch[1];
|
|
133
|
-
if (ssMatch) symbols.ss = ssMatch[1];
|
|
134
|
-
if (ksMatch) symbols.ks = ksMatch[1];
|
|
135
|
-
}
|
|
136
|
-
return symbols;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
139
|
const mapFinbricksStatus = (status) => {
|
|
140
140
|
switch (status) {
|
|
141
141
|
case "BOOK":
|
|
@@ -182,6 +182,7 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
|
|
|
182
182
|
const related = tx.entryDetails?.transactionDetails?.relatedParties;
|
|
183
183
|
const base = {
|
|
184
184
|
id: backendSdk.uuidv4(),
|
|
185
|
+
correlationId: backendSdk.uuidv4(),
|
|
185
186
|
connectorKey: account.connectorKey,
|
|
186
187
|
accountId: account.id,
|
|
187
188
|
bankRefId: tx.entryReference || tx.fbxReference,
|
|
@@ -194,14 +195,30 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
|
|
|
194
195
|
...mapReferencesToPayment(
|
|
195
196
|
tx.entryDetails.transactionDetails?.remittanceInformation?.structured?.creditorReferenceInformation?.reference || tx.entryDetails.transactionDetails?.references?.endToEndIdentification
|
|
196
197
|
),
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
creditor: {
|
|
199
|
+
holderName: isIncoming ? "Unknown" : related?.creditor?.name || "Unknown",
|
|
200
|
+
iban: isIncoming ? account.iban || void 0 : related.creditorAccount?.identification?.iban || account.iban || void 0,
|
|
201
|
+
number: isIncoming ? account.number || void 0 : related.creditorAccount?.identification?.other?.identification ? related.creditorAccount.identification.other.identification.split(
|
|
202
|
+
"/"
|
|
203
|
+
)[0] : account.number || void 0,
|
|
204
|
+
bankCode: isIncoming ? account.bankCode || void 0 : related.creditorAccount?.identification?.other?.identification ? related.creditorAccount.identification.other.identification.split(
|
|
205
|
+
"/"
|
|
206
|
+
)[1] : account.bankCode || void 0
|
|
207
|
+
},
|
|
208
|
+
debtor: {
|
|
209
|
+
holderName: isIncoming ? related?.debtor?.name || "Unknown" : "Unknown",
|
|
210
|
+
iban: isIncoming ? related.debtorAccount?.identification?.iban || account.iban || void 0 : account.iban ?? void 0,
|
|
211
|
+
number: isIncoming ? related.debtorAccount?.identification?.other?.identification ? related.debtorAccount.identification.other.identification.split(
|
|
212
|
+
"/"
|
|
213
|
+
)[0] : account.number || void 0 : account.number || void 0,
|
|
214
|
+
bankCode: isIncoming ? related.debtorAccount?.identification?.other?.identification ? related.debtorAccount.identification.other.identification.split(
|
|
215
|
+
"/"
|
|
216
|
+
)[1] : account.bankCode || void 0 : account.bankCode || void 0
|
|
217
|
+
},
|
|
201
218
|
direction: "INCOMING"
|
|
202
219
|
// přepíšeme správným směrem níže
|
|
203
220
|
};
|
|
204
|
-
base.direction =
|
|
221
|
+
base.direction = isIncoming ? "INCOMING" : "OUTGOING";
|
|
205
222
|
return base;
|
|
206
223
|
};
|
|
207
224
|
|
|
@@ -486,13 +503,13 @@ class FinbricksConnector extends IBankConnector {
|
|
|
486
503
|
},
|
|
487
504
|
amount: payment.amount,
|
|
488
505
|
debtor: {
|
|
489
|
-
debtorAccountIban: payment.
|
|
490
|
-
debtorName: payment.
|
|
506
|
+
debtorAccountIban: payment.debtor.iban,
|
|
507
|
+
debtorName: payment.debtor.holderName,
|
|
491
508
|
paymentProvider: this.PROVIDER
|
|
492
509
|
},
|
|
493
510
|
creditor: {
|
|
494
|
-
creditorAccountIban: payment.
|
|
495
|
-
creditorName: payment.
|
|
511
|
+
creditorAccountIban: payment.creditor.iban,
|
|
512
|
+
creditorName: payment.creditor.holderName
|
|
496
513
|
},
|
|
497
514
|
callbackUrl: "https://www.example.com"
|
|
498
515
|
}
|
|
@@ -526,9 +543,9 @@ class FinbricksConnector extends IBankConnector {
|
|
|
526
543
|
merchantId: this.finbricks.MERCHANT_ID,
|
|
527
544
|
merchantTransactionId: payment.bankRefId,
|
|
528
545
|
totalPrice: payment.amount,
|
|
529
|
-
debtorAccountIban: payment.
|
|
530
|
-
creditorAccountIban: payment.
|
|
531
|
-
creditorName: payment.
|
|
546
|
+
debtorAccountIban: payment.debtor.iban,
|
|
547
|
+
creditorAccountIban: payment.creditor.iban,
|
|
548
|
+
creditorName: payment.creditor.holderName,
|
|
532
549
|
description: payment.message,
|
|
533
550
|
variableSymbol: payment.vs,
|
|
534
551
|
callbackUrl: "https://example.com/callback",
|
|
@@ -744,7 +761,7 @@ class ErsteConnector extends IBankConnector {
|
|
|
744
761
|
debtorAccount: { identification: { iban: payment.debtorIban } },
|
|
745
762
|
creditorAccount: { identification: { iban: payment.creditorIban } },
|
|
746
763
|
creditor: {
|
|
747
|
-
name: payment.
|
|
764
|
+
name: payment.creditor.holderName
|
|
748
765
|
}
|
|
749
766
|
};
|
|
750
767
|
const [data, error] = await backendSdk.useResult(
|
|
@@ -886,17 +903,32 @@ class ErsteConnector extends IBankConnector {
|
|
|
886
903
|
const symbols = mapReferencesToPayment(reference);
|
|
887
904
|
const paymentInsert = {
|
|
888
905
|
id: backendSdk.uuidv4(),
|
|
906
|
+
correlationId: backendSdk.uuidv4(),
|
|
889
907
|
connectorKey: "ERSTE",
|
|
890
908
|
accountId: account.id,
|
|
891
909
|
bankRefId: payment.entryReference,
|
|
892
910
|
amount: payment.amount.value,
|
|
893
911
|
currency: payment.amount.currency.code,
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
912
|
+
debtor: {
|
|
913
|
+
holderName: payment.entryDetails.transactionDetails.relatedParties.debtor?.name,
|
|
914
|
+
iban: payment.entryDetails.transactionDetails.relatedParties.debtorAccount?.identification.iban,
|
|
915
|
+
number: payment.entryDetails.transactionDetails.relatedParties.debtorAccount?.identification.other?.identification ? payment.entryDetails.transactionDetails.relatedParties.debtorAccount.identification.other.identification.split(
|
|
916
|
+
"/"
|
|
917
|
+
)[0] : void 0,
|
|
918
|
+
bankCode: payment.entryDetails.transactionDetails.relatedParties.debtorAccount?.identification.other?.identification ? payment.entryDetails.transactionDetails.relatedParties.debtorAccount.identification.other.identification.split(
|
|
919
|
+
"/"
|
|
920
|
+
)[1] : void 0
|
|
921
|
+
},
|
|
922
|
+
creditor: {
|
|
923
|
+
holderName: payment.entryDetails.transactionDetails.relatedParties.creditor?.name,
|
|
924
|
+
iban: payment.entryDetails.transactionDetails.relatedParties.creditorAccount?.identification.iban,
|
|
925
|
+
number: payment.entryDetails.transactionDetails.relatedParties.creditorAccount?.identification.other?.identification ? payment.entryDetails.transactionDetails.relatedParties.creditorAccount.identification.other.identification.split(
|
|
926
|
+
"/"
|
|
927
|
+
)[0] : void 0,
|
|
928
|
+
bankCode: payment.entryDetails.transactionDetails.relatedParties.creditorAccount?.identification.other?.identification ? payment.entryDetails.transactionDetails.relatedParties.creditorAccount.identification.other.identification.split(
|
|
929
|
+
"/"
|
|
930
|
+
)[1] : void 0
|
|
931
|
+
},
|
|
900
932
|
paymentType: "DOMESTIC",
|
|
901
933
|
direction: "INCOMING",
|
|
902
934
|
message: payment.entryDetails.transactionDetails.remittanceInformation?.unstructured,
|
|
@@ -908,7 +940,7 @@ class ErsteConnector extends IBankConnector {
|
|
|
908
940
|
};
|
|
909
941
|
return {
|
|
910
942
|
...paymentInsert,
|
|
911
|
-
direction: getPaymentDirection(paymentInsert, account.iban)
|
|
943
|
+
direction: account.iban ? getPaymentDirection(paymentInsert, account.iban) : "INCOMING"
|
|
912
944
|
};
|
|
913
945
|
});
|
|
914
946
|
return payments;
|
|
@@ -1012,6 +1044,8 @@ class MockConnector extends IBankConnector {
|
|
|
1012
1044
|
}
|
|
1013
1045
|
|
|
1014
1046
|
const PAYMENT_TYPES = ["SEPA", "SWIFT", "IFSC", "DOMESTIC"];
|
|
1047
|
+
const CHARGE_BEARERS = ["SHA", "OUR", "BEN"];
|
|
1048
|
+
const INSTRUCTION_PRIORITIES = ["NORM", "INST"];
|
|
1015
1049
|
const PAYMENT_STATUSES = [
|
|
1016
1050
|
"PREPARED",
|
|
1017
1051
|
"INITIALIZED",
|
|
@@ -1081,6 +1115,7 @@ const account = sqliteCore.sqliteTable(
|
|
|
1081
1115
|
}).$type().notNull(),
|
|
1082
1116
|
status: sqliteCore.text("status", { enum: ACCOUNT_STATUSES }).$type().notNull(),
|
|
1083
1117
|
bankRefId: sqliteCore.text("bank_ref_id").notNull(),
|
|
1118
|
+
batchSizeLimit: sqliteCore.integer("batch_size_limit").notNull().default(50),
|
|
1084
1119
|
sync: sqliteCore.integer("sync", { mode: "boolean" }).default(false).notNull(),
|
|
1085
1120
|
syncPeriod: sqliteCore.integer("sync_period"),
|
|
1086
1121
|
lastSyncedAt: sqliteCore.integer("last_synced_at", { mode: "timestamp_ms" })
|
|
@@ -1135,6 +1170,7 @@ const batch = sqliteCore.sqliteTable("batch", {
|
|
|
1135
1170
|
|
|
1136
1171
|
const payment = sqliteCore.sqliteTable("payment", {
|
|
1137
1172
|
...backendSdk.base,
|
|
1173
|
+
correlationId: sqliteCore.text("correlation_id").notNull(),
|
|
1138
1174
|
refId: sqliteCore.text("ref_id"),
|
|
1139
1175
|
bankRefId: sqliteCore.text("bank_ref_id"),
|
|
1140
1176
|
accountId: sqliteCore.text("account_id").references(() => account.id).notNull(),
|
|
@@ -1156,14 +1192,10 @@ const payment = sqliteCore.sqliteTable("payment", {
|
|
|
1156
1192
|
processedAt: sqliteCore.integer("processed_at", {
|
|
1157
1193
|
mode: "timestamp_ms"
|
|
1158
1194
|
}),
|
|
1159
|
-
|
|
1160
|
-
creditorAccountNumberWithBankCode: sqliteCore.text(
|
|
1161
|
-
"creditor_account_number_with_bank_code"
|
|
1162
|
-
),
|
|
1195
|
+
creditor: sqliteCore.text("creditor", { mode: "json" }).$type().notNull(),
|
|
1163
1196
|
creditorIban: sqliteCore.text("creditor_iban"),
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
debtorAccountNumberWithBankCode: sqliteCore.text("debtor_account_number_with_bank_code")
|
|
1197
|
+
debtor: sqliteCore.text("debtor", { mode: "json" }).$type().notNull(),
|
|
1198
|
+
debtorIban: sqliteCore.text("debtor_iban")
|
|
1167
1199
|
});
|
|
1168
1200
|
const paymentRelations = relations.relations(payment, ({ one }) => ({
|
|
1169
1201
|
batch: one(batch, { fields: [payment.batchId], references: [batch.id] })
|
|
@@ -1183,6 +1215,7 @@ const tables = schema;
|
|
|
1183
1215
|
|
|
1184
1216
|
exports.ACCOUNT_STATUSES = ACCOUNT_STATUSES;
|
|
1185
1217
|
exports.BATCH_STATUSES = BATCH_STATUSES;
|
|
1218
|
+
exports.CHARGE_BEARERS = CHARGE_BEARERS;
|
|
1186
1219
|
exports.CONNECTOR_KEYS = CONNECTOR_KEYS;
|
|
1187
1220
|
exports.COUNTRY_CODES = COUNTRY_CODES;
|
|
1188
1221
|
exports.CREDENTIALS_TYPES = CREDENTIALS_TYPES;
|
|
@@ -1191,6 +1224,7 @@ exports.FINBRICKS_ENDPOINTS = FINBRICKS_ENDPOINTS;
|
|
|
1191
1224
|
exports.FinbricksClient = FinbricksClient;
|
|
1192
1225
|
exports.FinbricksConnector = FinbricksConnector;
|
|
1193
1226
|
exports.IBankConnector = IBankConnector;
|
|
1227
|
+
exports.INSTRUCTION_PRIORITIES = INSTRUCTION_PRIORITIES;
|
|
1194
1228
|
exports.MockConnector = MockConnector;
|
|
1195
1229
|
exports.PAYMENT_DIRECTIONS = PAYMENT_DIRECTIONS;
|
|
1196
1230
|
exports.PAYMENT_STATUSES = PAYMENT_STATUSES;
|