@pax2pay/model-banking 0.1.670 → 0.1.671
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/Account/Details.ts +6 -6
- package/Account/index.ts +3 -3
- package/Acquirer/index.ts +3 -3
- package/Amount.ts +2 -2
- package/Amounts.ts +2 -2
- package/Balances.ts +2 -2
- package/Card/Creatable.ts +1 -6
- package/Card/index.ts +4 -4
- package/Merchant/index.ts +2 -2
- package/Operation/Creatable.ts +2 -2
- package/Organization/Contact/Address/{General.ts → Default.ts} +2 -3
- package/Organization/Contact/Address/GB.ts +1 -2
- package/Organization/Contact/Address/SE.ts +1 -1
- package/Organization/Contact/Address/index.ts +2 -2
- package/Organization/Contact/Addresses.ts +1 -1
- package/Organization/Contact/Name.ts +1 -1
- package/Organization/Contact/Phone.ts +3 -3
- package/Organization/Contact/index.ts +2 -2
- package/Organization/Creatable.ts +1 -9
- package/Organization/index.ts +4 -4
- package/Rule/index.ts +1 -1
- package/Settlement/Totals.ts +2 -2
- package/Transaction/Creatable.ts +2 -2
- package/Transaction/Incoming.ts +2 -2
- package/Transaction/PreTransaction/Base.ts +2 -2
- package/Transaction/PreTransaction/Incoming.ts +2 -2
- package/Transaction/index.ts +2 -2
- package/Treasury/Snapshot/Account.ts +2 -2
- package/Treasury/Snapshot/Emoney.ts +2 -2
- package/Treasury/Snapshot/funding.ts +2 -2
- package/Treasury/Snapshot/index.ts +2 -2
- package/Treasury/Transaction/Creatable.ts +2 -2
- package/Warning/Issue.ts +2 -2
- package/Warning/Settlement/NegativeAmount.ts +2 -2
- package/Warning/Snapshot/DeltaFiat.ts +2 -2
- package/Warning/Snapshot/MissingBuffer.ts +2 -2
- package/Warning/Snapshot/MissingEmoney.ts +2 -2
- package/Warning/Snapshot/MissingFiat.ts +2 -2
- package/Warning/Snapshot/MissingTransaction.ts +2 -2
- package/Warning/Snapshot/Overdraft.ts +2 -2
- package/Warning/Snapshot/Reconciliation.ts +2 -2
- package/Warning/Snapshot/StaleFiat.ts +2 -2
- package/dist/cjs/Account/Details.d.ts +2 -688
- package/dist/cjs/Account/Details.js +3 -3
- package/dist/cjs/Account/Details.js.map +1 -1
- package/dist/cjs/Account/index.d.ts +3 -508
- package/dist/cjs/Account/index.js +3 -4
- package/dist/cjs/Account/index.js.map +1 -1
- package/dist/cjs/Acquirer/index.d.ts +1 -7
- package/dist/cjs/Acquirer/index.js +1 -1
- package/dist/cjs/Acquirer/index.js.map +1 -1
- package/dist/cjs/Amount.d.ts +1 -181
- package/dist/cjs/Amount.js +1 -1
- package/dist/cjs/Amount.js.map +1 -1
- package/dist/cjs/Amounts.js +1 -1
- package/dist/cjs/Amounts.js.map +1 -1
- package/dist/cjs/Backup/Rule.d.ts +1 -1
- package/dist/cjs/Balances.js +1 -1
- package/dist/cjs/Balances.js.map +1 -1
- package/dist/cjs/Card/Changeable.d.ts +1 -181
- package/dist/cjs/Card/Creatable.d.ts +1 -407
- package/dist/cjs/Card/Creatable.js +0 -3
- package/dist/cjs/Card/Creatable.js.map +1 -1
- package/dist/cjs/Card/Operation/Card.d.ts +1 -181
- package/dist/cjs/Card/Operation/index.d.ts +1 -181
- package/dist/cjs/Card/index.d.ts +1 -811
- package/dist/cjs/Card/index.js +3 -3
- package/dist/cjs/Card/index.js.map +1 -1
- package/dist/cjs/Merchant/index.js +1 -2
- package/dist/cjs/Merchant/index.js.map +1 -1
- package/dist/cjs/Operation/Creatable.js +1 -1
- package/dist/cjs/Operation/Creatable.js.map +1 -1
- package/dist/cjs/Organization/Changeable.d.ts +4 -90
- package/dist/cjs/Organization/Contact/Address/{General.d.ts → Default.d.ts} +1 -8
- package/dist/cjs/Organization/Contact/Address/{General.js → Default.js} +1 -1
- package/dist/cjs/Organization/Contact/Address/Default.js.map +1 -0
- package/dist/cjs/Organization/Contact/Address/GB.d.ts +1 -7
- package/dist/cjs/Organization/Contact/Address/GB.js.map +1 -1
- package/dist/cjs/Organization/Contact/Address/SE.d.ts +1 -6
- package/dist/cjs/Organization/Contact/Address/SE.js.map +1 -1
- package/dist/cjs/Organization/Contact/Address/index.d.ts +3 -21
- package/dist/cjs/Organization/Contact/Address/index.js +3 -3
- package/dist/cjs/Organization/Contact/Address/index.js.map +1 -1
- package/dist/cjs/Organization/Contact/Addresses.d.ts +1 -78
- package/dist/cjs/Organization/Contact/Addresses.js.map +1 -1
- package/dist/cjs/Organization/Contact/Creatable.d.ts +4 -90
- package/dist/cjs/Organization/Contact/Name.d.ts +1 -4
- package/dist/cjs/Organization/Contact/Name.js.map +1 -1
- package/dist/cjs/Organization/Contact/Phone.d.ts +1 -4
- package/dist/cjs/Organization/Contact/Phone.js +1 -1
- package/dist/cjs/Organization/Contact/Phone.js.map +1 -1
- package/dist/cjs/Organization/Contact/index.d.ts +1 -93
- package/dist/cjs/Organization/Contact/index.js +1 -1
- package/dist/cjs/Organization/Contact/index.js.map +1 -1
- package/dist/cjs/Organization/Creatable.d.ts +2 -112
- package/dist/cjs/Organization/Creatable.js +0 -5
- package/dist/cjs/Organization/Creatable.js.map +1 -1
- package/dist/cjs/Organization/index.d.ts +1 -121
- package/dist/cjs/Organization/index.js +3 -3
- package/dist/cjs/Organization/index.js.map +1 -1
- package/dist/cjs/Rail/Address/Card.d.ts +1 -7
- package/dist/cjs/Rail/Address/index.d.ts +1 -7
- package/dist/cjs/Rule/index.d.ts +1 -1
- package/dist/cjs/Settlement/Entry/Creatable.d.ts +4 -550
- package/dist/cjs/Settlement/Totals.js +1 -1
- package/dist/cjs/Settlement/Totals.js.map +1 -1
- package/dist/cjs/Transaction/Amount/index.d.ts +2 -362
- package/dist/cjs/Transaction/Creatable.d.ts +7 -739
- package/dist/cjs/Transaction/Creatable.js +1 -1
- package/dist/cjs/Transaction/Creatable.js.map +1 -1
- package/dist/cjs/Transaction/Exchange.d.ts +2 -362
- package/dist/cjs/Transaction/PreTransaction/Authorization.d.ts +4 -370
- package/dist/cjs/Transaction/PreTransaction/Base.d.ts +3 -369
- package/dist/cjs/Transaction/PreTransaction/Base.js +1 -1
- package/dist/cjs/Transaction/PreTransaction/Base.js.map +1 -1
- package/dist/cjs/Transaction/PreTransaction/Incoming.d.ts +4 -376
- package/dist/cjs/Transaction/PreTransaction/Incoming.js +1 -1
- package/dist/cjs/Transaction/PreTransaction/Incoming.js.map +1 -1
- package/dist/cjs/Transaction/PreTransaction/Outgoing.d.ts +3 -369
- package/dist/cjs/Transaction/PreTransaction/index.d.ts +11 -1115
- package/dist/cjs/Transaction/index.d.ts +19 -1141
- package/dist/cjs/Transaction/index.js +1 -1
- package/dist/cjs/Transaction/index.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Account.js +1 -1
- package/dist/cjs/Treasury/Snapshot/Account.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Emoney.js +1 -1
- package/dist/cjs/Treasury/Snapshot/Emoney.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/funding.js +1 -1
- package/dist/cjs/Treasury/Snapshot/funding.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/index.js +1 -1
- package/dist/cjs/Treasury/Snapshot/index.js.map +1 -1
- package/dist/cjs/Treasury/Transaction/Creatable.d.ts +1 -7
- package/dist/cjs/Treasury/Transaction/Creatable.js +1 -1
- package/dist/cjs/Treasury/Transaction/Creatable.js.map +1 -1
- package/dist/cjs/Warning/Issue.js +1 -1
- package/dist/cjs/Warning/Issue.js.map +1 -1
- package/dist/cjs/Warning/Settlement/NegativeAmount.js +1 -1
- package/dist/cjs/Warning/Settlement/NegativeAmount.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/DeltaFiat.js +1 -2
- package/dist/cjs/Warning/Snapshot/DeltaFiat.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingBuffer.js +1 -1
- package/dist/cjs/Warning/Snapshot/MissingBuffer.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingEmoney.js +1 -2
- package/dist/cjs/Warning/Snapshot/MissingEmoney.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingFiat.js +1 -2
- package/dist/cjs/Warning/Snapshot/MissingFiat.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingTransaction.js +1 -2
- package/dist/cjs/Warning/Snapshot/MissingTransaction.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/Overdraft.js +1 -1
- package/dist/cjs/Warning/Snapshot/Overdraft.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/Reconciliation.js +1 -2
- package/dist/cjs/Warning/Snapshot/Reconciliation.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/StaleFiat.js +1 -1
- package/dist/cjs/Warning/Snapshot/StaleFiat.js.map +1 -1
- package/dist/cjs/zod.d.ts +664 -0
- package/dist/cjs/zod.js +4 -0
- package/dist/cjs/zod.js.map +1 -1
- package/dist/mjs/Account/Details.d.ts +2 -688
- package/dist/mjs/Account/Details.js +4 -4
- package/dist/mjs/Account/Details.js.map +1 -1
- package/dist/mjs/Account/index.d.ts +3 -508
- package/dist/mjs/Account/index.js +3 -4
- package/dist/mjs/Account/index.js.map +1 -1
- package/dist/mjs/Acquirer/index.d.ts +1 -7
- package/dist/mjs/Acquirer/index.js +2 -2
- package/dist/mjs/Acquirer/index.js.map +1 -1
- package/dist/mjs/Amount.d.ts +1 -181
- package/dist/mjs/Amount.js +2 -2
- package/dist/mjs/Amount.js.map +1 -1
- package/dist/mjs/Amounts.js +2 -2
- package/dist/mjs/Amounts.js.map +1 -1
- package/dist/mjs/Backup/Rule.d.ts +1 -1
- package/dist/mjs/Balances.js +2 -2
- package/dist/mjs/Balances.js.map +1 -1
- package/dist/mjs/Card/Changeable.d.ts +1 -181
- package/dist/mjs/Card/Creatable.d.ts +1 -407
- package/dist/mjs/Card/Creatable.js +0 -3
- package/dist/mjs/Card/Creatable.js.map +1 -1
- package/dist/mjs/Card/Operation/Card.d.ts +1 -181
- package/dist/mjs/Card/Operation/index.d.ts +1 -181
- package/dist/mjs/Card/index.d.ts +1 -811
- package/dist/mjs/Card/index.js +3 -3
- package/dist/mjs/Card/index.js.map +1 -1
- package/dist/mjs/Merchant/index.js +2 -3
- package/dist/mjs/Merchant/index.js.map +1 -1
- package/dist/mjs/Operation/Creatable.js +2 -2
- package/dist/mjs/Operation/Creatable.js.map +1 -1
- package/dist/mjs/Organization/Changeable.d.ts +4 -90
- package/dist/mjs/Organization/Contact/Address/{General.d.ts → Default.d.ts} +1 -8
- package/dist/mjs/Organization/Contact/Address/{General.js → Default.js} +1 -1
- package/dist/mjs/Organization/Contact/Address/Default.js.map +1 -0
- package/dist/mjs/Organization/Contact/Address/GB.d.ts +1 -7
- package/dist/mjs/Organization/Contact/Address/GB.js.map +1 -1
- package/dist/mjs/Organization/Contact/Address/SE.d.ts +1 -6
- package/dist/mjs/Organization/Contact/Address/SE.js.map +1 -1
- package/dist/mjs/Organization/Contact/Address/index.d.ts +3 -21
- package/dist/mjs/Organization/Contact/Address/index.js +1 -1
- package/dist/mjs/Organization/Contact/Address/index.js.map +1 -1
- package/dist/mjs/Organization/Contact/Addresses.d.ts +1 -78
- package/dist/mjs/Organization/Contact/Addresses.js.map +1 -1
- package/dist/mjs/Organization/Contact/Creatable.d.ts +4 -90
- package/dist/mjs/Organization/Contact/Name.d.ts +1 -4
- package/dist/mjs/Organization/Contact/Name.js.map +1 -1
- package/dist/mjs/Organization/Contact/Phone.d.ts +1 -4
- package/dist/mjs/Organization/Contact/Phone.js +2 -2
- package/dist/mjs/Organization/Contact/Phone.js.map +1 -1
- package/dist/mjs/Organization/Contact/index.d.ts +1 -93
- package/dist/mjs/Organization/Contact/index.js +1 -1
- package/dist/mjs/Organization/Contact/index.js.map +1 -1
- package/dist/mjs/Organization/Creatable.d.ts +2 -112
- package/dist/mjs/Organization/Creatable.js +0 -5
- package/dist/mjs/Organization/Creatable.js.map +1 -1
- package/dist/mjs/Organization/index.d.ts +1 -121
- package/dist/mjs/Organization/index.js +3 -3
- package/dist/mjs/Organization/index.js.map +1 -1
- package/dist/mjs/Rail/Address/Card.d.ts +1 -7
- package/dist/mjs/Rail/Address/index.d.ts +1 -7
- package/dist/mjs/Rule/index.d.ts +1 -1
- package/dist/mjs/Settlement/Entry/Creatable.d.ts +4 -550
- package/dist/mjs/Settlement/Totals.js +2 -2
- package/dist/mjs/Settlement/Totals.js.map +1 -1
- package/dist/mjs/Transaction/Amount/index.d.ts +2 -362
- package/dist/mjs/Transaction/Creatable.d.ts +7 -739
- package/dist/mjs/Transaction/Creatable.js +2 -2
- package/dist/mjs/Transaction/Creatable.js.map +1 -1
- package/dist/mjs/Transaction/Exchange.d.ts +2 -362
- package/dist/mjs/Transaction/PreTransaction/Authorization.d.ts +4 -370
- package/dist/mjs/Transaction/PreTransaction/Base.d.ts +3 -369
- package/dist/mjs/Transaction/PreTransaction/Base.js +2 -2
- package/dist/mjs/Transaction/PreTransaction/Base.js.map +1 -1
- package/dist/mjs/Transaction/PreTransaction/Incoming.d.ts +4 -376
- package/dist/mjs/Transaction/PreTransaction/Incoming.js +2 -2
- package/dist/mjs/Transaction/PreTransaction/Incoming.js.map +1 -1
- package/dist/mjs/Transaction/PreTransaction/Outgoing.d.ts +3 -369
- package/dist/mjs/Transaction/PreTransaction/index.d.ts +11 -1115
- package/dist/mjs/Transaction/index.d.ts +19 -1141
- package/dist/mjs/Transaction/index.js +2 -2
- package/dist/mjs/Transaction/index.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Account.js +2 -2
- package/dist/mjs/Treasury/Snapshot/Account.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Emoney.js +2 -2
- package/dist/mjs/Treasury/Snapshot/Emoney.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/funding.js +2 -2
- package/dist/mjs/Treasury/Snapshot/funding.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/index.js +2 -2
- package/dist/mjs/Treasury/Snapshot/index.js.map +1 -1
- package/dist/mjs/Treasury/Transaction/Creatable.d.ts +1 -7
- package/dist/mjs/Treasury/Transaction/Creatable.js +2 -2
- package/dist/mjs/Treasury/Transaction/Creatable.js.map +1 -1
- package/dist/mjs/Warning/Issue.js +2 -2
- package/dist/mjs/Warning/Issue.js.map +1 -1
- package/dist/mjs/Warning/Settlement/NegativeAmount.js +2 -2
- package/dist/mjs/Warning/Settlement/NegativeAmount.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/DeltaFiat.js +2 -3
- package/dist/mjs/Warning/Snapshot/DeltaFiat.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingBuffer.js +2 -2
- package/dist/mjs/Warning/Snapshot/MissingBuffer.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingEmoney.js +2 -3
- package/dist/mjs/Warning/Snapshot/MissingEmoney.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingFiat.js +2 -3
- package/dist/mjs/Warning/Snapshot/MissingFiat.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingTransaction.js +2 -3
- package/dist/mjs/Warning/Snapshot/MissingTransaction.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/Overdraft.js +2 -2
- package/dist/mjs/Warning/Snapshot/Overdraft.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/Reconciliation.js +2 -3
- package/dist/mjs/Warning/Snapshot/Reconciliation.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/StaleFiat.js +2 -2
- package/dist/mjs/Warning/Snapshot/StaleFiat.js.map +1 -1
- package/dist/mjs/zod.d.ts +664 -0
- package/dist/mjs/zod.js +4 -0
- package/dist/mjs/zod.js.map +1 -1
- package/package.json +1 -1
- package/zod.ts +4 -0
- package/dist/cjs/Organization/Contact/Address/General.js.map +0 -1
- package/dist/mjs/Organization/Contact/Address/General.js.map +0 -1
package/Account/Details.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { isoly } from "isoly"
|
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Rail } from "../Rail"
|
|
4
4
|
import { Supplier } from "../Supplier"
|
|
5
|
-
import { zod } from "../zod"
|
|
5
|
+
import { zod, zodHelper } from "../zod"
|
|
6
6
|
|
|
7
7
|
export interface Details {
|
|
8
8
|
supplier: Supplier
|
|
@@ -17,11 +17,11 @@ export namespace Details {
|
|
|
17
17
|
reference: isly.string().optional(),
|
|
18
18
|
addresses: Rail.Address.type.array(),
|
|
19
19
|
})
|
|
20
|
-
export const typeZod = zod.object({
|
|
20
|
+
export const typeZod: zod.ZodType<Details> = zod.object({
|
|
21
21
|
supplier: Supplier.typeZod,
|
|
22
|
-
currencies:
|
|
22
|
+
currencies: zodHelper.currency.array(),
|
|
23
23
|
reference: zod.string().optional(),
|
|
24
|
-
addresses:
|
|
24
|
+
addresses: Rail.Address.typeZod.array(),
|
|
25
25
|
})
|
|
26
26
|
export interface Creatable {
|
|
27
27
|
supplier: Supplier
|
|
@@ -32,9 +32,9 @@ export namespace Details {
|
|
|
32
32
|
supplier: Supplier.type,
|
|
33
33
|
currency: isly.string(isoly.Currency.values),
|
|
34
34
|
})
|
|
35
|
-
export const typeZod = zod.object({
|
|
35
|
+
export const typeZod: zod.ZodType<Creatable> = zod.object({
|
|
36
36
|
supplier: Supplier.typeZod,
|
|
37
|
-
currency:
|
|
37
|
+
currency: zodHelper.currency,
|
|
38
38
|
})
|
|
39
39
|
}
|
|
40
40
|
}
|
package/Account/index.ts
CHANGED
|
@@ -39,7 +39,7 @@ export namespace Account {
|
|
|
39
39
|
rails: Rail.Address.type.array(),
|
|
40
40
|
details: Details.type.optional(),
|
|
41
41
|
charges: AccountCharge.type.optional(),
|
|
42
|
-
rules:
|
|
42
|
+
rules: isly.any().array().optional(),
|
|
43
43
|
status: AccountStatus.type,
|
|
44
44
|
type: Type.type,
|
|
45
45
|
})
|
|
@@ -48,10 +48,10 @@ export namespace Account {
|
|
|
48
48
|
created: zod.string().refine(isoly.DateTime.is),
|
|
49
49
|
organization: zod.string(),
|
|
50
50
|
balances: Balances.typeZod,
|
|
51
|
-
rails:
|
|
51
|
+
rails: Rail.Address.typeZod.array(),
|
|
52
52
|
details: Details.typeZod.optional(),
|
|
53
53
|
charges: AccountCharge.typeZod.optional(),
|
|
54
|
-
rules: zod.
|
|
54
|
+
rules: zod.any().array().optional(),
|
|
55
55
|
status: AccountStatus.typeZod,
|
|
56
56
|
type: Type.typeZod,
|
|
57
57
|
})
|
package/Acquirer/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { zod } from "../zod"
|
|
3
|
+
import { zod, zodHelper } from "../zod"
|
|
4
4
|
|
|
5
5
|
export interface Acquirer {
|
|
6
6
|
id: string
|
|
@@ -17,10 +17,10 @@ export namespace Acquirer {
|
|
|
17
17
|
retrievalReferenceNumber: isly.string().optional(),
|
|
18
18
|
systemTraceAuditNumber: isly.string().optional(),
|
|
19
19
|
})
|
|
20
|
-
export const typeZod = zod.object({
|
|
20
|
+
export const typeZod: zod.ZodType<Acquirer> = zod.object({
|
|
21
21
|
id: zod.string(),
|
|
22
22
|
number: zod.string(),
|
|
23
|
-
country:
|
|
23
|
+
country: zodHelper.countryCode.optional(),
|
|
24
24
|
retrievalReferenceNumber: zod.string().optional(),
|
|
25
25
|
systemTraceAuditNumber: zod.string().optional(),
|
|
26
26
|
})
|
package/Amount.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Amounts } from "./Amounts"
|
|
4
|
-
import { zod } from "./zod"
|
|
4
|
+
import { zod, zodHelper } from "./zod"
|
|
5
5
|
|
|
6
6
|
export type Amount = [isoly.Currency, number]
|
|
7
7
|
|
|
@@ -10,5 +10,5 @@ export namespace Amount {
|
|
|
10
10
|
return !amount ? {} : Object.fromEntries<number>([amount])
|
|
11
11
|
}
|
|
12
12
|
export const type = isly.tuple<Amount>(isly.string(isoly.Currency.values), isly.number())
|
|
13
|
-
export const typeZod = zod.tuple([
|
|
13
|
+
export const typeZod: zod.ZodType<Amount> = zod.tuple([zodHelper.currency, zod.number()])
|
|
14
14
|
}
|
package/Amounts.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { zod } from "./zod"
|
|
3
|
+
import { zod, zodHelper } from "./zod"
|
|
4
4
|
|
|
5
5
|
export type Amounts = Partial<Record<isoly.Currency, number>>
|
|
6
6
|
|
|
@@ -20,5 +20,5 @@ export namespace Amounts {
|
|
|
20
20
|
)
|
|
21
21
|
}
|
|
22
22
|
export const type = isly.record<Amounts>(isly.string(isoly.Currency.values), isly.number())
|
|
23
|
-
export const typeZod: zod.ZodType<Amounts> = zod.partialRecord(
|
|
23
|
+
export const typeZod: zod.ZodType<Amounts> = zod.partialRecord(zodHelper.currency, zod.number())
|
|
24
24
|
}
|
package/Balances.ts
CHANGED
|
@@ -2,14 +2,14 @@ import { isoly } from "isoly"
|
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Amounts } from "./Amounts"
|
|
4
4
|
import { Balance as BalancesBalance } from "./Balance"
|
|
5
|
-
import { zod } from "./zod"
|
|
5
|
+
import { zod, zodHelper } from "./zod"
|
|
6
6
|
|
|
7
7
|
export type Balances = Partial<Record<isoly.Currency, Balances.Balance.Extended>>
|
|
8
8
|
|
|
9
9
|
export namespace Balances {
|
|
10
10
|
export import Balance = BalancesBalance
|
|
11
11
|
export const type = isly.record<Balances>(isly.fromIs("isoly.Currency", isoly.Currency.is), Balances.Balance.type)
|
|
12
|
-
export const typeZod = zod.partialRecord(
|
|
12
|
+
export const typeZod = zod.partialRecord(zodHelper.currency, Balances.Balance.Extended.typeZod)
|
|
13
13
|
export function update(balances: Balances): Balances {
|
|
14
14
|
const result: Balances = {}
|
|
15
15
|
for (const [currency, balance] of Object.entries(balances)) {
|
package/Card/Creatable.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Amount } from "../Amount"
|
|
4
|
-
import type { Rule } from "../Rule"
|
|
5
|
-
import { type as ruleType } from "../Rule/type"
|
|
6
4
|
import { zod } from "../zod"
|
|
7
5
|
import { Expiry } from "./Expiry"
|
|
8
6
|
import { Meta } from "./Meta"
|
|
@@ -18,7 +16,6 @@ export interface Creatable {
|
|
|
18
16
|
holder: string
|
|
19
17
|
}
|
|
20
18
|
limit: Amount
|
|
21
|
-
rules?: Rule[]
|
|
22
19
|
meta?: Meta
|
|
23
20
|
key?: isoly.Date | string
|
|
24
21
|
restricted?: { to?: Restriction }
|
|
@@ -31,18 +28,16 @@ export namespace Creatable {
|
|
|
31
28
|
preset: Preset.type,
|
|
32
29
|
details: isly.object({ expiry: Expiry.type, holder: isly.string() }),
|
|
33
30
|
limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
|
|
34
|
-
rules: ruleType.array().optional(),
|
|
35
31
|
meta: isly.fromIs("Card.Meta", Meta.is).optional(),
|
|
36
32
|
key: isly.string().optional(),
|
|
37
33
|
restricted: isly.object<Required<Creatable>["restricted"]>({ to: Restriction.type.optional() }).optional(),
|
|
38
34
|
})
|
|
39
|
-
export const typeZod = zod.object({
|
|
35
|
+
export const typeZod: zod.ZodType<Creatable> = zod.object({
|
|
40
36
|
account: zod.string(),
|
|
41
37
|
number: zod.string().optional(),
|
|
42
38
|
preset: Preset.typeZod,
|
|
43
39
|
details: zod.object({ expiry: Expiry.typeZod, holder: zod.string() }),
|
|
44
40
|
limit: Amount.typeZod,
|
|
45
|
-
rules: zod.array(zod.never()).optional(),
|
|
46
41
|
meta: Meta.typeZod.optional(),
|
|
47
42
|
key: zod.string().optional(),
|
|
48
43
|
restricted: zod.object({ to: Restriction.typeZod.optional() }).optional(),
|
package/Card/index.ts
CHANGED
|
@@ -71,12 +71,12 @@ export namespace Card {
|
|
|
71
71
|
limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
|
|
72
72
|
spent: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
|
|
73
73
|
status: isly.union(isly.string("active"), isly.string("cancelled")),
|
|
74
|
-
history:
|
|
74
|
+
history: CardOperation.type.array(),
|
|
75
75
|
rules: ruleType.array(),
|
|
76
76
|
meta: isly.fromIs("Card.Meta", CardMeta.is).optional(),
|
|
77
77
|
restricted: isly.object<Required<Card>["restricted"]>({ to: CardRestriction.type.optional() }).optional(),
|
|
78
78
|
})
|
|
79
|
-
export const typeZod = zod.object({
|
|
79
|
+
export const typeZod: zod.ZodType<Card> = zod.object({
|
|
80
80
|
id: zod.string(),
|
|
81
81
|
number: zod.string().optional(),
|
|
82
82
|
created: zod.string().refine(isoly.DateTime.is),
|
|
@@ -96,8 +96,8 @@ export namespace Card {
|
|
|
96
96
|
limit: Amount.typeZod,
|
|
97
97
|
spent: Amount.typeZod,
|
|
98
98
|
status: zod.enum(["active", "cancelled"]),
|
|
99
|
-
history:
|
|
100
|
-
rules: zod.
|
|
99
|
+
history: CardOperation.typeZod.array(),
|
|
100
|
+
rules: zod.any().array(),
|
|
101
101
|
meta: CardMeta.typeZod.optional(),
|
|
102
102
|
restricted: zod.object({ to: CardRestriction.typeZod.optional() }).optional(),
|
|
103
103
|
})
|
package/Merchant/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { zod } from "../zod"
|
|
3
|
+
import { zod, zodHelper } from "../zod"
|
|
4
4
|
import { Category as MerchantCategory } from "./Category"
|
|
5
5
|
|
|
6
6
|
export interface Merchant {
|
|
@@ -33,6 +33,6 @@ export namespace Merchant {
|
|
|
33
33
|
city: zod.string(),
|
|
34
34
|
zip: zod.string(),
|
|
35
35
|
state: zod.string().optional(),
|
|
36
|
-
country:
|
|
36
|
+
country: zodHelper.countryCode,
|
|
37
37
|
})
|
|
38
38
|
}
|
package/Operation/Creatable.ts
CHANGED
|
@@ -2,7 +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
|
+
import { zod, zodHelper } from "../zod"
|
|
6
6
|
import { Changes } from "./Changes"
|
|
7
7
|
|
|
8
8
|
export interface Creatable {
|
|
@@ -40,7 +40,7 @@ export namespace Creatable {
|
|
|
40
40
|
})
|
|
41
41
|
export const typeZod = zod.object({
|
|
42
42
|
account: zod.string(),
|
|
43
|
-
currency:
|
|
43
|
+
currency: zodHelper.currency,
|
|
44
44
|
changes: Changes.typeZod,
|
|
45
45
|
type: zod.enum(types),
|
|
46
46
|
counterbalance: zod.string().optional(),
|
|
@@ -10,7 +10,6 @@ export interface Default {
|
|
|
10
10
|
zipCode: string
|
|
11
11
|
street: string
|
|
12
12
|
}
|
|
13
|
-
|
|
14
13
|
export namespace Default {
|
|
15
14
|
export const type = isly.object<Default>({
|
|
16
15
|
countryCode: isly.string(),
|
|
@@ -20,8 +19,8 @@ export namespace Default {
|
|
|
20
19
|
street: isly.string(),
|
|
21
20
|
zipCode: isly.string(),
|
|
22
21
|
})
|
|
23
|
-
export const typeZod = zod.object({
|
|
24
|
-
countryCode: zod.string(),
|
|
22
|
+
export const typeZod: zod.ZodType<Default> = zod.object({
|
|
23
|
+
countryCode: zod.string() as any,
|
|
25
24
|
state: zod.string().optional(),
|
|
26
25
|
county: zod.string().optional(),
|
|
27
26
|
city: zod.string(),
|
|
@@ -9,7 +9,6 @@ export interface GB {
|
|
|
9
9
|
building: string
|
|
10
10
|
zipCode: string
|
|
11
11
|
}
|
|
12
|
-
|
|
13
12
|
export namespace GB {
|
|
14
13
|
export const name = isoly.CountryCode.Name.en.from("GB")
|
|
15
14
|
export const type = isly.object<GB>({
|
|
@@ -19,7 +18,7 @@ export namespace GB {
|
|
|
19
18
|
building: isly.string(),
|
|
20
19
|
zipCode: isly.string(),
|
|
21
20
|
})
|
|
22
|
-
export const typeZod = zod.object({
|
|
21
|
+
export const typeZod: zod.ZodType<GB> = zod.object({
|
|
23
22
|
countryCode: zod.literal("GB"),
|
|
24
23
|
city: zod.string(),
|
|
25
24
|
street: zod.string(),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
2
|
import { zod } from "../../../zod"
|
|
3
|
+
import { Default } from "./Default"
|
|
3
4
|
import { GB } from "./GB"
|
|
4
|
-
import { Default } from "./General"
|
|
5
5
|
import { SE } from "./SE"
|
|
6
6
|
|
|
7
7
|
export type Address = GB | SE | Default
|
|
8
8
|
|
|
9
9
|
export namespace Address {
|
|
10
10
|
export const type = isly.union(GB.type, SE.type, Default.type)
|
|
11
|
-
export const typeZod = zod.union([GB.typeZod, SE.typeZod, Default.typeZod])
|
|
11
|
+
export const typeZod: zod.ZodType<Address> = zod.union([GB.typeZod, SE.typeZod, Default.typeZod])
|
|
12
12
|
}
|
|
@@ -15,7 +15,7 @@ export namespace Addresses {
|
|
|
15
15
|
delivery: Address.type.optional(),
|
|
16
16
|
visit: Address.type.optional(),
|
|
17
17
|
})
|
|
18
|
-
export const typeZod = zod.object({
|
|
18
|
+
export const typeZod: zod.ZodType<Addresses> = zod.object({
|
|
19
19
|
primary: Address.typeZod,
|
|
20
20
|
billing: Address.typeZod.optional(),
|
|
21
21
|
delivery: Address.typeZod.optional(),
|
|
@@ -7,5 +7,5 @@ export interface Name {
|
|
|
7
7
|
}
|
|
8
8
|
export namespace Name {
|
|
9
9
|
export const type = isly.object<Name>({ first: isly.string(), last: isly.string() })
|
|
10
|
-
export const typeZod = zod.object({ first: zod.string(), last: zod.string() })
|
|
10
|
+
export const typeZod: zod.ZodType<Name> = zod.object({ first: zod.string(), last: zod.string() })
|
|
11
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { zod } from "../../zod"
|
|
3
|
+
import { zod, zodHelper } from "../../zod"
|
|
4
4
|
|
|
5
5
|
export interface Phone {
|
|
6
6
|
number: string
|
|
@@ -11,8 +11,8 @@ export namespace Phone {
|
|
|
11
11
|
number: isly.string(/^\d+$/),
|
|
12
12
|
code: isly.fromIs("CallingCode", isoly.CallingCode.is),
|
|
13
13
|
})
|
|
14
|
-
export const typeZod = zod.object({
|
|
14
|
+
export const typeZod: zod.ZodType<Phone> = zod.object({
|
|
15
15
|
number: zod.string().regex(/^\d+$/),
|
|
16
|
-
code:
|
|
16
|
+
code: zodHelper.callingCode,
|
|
17
17
|
})
|
|
18
18
|
}
|
|
@@ -26,11 +26,11 @@ export namespace Contact {
|
|
|
26
26
|
phone: Phone.type,
|
|
27
27
|
owners: Name.type.array().optional(),
|
|
28
28
|
})
|
|
29
|
-
export const typeZod = zod.object({
|
|
29
|
+
export const typeZod: zod.ZodType<Contact> = zod.object({
|
|
30
30
|
address: Addresses.typeZod,
|
|
31
31
|
email: zod.string().regex(/^\S+@\S+\.\S+$/),
|
|
32
32
|
name: Name.typeZod,
|
|
33
33
|
phone: Phone.typeZod,
|
|
34
|
-
owners:
|
|
34
|
+
owners: Name.typeZod.array().optional(),
|
|
35
35
|
})
|
|
36
36
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
-
import type { Rule } from "../Rule"
|
|
3
|
-
import { type as ruleType } from "../Rule/type"
|
|
4
2
|
import { zod } from "../zod"
|
|
5
3
|
import { Contact } from "./Contact"
|
|
6
4
|
import { Fx } from "./Fx"
|
|
@@ -10,9 +8,7 @@ export interface Creatable {
|
|
|
10
8
|
name: string
|
|
11
9
|
code: string
|
|
12
10
|
risk: Risk
|
|
13
|
-
rules?: Rule[]
|
|
14
11
|
contact?: Contact.Creatable
|
|
15
|
-
groups?: string[]
|
|
16
12
|
fx?: Fx
|
|
17
13
|
}
|
|
18
14
|
export namespace Creatable {
|
|
@@ -20,18 +16,14 @@ export namespace Creatable {
|
|
|
20
16
|
name: isly.string(),
|
|
21
17
|
code: isly.string(new RegExp(/^[A-Za-z0-9\-_]+$/)),
|
|
22
18
|
risk: Risk.type,
|
|
23
|
-
rules: ruleType.array().optional(),
|
|
24
19
|
contact: Contact.Creatable.type.optional(),
|
|
25
|
-
groups: isly.string().array().optional(),
|
|
26
20
|
fx: Fx.type.optional(),
|
|
27
21
|
})
|
|
28
|
-
export const typeZod = zod.object({
|
|
22
|
+
export const typeZod: zod.ZodType<Creatable> = zod.object({
|
|
29
23
|
name: zod.string(),
|
|
30
24
|
code: zod.string().regex(/^[A-Za-z0-9\-_]+$/),
|
|
31
25
|
risk: Risk.typeZod,
|
|
32
|
-
rules: zod.array(zod.never()).optional(),
|
|
33
26
|
contact: Contact.Creatable.typeZod.optional(),
|
|
34
|
-
groups: zod.array(zod.string()).optional(),
|
|
35
27
|
fx: Fx.typeZod.optional(),
|
|
36
28
|
})
|
|
37
29
|
}
|
package/Organization/index.ts
CHANGED
|
@@ -40,19 +40,19 @@ export namespace Organization {
|
|
|
40
40
|
fx: OrganizationFx.type.optional(),
|
|
41
41
|
type: Type.type,
|
|
42
42
|
})
|
|
43
|
-
export const typeZod = zod.object({
|
|
43
|
+
export const typeZod: zod.ZodType<Organization> = zod.object({
|
|
44
44
|
name: zod.string(),
|
|
45
45
|
code: zod.string().regex(/^[A-Za-z0-9\-_]+$/),
|
|
46
46
|
realm: Realm.typeZod,
|
|
47
|
-
rules: zod.
|
|
47
|
+
rules: zod.any().array(),
|
|
48
48
|
status: zod.enum(["active", "inactive"]),
|
|
49
49
|
risk: Organization.Risk.typeZod,
|
|
50
50
|
contact: Contact.typeZod.optional(),
|
|
51
|
-
groups: zod.
|
|
51
|
+
groups: zod.string().array().optional(),
|
|
52
52
|
fx: OrganizationFx.typeZod.optional(),
|
|
53
53
|
type: Type.typeZod,
|
|
54
54
|
})
|
|
55
55
|
export function from(creatable: Creatable, realm: Realm): Organization {
|
|
56
|
-
return { ...creatable, realm, rules:
|
|
56
|
+
return { ...creatable, realm, rules: [], status: "active", type: "emoney" }
|
|
57
57
|
}
|
|
58
58
|
}
|
package/Rule/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { isly } from "isly"
|
|
|
2
2
|
import { State as RuleState } from "./State"
|
|
3
3
|
import { type as ruleType } from "./type"
|
|
4
4
|
|
|
5
|
-
export type Rule =
|
|
5
|
+
export type Rule = any
|
|
6
6
|
export namespace Rule {
|
|
7
7
|
export import State = RuleState
|
|
8
8
|
export type Kind = (typeof Kind.values)[number]
|
package/Settlement/Totals.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { zod } from "../zod"
|
|
3
|
+
import { zod, zodHelper } from "../zod"
|
|
4
4
|
import { Entry } from "./Entry"
|
|
5
5
|
import { Total } from "./Total"
|
|
6
6
|
|
|
7
7
|
export type Totals = Partial<Record<isoly.Currency, Total>>
|
|
8
8
|
export namespace Totals {
|
|
9
9
|
export const type = isly.record<isoly.Currency, Total>(isly.string(isoly.Currency.values), Total.type)
|
|
10
|
-
export const typeZod: zod.ZodType<Totals> = zod.partialRecord(
|
|
10
|
+
export const typeZod: zod.ZodType<Totals> = zod.partialRecord(zodHelper.currency, Total.typeZod)
|
|
11
11
|
export function addEntry(totals: Totals, entry: Entry): Totals {
|
|
12
12
|
const result = { ...totals }
|
|
13
13
|
if (entry.status == "succeeded" && (entry.type == "capture" || entry.type == "refund")) {
|
package/Transaction/Creatable.ts
CHANGED
|
@@ -3,7 +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
|
+
import { zod, zodHelper } from "../zod"
|
|
7
7
|
import { Amount } from "./Amount"
|
|
8
8
|
import { Exchange } from "./Exchange"
|
|
9
9
|
|
|
@@ -27,7 +27,7 @@ export namespace Creatable {
|
|
|
27
27
|
})
|
|
28
28
|
export const typeZod = zod.object({
|
|
29
29
|
counterpart: Rail.Address.typeZod,
|
|
30
|
-
currency:
|
|
30
|
+
currency: zodHelper.currency,
|
|
31
31
|
amount: zod.number(),
|
|
32
32
|
description: zod.string(),
|
|
33
33
|
exchange: Exchange.typeZod.optional(),
|
package/Transaction/Incoming.ts
CHANGED
|
@@ -1,7 +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
|
+
import { zod, zodHelper } from "../zod"
|
|
5
5
|
import { Reference as TransactionReference } from "./Reference"
|
|
6
6
|
|
|
7
7
|
export interface Incoming {
|
|
@@ -28,7 +28,7 @@ export namespace Incoming {
|
|
|
28
28
|
export const typeZod = zod.object({
|
|
29
29
|
account: Rail.Address.typeZod,
|
|
30
30
|
counterpart: Rail.Address.typeZod,
|
|
31
|
-
currency:
|
|
31
|
+
currency: zodHelper.currency,
|
|
32
32
|
amount: zod.number(),
|
|
33
33
|
description: zod.string(),
|
|
34
34
|
posted: zod.string(),
|
|
@@ -1,7 +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
|
+
import { zod, zodHelper } from "../../zod"
|
|
5
5
|
import { Exchange } from "../Exchange"
|
|
6
6
|
|
|
7
7
|
export interface Base {
|
|
@@ -24,7 +24,7 @@ export namespace Base {
|
|
|
24
24
|
export const typeZod = zod.object({
|
|
25
25
|
type: zod.enum(["outgoing", "incoming", "authorization"]),
|
|
26
26
|
counterpart: Rail.Address.typeZod,
|
|
27
|
-
currency:
|
|
27
|
+
currency: zodHelper.currency,
|
|
28
28
|
amount: zod.number(),
|
|
29
29
|
description: zod.string(),
|
|
30
30
|
exchange: Exchange.typeZod.optional(),
|
|
@@ -2,7 +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
|
+
import { zod, zodHelper } from "../../zod"
|
|
6
6
|
import { Reference as TransactionReference } from "../Reference"
|
|
7
7
|
import { Base } from "./Base"
|
|
8
8
|
|
|
@@ -30,7 +30,7 @@ export namespace Incoming {
|
|
|
30
30
|
export const typeZod = Base.typeZod.extend({
|
|
31
31
|
type: zod.literal("incoming"),
|
|
32
32
|
account: Rail.Address.typeZod,
|
|
33
|
-
currency:
|
|
33
|
+
currency: zodHelper.currency,
|
|
34
34
|
amount: zod.number(),
|
|
35
35
|
description: zod.string(),
|
|
36
36
|
posted: zod.string(),
|
package/Transaction/index.ts
CHANGED
|
@@ -7,7 +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
|
+
import { zod, zodHelper } from "../zod"
|
|
11
11
|
import { Amount as TransactionAmount } from "./Amount"
|
|
12
12
|
import { Creatable as TransactionCreatable } from "./Creatable"
|
|
13
13
|
import { Exchange as TransactionExchange } from "./Exchange"
|
|
@@ -88,7 +88,7 @@ export namespace Transaction {
|
|
|
88
88
|
})
|
|
89
89
|
export const typeZod = zod.object({
|
|
90
90
|
counterpart: Rail.Address.typeZod,
|
|
91
|
-
currency:
|
|
91
|
+
currency: zodHelper.currency,
|
|
92
92
|
amount: Amount.typeZod,
|
|
93
93
|
description: zod.string(),
|
|
94
94
|
organization: zod.string(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Warning } from "../../Warning"
|
|
4
|
-
import { zod } from "../../zod"
|
|
4
|
+
import { zod, zodHelper } from "../../zod"
|
|
5
5
|
import { Transaction } from "../Transaction"
|
|
6
6
|
|
|
7
7
|
export interface Account {
|
|
@@ -53,7 +53,7 @@ export namespace Account {
|
|
|
53
53
|
label: zod.string(),
|
|
54
54
|
reference: zod.string(),
|
|
55
55
|
description: zod.string().optional(),
|
|
56
|
-
currency:
|
|
56
|
+
currency: zodHelper.currency,
|
|
57
57
|
opening: Opening.typeZod.optional(),
|
|
58
58
|
closing: Closing.typeZod,
|
|
59
59
|
delta: Delta.typeZod,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { Balances } from "../../Balances"
|
|
3
3
|
import { Supplier } from "../../Supplier"
|
|
4
|
-
import { zod } from "../../zod"
|
|
4
|
+
import { zod, zodHelper } from "../../zod"
|
|
5
5
|
|
|
6
6
|
export interface Emoney {
|
|
7
7
|
organization: string
|
|
@@ -18,7 +18,7 @@ export namespace Emoney {
|
|
|
18
18
|
account: zod.string(),
|
|
19
19
|
created: zod.string().refine(isoly.DateTime.is).optional(),
|
|
20
20
|
supplier: Supplier.typeZod.optional(),
|
|
21
|
-
currencies: zod.array(
|
|
21
|
+
currencies: zod.array(zodHelper.currency).optional(),
|
|
22
22
|
timestamp: zod.string().refine(isoly.DateTime.is),
|
|
23
23
|
balances: Balances.typeZod,
|
|
24
24
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { zod } from "../../zod"
|
|
3
|
+
import { zod, zodHelper } from "../../zod"
|
|
4
4
|
import { Transaction } from "../Transaction"
|
|
5
5
|
|
|
6
6
|
export namespace funding {
|
|
@@ -24,7 +24,7 @@ export namespace funding {
|
|
|
24
24
|
export type Cursors = Partial<Record<isoly.Currency, Cursor>>
|
|
25
25
|
export namespace Cursors {
|
|
26
26
|
export const type = isly.record<Cursors>(isly.fromIs("isoly.Currency", isoly.Currency.is), Cursor.type)
|
|
27
|
-
export const typeZod: zod.ZodType<Cursors> = zod.partialRecord(
|
|
27
|
+
export const typeZod: zod.ZodType<Cursors> = zod.partialRecord(zodHelper.currency, Cursor.typeZod)
|
|
28
28
|
export function updateAmount(settlement: Transaction, cursors: Cursors): Cursors {
|
|
29
29
|
const cursor = cursors[settlement.currency]
|
|
30
30
|
if (!cursor) {
|
|
@@ -3,7 +3,7 @@ import { Balance } from "../../Balance"
|
|
|
3
3
|
import { Supplier } from "../../Supplier"
|
|
4
4
|
import { Transaction } from "../../Transaction"
|
|
5
5
|
import { Warning } from "../../Warning"
|
|
6
|
-
import { zod } from "../../zod"
|
|
6
|
+
import { zod, zodHelper } from "../../zod"
|
|
7
7
|
import { Account as SnapshotAccount } from "./Account"
|
|
8
8
|
import { Check as SnapshotCheck } from "./Check"
|
|
9
9
|
import { Emoney as SnapshotEmoney } from "./Emoney"
|
|
@@ -58,7 +58,7 @@ export namespace Snapshot {
|
|
|
58
58
|
accounts: zod.array(EmoneyAccounts.typeZod),
|
|
59
59
|
}),
|
|
60
60
|
created: zod.string().refine(isoly.DateTime.is),
|
|
61
|
-
currency:
|
|
61
|
+
currency: zodHelper.currency,
|
|
62
62
|
supplier: Supplier.typeZod,
|
|
63
63
|
fiat: zod.object({
|
|
64
64
|
total: zod.number(),
|
|
@@ -1,7 +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
|
+
import { zod, zodHelper } from "../../zod"
|
|
5
5
|
|
|
6
6
|
export interface Creatable {
|
|
7
7
|
creditor: Rail.Address
|
|
@@ -20,7 +20,7 @@ export namespace Creatable {
|
|
|
20
20
|
})
|
|
21
21
|
export const typeZod = zod.object({
|
|
22
22
|
creditor: Rail.Address.typeZod,
|
|
23
|
-
currency:
|
|
23
|
+
currency: zodHelper.currency,
|
|
24
24
|
amount: zod.number(),
|
|
25
25
|
description: zod.string(),
|
|
26
26
|
external: zod.string().optional(),
|
package/Warning/Issue.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { zod } from "../zod"
|
|
3
|
+
import { zod, zodHelper } from "../zod"
|
|
4
4
|
|
|
5
5
|
export interface Issue {
|
|
6
6
|
link: string
|
|
@@ -30,7 +30,7 @@ export namespace Issue {
|
|
|
30
30
|
})
|
|
31
31
|
export const typeZod: zod.ZodType<Creatable> = zod.object({
|
|
32
32
|
type: zod.string(),
|
|
33
|
-
currency:
|
|
33
|
+
currency: zodHelper.currency,
|
|
34
34
|
resource: zod.string().optional(),
|
|
35
35
|
issue: Issue.typeZod,
|
|
36
36
|
})
|