@pax2pay/model-banking 0.1.666 → 0.1.668
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/Treasury/Balance/index.ts +1 -0
- package/Treasury/Snapshot/Account.ts +21 -0
- package/Treasury/Snapshot/Check/BankFeedIntegrity.ts +18 -1
- package/Treasury/Snapshot/Check/Base.ts +7 -1
- package/Treasury/Snapshot/Check/Checks.ts +2 -0
- package/Treasury/Snapshot/Check/ExternalReconciliation.ts +9 -1
- package/Treasury/Snapshot/Check/InternalReconciliation.ts +9 -1
- package/Treasury/Snapshot/Check/LedgerIntegrity.ts +13 -1
- package/Treasury/Snapshot/Check/Overdraft.ts +7 -1
- package/Treasury/Snapshot/Check/Result.ts +3 -0
- package/Treasury/Snapshot/Check/TransactionMatch.ts +9 -1
- package/Treasury/Snapshot/Check/UnidentifiedFunds.ts +8 -1
- package/Treasury/Snapshot/Check/index.ts +17 -7
- package/Treasury/Snapshot/Emoney.ts +12 -0
- package/Treasury/Snapshot/Fiat.ts +14 -0
- package/Treasury/Snapshot/Reconciliation.ts +8 -0
- package/Treasury/Snapshot/funding.ts +6 -0
- package/Treasury/Snapshot/index.ts +32 -3
- package/Treasury/Transaction/Creatable.ts +8 -0
- package/Treasury/Transaction/index.ts +7 -0
- package/Warning/Snapshot/DeltaFiat.ts +6 -0
- package/Warning/Snapshot/MissingBuffer.ts +8 -0
- package/Warning/Snapshot/MissingEmoney.ts +6 -0
- package/Warning/Snapshot/MissingFiat.ts +6 -0
- package/Warning/Snapshot/MissingTransaction.ts +6 -0
- package/Warning/Snapshot/Overdraft.ts +7 -0
- package/Warning/Snapshot/Reconciliation.ts +8 -0
- package/Warning/Snapshot/StaleFiat.ts +7 -0
- package/Warning/Snapshot/index.ts +11 -0
- package/dist/cjs/Treasury/Balance/index.d.ts +1 -0
- package/dist/cjs/Treasury/Balance/index.js +1 -0
- package/dist/cjs/Treasury/Balance/index.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Account.d.ts +5 -0
- package/dist/cjs/Treasury/Snapshot/Account.js +22 -0
- package/dist/cjs/Treasury/Snapshot/Account.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/BankFeedIntegrity.d.ts +4 -1
- package/dist/cjs/Treasury/Snapshot/Check/BankFeedIntegrity.js +21 -0
- package/dist/cjs/Treasury/Snapshot/Check/BankFeedIntegrity.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/Base.d.ts +7 -1
- package/dist/cjs/Treasury/Snapshot/Check/Base.js +11 -0
- package/dist/cjs/Treasury/Snapshot/Check/Base.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/Checks.d.ts +2 -0
- package/dist/cjs/Treasury/Snapshot/Check/Checks.js +2 -0
- package/dist/cjs/Treasury/Snapshot/Check/Checks.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/ExternalReconciliation.d.ts +4 -1
- package/dist/cjs/Treasury/Snapshot/Check/ExternalReconciliation.js +12 -0
- package/dist/cjs/Treasury/Snapshot/Check/ExternalReconciliation.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/InternalReconciliation.d.ts +4 -1
- package/dist/cjs/Treasury/Snapshot/Check/InternalReconciliation.js +12 -0
- package/dist/cjs/Treasury/Snapshot/Check/InternalReconciliation.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/LedgerIntegrity.d.ts +4 -1
- package/dist/cjs/Treasury/Snapshot/Check/LedgerIntegrity.js +16 -0
- package/dist/cjs/Treasury/Snapshot/Check/LedgerIntegrity.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/Overdraft.d.ts +4 -1
- package/dist/cjs/Treasury/Snapshot/Check/Overdraft.js +10 -0
- package/dist/cjs/Treasury/Snapshot/Check/Overdraft.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/Result.d.ts +2 -0
- package/dist/cjs/Treasury/Snapshot/Check/Result.js +2 -0
- package/dist/cjs/Treasury/Snapshot/Check/Result.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/TransactionMatch.d.ts +4 -1
- package/dist/cjs/Treasury/Snapshot/Check/TransactionMatch.js +12 -0
- package/dist/cjs/Treasury/Snapshot/Check/TransactionMatch.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/UnidentifiedFunds.d.ts +4 -1
- package/dist/cjs/Treasury/Snapshot/Check/UnidentifiedFunds.js +11 -0
- package/dist/cjs/Treasury/Snapshot/Check/UnidentifiedFunds.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/index.d.ts +9 -7
- package/dist/cjs/Treasury/Snapshot/Check/index.js +24 -0
- package/dist/cjs/Treasury/Snapshot/Check/index.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Emoney.d.ts +4 -0
- package/dist/cjs/Treasury/Snapshot/Emoney.js +17 -0
- package/dist/cjs/Treasury/Snapshot/Emoney.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Fiat.d.ts +4 -0
- package/dist/cjs/Treasury/Snapshot/Fiat.js +19 -0
- package/dist/cjs/Treasury/Snapshot/Fiat.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Reconciliation.d.ts +4 -0
- package/dist/cjs/Treasury/Snapshot/Reconciliation.js +9 -0
- package/dist/cjs/Treasury/Snapshot/Reconciliation.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/funding.d.ts +3 -0
- package/dist/cjs/Treasury/Snapshot/funding.js +6 -0
- package/dist/cjs/Treasury/Snapshot/funding.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/index.d.ts +22 -3
- package/dist/cjs/Treasury/Snapshot/index.js +41 -0
- package/dist/cjs/Treasury/Snapshot/index.js.map +1 -1
- package/dist/cjs/Treasury/Transaction/Creatable.d.ts +498 -0
- package/dist/cjs/Treasury/Transaction/Creatable.js +8 -0
- package/dist/cjs/Treasury/Transaction/Creatable.js.map +1 -1
- package/dist/cjs/Treasury/Transaction/index.d.ts +2 -0
- package/dist/cjs/Treasury/Transaction/index.js +7 -0
- package/dist/cjs/Treasury/Transaction/index.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/DeltaFiat.d.ts +2 -0
- package/dist/cjs/Warning/Snapshot/DeltaFiat.js +7 -0
- package/dist/cjs/Warning/Snapshot/DeltaFiat.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingBuffer.d.ts +2 -0
- package/dist/cjs/Warning/Snapshot/MissingBuffer.js +8 -0
- package/dist/cjs/Warning/Snapshot/MissingBuffer.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingEmoney.d.ts +2 -0
- package/dist/cjs/Warning/Snapshot/MissingEmoney.js +7 -0
- package/dist/cjs/Warning/Snapshot/MissingEmoney.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingFiat.d.ts +2 -0
- package/dist/cjs/Warning/Snapshot/MissingFiat.js +7 -0
- package/dist/cjs/Warning/Snapshot/MissingFiat.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingTransaction.d.ts +2 -0
- package/dist/cjs/Warning/Snapshot/MissingTransaction.js +7 -0
- package/dist/cjs/Warning/Snapshot/MissingTransaction.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/Overdraft.d.ts +2 -0
- package/dist/cjs/Warning/Snapshot/Overdraft.js +7 -0
- package/dist/cjs/Warning/Snapshot/Overdraft.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/Reconciliation.d.ts +2 -0
- package/dist/cjs/Warning/Snapshot/Reconciliation.js +9 -0
- package/dist/cjs/Warning/Snapshot/Reconciliation.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/StaleFiat.d.ts +2 -0
- package/dist/cjs/Warning/Snapshot/StaleFiat.js +7 -0
- package/dist/cjs/Warning/Snapshot/StaleFiat.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/index.d.ts +2 -0
- package/dist/cjs/Warning/Snapshot/index.js +11 -0
- package/dist/cjs/Warning/Snapshot/index.js.map +1 -1
- package/dist/mjs/Treasury/Balance/index.d.ts +1 -0
- package/dist/mjs/Treasury/Balance/index.js +1 -0
- package/dist/mjs/Treasury/Balance/index.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Account.d.ts +5 -0
- package/dist/mjs/Treasury/Snapshot/Account.js +22 -0
- package/dist/mjs/Treasury/Snapshot/Account.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/BankFeedIntegrity.d.ts +4 -1
- package/dist/mjs/Treasury/Snapshot/Check/BankFeedIntegrity.js +20 -1
- package/dist/mjs/Treasury/Snapshot/Check/BankFeedIntegrity.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/Base.d.ts +7 -1
- package/dist/mjs/Treasury/Snapshot/Check/Base.js +10 -1
- package/dist/mjs/Treasury/Snapshot/Check/Base.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/Checks.d.ts +2 -0
- package/dist/mjs/Treasury/Snapshot/Check/Checks.js +2 -0
- package/dist/mjs/Treasury/Snapshot/Check/Checks.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/ExternalReconciliation.d.ts +4 -1
- package/dist/mjs/Treasury/Snapshot/Check/ExternalReconciliation.js +11 -1
- package/dist/mjs/Treasury/Snapshot/Check/ExternalReconciliation.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/InternalReconciliation.d.ts +4 -1
- package/dist/mjs/Treasury/Snapshot/Check/InternalReconciliation.js +11 -1
- package/dist/mjs/Treasury/Snapshot/Check/InternalReconciliation.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/LedgerIntegrity.d.ts +4 -1
- package/dist/mjs/Treasury/Snapshot/Check/LedgerIntegrity.js +15 -1
- package/dist/mjs/Treasury/Snapshot/Check/LedgerIntegrity.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/Overdraft.d.ts +4 -1
- package/dist/mjs/Treasury/Snapshot/Check/Overdraft.js +9 -1
- package/dist/mjs/Treasury/Snapshot/Check/Overdraft.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/Result.d.ts +2 -0
- package/dist/mjs/Treasury/Snapshot/Check/Result.js +2 -0
- package/dist/mjs/Treasury/Snapshot/Check/Result.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/TransactionMatch.d.ts +4 -1
- package/dist/mjs/Treasury/Snapshot/Check/TransactionMatch.js +11 -1
- package/dist/mjs/Treasury/Snapshot/Check/TransactionMatch.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/UnidentifiedFunds.d.ts +4 -1
- package/dist/mjs/Treasury/Snapshot/Check/UnidentifiedFunds.js +10 -1
- package/dist/mjs/Treasury/Snapshot/Check/UnidentifiedFunds.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/index.d.ts +9 -7
- package/dist/mjs/Treasury/Snapshot/Check/index.js +24 -0
- package/dist/mjs/Treasury/Snapshot/Check/index.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Emoney.d.ts +4 -0
- package/dist/mjs/Treasury/Snapshot/Emoney.js +16 -1
- package/dist/mjs/Treasury/Snapshot/Emoney.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Fiat.d.ts +4 -0
- package/dist/mjs/Treasury/Snapshot/Fiat.js +18 -1
- package/dist/mjs/Treasury/Snapshot/Fiat.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Reconciliation.d.ts +4 -0
- package/dist/mjs/Treasury/Snapshot/Reconciliation.js +8 -1
- package/dist/mjs/Treasury/Snapshot/Reconciliation.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/funding.d.ts +3 -0
- package/dist/mjs/Treasury/Snapshot/funding.js +6 -0
- package/dist/mjs/Treasury/Snapshot/funding.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/index.d.ts +22 -3
- package/dist/mjs/Treasury/Snapshot/index.js +41 -0
- package/dist/mjs/Treasury/Snapshot/index.js.map +1 -1
- package/dist/mjs/Treasury/Transaction/Creatable.d.ts +498 -0
- package/dist/mjs/Treasury/Transaction/Creatable.js +8 -0
- package/dist/mjs/Treasury/Transaction/Creatable.js.map +1 -1
- package/dist/mjs/Treasury/Transaction/index.d.ts +2 -0
- package/dist/mjs/Treasury/Transaction/index.js +7 -0
- package/dist/mjs/Treasury/Transaction/index.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/DeltaFiat.d.ts +2 -0
- package/dist/mjs/Warning/Snapshot/DeltaFiat.js +7 -0
- package/dist/mjs/Warning/Snapshot/DeltaFiat.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingBuffer.d.ts +2 -0
- package/dist/mjs/Warning/Snapshot/MissingBuffer.js +8 -0
- package/dist/mjs/Warning/Snapshot/MissingBuffer.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingEmoney.d.ts +2 -0
- package/dist/mjs/Warning/Snapshot/MissingEmoney.js +7 -0
- package/dist/mjs/Warning/Snapshot/MissingEmoney.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingFiat.d.ts +2 -0
- package/dist/mjs/Warning/Snapshot/MissingFiat.js +7 -0
- package/dist/mjs/Warning/Snapshot/MissingFiat.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingTransaction.d.ts +2 -0
- package/dist/mjs/Warning/Snapshot/MissingTransaction.js +7 -0
- package/dist/mjs/Warning/Snapshot/MissingTransaction.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/Overdraft.d.ts +2 -0
- package/dist/mjs/Warning/Snapshot/Overdraft.js +7 -0
- package/dist/mjs/Warning/Snapshot/Overdraft.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/Reconciliation.d.ts +2 -0
- package/dist/mjs/Warning/Snapshot/Reconciliation.js +9 -0
- package/dist/mjs/Warning/Snapshot/Reconciliation.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/StaleFiat.d.ts +2 -0
- package/dist/mjs/Warning/Snapshot/StaleFiat.js +7 -0
- package/dist/mjs/Warning/Snapshot/StaleFiat.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/index.d.ts +2 -0
- package/dist/mjs/Warning/Snapshot/index.js +11 -0
- package/dist/mjs/Warning/Snapshot/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +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
5
|
import { Transaction } from "../Transaction"
|
|
5
6
|
|
|
6
7
|
export interface Account {
|
|
@@ -18,14 +19,23 @@ export namespace Account {
|
|
|
18
19
|
export type Opening = { at: isoly.DateTime; balance: number }
|
|
19
20
|
export namespace Opening {
|
|
20
21
|
export const type = isly.object<Opening>({ at: isly.string(), balance: isly.number() })
|
|
22
|
+
export const typeZod: zod.ZodType<Opening> = zod.object({
|
|
23
|
+
at: zod.string().refine(isoly.DateTime.is),
|
|
24
|
+
balance: zod.number(),
|
|
25
|
+
})
|
|
21
26
|
}
|
|
22
27
|
export type Closing = Opening
|
|
23
28
|
export namespace Closing {
|
|
24
29
|
export const type = Opening.type
|
|
30
|
+
export const typeZod = Opening.typeZod
|
|
25
31
|
}
|
|
26
32
|
export type Delta = { amount: number; transactions: Transaction[] }
|
|
27
33
|
export namespace Delta {
|
|
28
34
|
export const type = isly.object<Delta>({ amount: isly.number(), transactions: Transaction.type.array() })
|
|
35
|
+
export const typeZod: zod.ZodType<Delta> = zod.object({
|
|
36
|
+
amount: zod.number(),
|
|
37
|
+
transactions: zod.array(Transaction.typeZod),
|
|
38
|
+
})
|
|
29
39
|
}
|
|
30
40
|
export const type = isly.object<Account>({
|
|
31
41
|
code: isly.string(),
|
|
@@ -38,4 +48,15 @@ export namespace Account {
|
|
|
38
48
|
delta: Delta.type,
|
|
39
49
|
warnings: Warning.Snapshot.type.array().optional(),
|
|
40
50
|
})
|
|
51
|
+
export const typeZod: zod.ZodType<Account> = zod.object({
|
|
52
|
+
code: zod.string(),
|
|
53
|
+
label: zod.string(),
|
|
54
|
+
reference: zod.string(),
|
|
55
|
+
description: zod.string().optional(),
|
|
56
|
+
currency: zod.enum(isoly.Currency.values),
|
|
57
|
+
opening: Opening.typeZod.optional(),
|
|
58
|
+
closing: Closing.typeZod,
|
|
59
|
+
delta: Delta.typeZod,
|
|
60
|
+
warnings: zod.array(Warning.Snapshot.typeZod).optional(),
|
|
61
|
+
})
|
|
41
62
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
|
+
import { zod } from "../../../zod"
|
|
2
3
|
import { Base } from "./Base"
|
|
3
4
|
import { Result } from "./Result"
|
|
4
5
|
|
|
@@ -16,4 +17,20 @@ export interface BankFeedIntegrity extends Base {
|
|
|
16
17
|
}[]
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
export namespace BankFeedIntegrity {
|
|
20
|
+
export namespace BankFeedIntegrity {
|
|
21
|
+
export const typeZod: zod.ZodType<BankFeedIntegrity> = Base.typeZod.extend({
|
|
22
|
+
check: zod.literal("bank feed integrity"),
|
|
23
|
+
accounts: zod.array(
|
|
24
|
+
zod.object({
|
|
25
|
+
code: zod.string(),
|
|
26
|
+
reference: zod.string(),
|
|
27
|
+
supplier: zod.string(),
|
|
28
|
+
opening: zod.object({ at: zod.string().refine(isoly.DateTime.is), balance: zod.number() }).optional(),
|
|
29
|
+
transaction: zod.object({ balance: zod.number() }).optional(),
|
|
30
|
+
closing: zod.object({ at: zod.string().refine(isoly.DateTime.is), balance: zod.number() }),
|
|
31
|
+
timestamp: zod.string(),
|
|
32
|
+
result: Result.typeZod,
|
|
33
|
+
})
|
|
34
|
+
),
|
|
35
|
+
})
|
|
36
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { zod } from "../../../zod"
|
|
1
2
|
import { Checks } from "./Checks"
|
|
2
3
|
import { Result } from "./Result"
|
|
3
4
|
|
|
@@ -5,4 +6,9 @@ export interface Base {
|
|
|
5
6
|
check: Checks
|
|
6
7
|
result: Result
|
|
7
8
|
}
|
|
8
|
-
export namespace Base {
|
|
9
|
+
export namespace Base {
|
|
10
|
+
export const typeZod = zod.object({
|
|
11
|
+
check: Checks.typeZod,
|
|
12
|
+
result: Result.typeZod,
|
|
13
|
+
}) satisfies zod.ZodType<Base>
|
|
14
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
+
import { zod } from "../../../zod"
|
|
2
3
|
|
|
3
4
|
export type Checks = (typeof Checks.value)[number]
|
|
4
5
|
export namespace Checks {
|
|
@@ -12,4 +13,5 @@ export namespace Checks {
|
|
|
12
13
|
"unidentified funds", // Flags any received money not yet assigned to a customer
|
|
13
14
|
] as const
|
|
14
15
|
export const type = isly.string(value)
|
|
16
|
+
export const typeZod: zod.ZodType<Checks> = zod.enum(value)
|
|
15
17
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { zod } from "../../../zod"
|
|
1
2
|
import { Base } from "./Base"
|
|
2
3
|
|
|
3
4
|
export interface ExternalReconciliation extends Base {
|
|
@@ -6,4 +7,11 @@ export interface ExternalReconciliation extends Base {
|
|
|
6
7
|
fiat: number
|
|
7
8
|
discrepancy: number
|
|
8
9
|
}
|
|
9
|
-
export namespace ExternalReconciliation {
|
|
10
|
+
export namespace ExternalReconciliation {
|
|
11
|
+
export const typeZod: zod.ZodType<ExternalReconciliation> = Base.typeZod.extend({
|
|
12
|
+
check: zod.literal("external reconciliation"),
|
|
13
|
+
counterbalance: zod.number(),
|
|
14
|
+
fiat: zod.number(),
|
|
15
|
+
discrepancy: zod.number(),
|
|
16
|
+
})
|
|
17
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { zod } from "../../../zod"
|
|
1
2
|
import { Base as ResultBase } from "./Base"
|
|
2
3
|
|
|
3
4
|
export interface InternalReconciliation extends ResultBase {
|
|
@@ -6,4 +7,11 @@ export interface InternalReconciliation extends ResultBase {
|
|
|
6
7
|
emoney: number
|
|
7
8
|
discrepancy: number
|
|
8
9
|
}
|
|
9
|
-
export namespace InternalReconciliation {
|
|
10
|
+
export namespace InternalReconciliation {
|
|
11
|
+
export const typeZod: zod.ZodType<InternalReconciliation> = ResultBase.typeZod.extend({
|
|
12
|
+
check: zod.literal("internal reconciliation"),
|
|
13
|
+
counterbalance: zod.number(),
|
|
14
|
+
emoney: zod.number(),
|
|
15
|
+
discrepancy: zod.number(),
|
|
16
|
+
})
|
|
17
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { zod } from "../../../zod"
|
|
1
2
|
import { Base } from "./Base"
|
|
2
3
|
|
|
3
4
|
export interface LedgerIntegrity extends Base {
|
|
@@ -10,4 +11,15 @@ export interface LedgerIntegrity extends Base {
|
|
|
10
11
|
passed: number
|
|
11
12
|
total: number
|
|
12
13
|
}
|
|
13
|
-
export namespace LedgerIntegrity {
|
|
14
|
+
export namespace LedgerIntegrity {
|
|
15
|
+
export const typeZod: zod.ZodType<LedgerIntegrity> = Base.typeZod.extend({
|
|
16
|
+
check: zod.literal("ledger integrity"),
|
|
17
|
+
opening: zod.object({ balance: zod.number() }),
|
|
18
|
+
ledger: zod.object({ change: zod.number() }),
|
|
19
|
+
closing: zod.object({ balance: zod.number() }),
|
|
20
|
+
failed: zod.array(zod.string()),
|
|
21
|
+
incomplete: zod.array(zod.string()),
|
|
22
|
+
passed: zod.number(),
|
|
23
|
+
total: zod.number(),
|
|
24
|
+
})
|
|
25
|
+
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { zod } from "../../../zod"
|
|
1
2
|
import { Base } from "./Base"
|
|
2
3
|
|
|
3
4
|
export interface Overdraft extends Base {
|
|
4
5
|
check: "overdraft"
|
|
5
6
|
overdrafts: { account: string; balance: number }[]
|
|
6
7
|
}
|
|
7
|
-
export namespace Overdraft {
|
|
8
|
+
export namespace Overdraft {
|
|
9
|
+
export const typeZod: zod.ZodType<Overdraft> = Base.typeZod.extend({
|
|
10
|
+
check: zod.literal("overdraft"),
|
|
11
|
+
overdrafts: zod.array(zod.object({ account: zod.string(), balance: zod.number() })),
|
|
12
|
+
})
|
|
13
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { zod } from "../../../zod"
|
|
2
|
+
|
|
1
3
|
export type Result = "passed" | "failed" | "incomplete"
|
|
2
4
|
export namespace Result {
|
|
5
|
+
export const typeZod: zod.ZodType<Result> = zod.enum(["passed", "failed", "incomplete"])
|
|
3
6
|
export const precedence: Record<Result, number> = {
|
|
4
7
|
failed: 3,
|
|
5
8
|
incomplete: 2,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { zod } from "../../../zod"
|
|
1
2
|
import { Base } from "./Base"
|
|
2
3
|
|
|
3
4
|
export interface TransactionMatch extends Base {
|
|
@@ -6,4 +7,11 @@ export interface TransactionMatch extends Base {
|
|
|
6
7
|
matched: number
|
|
7
8
|
unmatched: string[]
|
|
8
9
|
}
|
|
9
|
-
export namespace TransactionMatch {
|
|
10
|
+
export namespace TransactionMatch {
|
|
11
|
+
export const typeZod: zod.ZodType<TransactionMatch> = Base.typeZod.extend({
|
|
12
|
+
check: zod.literal("transaction match"),
|
|
13
|
+
total: zod.number(),
|
|
14
|
+
matched: zod.number(),
|
|
15
|
+
unmatched: zod.array(zod.string()),
|
|
16
|
+
})
|
|
17
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { zod } from "../../../zod"
|
|
1
2
|
import { Base as ResultBase } from "./Base"
|
|
2
3
|
|
|
3
4
|
export interface UnidentifiedFunds extends ResultBase {
|
|
@@ -5,4 +6,10 @@ export interface UnidentifiedFunds extends ResultBase {
|
|
|
5
6
|
account: string
|
|
6
7
|
balance: number
|
|
7
8
|
}
|
|
8
|
-
export namespace UnidentifiedFunds {
|
|
9
|
+
export namespace UnidentifiedFunds {
|
|
10
|
+
export const typeZod: zod.ZodType<UnidentifiedFunds> = ResultBase.typeZod.extend({
|
|
11
|
+
check: zod.literal("unidentified funds"),
|
|
12
|
+
account: zod.string(),
|
|
13
|
+
balance: zod.number(),
|
|
14
|
+
})
|
|
15
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { zod } from "../../../zod"
|
|
1
2
|
import { BankFeedIntegrity as CheckBankFeedIntegrity } from "./BankFeedIntegrity"
|
|
2
3
|
import { Checks as CheckChecks } from "./Checks"
|
|
3
4
|
import { ExternalReconciliation as CheckExternalReconciliation } from "./ExternalReconciliation"
|
|
@@ -19,11 +20,20 @@ export type Check =
|
|
|
19
20
|
export namespace Check {
|
|
20
21
|
export import Result = CheckResult
|
|
21
22
|
export import Checks = CheckChecks
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
23
|
+
export import BankFeedIntegrity = CheckBankFeedIntegrity
|
|
24
|
+
export import ExternalReconciliation = CheckExternalReconciliation
|
|
25
|
+
export import InternalReconciliation = CheckInternalReconciliation
|
|
26
|
+
export import LedgerIntegrity = CheckLedgerIntegrity
|
|
27
|
+
export import Overdraft = CheckOverdraft
|
|
28
|
+
export import TransactionMatch = CheckTransactionMatch
|
|
29
|
+
export import UnidentifiedFunds = CheckUnidentifiedFunds
|
|
30
|
+
export const typeZod: zod.ZodType<Check> = zod.union([
|
|
31
|
+
CheckBankFeedIntegrity.typeZod,
|
|
32
|
+
CheckExternalReconciliation.typeZod,
|
|
33
|
+
CheckInternalReconciliation.typeZod,
|
|
34
|
+
CheckLedgerIntegrity.typeZod,
|
|
35
|
+
CheckOverdraft.typeZod,
|
|
36
|
+
CheckTransactionMatch.typeZod,
|
|
37
|
+
CheckUnidentifiedFunds.typeZod,
|
|
38
|
+
])
|
|
29
39
|
}
|
|
@@ -1,6 +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
5
|
|
|
5
6
|
export interface Emoney {
|
|
6
7
|
organization: string
|
|
@@ -11,3 +12,14 @@ export interface Emoney {
|
|
|
11
12
|
timestamp: isoly.DateTime
|
|
12
13
|
balances: Balances
|
|
13
14
|
}
|
|
15
|
+
export namespace Emoney {
|
|
16
|
+
export const typeZod: zod.ZodType<Emoney> = zod.object({
|
|
17
|
+
organization: zod.string(),
|
|
18
|
+
account: zod.string(),
|
|
19
|
+
created: zod.string().refine(isoly.DateTime.is).optional(),
|
|
20
|
+
supplier: Supplier.typeZod.optional(),
|
|
21
|
+
currencies: zod.array(zod.enum(isoly.Currency.values)).optional(),
|
|
22
|
+
timestamp: zod.string().refine(isoly.DateTime.is),
|
|
23
|
+
balances: Balances.typeZod,
|
|
24
|
+
})
|
|
25
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { Supplier } from "../../Supplier"
|
|
3
|
+
import { zod } from "../../zod"
|
|
3
4
|
import { Balance } from "../Balance"
|
|
4
5
|
|
|
5
6
|
export interface Fiat {
|
|
@@ -13,3 +14,16 @@ export interface Fiat {
|
|
|
13
14
|
reference: string
|
|
14
15
|
description?: string
|
|
15
16
|
}
|
|
17
|
+
export namespace Fiat {
|
|
18
|
+
export const typeZod: zod.ZodType<Fiat> = zod.object({
|
|
19
|
+
supplier: Supplier.typeZod,
|
|
20
|
+
account: zod.string(),
|
|
21
|
+
timestamp: zod.string().refine(isoly.DateTime.is),
|
|
22
|
+
type: zod.enum(["safeguarded", "unsafe", "other", "buffer"]),
|
|
23
|
+
balances: Balance.typeZod,
|
|
24
|
+
conditions: zod.object({ minimum: Balance.typeZod.optional() }).optional(),
|
|
25
|
+
label: zod.string().optional(),
|
|
26
|
+
reference: zod.string(),
|
|
27
|
+
description: zod.string().optional(),
|
|
28
|
+
})
|
|
29
|
+
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
import { zod } from "../../zod"
|
|
2
|
+
|
|
1
3
|
export interface Reconciliation {
|
|
2
4
|
correct: number
|
|
3
5
|
incorrect: number
|
|
4
6
|
}
|
|
7
|
+
export namespace Reconciliation {
|
|
8
|
+
export const typeZod: zod.ZodType<Reconciliation> = zod.object({
|
|
9
|
+
correct: zod.number(),
|
|
10
|
+
incorrect: zod.number(),
|
|
11
|
+
})
|
|
12
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
+
import { zod } from "../../zod"
|
|
3
4
|
import { Transaction } from "../Transaction"
|
|
4
5
|
|
|
5
6
|
export namespace funding {
|
|
@@ -9,6 +10,10 @@ export namespace funding {
|
|
|
9
10
|
cursor: isly.string(),
|
|
10
11
|
amount: isly.number(),
|
|
11
12
|
})
|
|
13
|
+
export const typeZod: zod.ZodType<Cursor> = zod.object({
|
|
14
|
+
cursor: zod.string(),
|
|
15
|
+
amount: zod.number(),
|
|
16
|
+
})
|
|
12
17
|
export function fromTransaction(transaction: Transaction): string {
|
|
13
18
|
return `${transaction.currency}|${isoly.DateTime.invert(transaction.created)}|${transaction.reference}`
|
|
14
19
|
}
|
|
@@ -19,6 +24,7 @@ export namespace funding {
|
|
|
19
24
|
export type Cursors = Partial<Record<isoly.Currency, Cursor>>
|
|
20
25
|
export namespace Cursors {
|
|
21
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(zod.enum(isoly.Currency.values), Cursor.typeZod)
|
|
22
28
|
export function updateAmount(settlement: Transaction, cursors: Cursors): Cursors {
|
|
23
29
|
const cursor = cursors[settlement.currency]
|
|
24
30
|
if (!cursor) {
|
|
@@ -3,6 +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
7
|
import { Account as SnapshotAccount } from "./Account"
|
|
7
8
|
import { Check as SnapshotCheck } from "./Check"
|
|
8
9
|
import { Emoney as SnapshotEmoney } from "./Emoney"
|
|
@@ -35,10 +36,38 @@ export namespace Snapshot {
|
|
|
35
36
|
ledger?: { change: number }
|
|
36
37
|
closing: { at: isoly.DateTime; balance: number }
|
|
37
38
|
}
|
|
39
|
+
export namespace EmoneyAccounts {
|
|
40
|
+
export const typeZod = zod.object({
|
|
41
|
+
id: zod.string(),
|
|
42
|
+
organization: zod.string(),
|
|
43
|
+
opening: zod.object({ at: zod.string().refine(isoly.DateTime.is), balance: zod.number() }).optional(),
|
|
44
|
+
ledger: zod.object({ change: zod.number() }).optional(),
|
|
45
|
+
closing: zod.object({ at: zod.string().refine(isoly.DateTime.is), balance: zod.number() }),
|
|
46
|
+
}) satisfies zod.ZodType<EmoneyAccounts>
|
|
47
|
+
}
|
|
38
48
|
export import funding = snapshotFunding
|
|
39
49
|
export import Check = SnapshotCheck
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
export
|
|
50
|
+
export import Reconciliation = SnapshotReconciliation
|
|
51
|
+
export import Emoney = SnapshotEmoney
|
|
52
|
+
export import Fiat = SnapshotFiat
|
|
43
53
|
export import Account = SnapshotAccount
|
|
54
|
+
export const typeZod: zod.ZodType<Snapshot> = zod.object({
|
|
55
|
+
version: zod.literal(version),
|
|
56
|
+
emoney: Balance.Extended.typeZod.extend({
|
|
57
|
+
total: zod.number().optional(),
|
|
58
|
+
accounts: zod.array(EmoneyAccounts.typeZod),
|
|
59
|
+
}),
|
|
60
|
+
created: zod.string().refine(isoly.DateTime.is),
|
|
61
|
+
currency: zod.enum(isoly.Currency.values),
|
|
62
|
+
supplier: Supplier.typeZod,
|
|
63
|
+
fiat: zod.object({
|
|
64
|
+
total: zod.number(),
|
|
65
|
+
accounts: zod.array(Account.typeZod),
|
|
66
|
+
}),
|
|
67
|
+
counterbalance: zod.number().optional(),
|
|
68
|
+
notes: zod.array(Transaction.Note.typeZod),
|
|
69
|
+
checks: zod.array(Check.typeZod),
|
|
70
|
+
result: Check.Result.typeZod,
|
|
71
|
+
warnings: zod.array(Warning.Snapshot.typeZod).optional(),
|
|
72
|
+
})
|
|
44
73
|
}
|
|
@@ -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
|
|
|
5
6
|
export interface Creatable {
|
|
6
7
|
creditor: Rail.Address
|
|
@@ -17,4 +18,11 @@ export namespace Creatable {
|
|
|
17
18
|
description: isly.string(),
|
|
18
19
|
external: isly.string().optional(),
|
|
19
20
|
})
|
|
21
|
+
export const typeZod = zod.object({
|
|
22
|
+
creditor: Rail.Address.typeZod,
|
|
23
|
+
currency: zod.enum(isoly.Currency.values),
|
|
24
|
+
amount: zod.number(),
|
|
25
|
+
description: zod.string(),
|
|
26
|
+
external: zod.string().optional(),
|
|
27
|
+
}) satisfies zod.ZodType<Creatable>
|
|
20
28
|
}
|
|
@@ -2,6 +2,7 @@ import { cryptly } from "cryptly"
|
|
|
2
2
|
import { isoly } from "isoly"
|
|
3
3
|
import { isly } from "isly"
|
|
4
4
|
import { Rail } from "../../Rail"
|
|
5
|
+
import { zod } from "../../zod"
|
|
5
6
|
import { Creatable as TransactionCreatable } from "./Creatable"
|
|
6
7
|
|
|
7
8
|
export interface Transaction extends TransactionCreatable {
|
|
@@ -21,4 +22,10 @@ export namespace Transaction {
|
|
|
21
22
|
debtor: Rail.Address.type,
|
|
22
23
|
id: isly.string().optional(),
|
|
23
24
|
})
|
|
25
|
+
export const typeZod: zod.ZodType<Transaction> = Creatable.typeZod.extend({
|
|
26
|
+
reference: zod.string().refine(cryptly.Identifier.is),
|
|
27
|
+
created: zod.string(),
|
|
28
|
+
debtor: Rail.Address.typeZod,
|
|
29
|
+
id: zod.string().optional(),
|
|
30
|
+
})
|
|
24
31
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
+
import { zod } from "../../zod"
|
|
3
4
|
import { Base } from "../Base"
|
|
4
5
|
|
|
5
6
|
export interface DeltaFiat extends Base {
|
|
@@ -13,4 +14,9 @@ export namespace DeltaFiat {
|
|
|
13
14
|
severity: isly.string(["high", "medium"]).optional(),
|
|
14
15
|
currency: isly.string(),
|
|
15
16
|
})
|
|
17
|
+
export const typeZod: zod.ZodType<DeltaFiat> = Base.typeZod.extend({
|
|
18
|
+
type: zod.literal("delta-fiat"),
|
|
19
|
+
severity: zod.enum(["high", "medium"]).optional(),
|
|
20
|
+
currency: zod.enum(isoly.Currency.values),
|
|
21
|
+
})
|
|
16
22
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Treasury } from "../../Treasury"
|
|
4
|
+
import { zod } from "../../zod"
|
|
4
5
|
import { Base } from "../Base"
|
|
5
6
|
|
|
6
7
|
export interface MissingBuffer extends Base {
|
|
@@ -18,6 +19,13 @@ export namespace MissingBuffer {
|
|
|
18
19
|
minimum: isly.number(),
|
|
19
20
|
balance: isly.number(),
|
|
20
21
|
})
|
|
22
|
+
export const typeZod: zod.ZodType<MissingBuffer> = Base.typeZod.extend({
|
|
23
|
+
type: zod.literal("missing-buffer"),
|
|
24
|
+
severity: zod.literal("high").optional(),
|
|
25
|
+
currency: zod.enum(isoly.Currency.values),
|
|
26
|
+
minimum: zod.number(),
|
|
27
|
+
balance: zod.number(),
|
|
28
|
+
})
|
|
21
29
|
export function create(account: Treasury.Account): MissingBuffer[] {
|
|
22
30
|
const result: MissingBuffer[] = []
|
|
23
31
|
for (const [currency, amount] of Object.entries(account.balance)) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
+
import { zod } from "../../zod"
|
|
3
4
|
import { Base } from "../Base"
|
|
4
5
|
|
|
5
6
|
export interface MissingEmoney extends Base {
|
|
@@ -13,4 +14,9 @@ export namespace MissingEmoney {
|
|
|
13
14
|
severity: isly.string("high").optional(),
|
|
14
15
|
currency: isly.string(),
|
|
15
16
|
})
|
|
17
|
+
export const typeZod: zod.ZodType<MissingEmoney> = Base.typeZod.extend({
|
|
18
|
+
type: zod.literal("missing-emoney"),
|
|
19
|
+
severity: zod.literal("high").optional(),
|
|
20
|
+
currency: zod.enum(isoly.Currency.values),
|
|
21
|
+
})
|
|
16
22
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
+
import { zod } from "../../zod"
|
|
3
4
|
import { Base } from "../Base"
|
|
4
5
|
|
|
5
6
|
export interface MissingFiat extends Base {
|
|
@@ -13,4 +14,9 @@ export namespace MissingFiat {
|
|
|
13
14
|
severity: isly.string("high").optional(),
|
|
14
15
|
currency: isly.string(),
|
|
15
16
|
})
|
|
17
|
+
export const typeZod: zod.ZodType<MissingFiat> = Base.typeZod.extend({
|
|
18
|
+
type: zod.literal("missing-fiat"),
|
|
19
|
+
severity: zod.literal("high").optional(),
|
|
20
|
+
currency: zod.enum(isoly.Currency.values),
|
|
21
|
+
})
|
|
16
22
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
+
import { zod } from "../../zod"
|
|
3
4
|
import { Base } from "../Base"
|
|
4
5
|
|
|
5
6
|
export interface MissingTransaction extends Base {
|
|
@@ -13,4 +14,9 @@ export namespace MissingTransaction {
|
|
|
13
14
|
severity: isly.string("high").optional(),
|
|
14
15
|
currency: isly.string(),
|
|
15
16
|
})
|
|
17
|
+
export const typeZod: zod.ZodType<MissingTransaction> = Base.typeZod.extend({
|
|
18
|
+
type: zod.literal("missing-transaction"),
|
|
19
|
+
severity: zod.literal("high").optional(),
|
|
20
|
+
currency: zod.enum(isoly.Currency.values),
|
|
21
|
+
})
|
|
16
22
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
+
import { zod } from "../../zod"
|
|
3
4
|
import { Base } from "../Base"
|
|
4
5
|
|
|
5
6
|
export interface Overdraft extends Base {
|
|
@@ -16,4 +17,10 @@ export namespace Overdraft {
|
|
|
16
17
|
organization: isly.string(),
|
|
17
18
|
currency: isly.fromIs("Currency", isoly.Currency.is),
|
|
18
19
|
})
|
|
20
|
+
export const typeZod: zod.ZodType<Overdraft> = Base.typeZod.extend({
|
|
21
|
+
type: zod.literal("overdraft"),
|
|
22
|
+
severity: zod.literal("medium").optional(),
|
|
23
|
+
organization: zod.string(),
|
|
24
|
+
currency: zod.enum(isoly.Currency.values),
|
|
25
|
+
})
|
|
19
26
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
+
import { zod } from "../../zod"
|
|
3
4
|
import { Base } from "../Base"
|
|
4
5
|
|
|
5
6
|
export interface Reconciliation extends Base {
|
|
@@ -17,4 +18,11 @@ export namespace Reconciliation {
|
|
|
17
18
|
delta: isly.object({ account: isly.number(), operation: isly.number() }),
|
|
18
19
|
account: isly.string(),
|
|
19
20
|
})
|
|
21
|
+
export const typeZod: zod.ZodType<Reconciliation> = Base.typeZod.extend({
|
|
22
|
+
type: zod.literal("reconciliation"),
|
|
23
|
+
severity: zod.literal("high").optional(),
|
|
24
|
+
currency: zod.enum(isoly.Currency.values),
|
|
25
|
+
delta: zod.object({ account: zod.number(), operation: zod.number() }),
|
|
26
|
+
account: zod.string(),
|
|
27
|
+
})
|
|
20
28
|
}
|
|
@@ -2,6 +2,7 @@ import { isoly } from "isoly"
|
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Holidays } from "../../Holidays"
|
|
4
4
|
import { Treasury } from "../../Treasury"
|
|
5
|
+
import { zod } from "../../zod"
|
|
5
6
|
import { Base } from "../Base"
|
|
6
7
|
|
|
7
8
|
export interface StaleFiat extends Base {
|
|
@@ -17,6 +18,12 @@ export namespace StaleFiat {
|
|
|
17
18
|
currency: isly.string(),
|
|
18
19
|
transaction: isly.object<StaleFiat["transaction"]>({ id: isly.string(), created: isly.string() }),
|
|
19
20
|
})
|
|
21
|
+
export const typeZod: zod.ZodType<StaleFiat> = Base.typeZod.extend({
|
|
22
|
+
type: zod.literal("stale-fiat"),
|
|
23
|
+
severity: zod.literal("low").optional(),
|
|
24
|
+
currency: zod.enum(isoly.Currency.values),
|
|
25
|
+
transaction: zod.object({ id: zod.string(), created: zod.string() }),
|
|
26
|
+
})
|
|
20
27
|
export function create(account: Treasury.Account, transactions: Treasury.Transaction[]): StaleFiat[] {
|
|
21
28
|
const result: StaleFiat[] = []
|
|
22
29
|
for (const [currency, amount] of Object.entries(account.balance)) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
+
import { zod } from "../../zod"
|
|
2
3
|
import { DeltaFiat as WarningDeltaFiat } from "./DeltaFiat"
|
|
3
4
|
import { MissingBuffer as WarningMissingBuffer } from "./MissingBuffer"
|
|
4
5
|
import { MissingEmoney as WarningMissingEmoney } from "./MissingEmoney"
|
|
@@ -38,4 +39,14 @@ export namespace Snapshot {
|
|
|
38
39
|
Reconciliation.type,
|
|
39
40
|
StaleFiat.type
|
|
40
41
|
)
|
|
42
|
+
export const typeZod: zod.ZodType<Snapshot> = zod.union([
|
|
43
|
+
DeltaFiat.typeZod,
|
|
44
|
+
MissingBuffer.typeZod,
|
|
45
|
+
MissingEmoney.typeZod,
|
|
46
|
+
MissingFiat.typeZod,
|
|
47
|
+
MissingTransaction.typeZod,
|
|
48
|
+
Overdraft.typeZod,
|
|
49
|
+
Reconciliation.typeZod,
|
|
50
|
+
StaleFiat.typeZod,
|
|
51
|
+
])
|
|
41
52
|
}
|
|
@@ -6,6 +6,7 @@ export type Result = {
|
|
|
6
6
|
};
|
|
7
7
|
export declare namespace Balance {
|
|
8
8
|
const type: import("isly/dist/cjs/Type").Type<Partial<Record<"AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BOV" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHE" | "CHF" | "CHW" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MXV" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STN" | "SVC" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "USN" | "UYI" | "UYU" | "UYW" | "UZS" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XAG" | "XAU" | "XBA" | "XBB" | "XBC" | "XBD" | "XCD" | "XDR" | "XOF" | "XPD" | "XPF" | "XPT" | "XSU" | "XTS" | "XUA" | "XXX" | "YER" | "ZAR" | "ZMW" | "ZWL", number>>>;
|
|
9
|
+
const typeZod: import("zod").ZodType<Partial<Record<"AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BOV" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHE" | "CHF" | "CHW" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MXV" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STN" | "SVC" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "USN" | "UYI" | "UYU" | "UYW" | "UZS" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XAG" | "XAU" | "XBA" | "XBB" | "XBC" | "XBD" | "XCD" | "XDR" | "XOF" | "XPD" | "XPF" | "XPT" | "XSU" | "XTS" | "XUA" | "XXX" | "YER" | "ZAR" | "ZMW" | "ZWL", number>>, unknown, import("zod/v4/core").$ZodTypeInternals<Partial<Record<"AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BOV" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHE" | "CHF" | "CHW" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MXV" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STN" | "SVC" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "USN" | "UYI" | "UYU" | "UYW" | "UZS" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XAG" | "XAU" | "XBA" | "XBB" | "XBC" | "XBD" | "XCD" | "XDR" | "XOF" | "XPD" | "XPF" | "XPT" | "XSU" | "XTS" | "XUA" | "XXX" | "YER" | "ZAR" | "ZMW" | "ZWL", number>>, unknown>>;
|
|
9
10
|
}
|
|
10
11
|
export declare namespace Result {
|
|
11
12
|
function is(value: Result | any): value is Result;
|