@pax2pay/model-banking 0.1.457 → 0.1.458
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.
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { gracely } from "gracely"
|
|
2
2
|
import { isoly } from "isoly"
|
|
3
|
-
import { Card } from "../../Card"
|
|
4
|
-
import { Rail } from "../../Rail"
|
|
5
3
|
import { Transaction } from "../../Transaction"
|
|
6
4
|
import type { Entry } from "."
|
|
7
5
|
import { Creatable } from "./Creatable"
|
|
8
6
|
|
|
9
7
|
export function fromCreatable(
|
|
10
8
|
creatable: Creatable,
|
|
11
|
-
transaction: Transaction.CardTransaction | gracely.Error | string
|
|
12
|
-
card?: Card
|
|
9
|
+
transaction: Transaction.CardTransaction | gracely.Error | string
|
|
13
10
|
): Entry {
|
|
14
11
|
let result: Entry
|
|
15
12
|
const reasons: string[] = []
|
|
@@ -24,14 +21,12 @@ export function fromCreatable(
|
|
|
24
21
|
reasons.push(`Transaction ${transaction.id} on account ${transaction.accountId} unable to be finalized.`)
|
|
25
22
|
if (reasons.length > 0)
|
|
26
23
|
result = { status: "failed", reason: reasons.join("\n"), ...creatable, created }
|
|
27
|
-
else if (!card)
|
|
28
|
-
result = { status: "failed", reason: "Missing card", ...creatable, created }
|
|
29
24
|
else
|
|
30
25
|
result = {
|
|
31
26
|
status: "succeeded",
|
|
32
27
|
...(creatable as Creatable.Known),
|
|
33
28
|
created,
|
|
34
|
-
card:
|
|
29
|
+
card: (transaction as Transaction.CardTransaction).account,
|
|
35
30
|
transaction: {
|
|
36
31
|
id: (transaction as Transaction.CardTransaction).id,
|
|
37
32
|
posted: (transaction as Transaction.CardTransaction).posted,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { gracely } from "gracely";
|
|
2
|
-
import { Card } from "../../Card";
|
|
3
2
|
import { Transaction } from "../../Transaction";
|
|
4
3
|
import type { Entry } from ".";
|
|
5
4
|
import { Creatable } from "./Creatable";
|
|
6
|
-
export declare function fromCreatable(creatable: Creatable, transaction: Transaction.CardTransaction | gracely.Error | string
|
|
5
|
+
export declare function fromCreatable(creatable: Creatable, transaction: Transaction.CardTransaction | gracely.Error | string): Entry;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { gracely } from "gracely";
|
|
2
2
|
import { isoly } from "isoly";
|
|
3
|
-
|
|
4
|
-
export function fromCreatable(creatable, transaction, card) {
|
|
3
|
+
export function fromCreatable(creatable, transaction) {
|
|
5
4
|
let result;
|
|
6
5
|
const reasons = [];
|
|
7
6
|
const created = isoly.DateTime.now();
|
|
@@ -15,14 +14,12 @@ export function fromCreatable(creatable, transaction, card) {
|
|
|
15
14
|
reasons.push(`Transaction ${transaction.id} on account ${transaction.accountId} unable to be finalized.`);
|
|
16
15
|
if (reasons.length > 0)
|
|
17
16
|
result = { status: "failed", reason: reasons.join("\n"), ...creatable, created };
|
|
18
|
-
else if (!card)
|
|
19
|
-
result = { status: "failed", reason: "Missing card", ...creatable, created };
|
|
20
17
|
else
|
|
21
18
|
result = {
|
|
22
19
|
status: "succeeded",
|
|
23
20
|
...creatable,
|
|
24
21
|
created,
|
|
25
|
-
card:
|
|
22
|
+
card: transaction.account,
|
|
26
23
|
transaction: {
|
|
27
24
|
id: transaction.id,
|
|
28
25
|
posted: transaction.posted,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fromCreatable.js","sourceRoot":"../","sources":["Settlement/Entry/fromCreatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"fromCreatable.js","sourceRoot":"../","sources":["Settlement/Entry/fromCreatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAK7B,MAAM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