@pax2pay/model-banking 0.1.382 → 0.1.384
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/Batch.ts +1 -2
- package/Settlement/index.ts +7 -0
- package/Warning/Settlement/MissingFile.ts +28 -0
- package/Warning/Settlement/NegativeAmount.ts +37 -0
- package/Warning/Settlement/UnknownEntry.ts +29 -0
- package/Warning/Settlement/index.ts +17 -0
- package/Warning/index.ts +4 -2
- package/dist/Settlement/Batch.d.ts +0 -1
- package/dist/Settlement/Batch.js +1 -2
- package/dist/Settlement/Batch.js.map +1 -1
- package/dist/Settlement/index.d.ts +3 -0
- package/dist/Settlement/index.js +7 -0
- package/dist/Settlement/index.js.map +1 -1
- package/dist/Warning/Settlement/MissingFile.d.ts +15 -0
- package/dist/Warning/Settlement/MissingFile.js +22 -0
- package/dist/Warning/Settlement/MissingFile.js.map +1 -0
- package/dist/Warning/Settlement/NegativeAmount.d.ts +15 -0
- package/dist/Warning/Settlement/NegativeAmount.js +27 -0
- package/dist/Warning/Settlement/NegativeAmount.js.map +1 -0
- package/dist/Warning/Settlement/UnknownEntry.d.ts +14 -0
- package/dist/Warning/Settlement/UnknownEntry.js +23 -0
- package/dist/Warning/Settlement/UnknownEntry.js.map +1 -0
- package/dist/Warning/Settlement/index.d.ts +11 -0
- package/dist/Warning/Settlement/index.js +12 -0
- package/dist/Warning/Settlement/index.js.map +1 -0
- package/dist/Warning/index.d.ts +4 -2
- package/dist/Warning/index.js +3 -1
- package/dist/Warning/index.js.map +1 -1
- package/package.json +1 -1
package/Settlement/Batch.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { isly } from "isly"
|
|
|
2
2
|
|
|
3
3
|
export type Batch = string
|
|
4
4
|
export namespace Batch {
|
|
5
|
-
export const
|
|
6
|
-
export const type = isly.string<Batch>(regexp)
|
|
5
|
+
export const type = isly.string<Batch>()
|
|
7
6
|
export const is = type.is
|
|
8
7
|
}
|
package/Settlement/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Amounts } from "../Amounts"
|
|
4
|
+
import { Settlement as SettlementWarning } from "../Warning/Settlement"
|
|
4
5
|
import { Amount as SettlementAmount } from "./Amount"
|
|
5
6
|
import { Batch as SettlementBatch } from "./Batch"
|
|
6
7
|
import { Creatable as SettlementCreatable } from "./Creatable"
|
|
@@ -17,6 +18,7 @@ export interface Settlement extends Settlement.Creatable {
|
|
|
17
18
|
created: isoly.DateTime
|
|
18
19
|
status: Status
|
|
19
20
|
entries: Settlement.Entry.Summary
|
|
21
|
+
warnings?: Settlement.Warning[]
|
|
20
22
|
}
|
|
21
23
|
export namespace Settlement {
|
|
22
24
|
export import Identifier = SettlementIdentifier
|
|
@@ -27,6 +29,7 @@ export namespace Settlement {
|
|
|
27
29
|
export import Creatable = SettlementCreatable
|
|
28
30
|
export import Entry = SettlementEntry
|
|
29
31
|
export import Batch = SettlementBatch
|
|
32
|
+
export import Warning = SettlementWarning
|
|
30
33
|
export function from(id: Settlement.Identifier, creatable: Settlement.Creatable, by: string): Settlement {
|
|
31
34
|
return {
|
|
32
35
|
id,
|
|
@@ -49,6 +52,9 @@ export namespace Settlement {
|
|
|
49
52
|
result.entries.failed ? result.entries.failed.count++ : (result.entries.failed = { count: 1 })
|
|
50
53
|
break
|
|
51
54
|
}
|
|
55
|
+
if (entry.type == "unknown") {
|
|
56
|
+
;(result.warnings ??= []).push(Warning.UnknownEntry.create(entry, settlement.id))
|
|
57
|
+
}
|
|
52
58
|
}
|
|
53
59
|
return result
|
|
54
60
|
}
|
|
@@ -99,6 +105,7 @@ export namespace Settlement {
|
|
|
99
105
|
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
100
106
|
status: Status.type,
|
|
101
107
|
entries: Settlement.Entry.Summary.type,
|
|
108
|
+
warnings: Settlement.Warning.type.array().optional(),
|
|
102
109
|
})
|
|
103
110
|
export const is = type.is
|
|
104
111
|
export const flaw = type.flaw
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
2
|
+
import { isly } from "isly"
|
|
3
|
+
import { Stack } from "../../Card/Stack"
|
|
4
|
+
import { Batch } from "../../Settlement/Batch"
|
|
5
|
+
import { Identifier } from "../../Settlement/Identifier"
|
|
6
|
+
import { Totals } from "../../Settlement/Totals"
|
|
7
|
+
import { Base } from "../Base"
|
|
8
|
+
|
|
9
|
+
export interface MissingFile extends Base {
|
|
10
|
+
type: "missing-file"
|
|
11
|
+
resource: Identifier
|
|
12
|
+
totals?: Totals
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export namespace MissingFile {
|
|
16
|
+
export const type = Base.type.extend<MissingFile>({
|
|
17
|
+
type: isly.string("missing-file"),
|
|
18
|
+
resource: Identifier.type,
|
|
19
|
+
totals: Totals.type.optional(),
|
|
20
|
+
})
|
|
21
|
+
export function create(date: isoly.Date, order: number, stack: Stack): MissingFile {
|
|
22
|
+
return {
|
|
23
|
+
type: "missing-file",
|
|
24
|
+
resource: Identifier.create(date, stack, order),
|
|
25
|
+
date: isoly.Date.now(),
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
2
|
+
import { isly } from "isly"
|
|
3
|
+
import { Identifier } from "../../Settlement/Identifier"
|
|
4
|
+
import { Total } from "../../Settlement/Total"
|
|
5
|
+
import { Totals } from "../../Settlement/Totals"
|
|
6
|
+
import { Base } from "../Base"
|
|
7
|
+
|
|
8
|
+
export interface NegativeAmount extends Base {
|
|
9
|
+
type: "negative-amount"
|
|
10
|
+
resource: Identifier
|
|
11
|
+
value: number
|
|
12
|
+
currency: isoly.Currency
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export namespace NegativeAmount {
|
|
16
|
+
export const type = Base.type.extend<NegativeAmount>({
|
|
17
|
+
type: isly.string("negative-amount"),
|
|
18
|
+
resource: Identifier.type,
|
|
19
|
+
value: isly.number(),
|
|
20
|
+
currency: isly.fromIs("currency", isoly.Currency.is),
|
|
21
|
+
})
|
|
22
|
+
export function create(resource: Identifier, totals: Totals): NegativeAmount[] {
|
|
23
|
+
const warnings: NegativeAmount[] = []
|
|
24
|
+
Object.entries(totals).forEach(
|
|
25
|
+
([currency, total]: [isoly.Currency, Total]) =>
|
|
26
|
+
(total.outcome?.net ?? 0) < 0 &&
|
|
27
|
+
warnings.push({
|
|
28
|
+
type: "negative-amount",
|
|
29
|
+
resource,
|
|
30
|
+
value: total.outcome!.net,
|
|
31
|
+
currency,
|
|
32
|
+
date: isoly.Date.now(),
|
|
33
|
+
})
|
|
34
|
+
)
|
|
35
|
+
return warnings
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cryptly } from "cryptly"
|
|
2
|
+
import { isoly } from "isoly"
|
|
3
|
+
import { isly } from "isly"
|
|
4
|
+
import { Authorization } from "../../Authorization"
|
|
5
|
+
import { Unknown } from "../../Settlement/Entry/Unknown"
|
|
6
|
+
import { Identifier } from "../../Settlement/Identifier"
|
|
7
|
+
import { Base } from "../Base"
|
|
8
|
+
|
|
9
|
+
export interface UnknownEntry extends Base {
|
|
10
|
+
type: "unknown-entry"
|
|
11
|
+
resource: Identifier
|
|
12
|
+
authorization?: Authorization["id"]
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export namespace UnknownEntry {
|
|
16
|
+
export const type = Base.type.extend<UnknownEntry>({
|
|
17
|
+
type: isly.string("unknown-entry"),
|
|
18
|
+
resource: Identifier.type,
|
|
19
|
+
authorization: isly.fromIs("Authorization.id", cryptly.Identifier.is).optional(),
|
|
20
|
+
})
|
|
21
|
+
export function create(entry: Unknown, resource: Identifier): UnknownEntry {
|
|
22
|
+
return {
|
|
23
|
+
type: "unknown-entry",
|
|
24
|
+
resource,
|
|
25
|
+
authorization: entry.authorization?.id,
|
|
26
|
+
date: isoly.Date.now(),
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isly } from "isly"
|
|
2
|
+
import { MissingFile as MissingFileWarning } from "./MissingFile"
|
|
3
|
+
import { NegativeAmount as NegativeAmountWarning } from "./NegativeAmount"
|
|
4
|
+
import { UnknownEntry as UnknownEntryWarning } from "./UnknownEntry"
|
|
5
|
+
|
|
6
|
+
export type Settlement = NegativeAmountWarning | MissingFileWarning | UnknownEntryWarning
|
|
7
|
+
|
|
8
|
+
export namespace Settlement {
|
|
9
|
+
export import NegativeAmount = NegativeAmountWarning
|
|
10
|
+
export import MissingFile = MissingFileWarning
|
|
11
|
+
export import UnknownEntry = UnknownEntryWarning
|
|
12
|
+
export const type = isly.union<Settlement, NegativeAmount, MissingFile, UnknownEntry>(
|
|
13
|
+
NegativeAmount.type,
|
|
14
|
+
MissingFile.type,
|
|
15
|
+
UnknownEntry.type
|
|
16
|
+
)
|
|
17
|
+
}
|
package/Warning/index.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
2
|
import { Base as WarningBase } from "./Base"
|
|
3
|
+
import { Settlement as WarningSettlement } from "./Settlement"
|
|
3
4
|
import { Snapshot as WarningSnapshot } from "./Snapshot"
|
|
4
5
|
|
|
5
|
-
export type Warning = Warning.Snapshot
|
|
6
|
+
export type Warning = Warning.Snapshot | Warning.Settlement
|
|
6
7
|
|
|
7
8
|
export namespace Warning {
|
|
8
9
|
export import Snapshot = WarningSnapshot
|
|
10
|
+
export import Settlement = WarningSettlement
|
|
9
11
|
export import Base = WarningBase
|
|
10
|
-
export const type = isly.union<Warning>(Snapshot.type)
|
|
12
|
+
export const type = isly.union<Warning, Snapshot, Settlement>(Snapshot.type, Settlement.type)
|
|
11
13
|
}
|
package/dist/Settlement/Batch.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
2
|
export var Batch;
|
|
3
3
|
(function (Batch) {
|
|
4
|
-
Batch.
|
|
5
|
-
Batch.type = isly.string(Batch.regexp);
|
|
4
|
+
Batch.type = isly.string();
|
|
6
5
|
Batch.is = Batch.type.is;
|
|
7
6
|
})(Batch || (Batch = {}));
|
|
8
7
|
//# sourceMappingURL=Batch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Batch.js","sourceRoot":"../","sources":["Settlement/Batch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,MAAM,KAAW,KAAK,
|
|
1
|
+
{"version":3,"file":"Batch.js","sourceRoot":"../","sources":["Settlement/Batch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,MAAM,KAAW,KAAK,CAGrB;AAHD,WAAiB,KAAK;IACR,UAAI,GAAG,IAAI,CAAC,MAAM,EAAS,CAAA;IAC3B,QAAE,GAAG,MAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAHgB,KAAK,KAAL,KAAK,QAGrB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { isly } from "isly";
|
|
3
3
|
import { Amounts } from "../Amounts";
|
|
4
|
+
import { Settlement as SettlementWarning } from "../Warning/Settlement";
|
|
4
5
|
import { Amount as SettlementAmount } from "./Amount";
|
|
5
6
|
import { Batch as SettlementBatch } from "./Batch";
|
|
6
7
|
import { Creatable as SettlementCreatable } from "./Creatable";
|
|
@@ -16,6 +17,7 @@ export interface Settlement extends Settlement.Creatable {
|
|
|
16
17
|
created: isoly.DateTime;
|
|
17
18
|
status: Status;
|
|
18
19
|
entries: Settlement.Entry.Summary;
|
|
20
|
+
warnings?: Settlement.Warning[];
|
|
19
21
|
}
|
|
20
22
|
export declare namespace Settlement {
|
|
21
23
|
export import Identifier = SettlementIdentifier;
|
|
@@ -26,6 +28,7 @@ export declare namespace Settlement {
|
|
|
26
28
|
export import Creatable = SettlementCreatable;
|
|
27
29
|
export import Entry = SettlementEntry;
|
|
28
30
|
export import Batch = SettlementBatch;
|
|
31
|
+
export import Warning = SettlementWarning;
|
|
29
32
|
export function from(id: Settlement.Identifier, creatable: Settlement.Creatable, by: string): Settlement;
|
|
30
33
|
export function compile(settlement: Settlement, entries: Settlement.Entry[]): Settlement;
|
|
31
34
|
type OldTotal = {
|
package/dist/Settlement/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { isly } from "isly";
|
|
3
|
+
import { Settlement as SettlementWarning } from "../Warning/Settlement";
|
|
3
4
|
import { Amount as SettlementAmount } from "./Amount";
|
|
4
5
|
import { Batch as SettlementBatch } from "./Batch";
|
|
5
6
|
import { Creatable as SettlementCreatable } from "./Creatable";
|
|
@@ -19,6 +20,7 @@ export var Settlement;
|
|
|
19
20
|
Settlement.Creatable = SettlementCreatable;
|
|
20
21
|
Settlement.Entry = SettlementEntry;
|
|
21
22
|
Settlement.Batch = SettlementBatch;
|
|
23
|
+
Settlement.Warning = SettlementWarning;
|
|
22
24
|
function from(id, creatable, by) {
|
|
23
25
|
return {
|
|
24
26
|
id,
|
|
@@ -42,6 +44,10 @@ export var Settlement;
|
|
|
42
44
|
result.entries.failed ? result.entries.failed.count++ : (result.entries.failed = { count: 1 });
|
|
43
45
|
break;
|
|
44
46
|
}
|
|
47
|
+
if (entry.type == "unknown") {
|
|
48
|
+
;
|
|
49
|
+
(result.warnings ??= []).push(Settlement.Warning.UnknownEntry.create(entry, settlement.id));
|
|
50
|
+
}
|
|
45
51
|
}
|
|
46
52
|
return result;
|
|
47
53
|
}
|
|
@@ -85,6 +91,7 @@ export var Settlement;
|
|
|
85
91
|
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
86
92
|
status: Status.type,
|
|
87
93
|
entries: Settlement.Entry.Summary.type,
|
|
94
|
+
warnings: Settlement.Warning.type.array().optional(),
|
|
88
95
|
});
|
|
89
96
|
Settlement.is = Settlement.type.is;
|
|
90
97
|
Settlement.flaw = Settlement.type.flaw;
|
|
@@ -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;AAE3B,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACrD,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,GAAG,IAAI,aAAa,EAAE,MAAM,OAAO,CAAA;AAC5C,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,UAAU,CAAA;
|
|
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;AAE3B,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACvE,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACrD,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,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AK,CAAA;YACb,CAAC,EAAE,EAAY,CAAC,CAAA;YAChB,MAAM,GAAG,EAAE,GAAG,iBAAiB,EAAE,MAAM,EAAE,CAAA;QAC1C,CAAC;aAAM,CAAC;YACP,MAAM,GAAG,UAAU,CAAA;QACpB,CAAC;QACD,OAAO,MAAM,CAAA;IACd,CAAC;IAhCe,qBAAU,aAgCzB,CAAA;IACY,eAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAa;QAC/D,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;QACxD,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzD,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI;QACtC,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;KACpD,CAAC,CAAA;IACW,aAAE,GAAG,WAAA,IAAI,CAAC,EAAE,CAAA;IACZ,eAAI,GAAG,WAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EAzFgB,UAAU,KAAV,UAAU,QAyF1B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import { isly } from "isly";
|
|
3
|
+
import { Stack } from "../../Card/Stack";
|
|
4
|
+
import { Identifier } from "../../Settlement/Identifier";
|
|
5
|
+
import { Totals } from "../../Settlement/Totals";
|
|
6
|
+
import { Base } from "../Base";
|
|
7
|
+
export interface MissingFile extends Base {
|
|
8
|
+
type: "missing-file";
|
|
9
|
+
resource: Identifier;
|
|
10
|
+
totals?: Totals;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace MissingFile {
|
|
13
|
+
const type: isly.object.ExtendableType<MissingFile>;
|
|
14
|
+
function create(date: isoly.Date, order: number, stack: Stack): MissingFile;
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import { isly } from "isly";
|
|
3
|
+
import { Identifier } from "../../Settlement/Identifier";
|
|
4
|
+
import { Totals } from "../../Settlement/Totals";
|
|
5
|
+
import { Base } from "../Base";
|
|
6
|
+
export var MissingFile;
|
|
7
|
+
(function (MissingFile) {
|
|
8
|
+
MissingFile.type = Base.type.extend({
|
|
9
|
+
type: isly.string("missing-file"),
|
|
10
|
+
resource: Identifier.type,
|
|
11
|
+
totals: Totals.type.optional(),
|
|
12
|
+
});
|
|
13
|
+
function create(date, order, stack) {
|
|
14
|
+
return {
|
|
15
|
+
type: "missing-file",
|
|
16
|
+
resource: Identifier.create(date, stack, order),
|
|
17
|
+
date: isoly.Date.now(),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
MissingFile.create = create;
|
|
21
|
+
})(MissingFile || (MissingFile = {}));
|
|
22
|
+
//# sourceMappingURL=MissingFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MissingFile.js","sourceRoot":"../","sources":["Warning/Settlement/MissingFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAQ9B,MAAM,KAAW,WAAW,CAa3B;AAbD,WAAiB,WAAW;IACd,gBAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAc;QACjD,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;QACjC,QAAQ,EAAE,UAAU,CAAC,IAAI;QACzB,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE;KAC9B,CAAC,CAAA;IACF,SAAgB,MAAM,CAAC,IAAgB,EAAE,KAAa,EAAE,KAAY;QACnE,OAAO;YACN,IAAI,EAAE,cAAc;YACpB,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC;YAC/C,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;SACtB,CAAA;IACF,CAAC;IANe,kBAAM,SAMrB,CAAA;AACF,CAAC,EAbgB,WAAW,KAAX,WAAW,QAa3B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import { isly } from "isly";
|
|
3
|
+
import { Identifier } from "../../Settlement/Identifier";
|
|
4
|
+
import { Totals } from "../../Settlement/Totals";
|
|
5
|
+
import { Base } from "../Base";
|
|
6
|
+
export interface NegativeAmount extends Base {
|
|
7
|
+
type: "negative-amount";
|
|
8
|
+
resource: Identifier;
|
|
9
|
+
value: number;
|
|
10
|
+
currency: isoly.Currency;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace NegativeAmount {
|
|
13
|
+
const type: isly.object.ExtendableType<NegativeAmount>;
|
|
14
|
+
function create(resource: Identifier, totals: Totals): NegativeAmount[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import { isly } from "isly";
|
|
3
|
+
import { Identifier } from "../../Settlement/Identifier";
|
|
4
|
+
import { Base } from "../Base";
|
|
5
|
+
export var NegativeAmount;
|
|
6
|
+
(function (NegativeAmount) {
|
|
7
|
+
NegativeAmount.type = Base.type.extend({
|
|
8
|
+
type: isly.string("negative-amount"),
|
|
9
|
+
resource: Identifier.type,
|
|
10
|
+
value: isly.number(),
|
|
11
|
+
currency: isly.fromIs("currency", isoly.Currency.is),
|
|
12
|
+
});
|
|
13
|
+
function create(resource, totals) {
|
|
14
|
+
const warnings = [];
|
|
15
|
+
Object.entries(totals).forEach(([currency, total]) => (total.outcome?.net ?? 0) < 0 &&
|
|
16
|
+
warnings.push({
|
|
17
|
+
type: "negative-amount",
|
|
18
|
+
resource,
|
|
19
|
+
value: total.outcome.net,
|
|
20
|
+
currency,
|
|
21
|
+
date: isoly.Date.now(),
|
|
22
|
+
}));
|
|
23
|
+
return warnings;
|
|
24
|
+
}
|
|
25
|
+
NegativeAmount.create = create;
|
|
26
|
+
})(NegativeAmount || (NegativeAmount = {}));
|
|
27
|
+
//# sourceMappingURL=NegativeAmount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NegativeAmount.js","sourceRoot":"../","sources":["Warning/Settlement/NegativeAmount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAGxD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAS9B,MAAM,KAAW,cAAc,CAsB9B;AAtBD,WAAiB,cAAc;IACjB,mBAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAiB;QACpD,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC;QACpC,QAAQ,EAAE,UAAU,CAAC,IAAI;QACzB,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;QACpB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;KACpD,CAAC,CAAA;IACF,SAAgB,MAAM,CAAC,QAAoB,EAAE,MAAc;QAC1D,MAAM,QAAQ,GAAqB,EAAE,CAAA;QACrC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAC7B,CAAC,CAAC,QAAQ,EAAE,KAAK,CAA0B,EAAE,EAAE,CAC9C,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC;YAC7B,QAAQ,CAAC,IAAI,CAAC;gBACb,IAAI,EAAE,iBAAiB;gBACvB,QAAQ;gBACR,KAAK,EAAE,KAAK,CAAC,OAAQ,CAAC,GAAG;gBACzB,QAAQ;gBACR,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;aACtB,CAAC,CACH,CAAA;QACD,OAAO,QAAQ,CAAA;IAChB,CAAC;IAde,qBAAM,SAcrB,CAAA;AACF,CAAC,EAtBgB,cAAc,KAAd,cAAc,QAsB9B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isly } from "isly";
|
|
2
|
+
import { Authorization } from "../../Authorization";
|
|
3
|
+
import { Unknown } from "../../Settlement/Entry/Unknown";
|
|
4
|
+
import { Identifier } from "../../Settlement/Identifier";
|
|
5
|
+
import { Base } from "../Base";
|
|
6
|
+
export interface UnknownEntry extends Base {
|
|
7
|
+
type: "unknown-entry";
|
|
8
|
+
resource: Identifier;
|
|
9
|
+
authorization?: Authorization["id"];
|
|
10
|
+
}
|
|
11
|
+
export declare namespace UnknownEntry {
|
|
12
|
+
const type: isly.object.ExtendableType<UnknownEntry>;
|
|
13
|
+
function create(entry: Unknown, resource: Identifier): UnknownEntry;
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cryptly } from "cryptly";
|
|
2
|
+
import { isoly } from "isoly";
|
|
3
|
+
import { isly } from "isly";
|
|
4
|
+
import { Identifier } from "../../Settlement/Identifier";
|
|
5
|
+
import { Base } from "../Base";
|
|
6
|
+
export var UnknownEntry;
|
|
7
|
+
(function (UnknownEntry) {
|
|
8
|
+
UnknownEntry.type = Base.type.extend({
|
|
9
|
+
type: isly.string("unknown-entry"),
|
|
10
|
+
resource: Identifier.type,
|
|
11
|
+
authorization: isly.fromIs("Authorization.id", cryptly.Identifier.is).optional(),
|
|
12
|
+
});
|
|
13
|
+
function create(entry, resource) {
|
|
14
|
+
return {
|
|
15
|
+
type: "unknown-entry",
|
|
16
|
+
resource,
|
|
17
|
+
authorization: entry.authorization?.id,
|
|
18
|
+
date: isoly.Date.now(),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
UnknownEntry.create = create;
|
|
22
|
+
})(UnknownEntry || (UnknownEntry = {}));
|
|
23
|
+
//# sourceMappingURL=UnknownEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnknownEntry.js","sourceRoot":"../","sources":["Warning/Settlement/UnknownEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAQ9B,MAAM,KAAW,YAAY,CAc5B;AAdD,WAAiB,YAAY;IACf,iBAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAe;QAClD,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;QAClC,QAAQ,EAAE,UAAU,CAAC,IAAI;QACzB,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;KAChF,CAAC,CAAA;IACF,SAAgB,MAAM,CAAC,KAAc,EAAE,QAAoB;QAC1D,OAAO;YACN,IAAI,EAAE,eAAe;YACrB,QAAQ;YACR,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE,EAAE;YACtC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;SACtB,CAAA;IACF,CAAC;IAPe,mBAAM,SAOrB,CAAA;AACF,CAAC,EAdgB,YAAY,KAAZ,YAAY,QAc5B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isly } from "isly";
|
|
2
|
+
import { MissingFile as MissingFileWarning } from "./MissingFile";
|
|
3
|
+
import { NegativeAmount as NegativeAmountWarning } from "./NegativeAmount";
|
|
4
|
+
import { UnknownEntry as UnknownEntryWarning } from "./UnknownEntry";
|
|
5
|
+
export type Settlement = NegativeAmountWarning | MissingFileWarning | UnknownEntryWarning;
|
|
6
|
+
export declare namespace Settlement {
|
|
7
|
+
export import NegativeAmount = NegativeAmountWarning;
|
|
8
|
+
export import MissingFile = MissingFileWarning;
|
|
9
|
+
export import UnknownEntry = UnknownEntryWarning;
|
|
10
|
+
const type: isly.Type<Settlement>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isly } from "isly";
|
|
2
|
+
import { MissingFile as MissingFileWarning } from "./MissingFile";
|
|
3
|
+
import { NegativeAmount as NegativeAmountWarning } from "./NegativeAmount";
|
|
4
|
+
import { UnknownEntry as UnknownEntryWarning } from "./UnknownEntry";
|
|
5
|
+
export var Settlement;
|
|
6
|
+
(function (Settlement) {
|
|
7
|
+
Settlement.NegativeAmount = NegativeAmountWarning;
|
|
8
|
+
Settlement.MissingFile = MissingFileWarning;
|
|
9
|
+
Settlement.UnknownEntry = UnknownEntryWarning;
|
|
10
|
+
Settlement.type = isly.union(Settlement.NegativeAmount.type, Settlement.MissingFile.type, Settlement.UnknownEntry.type);
|
|
11
|
+
})(Settlement || (Settlement = {}));
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Warning/Settlement/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAC1E,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAIpE,MAAM,KAAW,UAAU,CAS1B;AATD,WAAiB,UAAU;IACZ,yBAAc,GAAG,qBAAqB,CAAA;IACtC,sBAAW,GAAG,kBAAkB,CAAA;IAChC,uBAAY,GAAG,mBAAmB,CAAA;IACnC,eAAI,GAAG,IAAI,CAAC,KAAK,CAC7B,WAAA,cAAc,CAAC,IAAI,EACnB,WAAA,WAAW,CAAC,IAAI,EAChB,WAAA,YAAY,CAAC,IAAI,CACjB,CAAA;AACF,CAAC,EATgB,UAAU,KAAV,UAAU,QAS1B"}
|
package/dist/Warning/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
2
|
import { Base as WarningBase } from "./Base";
|
|
3
|
+
import { Settlement as WarningSettlement } from "./Settlement";
|
|
3
4
|
import { Snapshot as WarningSnapshot } from "./Snapshot";
|
|
4
|
-
export type Warning = Warning.Snapshot;
|
|
5
|
+
export type Warning = Warning.Snapshot | Warning.Settlement;
|
|
5
6
|
export declare namespace Warning {
|
|
6
7
|
export import Snapshot = WarningSnapshot;
|
|
8
|
+
export import Settlement = WarningSettlement;
|
|
7
9
|
export import Base = WarningBase;
|
|
8
|
-
const type: isly.Type<
|
|
10
|
+
const type: isly.Type<Warning>;
|
|
9
11
|
}
|
package/dist/Warning/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
2
|
import { Base as WarningBase } from "./Base";
|
|
3
|
+
import { Settlement as WarningSettlement } from "./Settlement";
|
|
3
4
|
import { Snapshot as WarningSnapshot } from "./Snapshot";
|
|
4
5
|
export var Warning;
|
|
5
6
|
(function (Warning) {
|
|
6
7
|
Warning.Snapshot = WarningSnapshot;
|
|
8
|
+
Warning.Settlement = WarningSettlement;
|
|
7
9
|
Warning.Base = WarningBase;
|
|
8
|
-
Warning.type = isly.union(Warning.Snapshot.type);
|
|
10
|
+
Warning.type = isly.union(Warning.Snapshot.type, Warning.Settlement.type);
|
|
9
11
|
})(Warning || (Warning = {}));
|
|
10
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Warning/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,YAAY,CAAA;AAIxD,MAAM,KAAW,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Warning/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAC9D,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,YAAY,CAAA;AAIxD,MAAM,KAAW,OAAO,CAKvB;AALD,WAAiB,OAAO;IACT,gBAAQ,GAAG,eAAe,CAAA;IAC1B,kBAAU,GAAG,iBAAiB,CAAA;IAC9B,YAAI,GAAG,WAAW,CAAA;IACnB,YAAI,GAAG,IAAI,CAAC,KAAK,CAAgC,QAAA,QAAQ,CAAC,IAAI,EAAE,QAAA,UAAU,CAAC,IAAI,CAAC,CAAA;AAC9F,CAAC,EALgB,OAAO,KAAP,OAAO,QAKvB"}
|