@pax2pay/model-banking 0.1.202 → 0.1.204
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/Operation/Creatable.ts +5 -3
- package/Settlement/Total.ts +11 -0
- package/dist/Operation/Creatable.d.ts +1 -1
- package/dist/Operation/Creatable.js +5 -3
- package/dist/Operation/Creatable.js.map +1 -1
- package/dist/Settlement/Total.d.ts +1 -0
- package/dist/Settlement/Total.js +5 -0
- package/dist/Settlement/Total.js.map +1 -1
- package/package.json +1 -1
package/Operation/Creatable.ts
CHANGED
|
@@ -12,16 +12,18 @@ export interface Creatable {
|
|
|
12
12
|
|
|
13
13
|
export namespace Creatable {
|
|
14
14
|
export const types = [
|
|
15
|
-
"authorization",
|
|
16
|
-
"settlement",
|
|
17
15
|
"incoming",
|
|
18
16
|
"finalizeIncoming",
|
|
19
17
|
"outgoing",
|
|
20
18
|
"finalizeOutgoing",
|
|
21
|
-
"
|
|
19
|
+
"authorization",
|
|
20
|
+
"capture",
|
|
21
|
+
"refund",
|
|
22
|
+
"cancel",
|
|
22
23
|
"remove",
|
|
23
24
|
"legacy",
|
|
24
25
|
"collect",
|
|
26
|
+
"deposit",
|
|
25
27
|
] as const
|
|
26
28
|
export type Type = typeof types[number]
|
|
27
29
|
export const type = isly.object<Creatable>({
|
package/Settlement/Total.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
1
2
|
import { isly } from "isly"
|
|
2
3
|
import { Amounts } from "../Amounts"
|
|
3
4
|
import { Fee } from "./Fee"
|
|
@@ -14,6 +15,16 @@ export namespace Total {
|
|
|
14
15
|
export function add(addendee: Total, addend: Total): Total {
|
|
15
16
|
return { amount: Amounts.add(addendee.amount, addend.amount), fee: Fee.add(addendee.fee, addend.fee) }
|
|
16
17
|
}
|
|
18
|
+
export function compare(expected: Total, outcome: Total): boolean {
|
|
19
|
+
return (
|
|
20
|
+
([...new Set([...Object.keys(expected.amount), ...Object.keys(outcome.amount)])] as isoly.Currency[]).every(
|
|
21
|
+
currency => expected.amount[currency] == outcome.amount[currency]
|
|
22
|
+
) &&
|
|
23
|
+
([...new Set([...Object.keys(expected.fee.other), ...Object.keys(outcome.fee.other)])] as isoly.Currency[]).every(
|
|
24
|
+
currency => expected.fee.other[currency] == outcome.fee.other[currency]
|
|
25
|
+
)
|
|
26
|
+
)
|
|
27
|
+
}
|
|
17
28
|
export const type = isly.object<Total>({ amount: Amounts.type, fee: Fee.type })
|
|
18
29
|
export const is = type.is
|
|
19
30
|
export const flaw = type.flaw
|
|
@@ -9,7 +9,7 @@ export interface Creatable {
|
|
|
9
9
|
type: Creatable.Type;
|
|
10
10
|
}
|
|
11
11
|
export declare namespace Creatable {
|
|
12
|
-
const types: readonly ["
|
|
12
|
+
const types: readonly ["incoming", "finalizeIncoming", "outgoing", "finalizeOutgoing", "authorization", "capture", "refund", "cancel", "remove", "legacy", "collect", "deposit"];
|
|
13
13
|
type Type = typeof types[number];
|
|
14
14
|
const type: isly.object.ExtendableType<Creatable>;
|
|
15
15
|
const is: isly.Type.IsFunction<Creatable>;
|
|
@@ -5,16 +5,18 @@ import { Changes } from "./Changes";
|
|
|
5
5
|
export var Creatable;
|
|
6
6
|
(function (Creatable) {
|
|
7
7
|
Creatable.types = [
|
|
8
|
-
"authorization",
|
|
9
|
-
"settlement",
|
|
10
8
|
"incoming",
|
|
11
9
|
"finalizeIncoming",
|
|
12
10
|
"outgoing",
|
|
13
11
|
"finalizeOutgoing",
|
|
14
|
-
"
|
|
12
|
+
"authorization",
|
|
13
|
+
"capture",
|
|
14
|
+
"refund",
|
|
15
|
+
"cancel",
|
|
15
16
|
"remove",
|
|
16
17
|
"legacy",
|
|
17
18
|
"collect",
|
|
19
|
+
"deposit",
|
|
18
20
|
];
|
|
19
21
|
Creatable.type = isly.object({
|
|
20
22
|
account: isly.fromIs("cryptly.Identifier", cryptly.Identifier.is),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Operation/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AASnC,MAAM,KAAW,SAAS,
|
|
1
|
+
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Operation/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AASnC,MAAM,KAAW,SAAS,CAwBzB;AAxBD,WAAiB,SAAS;IACZ,eAAK,GAAG;QACpB,UAAU;QACV,kBAAkB;QAClB,UAAU;QACV,kBAAkB;QAClB,eAAe;QACf,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,SAAS;QACT,SAAS;KACA,CAAA;IAEG,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;QAC1C,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACjE,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1D,OAAO,EAAE,OAAO,CAAC,IAAI;QACrB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,UAAA,KAAK,CAAC;KACxB,CAAC,CAAA;IACW,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;IACZ,cAAI,GAAG,UAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EAxBgB,SAAS,KAAT,SAAS,QAwBzB"}
|
|
@@ -8,6 +8,7 @@ export type Total = {
|
|
|
8
8
|
export declare namespace Total {
|
|
9
9
|
function initiate(partial?: Partial<Total>): Total;
|
|
10
10
|
function add(addendee: Total, addend: Total): Total;
|
|
11
|
+
function compare(expected: Total, outcome: Total): boolean;
|
|
11
12
|
const type: isly.object.ExtendableType<Total>;
|
|
12
13
|
const is: isly.Type.IsFunction<Total>;
|
|
13
14
|
const flaw: isly.Type.FlawFunction;
|
package/dist/Settlement/Total.js
CHANGED
|
@@ -11,6 +11,11 @@ export var Total;
|
|
|
11
11
|
return { amount: Amounts.add(addendee.amount, addend.amount), fee: Fee.add(addendee.fee, addend.fee) };
|
|
12
12
|
}
|
|
13
13
|
Total.add = add;
|
|
14
|
+
function compare(expected, outcome) {
|
|
15
|
+
return ([...new Set([...Object.keys(expected.amount), ...Object.keys(outcome.amount)])].every(currency => expected.amount[currency] == outcome.amount[currency]) &&
|
|
16
|
+
[...new Set([...Object.keys(expected.fee.other), ...Object.keys(outcome.fee.other)])].every(currency => expected.fee.other[currency] == outcome.fee.other[currency]));
|
|
17
|
+
}
|
|
18
|
+
Total.compare = compare;
|
|
14
19
|
Total.type = isly.object({ amount: Amounts.type, fee: Fee.type });
|
|
15
20
|
Total.is = Total.type.is;
|
|
16
21
|
Total.flaw = Total.type.flaw;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Total.js","sourceRoot":"../","sources":["Settlement/Total.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Total.js","sourceRoot":"../","sources":["Settlement/Total.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAO3B,MAAM,KAAW,KAAK,CAoBrB;AApBD,WAAiB,KAAK;IACrB,SAAgB,QAA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