@pax2pay/model-banking 0.1.108 → 0.1.109
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/Settlement/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Entry as SettlementEntry } from "./Entry"
|
|
|
4
4
|
|
|
5
5
|
export type Settlement = Settlement.Succeeded | Settlement.Failed | Settlement.Ongoing
|
|
6
6
|
export namespace Settlement {
|
|
7
|
-
export type Summary = Omit<Settlement.Succeeded, "entries"> | Settlement.Failed | Settlement.Ongoing
|
|
7
|
+
export type Summary = Omit<Settlement.Succeeded, "entries"> | Settlement.Failed | Omit<Settlement.Ongoing, "entries">
|
|
8
8
|
export interface Base {
|
|
9
9
|
id: string
|
|
10
10
|
created: [string, isoly.DateTime]
|
|
@@ -13,11 +13,11 @@ export namespace Settlement {
|
|
|
13
13
|
status: string
|
|
14
14
|
}
|
|
15
15
|
export interface Succeeded extends Base {
|
|
16
|
-
|
|
16
|
+
status: "succeeded"
|
|
17
17
|
amount: Partial<Record<isoly.Currency, number>>
|
|
18
18
|
fee: Partial<Record<isoly.Currency, number>>
|
|
19
19
|
entries: SettlementEntry[]
|
|
20
|
-
|
|
20
|
+
settled: { user: string; created: isoly.DateTime; transactions: Record<string, [isoly.Currency, number]> }
|
|
21
21
|
}
|
|
22
22
|
export interface Failed extends Base {
|
|
23
23
|
status: "failed"
|
|
@@ -25,6 +25,9 @@ export namespace Settlement {
|
|
|
25
25
|
}
|
|
26
26
|
export interface Ongoing extends Base {
|
|
27
27
|
status: "ongoing"
|
|
28
|
+
amount: Partial<Record<isoly.Currency, number>>
|
|
29
|
+
fee: Partial<Record<isoly.Currency, number>>
|
|
30
|
+
entries: SettlementEntry[]
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
export namespace Succeeded {
|
|
@@ -33,16 +36,18 @@ export namespace Settlement {
|
|
|
33
36
|
created: isly.tuple(isly.string(), isly.fromIs("Settlement.created", isoly.DateTime.is)),
|
|
34
37
|
regarding: isly.fromIs("Settlement.regarding", isoly.Date.is),
|
|
35
38
|
configuration: isly.string(),
|
|
36
|
-
settled: isly
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
settled: isly.object<{
|
|
40
|
+
user: string
|
|
41
|
+
created: isoly.DateTime
|
|
42
|
+
transactions: Record<string, [isoly.Currency, number]>
|
|
43
|
+
}>({
|
|
44
|
+
user: isly.string(),
|
|
45
|
+
created: isly.fromIs("Settlement.settled.created", isoly.DateTime.is),
|
|
46
|
+
transactions: isly.record(
|
|
47
|
+
isly.string(),
|
|
48
|
+
isly.tuple(isly.fromIs("Settlement.settled.transactions.currency", isoly.Currency.is), isly.number())
|
|
49
|
+
),
|
|
50
|
+
}),
|
|
46
51
|
amount: isly.record(isly.fromIs("Settlement.entries.amount", isoly.Currency.is), isly.number()),
|
|
47
52
|
fee: isly.record(isly.fromIs("Settlement.entries.fee", isoly.Currency.is), isly.number()),
|
|
48
53
|
entries: SettlementEntry.type.array(),
|
|
@@ -67,6 +72,9 @@ export namespace Settlement {
|
|
|
67
72
|
created: isly.tuple(isly.string(), isly.fromIs("Settlement.created", isoly.DateTime.is)),
|
|
68
73
|
regarding: isly.fromIs("Settlement.regarding", isoly.Date.is),
|
|
69
74
|
configuration: isly.string(),
|
|
75
|
+
amount: isly.record(isly.fromIs("Settlement.entries.amount", isoly.Currency.is), isly.number()),
|
|
76
|
+
fee: isly.record(isly.fromIs("Settlement.entries.fee", isoly.Currency.is), isly.number()),
|
|
77
|
+
entries: SettlementEntry.type.array(),
|
|
70
78
|
status: isly.string("ongoing"),
|
|
71
79
|
})
|
|
72
80
|
export const is = type.is
|
|
@@ -3,7 +3,7 @@ import { isly } from "isly";
|
|
|
3
3
|
import { Entry as SettlementEntry } from "./Entry";
|
|
4
4
|
export type Settlement = Settlement.Succeeded | Settlement.Failed | Settlement.Ongoing;
|
|
5
5
|
export declare namespace Settlement {
|
|
6
|
-
type Summary = Omit<Settlement.Succeeded, "entries"> | Settlement.Failed | Settlement.Ongoing
|
|
6
|
+
type Summary = Omit<Settlement.Succeeded, "entries"> | Settlement.Failed | Omit<Settlement.Ongoing, "entries">;
|
|
7
7
|
interface Base {
|
|
8
8
|
id: string;
|
|
9
9
|
created: [string, isoly.DateTime];
|
|
@@ -12,15 +12,15 @@ export declare namespace Settlement {
|
|
|
12
12
|
status: string;
|
|
13
13
|
}
|
|
14
14
|
interface Succeeded extends Base {
|
|
15
|
-
|
|
15
|
+
status: "succeeded";
|
|
16
|
+
amount: Partial<Record<isoly.Currency, number>>;
|
|
17
|
+
fee: Partial<Record<isoly.Currency, number>>;
|
|
18
|
+
entries: SettlementEntry[];
|
|
19
|
+
settled: {
|
|
16
20
|
user: string;
|
|
17
21
|
created: isoly.DateTime;
|
|
18
22
|
transactions: Record<string, [isoly.Currency, number]>;
|
|
19
23
|
};
|
|
20
|
-
amount: Partial<Record<isoly.Currency, number>>;
|
|
21
|
-
fee: Partial<Record<isoly.Currency, number>>;
|
|
22
|
-
entries: SettlementEntry[];
|
|
23
|
-
status: "succeeded";
|
|
24
24
|
}
|
|
25
25
|
interface Failed extends Base {
|
|
26
26
|
status: "failed";
|
|
@@ -28,6 +28,9 @@ export declare namespace Settlement {
|
|
|
28
28
|
}
|
|
29
29
|
interface Ongoing extends Base {
|
|
30
30
|
status: "ongoing";
|
|
31
|
+
amount: Partial<Record<isoly.Currency, number>>;
|
|
32
|
+
fee: Partial<Record<isoly.Currency, number>>;
|
|
33
|
+
entries: SettlementEntry[];
|
|
31
34
|
}
|
|
32
35
|
namespace Succeeded {
|
|
33
36
|
const type: isly.object.ExtendableType<Succeeded>;
|
package/dist/Settlement/index.js
CHANGED
|
@@ -10,13 +10,11 @@ export var Settlement;
|
|
|
10
10
|
created: isly.tuple(isly.string(), isly.fromIs("Settlement.created", isoly.DateTime.is)),
|
|
11
11
|
regarding: isly.fromIs("Settlement.regarding", isoly.Date.is),
|
|
12
12
|
configuration: isly.string(),
|
|
13
|
-
settled: isly
|
|
14
|
-
.object({
|
|
13
|
+
settled: isly.object({
|
|
15
14
|
user: isly.string(),
|
|
16
15
|
created: isly.fromIs("Settlement.settled.created", isoly.DateTime.is),
|
|
17
16
|
transactions: isly.record(isly.string(), isly.tuple(isly.fromIs("Settlement.settled.transactions.currency", isoly.Currency.is), isly.number())),
|
|
18
|
-
})
|
|
19
|
-
.optional(),
|
|
17
|
+
}),
|
|
20
18
|
amount: isly.record(isly.fromIs("Settlement.entries.amount", isoly.Currency.is), isly.number()),
|
|
21
19
|
fee: isly.record(isly.fromIs("Settlement.entries.fee", isoly.Currency.is), isly.number()),
|
|
22
20
|
entries: SettlementEntry.type.array(),
|
|
@@ -43,6 +41,9 @@ export var Settlement;
|
|
|
43
41
|
created: isly.tuple(isly.string(), isly.fromIs("Settlement.created", isoly.DateTime.is)),
|
|
44
42
|
regarding: isly.fromIs("Settlement.regarding", isoly.Date.is),
|
|
45
43
|
configuration: isly.string(),
|
|
44
|
+
amount: isly.record(isly.fromIs("Settlement.entries.amount", isoly.Currency.is), isly.number()),
|
|
45
|
+
fee: isly.record(isly.fromIs("Settlement.entries.fee", isoly.Currency.is), isly.number()),
|
|
46
|
+
entries: SettlementEntry.type.array(),
|
|
46
47
|
status: isly.string("ongoing"),
|
|
47
48
|
});
|
|
48
49
|
Ongoing.is = Ongoing.type.is;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Settlement/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,SAAS,CAAA;AAGlD,MAAM,KAAW,UAAU,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["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