@pax2pay/model-banking 0.1.661 → 0.1.664

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 (73) hide show
  1. package/Merchant/Category.ts +2 -0
  2. package/Rail/Address/Bic.ts +27 -0
  3. package/Rail/Address/index.ts +28 -17
  4. package/dist/cjs/Account/Details.d.ts +6 -0
  5. package/dist/cjs/Account/index.d.ts +12 -0
  6. package/dist/cjs/Merchant/Category.d.ts +2 -0
  7. package/dist/cjs/Merchant/Category.js +2 -0
  8. package/dist/cjs/Merchant/Category.js.map +1 -1
  9. package/dist/cjs/Rail/Address/Bic.d.ts +19 -0
  10. package/dist/cjs/Rail/Address/Bic.js +24 -0
  11. package/dist/cjs/Rail/Address/Bic.js.map +1 -0
  12. package/dist/cjs/Rail/Address/index.d.ts +12 -4
  13. package/dist/cjs/Rail/Address/index.js +39 -30
  14. package/dist/cjs/Rail/Address/index.js.map +1 -1
  15. package/dist/cjs/Transaction/Creatable.d.ts +6 -0
  16. package/dist/cjs/Transaction/PreTransaction/Base.d.ts +6 -0
  17. package/dist/cjs/Transaction/PreTransaction/Incoming.d.ts +12 -0
  18. package/dist/cjs/Transaction/PreTransaction/Outgoing.d.ts +6 -0
  19. package/dist/cjs/Transaction/PreTransaction/index.d.ts +18 -0
  20. package/dist/cjs/Transaction/index.d.ts +41 -5
  21. package/dist/cjs/policy/Mcc/Action.d.ts +2 -0
  22. package/dist/cjs/policy/Mcc/Action.js +2 -0
  23. package/dist/cjs/policy/Mcc/Action.js.map +1 -1
  24. package/dist/cjs/policy/Mcc/Creatable.d.ts +17 -0
  25. package/dist/cjs/policy/Mcc/Creatable.js +9 -0
  26. package/dist/cjs/policy/Mcc/Creatable.js.map +1 -1
  27. package/dist/cjs/policy/Mcc/Group.d.ts +3 -0
  28. package/dist/cjs/policy/Mcc/Group.js +9 -0
  29. package/dist/cjs/policy/Mcc/Group.js.map +1 -1
  30. package/dist/cjs/policy/Mcc/Updatable.d.ts +2 -0
  31. package/dist/cjs/policy/Mcc/Updatable.js +2 -0
  32. package/dist/cjs/policy/Mcc/Updatable.js.map +1 -1
  33. package/dist/cjs/policy/Mcc/index.d.ts +2 -0
  34. package/dist/cjs/policy/Mcc/index.js +7 -0
  35. package/dist/cjs/policy/Mcc/index.js.map +1 -1
  36. package/dist/mjs/Account/Details.d.ts +6 -0
  37. package/dist/mjs/Account/index.d.ts +12 -0
  38. package/dist/mjs/Merchant/Category.d.ts +2 -0
  39. package/dist/mjs/Merchant/Category.js +2 -0
  40. package/dist/mjs/Merchant/Category.js.map +1 -1
  41. package/dist/mjs/Rail/Address/Bic.d.ts +19 -0
  42. package/dist/mjs/Rail/Address/Bic.js +21 -0
  43. package/dist/mjs/Rail/Address/Bic.js.map +1 -0
  44. package/dist/mjs/Rail/Address/index.d.ts +12 -4
  45. package/dist/mjs/Rail/Address/index.js +39 -30
  46. package/dist/mjs/Rail/Address/index.js.map +1 -1
  47. package/dist/mjs/Transaction/Creatable.d.ts +6 -0
  48. package/dist/mjs/Transaction/PreTransaction/Base.d.ts +6 -0
  49. package/dist/mjs/Transaction/PreTransaction/Incoming.d.ts +12 -0
  50. package/dist/mjs/Transaction/PreTransaction/Outgoing.d.ts +6 -0
  51. package/dist/mjs/Transaction/PreTransaction/index.d.ts +18 -0
  52. package/dist/mjs/Transaction/index.d.ts +41 -5
  53. package/dist/mjs/policy/Mcc/Action.d.ts +2 -0
  54. package/dist/mjs/policy/Mcc/Action.js +2 -0
  55. package/dist/mjs/policy/Mcc/Action.js.map +1 -1
  56. package/dist/mjs/policy/Mcc/Creatable.d.ts +17 -0
  57. package/dist/mjs/policy/Mcc/Creatable.js +9 -0
  58. package/dist/mjs/policy/Mcc/Creatable.js.map +1 -1
  59. package/dist/mjs/policy/Mcc/Group.d.ts +3 -0
  60. package/dist/mjs/policy/Mcc/Group.js +9 -0
  61. package/dist/mjs/policy/Mcc/Group.js.map +1 -1
  62. package/dist/mjs/policy/Mcc/Updatable.d.ts +2 -0
  63. package/dist/mjs/policy/Mcc/Updatable.js +2 -0
  64. package/dist/mjs/policy/Mcc/Updatable.js.map +1 -1
  65. package/dist/mjs/policy/Mcc/index.d.ts +2 -0
  66. package/dist/mjs/policy/Mcc/index.js +7 -0
  67. package/dist/mjs/policy/Mcc/index.js.map +1 -1
  68. package/package.json +5 -2
  69. package/policy/Mcc/Action.ts +2 -0
  70. package/policy/Mcc/Creatable.ts +9 -0
  71. package/policy/Mcc/Group.ts +9 -0
  72. package/policy/Mcc/Updatable.ts +2 -0
  73. package/policy/Mcc/index.ts +7 -0
@@ -1,4 +1,5 @@
1
1
  import { isly } from "isly"
2
+ import { zod } from "../zod"
2
3
 
3
4
  export type Category = string
4
5
 
@@ -7,4 +8,5 @@ export namespace Category {
7
8
  "Merchant.Category",
8
9
  (value: any): value is Category => typeof value === "string" && /^\d{4}$/.test(value)
9
10
  )
11
+ export const typeZod: zod.ZodType<Category> = zod.string().regex(/^\d{4}$/)
10
12
  }
@@ -0,0 +1,27 @@
1
+ import { isly } from "isly"
2
+ import { zod } from "../../zod"
3
+
4
+ export interface Bic {
5
+ type: "bic"
6
+ account: string
7
+ institution: string // BIC, validated against the SWIFT directory by the supplier
8
+ holder: string
9
+ transactor?: string
10
+ }
11
+ export namespace Bic {
12
+ export const currencies = ["USD"] as const
13
+ export const type = isly.object<Bic>({
14
+ type: isly.string("bic"),
15
+ account: isly.string(),
16
+ institution: isly.string(),
17
+ holder: isly.string(),
18
+ transactor: isly.string().optional(),
19
+ })
20
+ export const typeZod = zod.object({
21
+ type: zod.literal("bic"),
22
+ account: zod.string(),
23
+ institution: zod.string(),
24
+ holder: zod.string(),
25
+ transactor: zod.string().optional(),
26
+ })
27
+ }
@@ -1,6 +1,7 @@
1
1
  import { isly } from "isly"
2
2
  import { Realm } from "../../Realm"
3
3
  import { zod } from "../../zod"
4
+ import { Bic as AddressBic } from "./Bic"
4
5
  import { Card as AddressCard } from "./Card"
5
6
  import { Iban as AddressIban } from "./Iban"
6
7
  import { Internal as AddressInternal } from "./internal"
@@ -15,13 +16,14 @@ export type Address =
15
16
  | AddressInternal
16
17
  | AddressPaxGiro
17
18
  | AddressScan
19
+ | AddressBic
18
20
  export namespace Address {
19
21
  export const realm: Record<Realm, string[]> = {
20
- test: ["paxgiro", "internal", "iban", "scan", "card", "paxgiro-credit"],
22
+ test: ["paxgiro", "internal", "iban", "bic", "scan", "card", "paxgiro-credit"],
21
23
  uk: ["internal", "iban", "scan", "card"],
22
24
  eea: ["internal", "iban", "scan", "card"],
23
25
  }
24
- export const values = ["paxgiro", "internal", "iban", "scan", "card", "paxgiro-credit"] as const
26
+ export const values = ["paxgiro", "internal", "iban", "bic", "scan", "card", "paxgiro-credit"] as const
25
27
  export type Type = (typeof values)[number]
26
28
  export function compare(addresses: [Address, Address]): boolean {
27
29
  return Object.entries(addresses[0]).every(([key, value]) => value == (addresses[1] as any)[key])
@@ -36,44 +38,50 @@ export namespace Address {
36
38
  }
37
39
  return result
38
40
  }
39
- export function stringify(Address: Address): string {
41
+ export function stringify(address: Address): string {
40
42
  let result: string
41
- switch (Address.type) {
43
+ switch (address.type) {
42
44
  case "iban":
43
- result = `iban-${Address.iban}`
45
+ result = `iban-${address.iban}`
44
46
  break
45
47
  case "paxgiro":
46
- result = `pxg-${Address.identifier}`
48
+ result = `pxg-${address.identifier}`
47
49
  break
48
50
  case "internal":
49
- result = `internal-${Address.identifier}`
51
+ result = `internal-${address.identifier}`
50
52
  break
51
53
  case "scan":
52
- result = `scan-${Address.sort}-${Address.account}`
54
+ result = `scan-${address.sort}-${address.account}`
53
55
  break
54
56
  case "card":
55
- result = "id" in Address ? `${Address.type}-${Address.id}` : `${Address.type}-merchant-${Address.merchant.id}`
57
+ result = "id" in address ? `${address.type}-${address.id}` : `${address.type}-merchant-${address.merchant.id}`
58
+ break
59
+ case "bic":
60
+ result = `bic-${address.institution}-${address.account}`
56
61
  break
57
62
  }
58
63
  return result
59
64
  }
60
- export function beautify(Address: Address): string {
65
+ export function beautify(address: Address): string {
61
66
  let result: string
62
- switch (Address.type) {
67
+ switch (address.type) {
63
68
  case "iban":
64
- result = `${Address.iban}`
69
+ result = `${address.iban}`
65
70
  break
66
71
  case "paxgiro":
67
- result = `${Address.identifier}`
72
+ result = `${address.identifier}`
68
73
  break
69
74
  case "internal":
70
- result = `${Address.identifier}`
75
+ result = `${address.identifier}`
71
76
  break
72
77
  case "scan":
73
- result = `${Address.sort} ${Address.account}`
78
+ result = `${address.sort} ${address.account}`
74
79
  break
75
80
  case "card":
76
- result = "id" in Address ? `${Address.type}-${Address.id}` : `${Address.type}-merchant-${Address.merchant.id}`
81
+ result = "id" in address ? `${address.type}-${address.id}` : `${address.type}-merchant-${address.merchant.id}`
82
+ break
83
+ case "bic":
84
+ result = `${address.institution} ${address.account}`
77
85
  break
78
86
  }
79
87
  return result
@@ -84,7 +92,8 @@ export namespace Address {
84
92
  AddressIban.type,
85
93
  AddressInternal.type,
86
94
  AddressPaxGiro.type,
87
- AddressScan.type
95
+ AddressScan.type,
96
+ AddressBic.type
88
97
  )
89
98
  export const typeZod = zod.union([
90
99
  AddressCard.typeZod,
@@ -93,6 +102,7 @@ export namespace Address {
93
102
  AddressInternal.typeZod,
94
103
  AddressPaxGiro.typeZod,
95
104
  AddressScan.typeZod,
105
+ AddressBic.typeZod,
96
106
  ])
97
107
 
98
108
  export import PaxGiro = AddressPaxGiro
@@ -101,4 +111,5 @@ export namespace Address {
101
111
  export import Internal = AddressInternal
102
112
  export import Card = AddressCard
103
113
  export import Route = AddressRoute
114
+ export import Bic = AddressBic
104
115
  }
@@ -251,6 +251,12 @@ export declare namespace Details {
251
251
  account: zod.ZodString;
252
252
  holder: zod.ZodString;
253
253
  institution: zod.ZodOptional<zod.ZodString>;
254
+ }, zod.z.core.$strip>, zod.ZodObject<{
255
+ type: zod.ZodLiteral<"bic">;
256
+ account: zod.ZodString;
257
+ institution: zod.ZodString;
258
+ holder: zod.ZodString;
259
+ transactor: zod.ZodOptional<zod.ZodString>;
254
260
  }, zod.z.core.$strip>]>>;
255
261
  }, zod.z.core.$strip>;
256
262
  interface Creatable {
@@ -284,6 +284,12 @@ export declare namespace Account {
284
284
  account: zod.ZodString;
285
285
  holder: zod.ZodString;
286
286
  institution: zod.ZodOptional<zod.ZodString>;
287
+ }, zod.z.core.$strip>, zod.ZodObject<{
288
+ type: zod.ZodLiteral<"bic">;
289
+ account: zod.ZodString;
290
+ institution: zod.ZodString;
291
+ holder: zod.ZodString;
292
+ transactor: zod.ZodOptional<zod.ZodString>;
287
293
  }, zod.z.core.$strip>]>>;
288
294
  details: zod.ZodOptional<zod.ZodObject<{
289
295
  supplier: zod.ZodEnum<{
@@ -526,6 +532,12 @@ export declare namespace Account {
526
532
  account: zod.ZodString;
527
533
  holder: zod.ZodString;
528
534
  institution: zod.ZodOptional<zod.ZodString>;
535
+ }, zod.z.core.$strip>, zod.ZodObject<{
536
+ type: zod.ZodLiteral<"bic">;
537
+ account: zod.ZodString;
538
+ institution: zod.ZodString;
539
+ holder: zod.ZodString;
540
+ transactor: zod.ZodOptional<zod.ZodString>;
529
541
  }, zod.z.core.$strip>]>>;
530
542
  }, zod.z.core.$strip>>;
531
543
  charges: zod.ZodOptional<zod.ZodObject<{
@@ -1,5 +1,7 @@
1
1
  import { isly } from "isly";
2
+ import { zod } from "../zod";
2
3
  export type Category = string;
3
4
  export declare namespace Category {
4
5
  const type: isly.Type<string>;
6
+ const typeZod: zod.ZodType<Category>;
5
7
  }
@@ -2,8 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Category = void 0;
4
4
  const isly_1 = require("isly");
5
+ const zod_1 = require("../zod");
5
6
  var Category;
6
7
  (function (Category) {
7
8
  Category.type = isly_1.isly.fromIs("Merchant.Category", (value) => typeof value === "string" && /^\d{4}$/.test(value));
9
+ Category.typeZod = zod_1.zod.string().regex(/^\d{4}$/);
8
10
  })(Category || (exports.Category = Category = {}));
9
11
  //# sourceMappingURL=Category.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Category.js","sourceRoot":"","sources":["../../../Merchant/Category.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAI3B,IAAiB,QAAQ,CAKxB;AALD,WAAiB,QAAQ;IACX,aAAI,GAAG,WAAI,CAAC,MAAM,CAC9B,mBAAmB,EACnB,CAAC,KAAU,EAAqB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CACrF,CAAA;AACF,CAAC,EALgB,QAAQ,wBAAR,QAAQ,QAKxB"}
1
+ {"version":3,"file":"Category.js","sourceRoot":"","sources":["../../../Merchant/Category.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,gCAA4B;AAI5B,IAAiB,QAAQ,CAMxB;AAND,WAAiB,QAAQ;IACX,aAAI,GAAG,WAAI,CAAC,MAAM,CAC9B,mBAAmB,EACnB,CAAC,KAAU,EAAqB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CACrF,CAAA;IACY,gBAAO,GAA0B,SAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;AAC5E,CAAC,EANgB,QAAQ,wBAAR,QAAQ,QAMxB"}
@@ -0,0 +1,19 @@
1
+ import { zod } from "../../zod";
2
+ export interface Bic {
3
+ type: "bic";
4
+ account: string;
5
+ institution: string;
6
+ holder: string;
7
+ transactor?: string;
8
+ }
9
+ export declare namespace Bic {
10
+ const currencies: readonly ["USD"];
11
+ const type: import("isly/dist/cjs/object").IslyObject<Bic, object>;
12
+ const typeZod: zod.ZodObject<{
13
+ type: zod.ZodLiteral<"bic">;
14
+ account: zod.ZodString;
15
+ institution: zod.ZodString;
16
+ holder: zod.ZodString;
17
+ transactor: zod.ZodOptional<zod.ZodString>;
18
+ }, zod.z.core.$strip>;
19
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Bic = void 0;
4
+ const isly_1 = require("isly");
5
+ const zod_1 = require("../../zod");
6
+ var Bic;
7
+ (function (Bic) {
8
+ Bic.currencies = ["USD"];
9
+ Bic.type = isly_1.isly.object({
10
+ type: isly_1.isly.string("bic"),
11
+ account: isly_1.isly.string(),
12
+ institution: isly_1.isly.string(),
13
+ holder: isly_1.isly.string(),
14
+ transactor: isly_1.isly.string().optional(),
15
+ });
16
+ Bic.typeZod = zod_1.zod.object({
17
+ type: zod_1.zod.literal("bic"),
18
+ account: zod_1.zod.string(),
19
+ institution: zod_1.zod.string(),
20
+ holder: zod_1.zod.string(),
21
+ transactor: zod_1.zod.string().optional(),
22
+ });
23
+ })(Bic || (exports.Bic = Bic = {}));
24
+ //# sourceMappingURL=Bic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bic.js","sourceRoot":"","sources":["../../../../Rail/Address/Bic.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,mCAA+B;AAS/B,IAAiB,GAAG,CAgBnB;AAhBD,WAAiB,GAAG;IACN,cAAU,GAAG,CAAC,KAAK,CAAU,CAAA;IAC7B,QAAI,GAAG,WAAI,CAAC,MAAM,CAAM;QACpC,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QACxB,OAAO,EAAE,WAAI,CAAC,MAAM,EAAE;QACtB,WAAW,EAAE,WAAI,CAAC,MAAM,EAAE;QAC1B,MAAM,EAAE,WAAI,CAAC,MAAM,EAAE;QACrB,UAAU,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACpC,CAAC,CAAA;IACW,WAAO,GAAG,SAAG,CAAC,MAAM,CAAC;QACjC,IAAI,EAAE,SAAG,CAAC,OAAO,CAAC,KAAK,CAAC;QACxB,OAAO,EAAE,SAAG,CAAC,MAAM,EAAE;QACrB,WAAW,EAAE,SAAG,CAAC,MAAM,EAAE;QACzB,MAAM,EAAE,SAAG,CAAC,MAAM,EAAE;QACpB,UAAU,EAAE,SAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACnC,CAAC,CAAA;AACH,CAAC,EAhBgB,GAAG,mBAAH,GAAG,QAgBnB"}
@@ -1,21 +1,22 @@
1
1
  import { isly } from "isly";
2
2
  import { Realm } from "../../Realm";
3
3
  import { zod } from "../../zod";
4
+ import { Bic as AddressBic } from "./Bic";
4
5
  import { Card as AddressCard } from "./Card";
5
6
  import { Iban as AddressIban } from "./Iban";
6
7
  import { Internal as AddressInternal } from "./internal";
7
8
  import { PaxGiro as AddressPaxGiro } from "./PaxGiro";
8
9
  import { Route as AddressRoute } from "./Route";
9
10
  import { Scan as AddressScan } from "./Scan";
10
- export type Address = AddressCard | AddressCard.Counterpart | AddressIban | AddressInternal | AddressPaxGiro | AddressScan;
11
+ export type Address = AddressCard | AddressCard.Counterpart | AddressIban | AddressInternal | AddressPaxGiro | AddressScan | AddressBic;
11
12
  export declare namespace Address {
12
13
  const realm: Record<Realm, string[]>;
13
- const values: readonly ["paxgiro", "internal", "iban", "scan", "card", "paxgiro-credit"];
14
+ const values: readonly ["paxgiro", "internal", "iban", "bic", "scan", "card", "paxgiro-credit"];
14
15
  type Type = (typeof values)[number];
15
16
  function compare(addresses: [Address, Address]): boolean;
16
17
  function parse(value: string): Address | undefined;
17
- function stringify(Address: Address): string;
18
- function beautify(Address: Address): string;
18
+ function stringify(address: Address): string;
19
+ function beautify(address: Address): string;
19
20
  const type: isly.Type<Address>;
20
21
  const typeZod: zod.ZodUnion<readonly [zod.ZodObject<{
21
22
  type: zod.ZodLiteral<"card">;
@@ -70,6 +71,12 @@ export declare namespace Address {
70
71
  account: zod.ZodString;
71
72
  holder: zod.ZodString;
72
73
  institution: zod.ZodOptional<zod.ZodString>;
74
+ }, zod.z.core.$strip>, zod.ZodObject<{
75
+ type: zod.ZodLiteral<"bic">;
76
+ account: zod.ZodString;
77
+ institution: zod.ZodString;
78
+ holder: zod.ZodString;
79
+ transactor: zod.ZodOptional<zod.ZodString>;
73
80
  }, zod.z.core.$strip>]>;
74
81
  export import PaxGiro = AddressPaxGiro;
75
82
  export import Iban = AddressIban;
@@ -77,4 +84,5 @@ export declare namespace Address {
77
84
  export import Internal = AddressInternal;
78
85
  export import Card = AddressCard;
79
86
  export import Route = AddressRoute;
87
+ export import Bic = AddressBic;
80
88
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Address = void 0;
4
4
  const isly_1 = require("isly");
5
5
  const zod_1 = require("../../zod");
6
+ const Bic_1 = require("./Bic");
6
7
  const Card_1 = require("./Card");
7
8
  const Iban_1 = require("./Iban");
8
9
  const internal_1 = require("./internal");
@@ -10,17 +11,17 @@ const PaxGiro_1 = require("./PaxGiro");
10
11
  const Route_1 = require("./Route");
11
12
  const Scan_1 = require("./Scan");
12
13
  var Address;
13
- (function (Address_1) {
14
- Address_1.realm = {
15
- test: ["paxgiro", "internal", "iban", "scan", "card", "paxgiro-credit"],
14
+ (function (Address) {
15
+ Address.realm = {
16
+ test: ["paxgiro", "internal", "iban", "bic", "scan", "card", "paxgiro-credit"],
16
17
  uk: ["internal", "iban", "scan", "card"],
17
18
  eea: ["internal", "iban", "scan", "card"],
18
19
  };
19
- Address_1.values = ["paxgiro", "internal", "iban", "scan", "card", "paxgiro-credit"];
20
+ Address.values = ["paxgiro", "internal", "iban", "bic", "scan", "card", "paxgiro-credit"];
20
21
  function compare(addresses) {
21
22
  return Object.entries(addresses[0]).every(([key, value]) => value == addresses[1][key]);
22
23
  }
23
- Address_1.compare = compare;
24
+ Address.compare = compare;
24
25
  function parse(value) {
25
26
  let result;
26
27
  const splitted = value.split("-");
@@ -31,65 +32,73 @@ var Address;
31
32
  }
32
33
  return result;
33
34
  }
34
- Address_1.parse = parse;
35
- function stringify(Address) {
35
+ Address.parse = parse;
36
+ function stringify(address) {
36
37
  let result;
37
- switch (Address.type) {
38
+ switch (address.type) {
38
39
  case "iban":
39
- result = `iban-${Address.iban}`;
40
+ result = `iban-${address.iban}`;
40
41
  break;
41
42
  case "paxgiro":
42
- result = `pxg-${Address.identifier}`;
43
+ result = `pxg-${address.identifier}`;
43
44
  break;
44
45
  case "internal":
45
- result = `internal-${Address.identifier}`;
46
+ result = `internal-${address.identifier}`;
46
47
  break;
47
48
  case "scan":
48
- result = `scan-${Address.sort}-${Address.account}`;
49
+ result = `scan-${address.sort}-${address.account}`;
49
50
  break;
50
51
  case "card":
51
- result = "id" in Address ? `${Address.type}-${Address.id}` : `${Address.type}-merchant-${Address.merchant.id}`;
52
+ result = "id" in address ? `${address.type}-${address.id}` : `${address.type}-merchant-${address.merchant.id}`;
53
+ break;
54
+ case "bic":
55
+ result = `bic-${address.institution}-${address.account}`;
52
56
  break;
53
57
  }
54
58
  return result;
55
59
  }
56
- Address_1.stringify = stringify;
57
- function beautify(Address) {
60
+ Address.stringify = stringify;
61
+ function beautify(address) {
58
62
  let result;
59
- switch (Address.type) {
63
+ switch (address.type) {
60
64
  case "iban":
61
- result = `${Address.iban}`;
65
+ result = `${address.iban}`;
62
66
  break;
63
67
  case "paxgiro":
64
- result = `${Address.identifier}`;
68
+ result = `${address.identifier}`;
65
69
  break;
66
70
  case "internal":
67
- result = `${Address.identifier}`;
71
+ result = `${address.identifier}`;
68
72
  break;
69
73
  case "scan":
70
- result = `${Address.sort} ${Address.account}`;
74
+ result = `${address.sort} ${address.account}`;
71
75
  break;
72
76
  case "card":
73
- result = "id" in Address ? `${Address.type}-${Address.id}` : `${Address.type}-merchant-${Address.merchant.id}`;
77
+ result = "id" in address ? `${address.type}-${address.id}` : `${address.type}-merchant-${address.merchant.id}`;
78
+ break;
79
+ case "bic":
80
+ result = `${address.institution} ${address.account}`;
74
81
  break;
75
82
  }
76
83
  return result;
77
84
  }
78
- Address_1.beautify = beautify;
79
- Address_1.type = isly_1.isly.union(Card_1.Card.type, Card_1.Card.Counterpart.type, Iban_1.Iban.type, internal_1.Internal.type, PaxGiro_1.PaxGiro.type, Scan_1.Scan.type);
80
- Address_1.typeZod = zod_1.zod.union([
85
+ Address.beautify = beautify;
86
+ Address.type = isly_1.isly.union(Card_1.Card.type, Card_1.Card.Counterpart.type, Iban_1.Iban.type, internal_1.Internal.type, PaxGiro_1.PaxGiro.type, Scan_1.Scan.type, Bic_1.Bic.type);
87
+ Address.typeZod = zod_1.zod.union([
81
88
  Card_1.Card.typeZod,
82
89
  Card_1.Card.Counterpart.typeZod,
83
90
  Iban_1.Iban.typeZod,
84
91
  internal_1.Internal.typeZod,
85
92
  PaxGiro_1.PaxGiro.typeZod,
86
93
  Scan_1.Scan.typeZod,
94
+ Bic_1.Bic.typeZod,
87
95
  ]);
88
- Address_1.PaxGiro = PaxGiro_1.PaxGiro;
89
- Address_1.Iban = Iban_1.Iban;
90
- Address_1.Scan = Scan_1.Scan;
91
- Address_1.Internal = internal_1.Internal;
92
- Address_1.Card = Card_1.Card;
93
- Address_1.Route = Route_1.Route;
96
+ Address.PaxGiro = PaxGiro_1.PaxGiro;
97
+ Address.Iban = Iban_1.Iban;
98
+ Address.Scan = Scan_1.Scan;
99
+ Address.Internal = internal_1.Internal;
100
+ Address.Card = Card_1.Card;
101
+ Address.Route = Route_1.Route;
102
+ Address.Bic = Bic_1.Bic;
94
103
  })(Address || (exports.Address = Address = {}));
95
104
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Rail/Address/index.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAE3B,mCAA+B;AAC/B,iCAA4C;AAC5C,iCAA4C;AAC5C,yCAAwD;AACxD,uCAAqD;AACrD,mCAA+C;AAC/C,iCAA4C;AAS5C,IAAiB,OAAO,CAsFvB;AAtFD,WAAiB,SAAO;IACV,eAAK,GAA4B;QAC7C,IAAI,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC;QACvE,EAAE,EAAE,CAAC,UAA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AC,WAAW,IAAI,OAAO,CAAC,OAAO,EAAE,CAAA;gBACpD,MAAK;QACP,CAAC;QACD,OAAO,MAAM,CAAA;IACd,CAAC;IAvBe,gBAAQ,WAuBvB,CAAA;IACY,YAAI,GAAG,WAAI,CAAC,KAAK,CAC7B,WAAW,CAAC,IAAI,EAChB,WAAW,CAAC,WAAW,CAAC,IAAI,EAC5B,WAAW,CAAC,IAAI,EAChB,mBAAe,CAAC,IAAI,EACpB,iBAAc,CAAC,IAAI,EACnB,WAAW,CAAC,IAAI,EAChB,SAAU,CAAC,IAAI,CACf,CAAA;IACY,eAAO,GAAG,SAAG,CAAC,KAAK,CAAC;QAChC,WAAW,CAAC,OAAO;QACnB,WAAW,CAAC,WAAW,CAAC,OAAO;QAC/B,WAAW,CAAC,OAAO;QACnB,mBAAe,CAAC,OAAO;QACvB,iBAAc,CAAC,OAAO;QACtB,WAAW,CAAC,OAAO;QACnB,SAAU,CAAC,OAAO;KAClB,CAAC,CAAA;IAEY,eAAO,GAAG,iBAAc,CAAA;IACxB,YAAI,GAAG,WAAW,CAAA;IAClB,YAAI,GAAG,WAAW,CAAA;IAClB,gBAAQ,GAAG,mBAAe,CAAA;IAC1B,YAAI,GAAG,WAAW,CAAA;IAClB,aAAK,GAAG,aAAY,CAAA;IACpB,WAAG,GAAG,SAAU,CAAA;AAC/B,CAAC,EA/FgB,OAAO,uBAAP,OAAO,QA+FvB"}
@@ -72,6 +72,12 @@ export declare namespace Creatable {
72
72
  account: zod.ZodString;
73
73
  holder: zod.ZodString;
74
74
  institution: zod.ZodOptional<zod.ZodString>;
75
+ }, zod.z.core.$strip>, zod.ZodObject<{
76
+ type: zod.ZodLiteral<"bic">;
77
+ account: zod.ZodString;
78
+ institution: zod.ZodString;
79
+ holder: zod.ZodString;
80
+ transactor: zod.ZodOptional<zod.ZodString>;
75
81
  }, zod.z.core.$strip>]>;
76
82
  currency: zod.ZodEnum<{
77
83
  AED: "AED";
@@ -71,6 +71,12 @@ export declare namespace Base {
71
71
  account: zod.ZodString;
72
72
  holder: zod.ZodString;
73
73
  institution: zod.ZodOptional<zod.ZodString>;
74
+ }, zod.z.core.$strip>, zod.ZodObject<{
75
+ type: zod.ZodLiteral<"bic">;
76
+ account: zod.ZodString;
77
+ institution: zod.ZodString;
78
+ holder: zod.ZodString;
79
+ transactor: zod.ZodOptional<zod.ZodString>;
74
80
  }, zod.z.core.$strip>]>;
75
81
  currency: zod.ZodEnum<{
76
82
  AED: "AED";
@@ -70,6 +70,12 @@ export declare namespace Incoming {
70
70
  account: zod.ZodString;
71
71
  holder: zod.ZodString;
72
72
  institution: zod.ZodOptional<zod.ZodString>;
73
+ }, zod.z.core.$strip>, zod.ZodObject<{
74
+ type: zod.ZodLiteral<"bic">;
75
+ account: zod.ZodString;
76
+ institution: zod.ZodString;
77
+ holder: zod.ZodString;
78
+ transactor: zod.ZodOptional<zod.ZodString>;
73
79
  }, zod.z.core.$strip>]>;
74
80
  exchange: zod.ZodOptional<zod.ZodObject<{
75
81
  rate: zod.ZodNumber;
@@ -491,6 +497,12 @@ export declare namespace Incoming {
491
497
  account: zod.ZodString;
492
498
  holder: zod.ZodString;
493
499
  institution: zod.ZodOptional<zod.ZodString>;
500
+ }, zod.z.core.$strip>, zod.ZodObject<{
501
+ type: zod.ZodLiteral<"bic">;
502
+ account: zod.ZodString;
503
+ institution: zod.ZodString;
504
+ holder: zod.ZodString;
505
+ transactor: zod.ZodOptional<zod.ZodString>;
494
506
  }, zod.z.core.$strip>]>;
495
507
  currency: zod.ZodEnum<{
496
508
  AED: "AED";
@@ -58,6 +58,12 @@ export declare namespace Outgoing {
58
58
  account: zod.ZodString;
59
59
  holder: zod.ZodString;
60
60
  institution: zod.ZodOptional<zod.ZodString>;
61
+ }, zod.z.core.$strip>, zod.ZodObject<{
62
+ type: zod.ZodLiteral<"bic">;
63
+ account: zod.ZodString;
64
+ institution: zod.ZodString;
65
+ holder: zod.ZodString;
66
+ transactor: zod.ZodOptional<zod.ZodString>;
61
67
  }, zod.z.core.$strip>]>;
62
68
  currency: zod.ZodEnum<{
63
69
  AED: "AED";
@@ -66,6 +66,12 @@ export declare namespace PreTransaction {
66
66
  account: zod.ZodString;
67
67
  holder: zod.ZodString;
68
68
  institution: zod.ZodOptional<zod.ZodString>;
69
+ }, zod.z.core.$strip>, zod.ZodObject<{
70
+ type: zod.ZodLiteral<"bic">;
71
+ account: zod.ZodString;
72
+ institution: zod.ZodString;
73
+ holder: zod.ZodString;
74
+ transactor: zod.ZodOptional<zod.ZodString>;
69
75
  }, zod.z.core.$strip>]>;
70
76
  currency: zod.ZodEnum<{
71
77
  AED: "AED";
@@ -1252,6 +1258,12 @@ export declare namespace PreTransaction {
1252
1258
  account: zod.ZodString;
1253
1259
  holder: zod.ZodString;
1254
1260
  institution: zod.ZodOptional<zod.ZodString>;
1261
+ }, zod.z.core.$strip>, zod.ZodObject<{
1262
+ type: zod.ZodLiteral<"bic">;
1263
+ account: zod.ZodString;
1264
+ institution: zod.ZodString;
1265
+ holder: zod.ZodString;
1266
+ transactor: zod.ZodOptional<zod.ZodString>;
1255
1267
  }, zod.z.core.$strip>]>;
1256
1268
  exchange: zod.ZodOptional<zod.ZodObject<{
1257
1269
  rate: zod.ZodNumber;
@@ -1673,6 +1685,12 @@ export declare namespace PreTransaction {
1673
1685
  account: zod.ZodString;
1674
1686
  holder: zod.ZodString;
1675
1687
  institution: zod.ZodOptional<zod.ZodString>;
1688
+ }, zod.z.core.$strip>, zod.ZodObject<{
1689
+ type: zod.ZodLiteral<"bic">;
1690
+ account: zod.ZodString;
1691
+ institution: zod.ZodString;
1692
+ holder: zod.ZodString;
1693
+ transactor: zod.ZodOptional<zod.ZodString>;
1676
1694
  }, zod.z.core.$strip>]>;
1677
1695
  currency: zod.ZodEnum<{
1678
1696
  AED: "AED";