@pax2pay/model-banking 0.1.263 → 0.1.264
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/Changes.ts
CHANGED
|
@@ -6,21 +6,11 @@ import { Counterbalances } from "../CounterBalances"
|
|
|
6
6
|
import { Change } from "./Change"
|
|
7
7
|
|
|
8
8
|
// TODO: remove old counterbalances
|
|
9
|
-
export type Changes = Partial<Record<Balances.Balance.Entry, Change>> &
|
|
10
|
-
Record<Counterbalances.Counterbalance.Entry.Settlement | Changes.Entry.Counterbalance, Change>
|
|
9
|
+
export type Changes = Partial<Record<Balances.Balance.Entry, Change>> & Record<Changes.Entry.Counterbalance, Change>
|
|
11
10
|
|
|
12
11
|
export namespace Changes {
|
|
13
12
|
export namespace Entry {
|
|
14
13
|
export type Counterbalance = `${Counterbalance2.Link}-${isoly.DateTime}`
|
|
15
|
-
export const Counterbalance = isly.fromIs<Counterbalance>(
|
|
16
|
-
"Changes.Entry.Counterbalance",
|
|
17
|
-
(value: any | Counterbalance) => {
|
|
18
|
-
const result = !value ? false : typeof value == "string" && value.split("-")
|
|
19
|
-
return (
|
|
20
|
-
result && Counterbalance2.Link.is(`${result[0]}-${result[1]}`) && isoly.DateTime.is(result.slice(2).join("-"))
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
)
|
|
24
14
|
export function split(counterbalance: Counterbalance): [Counterbalance2.Link, isoly.DateTime] {
|
|
25
15
|
const split = counterbalance.split("-")
|
|
26
16
|
const [supplier, account, hour] = [split[0], split[1], split.slice(2).join("-")]
|
|
@@ -28,14 +18,7 @@ export namespace Changes {
|
|
|
28
18
|
}
|
|
29
19
|
}
|
|
30
20
|
export type Entry = Balances.Balance.Entry | Entry.Counterbalance | Counterbalances.Counterbalance.Entry.Settlement
|
|
31
|
-
export const type = isly.record<Changes>(
|
|
32
|
-
isly.union<Entry, Balances.Balance.Entry, Entry.Counterbalance, Counterbalances.Counterbalance.Entry>(
|
|
33
|
-
Balances.Balance.Entry.type,
|
|
34
|
-
Entry.Counterbalance,
|
|
35
|
-
Counterbalances.Counterbalance.Entry.type
|
|
36
|
-
),
|
|
37
|
-
Change.type
|
|
38
|
-
)
|
|
21
|
+
export const type = isly.record<Changes>(isly.string(), Change.type)
|
|
39
22
|
export const is = type.is
|
|
40
23
|
export const flaw = type.flaw
|
|
41
24
|
}
|
|
@@ -4,11 +4,10 @@ import { Balances } from "../Balances";
|
|
|
4
4
|
import { Counterbalance2 } from "../Counterbalance2";
|
|
5
5
|
import { Counterbalances } from "../CounterBalances";
|
|
6
6
|
import { Change } from "./Change";
|
|
7
|
-
export type Changes = Partial<Record<Balances.Balance.Entry, Change>> & Record<
|
|
7
|
+
export type Changes = Partial<Record<Balances.Balance.Entry, Change>> & Record<Changes.Entry.Counterbalance, Change>;
|
|
8
8
|
export declare namespace Changes {
|
|
9
9
|
namespace Entry {
|
|
10
10
|
type Counterbalance = `${Counterbalance2.Link}-${isoly.DateTime}`;
|
|
11
|
-
const Counterbalance: isly.Type<`${string}-${string}`>;
|
|
12
11
|
function split(counterbalance: Counterbalance): [Counterbalance2.Link, isoly.DateTime];
|
|
13
12
|
}
|
|
14
13
|
type Entry = Balances.Balance.Entry | Entry.Counterbalance | Counterbalances.Counterbalance.Entry.Settlement;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import { isoly } from "isoly";
|
|
2
1
|
import { isly } from "isly";
|
|
3
|
-
import { Balances } from "../Balances";
|
|
4
|
-
import { Counterbalance2 } from "../Counterbalance2";
|
|
5
|
-
import { Counterbalances } from "../CounterBalances";
|
|
6
2
|
import { Change } from "./Change";
|
|
7
3
|
export var Changes;
|
|
8
4
|
(function (Changes) {
|
|
9
5
|
let Entry;
|
|
10
6
|
(function (Entry) {
|
|
11
|
-
Entry.Counterbalance = isly.fromIs("Changes.Entry.Counterbalance", (value) => {
|
|
12
|
-
const result = !value ? false : typeof value == "string" && value.split("-");
|
|
13
|
-
return (result && Counterbalance2.Link.is(`${result[0]}-${result[1]}`) && isoly.DateTime.is(result.slice(2).join("-")));
|
|
14
|
-
});
|
|
15
7
|
function split(counterbalance) {
|
|
16
8
|
const split = counterbalance.split("-");
|
|
17
9
|
const [supplier, account, hour] = [split[0], split[1], split.slice(2).join("-")];
|
|
@@ -19,7 +11,7 @@ export var Changes;
|
|
|
19
11
|
}
|
|
20
12
|
Entry.split = split;
|
|
21
13
|
})(Entry = Changes.Entry || (Changes.Entry = {}));
|
|
22
|
-
Changes.type = isly.record(isly.
|
|
14
|
+
Changes.type = isly.record(isly.string(), Change.type);
|
|
23
15
|
Changes.is = Changes.type.is;
|
|
24
16
|
Changes.flaw = Changes.type.flaw;
|
|
25
17
|
})(Changes || (Changes = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Changes.js","sourceRoot":"../","sources":["Operation/Changes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Changes.js","sourceRoot":"../","sources":["Operation/Changes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAKjC,MAAM,KAAW,OAAO,CAavB;AAbD,WAAiB,OAAO;IACvB,IAAiB,KAAK,CAOrB;IAPD,WAAiB,KAAK;QAErB,SAAgB,KAAK,CAAC,cAA8B;YACnD,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YACvC,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;YAChF,OAAO,CAAC,GAAG,QAAQ,IAAI,OAAO,EAA0B,EAAE,IAAI,CAAC,CAAA;QAChE,CAAC;QAJe,WAAK,QAIpB,CAAA;IACF,CAAC,EAPgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAOrB;IAEY,YAAI,GAAG,IAAI,CAAC,MAAM,CAAU,IAAI,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;IACvD,UAAE,GAAG,QAAA,IAAI,CAAC,EAAE,CAAA;IACZ,YAAI,GAAG,QAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EAbgB,OAAO,KAAP,OAAO,QAavB"}
|