@pax2pay/model-banking 0.1.659 → 0.1.661

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 (142) hide show
  1. package/Operation/Change.ts +7 -0
  2. package/Operation/Changes.ts +2 -0
  3. package/Operation/Creatable.ts +8 -0
  4. package/Operation/Status.ts +2 -0
  5. package/Operation/index.ts +8 -0
  6. package/Rail/index.ts +2 -0
  7. package/Transaction/Amount/Charge/index.ts +17 -0
  8. package/Transaction/Amount/index.ts +8 -0
  9. package/Transaction/Creatable.ts +16 -0
  10. package/Transaction/Exchange.ts +7 -0
  11. package/Transaction/Identifier.ts +1 -0
  12. package/Transaction/Incoming.ts +11 -0
  13. package/Transaction/Note.ts +11 -0
  14. package/Transaction/PreTransaction/Authorization.ts +8 -0
  15. package/Transaction/PreTransaction/Base.ts +9 -0
  16. package/Transaction/PreTransaction/Incoming.ts +11 -0
  17. package/Transaction/PreTransaction/Outgoing.ts +3 -2
  18. package/Transaction/PreTransaction/index.ts +2 -0
  19. package/Transaction/Reference.ts +9 -0
  20. package/Transaction/Status.ts +2 -0
  21. package/Transaction/index.ts +33 -0
  22. package/dist/cjs/Operation/Change.d.ts +14 -0
  23. package/dist/cjs/Operation/Change.js +7 -0
  24. package/dist/cjs/Operation/Change.js.map +1 -1
  25. package/dist/cjs/Operation/Changes.d.ts +14 -0
  26. package/dist/cjs/Operation/Changes.js +2 -0
  27. package/dist/cjs/Operation/Changes.js.map +1 -1
  28. package/dist/cjs/Operation/Creatable.d.ts +216 -0
  29. package/dist/cjs/Operation/Creatable.js +8 -0
  30. package/dist/cjs/Operation/Creatable.js.map +1 -1
  31. package/dist/cjs/Operation/Status.d.ts +6 -0
  32. package/dist/cjs/Operation/Status.js +2 -0
  33. package/dist/cjs/Operation/Status.js.map +1 -1
  34. package/dist/cjs/Operation/index.d.ts +221 -0
  35. package/dist/cjs/Operation/index.js +8 -0
  36. package/dist/cjs/Operation/index.js.map +1 -1
  37. package/dist/cjs/Rail/index.d.ts +18 -0
  38. package/dist/cjs/Rail/index.js +2 -0
  39. package/dist/cjs/Rail/index.js.map +1 -1
  40. package/dist/cjs/Transaction/Amount/Charge/index.d.ts +479 -0
  41. package/dist/cjs/Transaction/Amount/Charge/index.js +17 -0
  42. package/dist/cjs/Transaction/Amount/Charge/index.js.map +1 -1
  43. package/dist/cjs/Transaction/Amount/index.d.ts +612 -0
  44. package/dist/cjs/Transaction/Amount/index.js +8 -0
  45. package/dist/cjs/Transaction/Amount/index.js.map +1 -1
  46. package/dist/cjs/Transaction/Creatable.d.ts +1191 -0
  47. package/dist/cjs/Transaction/Creatable.js +16 -0
  48. package/dist/cjs/Transaction/Creatable.js.map +1 -1
  49. package/dist/cjs/Transaction/Exchange.d.ts +367 -0
  50. package/dist/cjs/Transaction/Exchange.js +7 -0
  51. package/dist/cjs/Transaction/Exchange.js.map +1 -1
  52. package/dist/cjs/Transaction/Identifier.d.ts +1 -0
  53. package/dist/cjs/Transaction/Identifier.js +1 -0
  54. package/dist/cjs/Transaction/Identifier.js.map +1 -1
  55. package/dist/cjs/Transaction/Note.d.ts +21 -0
  56. package/dist/cjs/Transaction/Note.js +11 -0
  57. package/dist/cjs/Transaction/Note.js.map +1 -1
  58. package/dist/cjs/Transaction/PreTransaction/Authorization.d.ts +583 -0
  59. package/dist/cjs/Transaction/PreTransaction/Authorization.js +8 -0
  60. package/dist/cjs/Transaction/PreTransaction/Authorization.js.map +1 -1
  61. package/dist/cjs/Transaction/PreTransaction/Base.d.ts +611 -0
  62. package/dist/cjs/Transaction/PreTransaction/Base.js +9 -0
  63. package/dist/cjs/Transaction/PreTransaction/Base.js.map +1 -1
  64. package/dist/cjs/Transaction/PreTransaction/Incoming.d.ts +691 -0
  65. package/dist/cjs/Transaction/PreTransaction/Incoming.js +11 -0
  66. package/dist/cjs/Transaction/PreTransaction/Incoming.js.map +1 -1
  67. package/dist/cjs/Transaction/PreTransaction/Outgoing.d.ts +608 -2
  68. package/dist/cjs/Transaction/PreTransaction/Outgoing.js +3 -1
  69. package/dist/cjs/Transaction/PreTransaction/Outgoing.js.map +1 -1
  70. package/dist/cjs/Transaction/PreTransaction/index.d.ts +1877 -0
  71. package/dist/cjs/Transaction/PreTransaction/index.js +2 -0
  72. package/dist/cjs/Transaction/PreTransaction/index.js.map +1 -1
  73. package/dist/cjs/Transaction/Reference.d.ts +13 -0
  74. package/dist/cjs/Transaction/Reference.js +9 -0
  75. package/dist/cjs/Transaction/Reference.js.map +1 -1
  76. package/dist/cjs/Transaction/Status.d.ts +21 -0
  77. package/dist/cjs/Transaction/Status.js +2 -0
  78. package/dist/cjs/Transaction/Status.js.map +1 -1
  79. package/dist/cjs/Transaction/index.d.ts +4153 -0
  80. package/dist/cjs/Transaction/index.js +33 -0
  81. package/dist/cjs/Transaction/index.js.map +1 -1
  82. package/dist/mjs/Operation/Change.d.ts +14 -0
  83. package/dist/mjs/Operation/Change.js +7 -0
  84. package/dist/mjs/Operation/Change.js.map +1 -1
  85. package/dist/mjs/Operation/Changes.d.ts +14 -0
  86. package/dist/mjs/Operation/Changes.js +2 -0
  87. package/dist/mjs/Operation/Changes.js.map +1 -1
  88. package/dist/mjs/Operation/Creatable.d.ts +216 -0
  89. package/dist/mjs/Operation/Creatable.js +8 -0
  90. package/dist/mjs/Operation/Creatable.js.map +1 -1
  91. package/dist/mjs/Operation/Status.d.ts +6 -0
  92. package/dist/mjs/Operation/Status.js +2 -0
  93. package/dist/mjs/Operation/Status.js.map +1 -1
  94. package/dist/mjs/Operation/index.d.ts +221 -0
  95. package/dist/mjs/Operation/index.js +8 -0
  96. package/dist/mjs/Operation/index.js.map +1 -1
  97. package/dist/mjs/Rail/index.d.ts +18 -0
  98. package/dist/mjs/Rail/index.js +2 -0
  99. package/dist/mjs/Rail/index.js.map +1 -1
  100. package/dist/mjs/Transaction/Amount/Charge/index.d.ts +479 -0
  101. package/dist/mjs/Transaction/Amount/Charge/index.js +17 -0
  102. package/dist/mjs/Transaction/Amount/Charge/index.js.map +1 -1
  103. package/dist/mjs/Transaction/Amount/index.d.ts +612 -0
  104. package/dist/mjs/Transaction/Amount/index.js +8 -0
  105. package/dist/mjs/Transaction/Amount/index.js.map +1 -1
  106. package/dist/mjs/Transaction/Creatable.d.ts +1191 -0
  107. package/dist/mjs/Transaction/Creatable.js +16 -0
  108. package/dist/mjs/Transaction/Creatable.js.map +1 -1
  109. package/dist/mjs/Transaction/Exchange.d.ts +367 -0
  110. package/dist/mjs/Transaction/Exchange.js +7 -0
  111. package/dist/mjs/Transaction/Exchange.js.map +1 -1
  112. package/dist/mjs/Transaction/Identifier.d.ts +1 -0
  113. package/dist/mjs/Transaction/Identifier.js +1 -0
  114. package/dist/mjs/Transaction/Identifier.js.map +1 -1
  115. package/dist/mjs/Transaction/Note.d.ts +21 -0
  116. package/dist/mjs/Transaction/Note.js +11 -0
  117. package/dist/mjs/Transaction/Note.js.map +1 -1
  118. package/dist/mjs/Transaction/PreTransaction/Authorization.d.ts +583 -0
  119. package/dist/mjs/Transaction/PreTransaction/Authorization.js +8 -0
  120. package/dist/mjs/Transaction/PreTransaction/Authorization.js.map +1 -1
  121. package/dist/mjs/Transaction/PreTransaction/Base.d.ts +611 -0
  122. package/dist/mjs/Transaction/PreTransaction/Base.js +9 -0
  123. package/dist/mjs/Transaction/PreTransaction/Base.js.map +1 -1
  124. package/dist/mjs/Transaction/PreTransaction/Incoming.d.ts +691 -0
  125. package/dist/mjs/Transaction/PreTransaction/Incoming.js +11 -0
  126. package/dist/mjs/Transaction/PreTransaction/Incoming.js.map +1 -1
  127. package/dist/mjs/Transaction/PreTransaction/Outgoing.d.ts +608 -2
  128. package/dist/mjs/Transaction/PreTransaction/Outgoing.js +3 -1
  129. package/dist/mjs/Transaction/PreTransaction/Outgoing.js.map +1 -1
  130. package/dist/mjs/Transaction/PreTransaction/index.d.ts +1877 -0
  131. package/dist/mjs/Transaction/PreTransaction/index.js +2 -0
  132. package/dist/mjs/Transaction/PreTransaction/index.js.map +1 -1
  133. package/dist/mjs/Transaction/Reference.d.ts +13 -0
  134. package/dist/mjs/Transaction/Reference.js +9 -0
  135. package/dist/mjs/Transaction/Reference.js.map +1 -1
  136. package/dist/mjs/Transaction/Status.d.ts +21 -0
  137. package/dist/mjs/Transaction/Status.js +2 -0
  138. package/dist/mjs/Transaction/Status.js.map +1 -1
  139. package/dist/mjs/Transaction/index.d.ts +4153 -0
  140. package/dist/mjs/Transaction/index.js +33 -0
  141. package/dist/mjs/Transaction/index.js.map +1 -1
  142. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import { isly } from "isly"
2
+ import { zod } from "../zod"
2
3
  import { Status } from "./Status"
3
4
 
4
5
  export interface Change<T extends Change.Operand = Change.Operand> {
@@ -17,6 +18,12 @@ export namespace Change {
17
18
  status: Status.type,
18
19
  result: isly.number().optional(),
19
20
  })
21
+ export const typeZod = zod.object({
22
+ type: zod.enum(operand),
23
+ amount: zod.number(),
24
+ status: Status.typeZod,
25
+ result: zod.number().optional(),
26
+ })
20
27
  export namespace Add {
21
28
  export const type = Change.type.extend<Change<"add">>({
22
29
  type: isly.string("add"),
@@ -2,6 +2,7 @@ import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
3
  import { Balance as AccountBalance } from "../Balance"
4
4
  import type { Settlement } from "../Settlement"
5
+ import { zod } from "../zod"
5
6
  import { Change } from "./Change"
6
7
 
7
8
  export type Changes = Partial<Record<Changes.Entry.Balance, Change>>
@@ -47,6 +48,7 @@ export namespace Changes {
47
48
  export type Sum = Partial<Record<Changes.Entry.Balance, number>>
48
49
  export type MaybeLegacy = Changes | Legacy
49
50
  export const type = isly.record<Changes>(isly.string(), Change.type)
51
+ export const typeZod = zod.record(zod.string(), Change.typeZod)
50
52
  export type Legacy = Partial<Record<AccountBalance.Legacy.Entry, Change>>
51
53
  export namespace Legacy {
52
54
  export const type = isly.record<Legacy>(isly.string(), Change.type)
@@ -2,6 +2,7 @@ import { cryptly } from "cryptly"
2
2
  import { isoly } from "isoly"
3
3
  import { isly } from "isly"
4
4
  import { Settlement } from "../Settlement"
5
+ import { zod } from "../zod"
5
6
  import { Changes } from "./Changes"
6
7
 
7
8
  export interface Creatable {
@@ -37,6 +38,13 @@ export namespace Creatable {
37
38
  type: isly.string(types),
38
39
  counterbalance: isly.string().optional(),
39
40
  })
41
+ export const typeZod = zod.object({
42
+ account: zod.string(),
43
+ currency: zod.enum(isoly.Currency.values),
44
+ changes: Changes.typeZod,
45
+ type: zod.enum(types),
46
+ counterbalance: zod.string().optional(),
47
+ })
40
48
  export function fromRefund(account: string, settlement: string, entry: Settlement.Entry.Creatable.Refund): Creatable {
41
49
  // The Entry.Refund.Creatable has negative amount and fee
42
50
  // The operation amounts should always be positive
@@ -1,8 +1,10 @@
1
1
  import { isly } from "isly"
2
+ import { zod } from "../zod"
2
3
 
3
4
  export type Status = (typeof Status.values)[number]
4
5
 
5
6
  export namespace Status {
6
7
  export const values = ["pending", "success", "failed"] as const
7
8
  export const type = isly.string(values)
9
+ export const typeZod = zod.enum(values)
8
10
  }
@@ -1,5 +1,6 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
+ import { zod } from "../zod"
3
4
  import { Change as OperationChange } from "./Change"
4
5
  import { Changes as OperationChanges } from "./Changes"
5
6
  import { Creatable as OperationCreatable } from "./Creatable"
@@ -34,6 +35,13 @@ export namespace Operation {
34
35
  export import Creatable = OperationCreatable
35
36
  export import Changes = OperationChanges
36
37
  export import Change = OperationChange
38
+ export const typeZod = Creatable.typeZod.extend({
39
+ transaction: zod.string(),
40
+ counter: zod.number(),
41
+ created: zod.string().refine(isoly.DateTime.is),
42
+ signature: zod.string().optional(),
43
+ previous: zod.string().optional(),
44
+ })
37
45
  export const type = OperationCreatable.type.extend<Operation>({
38
46
  transaction: isly.string(),
39
47
  counter: isly.number(),
package/Rail/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { isly } from "isly"
2
+ import { zod } from "../zod"
2
3
  import { Address as RailAddress } from "./Address"
3
4
 
4
5
  export type Rail = (typeof Rail.rails)[number]
@@ -21,5 +22,6 @@ export namespace Rail {
21
22
  "rix-inst",
22
23
  ] as const
23
24
  export const type = isly.string<Rail>(rails)
25
+ export const typeZod = zod.enum(rails)
24
26
  export import Address = RailAddress
25
27
  }
@@ -1,6 +1,7 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
3
  import { Card } from "../../../Card"
4
+ import { zod } from "../../../zod"
4
5
 
5
6
  export interface Charge {
6
7
  merchant?: Charge.Merchant
@@ -18,6 +19,11 @@ export namespace Charge {
18
19
  rate: isly.number(),
19
20
  preset: isly.union(Card.Preset.type, isly.string("default")),
20
21
  })
22
+ export const typeZod = zod.object({
23
+ amount: zod.number(),
24
+ rate: zod.number(),
25
+ preset: zod.union([Card.Preset.typeZod, zod.literal("default")]),
26
+ })
21
27
  }
22
28
  export interface Merchant {
23
29
  amount: number
@@ -36,6 +42,13 @@ export namespace Charge {
36
42
  account: isly.string(),
37
43
  }),
38
44
  })
45
+ export const typeZod = zod.object({
46
+ amount: zod.number(),
47
+ rate: zod.number(),
48
+ merchant: Card.Restriction.Merchant.typeZod,
49
+ preset: zod.union([Card.Preset.typeZod, zod.literal("default")]),
50
+ destination: zod.object({ account: zod.string() }),
51
+ })
39
52
  }
40
53
  export function total(currency: isoly.Currency, charges: Charge): number {
41
54
  return isoly.Currency.add(currency, charges.fx?.amount ?? 0, charges.merchant?.amount ?? 0)
@@ -44,4 +57,8 @@ export namespace Charge {
44
57
  merchant: Charge.Merchant.type.optional(),
45
58
  fx: Charge.Fx.type.optional(),
46
59
  })
60
+ export const typeZod = zod.object({
61
+ merchant: Charge.Merchant.typeZod.optional(),
62
+ fx: Charge.Fx.typeZod.optional(),
63
+ })
47
64
  }
@@ -1,5 +1,6 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
+ import { zod } from "../../zod"
3
4
  import { Exchange } from "../Exchange"
4
5
  import { Charge as AmountCharge } from "./Charge"
5
6
 
@@ -19,6 +20,13 @@ export namespace Amount {
19
20
  total: isly.number(),
20
21
  exchange: Exchange.type.optional(),
21
22
  })
23
+ export const typeZod = zod.object({
24
+ original: zod.number(),
25
+ charge: zod.number(),
26
+ charges: Amount.Charge.typeZod.optional(),
27
+ total: zod.number(),
28
+ exchange: Exchange.typeZod.optional(),
29
+ })
22
30
  export function change(
23
31
  currency: isoly.Currency,
24
32
  amount: Amount,
@@ -3,6 +3,7 @@ import { isly } from "isly"
3
3
  import { Account } from "../Account"
4
4
  import { Preset } from "../Card/Preset"
5
5
  import { Rail } from "../Rail"
6
+ import { zod } from "../zod"
6
7
  import { Amount } from "./Amount"
7
8
  import { Exchange } from "./Exchange"
8
9
 
@@ -24,6 +25,14 @@ export namespace Creatable {
24
25
  exchange: Exchange.type.optional(),
25
26
  reference: isly.object<{ reference?: string }>({ reference: isly.string().optional() }).optional(),
26
27
  })
28
+ export const typeZod = zod.object({
29
+ counterpart: Rail.Address.typeZod,
30
+ currency: zod.enum(isoly.Currency.values),
31
+ amount: zod.number(),
32
+ description: zod.string(),
33
+ exchange: Exchange.typeZod.optional(),
34
+ reference: zod.object({ reference: zod.string().optional() }).optional(),
35
+ })
27
36
  export interface CardTransaction extends Creatable {
28
37
  account: Pick<Rail.Address.Card, "id" | "type">
29
38
  accountId: string
@@ -39,6 +48,13 @@ export namespace Creatable {
39
48
  reference: isly.object<{ reference: string }>({ reference: isly.string() }),
40
49
  approvalCode: isly.string().optional(),
41
50
  })
51
+ export const typeZod = Creatable.typeZod.extend({
52
+ account: Rail.Address.Card.typeZod.pick({ id: true, type: true }),
53
+ accountId: zod.string(),
54
+ counterpart: Rail.Address.Card.Counterpart.typeZod,
55
+ reference: zod.object({ reference: zod.string() }),
56
+ approvalCode: zod.string().optional(),
57
+ })
42
58
  export function charge(creatable: CardTransaction, preset: Preset, charges?: Account.Charge): Amount.Charge {
43
59
  return Account.Charge.evaluate(
44
60
  creatable.counterpart,
@@ -1,5 +1,6 @@
1
1
  import { isly } from "isly"
2
2
  import { Amount } from "../Amount"
3
+ import { zod } from "../zod"
3
4
 
4
5
  export interface Exchange {
5
6
  rate: number
@@ -14,4 +15,10 @@ export namespace Exchange {
14
15
  from: Amount.type.optional(),
15
16
  quote: isly.string().optional(),
16
17
  })
18
+ export const typeZod = zod.object({
19
+ rate: zod.number(),
20
+ to: Amount.typeZod.optional(),
21
+ from: Amount.typeZod.optional(),
22
+ quote: zod.string().optional(),
23
+ })
17
24
  }
@@ -4,6 +4,7 @@ import { Identifier as Pax2PayIdentifier } from "../Identifier"
4
4
  export type Identifier = Pax2PayIdentifier
5
5
  export namespace Identifier {
6
6
  export const type = Pax2PayIdentifier.type
7
+ export const typeZod = Pax2PayIdentifier.typeZod
7
8
  export function generate(): string {
8
9
  //This function will stop working 4199-11-24T01:22:57.664Z
9
10
  //Then we need to replace "zzy" instead
@@ -1,6 +1,7 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
3
  import { Rail } from "../Rail"
4
+ import { zod } from "../zod"
4
5
  import { Reference as TransactionReference } from "./Reference"
5
6
 
6
7
  export interface Incoming {
@@ -24,4 +25,14 @@ export namespace Incoming {
24
25
  rail: Rail.type.optional(),
25
26
  reference: TransactionReference.type.optional(),
26
27
  })
28
+ export const typeZod = zod.object({
29
+ account: Rail.Address.typeZod,
30
+ counterpart: Rail.Address.typeZod,
31
+ currency: zod.enum(isoly.Currency.values),
32
+ amount: zod.number(),
33
+ description: zod.string(),
34
+ posted: zod.string(),
35
+ rail: Rail.typeZod.optional(),
36
+ reference: TransactionReference.typeZod.optional(),
37
+ })
27
38
  }
@@ -1,5 +1,6 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
+ import { zod } from "../zod"
3
4
 
4
5
  export interface Note extends Note.Creatable {
5
6
  author: string
@@ -32,9 +33,19 @@ export namespace Note {
32
33
  flags: isly.string().array().optional(),
33
34
  rule: isly.any().optional(),
34
35
  })
36
+ export const typeZod = zod.object({
37
+ text: zod.string().optional(),
38
+ action: zod.enum(["approve", "reject"]).optional(),
39
+ flags: zod.array(zod.string()).optional(),
40
+ rule: zod.any().optional(),
41
+ })
35
42
  }
36
43
  export const type = Creatable.type.extend<Note>({
37
44
  author: isly.string(),
38
45
  created: isly.string(),
39
46
  })
47
+ export const typeZod = Creatable.typeZod.extend({
48
+ author: zod.string(),
49
+ created: zod.string().refine(isoly.DateTime.is),
50
+ })
40
51
  }
@@ -1,5 +1,6 @@
1
1
  import { isly } from "isly"
2
2
  import { Rail } from "../../Rail"
3
+ import { zod } from "../../zod"
3
4
  import { Base } from "./Base"
4
5
 
5
6
  export interface Authorization extends Base {
@@ -17,4 +18,11 @@ export namespace Authorization {
17
18
  reference: isly.object<{ reference: string }>({ reference: isly.string() }),
18
19
  approvalCode: isly.string().optional(),
19
20
  })
21
+ export const typeZod = Base.typeZod.extend({
22
+ type: zod.literal("authorization"),
23
+ account: Rail.Address.Card.typeZod.pick({ id: true, type: true }),
24
+ counterpart: Rail.Address.Card.Counterpart.typeZod,
25
+ reference: zod.object({ reference: zod.string() }),
26
+ approvalCode: zod.string().optional(),
27
+ })
20
28
  }
@@ -1,6 +1,7 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
3
  import { Rail } from "../../Rail"
4
+ import { zod } from "../../zod"
4
5
  import { Exchange } from "../Exchange"
5
6
 
6
7
  export interface Base {
@@ -20,4 +21,12 @@ export namespace Base {
20
21
  description: isly.string(),
21
22
  exchange: Exchange.type.optional(),
22
23
  })
24
+ export const typeZod = zod.object({
25
+ type: zod.enum(["outgoing", "incoming", "authorization"]),
26
+ counterpart: Rail.Address.typeZod,
27
+ currency: zod.enum(isoly.Currency.values),
28
+ amount: zod.number(),
29
+ description: zod.string(),
30
+ exchange: Exchange.typeZod.optional(),
31
+ })
23
32
  }
@@ -2,6 +2,7 @@ import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
3
  import { Rail } from "../../Rail"
4
4
  import { Settlement } from "../../Settlement"
5
+ import { zod } from "../../zod"
5
6
  import { Reference as TransactionReference } from "../Reference"
6
7
  import { Base } from "./Base"
7
8
 
@@ -26,6 +27,16 @@ export namespace Incoming {
26
27
  rail: Rail.type.optional(),
27
28
  reference: TransactionReference.type.optional(),
28
29
  })
30
+ export const typeZod = Base.typeZod.extend({
31
+ type: zod.literal("incoming"),
32
+ account: Rail.Address.typeZod,
33
+ currency: zod.enum(isoly.Currency.values),
34
+ amount: zod.number(),
35
+ description: zod.string(),
36
+ posted: zod.string(),
37
+ rail: Rail.typeZod.optional(),
38
+ reference: TransactionReference.typeZod.optional(),
39
+ })
29
40
  export function fromRefund(entry: Settlement.Entry.Creatable.Refund, card: Rail.Address.Card): Incoming {
30
41
  const [currency, amount] = entry.amount
31
42
  return {
@@ -1,8 +1,9 @@
1
- import type { Base } from "./Base"
1
+ import { zod } from "../../zod"
2
+ import { Base } from "./Base"
2
3
 
3
4
  export interface Outgoing extends Base {
4
5
  type: "outgoing"
5
6
  }
6
7
  export namespace Outgoing {
7
- export const dummy = true
8
+ export const typeZod = Base.typeZod.extend({ type: zod.literal("outgoing") })
8
9
  }
@@ -1,4 +1,5 @@
1
1
  import { Rail } from "../../Rail"
2
+ import { zod } from "../../zod"
2
3
  import { Authorization as PreTransactionAuthorization } from "./Authorization"
3
4
  import { Incoming as PreTransactionIncoming } from "./Incoming"
4
5
  import { Outgoing as PreTransactionOutgoing } from "./Outgoing"
@@ -13,4 +14,5 @@ export namespace PreTransaction {
13
14
  export import Authorization = PreTransactionAuthorization
14
15
  export import Incoming = PreTransactionIncoming
15
16
  export import Outgoing = PreTransactionOutgoing
17
+ export const typeZod = zod.union([Outgoing.typeZod, Authorization.typeZod, Incoming.typeZod])
16
18
  }
@@ -1,5 +1,6 @@
1
1
  import { isly } from "isly"
2
2
  import { Supplier } from "../Supplier"
3
+ import { zod } from "../zod"
3
4
 
4
5
  export interface Reference {
5
6
  supplier?: Supplier
@@ -19,4 +20,12 @@ export namespace Reference {
19
20
  instruction: isly.string().optional(),
20
21
  network: isly.string().optional(),
21
22
  })
23
+ export const typeZod = zod.object({
24
+ supplier: Supplier.typeZod.optional(),
25
+ reference: zod.string().optional(),
26
+ returnId: zod.string().optional(),
27
+ endToEndId: zod.string().optional(),
28
+ instruction: zod.string().optional(),
29
+ network: zod.string().optional(),
30
+ })
22
31
  }
@@ -1,4 +1,5 @@
1
1
  import { isly } from "isly"
2
+ import { zod } from "../zod"
2
3
 
3
4
  export type Status = Status.Success | [Status.Fail, Status.Reason]
4
5
  export namespace Status {
@@ -27,4 +28,5 @@ export namespace Status {
27
28
  Success,
28
29
  isly.tuple<[Fail, Status.Reason]>(Fail, Reason)
29
30
  )
31
+ export const typeZod = zod.union([zod.enum(successes), zod.tuple([zod.enum(failures), zod.enum(reasons)])])
30
32
  }
@@ -7,6 +7,7 @@ import { Rail } from "../Rail"
7
7
  import { Report } from "../Report"
8
8
  import type { Rule } from "../Rule"
9
9
  import { Settlement } from "../Settlement"
10
+ import { zod } from "../zod"
10
11
  import { Amount as TransactionAmount } from "./Amount"
11
12
  import { Creatable as TransactionCreatable } from "./Creatable"
12
13
  import { Exchange as TransactionExchange } from "./Exchange"
@@ -85,6 +86,32 @@ export namespace Transaction {
85
86
  risk: isly.number().optional(),
86
87
  state: isly.any().optional(),
87
88
  })
89
+ export const typeZod = zod.object({
90
+ counterpart: Rail.Address.typeZod,
91
+ currency: zod.enum(isoly.Currency.values),
92
+ amount: Amount.typeZod,
93
+ description: zod.string(),
94
+ organization: zod.string(),
95
+ accountId: zod.string(),
96
+ accountName: zod.string().optional(),
97
+ account: Rail.Address.typeZod,
98
+ type: zod.enum(types).optional(),
99
+ direction: zod.enum(directions).optional(),
100
+ id: Identifier.typeZod,
101
+ reference: Reference.typeZod.optional(),
102
+ posted: zod.string().refine(isoly.DateTime.is),
103
+ transacted: zod.string().refine(isoly.DateTime.is).optional(),
104
+ by: zod.string().optional(),
105
+ balance: zod.object({ actual: zod.number(), available: zod.number(), reserved: zod.number() }),
106
+ operations: zod.array(Operation.typeZod).optional(),
107
+ status: Status.typeZod,
108
+ rail: Rail.typeZod.optional(),
109
+ flags: zod.array(zod.string()),
110
+ oldFlags: zod.array(zod.string()),
111
+ notes: zod.array(Note.typeZod),
112
+ risk: zod.number().optional(),
113
+ state: zod.any().optional(),
114
+ })
88
115
  export function amountFromOperations(transaction: Transaction, operations: Operation[]): Amount {
89
116
  const changes = Operation.sum(operations)
90
117
  const reserved = isoly.Currency.add(
@@ -105,6 +132,7 @@ export namespace Transaction {
105
132
  }
106
133
  export namespace Legacy {
107
134
  export const type = Transaction.type.omit<"amount">(["amount"]).extend<Legacy>({ amount: isly.number() })
135
+ export const typeZod = Transaction.typeZod.omit({ amount: true }).extend({ amount: zod.number() })
108
136
  }
109
137
  export function fromLegacy(transaction: Transaction | Legacy): Transaction {
110
138
  return {
@@ -131,6 +159,7 @@ export namespace Transaction {
131
159
  export type Event = Omit<Transaction, "state">
132
160
  export namespace Event {
133
161
  export const type = Transaction.type.omit(["state"])
162
+ export const typeZod = Transaction.typeZod.omit({ state: true })
134
163
 
135
164
  export function from(transaction: Transaction): Event {
136
165
  return (({ state, ...event }) => event)(transaction)
@@ -384,5 +413,9 @@ export namespace Transaction {
384
413
  account: Rail.Address.Card.type,
385
414
  counterpart: Rail.Address.Card.Counterpart.type,
386
415
  })
416
+ export const typeZod = Transaction.typeZod.omit({ account: true, counterpart: true }).extend({
417
+ account: Rail.Address.Card.typeZod,
418
+ counterpart: Rail.Address.Card.Counterpart.typeZod,
419
+ })
387
420
  }
388
421
  }
@@ -1,3 +1,4 @@
1
+ import { zod } from "../zod";
1
2
  import { Status } from "./Status";
2
3
  export interface Change<T extends Change.Operand = Change.Operand> {
3
4
  type: T;
@@ -9,6 +10,19 @@ export declare namespace Change {
9
10
  const operand: readonly ["add", "subtract"];
10
11
  type Operand = (typeof operand)[number];
11
12
  const type: import("isly/dist/cjs/object").IslyObject<Change<"add" | "subtract">, object>;
13
+ const typeZod: zod.ZodObject<{
14
+ type: zod.ZodEnum<{
15
+ add: "add";
16
+ subtract: "subtract";
17
+ }>;
18
+ amount: zod.ZodNumber;
19
+ status: zod.ZodEnum<{
20
+ success: "success";
21
+ pending: "pending";
22
+ failed: "failed";
23
+ }>;
24
+ result: zod.ZodOptional<zod.ZodNumber>;
25
+ }, zod.z.core.$strip>;
12
26
  namespace Add {
13
27
  const type: import("isly/dist/cjs/object").IslyObject<Change<"add">, Change<"add" | "subtract">>;
14
28
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Change = void 0;
4
4
  const isly_1 = require("isly");
5
+ const zod_1 = require("../zod");
5
6
  const Status_1 = require("./Status");
6
7
  var Change;
7
8
  (function (Change) {
@@ -12,6 +13,12 @@ var Change;
12
13
  status: Status_1.Status.type,
13
14
  result: isly_1.isly.number().optional(),
14
15
  });
16
+ Change.typeZod = zod_1.zod.object({
17
+ type: zod_1.zod.enum(Change.operand),
18
+ amount: zod_1.zod.number(),
19
+ status: Status_1.Status.typeZod,
20
+ result: zod_1.zod.number().optional(),
21
+ });
15
22
  let Add;
16
23
  (function (Add) {
17
24
  Add.type = Change.type.extend({
@@ -1 +1 @@
1
- {"version":3,"file":"Change.js","sourceRoot":"","sources":["../../../Operation/Change.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,qCAAiC;AASjC,IAAiB,MAAM,CAmBtB;AAnBD,WAAiB,MAAM;IACT,cAAO,GAAG,CAAC,KAAK,EAAE,UAAU,CAAU,CAAA;IAEtC,WAAI,GAAG,WAAI,CAAC,MAAM,CAAS;QACvC,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QACtC,MAAM,EAAE,WAAI,CAAC,MAAM,EAAE;QACrB,MAAM,EAAE,eAAM,CAAC,IAAI;QACnB,MAAM,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAChC,CAAC,CAAA;IACF,IA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EAAE;KAC/B,CAAC,CAAA;IACF,IAAiB,GAAG,CAInB;IAJD,WAAiB,GAAG;QACN,QAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAgB;YACrD,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,KAAK,CAAC;SACxB,CAAC,CAAA;IACH,CAAC,EAJgB,GAAG,GAAH,UAAG,KAAH,UAAG,QAInB;IACD,IAAiB,QAAQ,CAIxB;IAJD,WAAiB,QAAQ;QACX,aAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAqB;YAC1D,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,UAAU,CAAC;SAC7B,CAAC,CAAA;IACH,CAAC,EAJgB,QAAQ,GAAR,eAAQ,KAAR,eAAQ,QAIxB;AACF,CAAC,EAzBgB,MAAM,sBAAN,MAAM,QAyBtB"}
@@ -2,6 +2,7 @@ import { isoly } from "isoly";
2
2
  import { isly } from "isly";
3
3
  import { Balance as AccountBalance } from "../Balance";
4
4
  import type { Settlement } from "../Settlement";
5
+ import { zod } from "../zod";
5
6
  import { Change } from "./Change";
6
7
  export type Changes = Partial<Record<Changes.Entry.Balance, Change>>;
7
8
  export declare namespace Changes {
@@ -11,6 +12,19 @@ export declare namespace Changes {
11
12
  type Sum = Partial<Record<Changes.Entry.Balance, number>>;
12
13
  type MaybeLegacy = Changes | Legacy;
13
14
  const type: isly.Type<Partial<Record<"available" | "reserved-incoming" | "reserved-outgoing" | "reserved-buffer", Change<"add" | "subtract">>>>;
15
+ const typeZod: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
16
+ type: zod.ZodEnum<{
17
+ add: "add";
18
+ subtract: "subtract";
19
+ }>;
20
+ amount: zod.ZodNumber;
21
+ status: zod.ZodEnum<{
22
+ success: "success";
23
+ pending: "pending";
24
+ failed: "failed";
25
+ }>;
26
+ result: zod.ZodOptional<zod.ZodNumber>;
27
+ }, zod.z.core.$strip>>;
14
28
  type Legacy = Partial<Record<AccountBalance.Legacy.Entry, Change>>;
15
29
  namespace Legacy {
16
30
  const type: isly.Type<Partial<Record<"actual" | "incomingReserved" | "outgoingReserved" | "bufferReserved", Change<"add" | "subtract">>>>;
@@ -4,6 +4,7 @@ exports.Changes = void 0;
4
4
  const isoly_1 = require("isoly");
5
5
  const isly_1 = require("isly");
6
6
  const Balance_1 = require("../Balance");
7
+ const zod_1 = require("../zod");
7
8
  const Change_1 = require("./Change");
8
9
  var Changes;
9
10
  (function (Changes) {
@@ -30,6 +31,7 @@ var Changes;
30
31
  }
31
32
  Changes.reserved = reserved;
32
33
  Changes.type = isly_1.isly.record(isly_1.isly.string(), Change_1.Change.type);
34
+ Changes.typeZod = zod_1.zod.record(zod_1.zod.string(), Change_1.Change.typeZod);
33
35
  let Legacy;
34
36
  (function (Legacy) {
35
37
  Legacy.type = isly_1.isly.record(isly_1.isly.string(), Change_1.Change.type);
@@ -1 +1 @@
1
- {"version":3,"file":"Changes.js","sourceRoot":"","sources":["../../../Operation/Changes.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAC3B,wCAAsD;AAEtD,qCAAiC;AAGjC,IAAiB,OAAO,CA+FvB;AA/FD,WAAiB,OAAO;IACvB,SAAgB,OAAO,CAAC,QAAwB,EAAE,OAAgB;QACjE,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAC5F,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,aAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,EAC7G,CAAC,CACD,CAAA;IACF,CAAC;IALe,eAAO,UAKtB,CAAA;IACD,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