@pax2pay/model-banking 0.1.470 → 0.1.471
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/Rule/State/Account.ts +4 -2
- package/Rule/State/Transaction.ts +1 -1
- package/Rule/State/index.ts +3 -1
- package/Transaction/Creatable.ts +3 -0
- package/dist/Rule/State/Account.d.ts +3 -1
- package/dist/Rule/State/Account.js +2 -2
- package/dist/Rule/State/Account.js.map +1 -1
- package/dist/Rule/State/Transaction.d.ts +1 -1
- package/dist/Rule/State/index.d.ts +2 -1
- package/dist/Rule/State/index.js +2 -2
- package/dist/Rule/State/index.js.map +1 -1
- package/dist/Transaction/Creatable.d.ts +2 -0
- package/dist/Transaction/Creatable.js +2 -0
- package/dist/Transaction/Creatable.js.map +1 -1
- package/package.json +1 -1
package/Rule/State/Account.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Account as ModelAccount } from "../../Account"
|
|
2
|
+
import { Rail } from "../../Rail"
|
|
2
3
|
|
|
3
4
|
export interface Account extends ModelAccount {
|
|
5
|
+
address: Rail.Address
|
|
4
6
|
transactions: Account.Transactions
|
|
5
7
|
days: Account.Days
|
|
6
8
|
}
|
|
@@ -24,7 +26,7 @@ export namespace Account {
|
|
|
24
26
|
outgoing: { today: Today }
|
|
25
27
|
card: { today: Today }
|
|
26
28
|
}
|
|
27
|
-
export function from(account: ModelAccount, transactions: Transactions, days: Days): Account {
|
|
28
|
-
return { ...account, transactions, days }
|
|
29
|
+
export function from(account: ModelAccount, address: Rail.Address, transactions: Transactions, days: Days): Account {
|
|
30
|
+
return { ...account, address, transactions, days }
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -2,7 +2,7 @@ import { isoly } from "isoly"
|
|
|
2
2
|
import { Transaction as ModelTransaction } from "../../Transaction"
|
|
3
3
|
import type { Rule } from "../index"
|
|
4
4
|
|
|
5
|
-
export interface Transaction extends ModelTransaction.Creatable {
|
|
5
|
+
export interface Transaction extends ModelTransaction.Creatable.Resolved {
|
|
6
6
|
kind: Rule.Base.Kind
|
|
7
7
|
stage: "finalize" | "initiate"
|
|
8
8
|
amount: number
|
package/Rule/State/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
2
|
import { Account as ModelAccount } from "../../Account"
|
|
3
|
+
import { Rail } from "../../Rail"
|
|
3
4
|
import type { Transaction as ModelTransaction } from "../../Transaction"
|
|
4
5
|
import type { Rule } from "../index"
|
|
5
6
|
import { Account as StateAccount } from "./Account"
|
|
@@ -40,6 +41,7 @@ export namespace State {
|
|
|
40
41
|
export function from(
|
|
41
42
|
data: Data,
|
|
42
43
|
account: ModelAccount,
|
|
44
|
+
address: Rail.Address,
|
|
43
45
|
transactions: Account.Transactions,
|
|
44
46
|
days: Account.Days,
|
|
45
47
|
transaction: ModelTransaction.Creatable.Resolved | ModelTransaction,
|
|
@@ -51,7 +53,7 @@ export namespace State {
|
|
|
51
53
|
): State {
|
|
52
54
|
return {
|
|
53
55
|
data,
|
|
54
|
-
account: Account.from(account, transactions, days),
|
|
56
|
+
account: Account.from(account, address, transactions, days),
|
|
55
57
|
transaction: Transaction.from(account.name, transaction, kind, stage),
|
|
56
58
|
authorization,
|
|
57
59
|
card,
|
package/Transaction/Creatable.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Rail } from "../Rail"
|
|
4
|
+
import { Exchange } from "./Exchange"
|
|
4
5
|
|
|
5
6
|
export interface Creatable {
|
|
6
7
|
counterpart: string | Rail.Address
|
|
7
8
|
currency: isoly.Currency
|
|
8
9
|
amount: number
|
|
9
10
|
description: string
|
|
11
|
+
exchange?: Exchange
|
|
10
12
|
}
|
|
11
13
|
export namespace Creatable {
|
|
12
14
|
export type Resolved = Creatable & { counterpart: Rail.Address }
|
|
@@ -15,5 +17,6 @@ export namespace Creatable {
|
|
|
15
17
|
currency: isly.fromIs("isoly.Currency", isoly.Currency.is),
|
|
16
18
|
amount: isly.number(),
|
|
17
19
|
description: isly.string(),
|
|
20
|
+
exchange: Exchange.type.optional(),
|
|
18
21
|
})
|
|
19
22
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Account as ModelAccount } from "../../Account";
|
|
2
|
+
import { Rail } from "../../Rail";
|
|
2
3
|
export interface Account extends ModelAccount {
|
|
4
|
+
address: Rail.Address;
|
|
3
5
|
transactions: Account.Transactions;
|
|
4
6
|
days: Account.Days;
|
|
5
7
|
}
|
|
@@ -28,6 +30,6 @@ export declare namespace Account {
|
|
|
28
30
|
today: Today;
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
|
-
export function from(account: ModelAccount, transactions: Transactions, days: Days): Account;
|
|
33
|
+
export function from(account: ModelAccount, address: Rail.Address, transactions: Transactions, days: Days): Account;
|
|
32
34
|
export {};
|
|
33
35
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export var Account;
|
|
2
2
|
(function (Account) {
|
|
3
|
-
function from(account, transactions, days) {
|
|
4
|
-
return { ...account, transactions, days };
|
|
3
|
+
function from(account, address, transactions, days) {
|
|
4
|
+
return { ...account, address, transactions, days };
|
|
5
5
|
}
|
|
6
6
|
Account.from = from;
|
|
7
7
|
})(Account || (Account = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.js","sourceRoot":"../","sources":["Rule/State/Account.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Account.js","sourceRoot":"../","sources":["Rule/State/Account.ts"],"names":[],"mappings":"AASA,MAAM,KAAW,OAAO,CAsBvB;AAtBD,WAAiB,OAAO;IAmBvB,SAAgB,IAAI,CAAC,OAAqB,EAAE,OAAqB,EAAE,YAA0B,EAAE,IAAU;QACxG,OAAO,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,CAAA;IACnD,CAAC;IAFe,YAAI,OAEnB,CAAA;AACF,CAAC,EAtBgB,OAAO,KAAP,OAAO,QAsBvB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { Transaction as ModelTransaction } from "../../Transaction";
|
|
3
3
|
import type { Rule } from "../index";
|
|
4
|
-
export interface Transaction extends ModelTransaction.Creatable {
|
|
4
|
+
export interface Transaction extends ModelTransaction.Creatable.Resolved {
|
|
5
5
|
kind: Rule.Base.Kind;
|
|
6
6
|
stage: "finalize" | "initiate";
|
|
7
7
|
amount: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
2
|
import { Account as ModelAccount } from "../../Account";
|
|
3
|
+
import { Rail } from "../../Rail";
|
|
3
4
|
import type { Transaction as ModelTransaction } from "../../Transaction";
|
|
4
5
|
import type { Rule } from "../index";
|
|
5
6
|
import { Account as StateAccount } from "./Account";
|
|
@@ -36,5 +37,5 @@ export declare namespace State {
|
|
|
36
37
|
flags: string[];
|
|
37
38
|
notes: ModelTransaction.Note[];
|
|
38
39
|
}
|
|
39
|
-
function from(data: Data, account: ModelAccount, transactions: Account.Transactions, days: Account.Days, transaction: ModelTransaction.Creatable.Resolved | ModelTransaction, kind: Rule.Base.Kind, stage: "finalize" | "initiate", authorization?: Authorization, card?: Card, organization?: Organization): State;
|
|
40
|
+
function from(data: Data, account: ModelAccount, address: Rail.Address, transactions: Account.Transactions, days: Account.Days, transaction: ModelTransaction.Creatable.Resolved | ModelTransaction, kind: Rule.Base.Kind, stage: "finalize" | "initiate", authorization?: Authorization, card?: Card, organization?: Organization): State;
|
|
40
41
|
}
|
package/dist/Rule/State/index.js
CHANGED
|
@@ -18,10 +18,10 @@ export var State;
|
|
|
18
18
|
Outcome.values = ["approve", "reject", "review"];
|
|
19
19
|
Outcome.type = isly.string(Outcome.values);
|
|
20
20
|
})(Outcome = State.Outcome || (State.Outcome = {}));
|
|
21
|
-
function from(data, account, transactions, days, transaction, kind, stage, authorization, card, organization) {
|
|
21
|
+
function from(data, account, address, transactions, days, transaction, kind, stage, authorization, card, organization) {
|
|
22
22
|
return {
|
|
23
23
|
data,
|
|
24
|
-
account: State.Account.from(account, transactions, days),
|
|
24
|
+
account: State.Account.from(account, address, transactions, days),
|
|
25
25
|
transaction: State.Transaction.from(account.name, transaction, kind, stage),
|
|
26
26
|
authorization,
|
|
27
27
|
card,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Rule/State/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Rule/State/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAK3B,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE1C,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAU/D,MAAM,KAAW,KAAK,CAyCrB;AAzCD,WAAiB,KAAK;IACP,aAAO,GAAG,YAAY,CAAA;IACtB,mBAAa,GAAG,kBAAkB,CAAA;IAClC,UAAI,GAAG,SAAS,CAAA;IAChB,aAAO,GAAG,YAAY,CAAA;IACtB,iBAAW,GAAG,gBAAgB,CAAA;IAC9B,kBAAY,GAAG,iBAAiB,CAAA;IAG9C,IAAiB,OAAO,CAGvB;IAHD,WAAiB,OAAO;QACV,cAAM,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAA;QACjD,YAAI,GAAG,IAAI,CAAC,MAAM,CAAU,QAAA,MAAM,CAAC,CAAA;IACjD,CAAC,EAHgB,OAAO,GAAP,aAAO,KAAP,aAAO,QAGvB;IAOD,SAAgB,IAAI,CACnB,IAAU,EACV,OAAqB,EACrB,OAAqB,EACrB,YAAkC,EAClC,IAAkB,EAClB,WAAmE,EACnE,IAAoB,EACpB,KAA8B,EAC9B,aAA6B,EAC7B,IAAW,EACX,YAA2B;QAE3B,OAAO;YACN,IAAI;YACJ,OAAO,EAAE,MAAA,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC;YAC3D,WAAW,EAAE,MAAA,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC;YACrE,aAAa;YACb,IAAI;YACJ,YAAY;SACZ,CAAA;IACF,CAAC;IArBe,UAAI,OAqBnB,CAAA;AACF,CAAC,EAzCgB,KAAK,KAAL,KAAK,QAyCrB"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { Rail } from "../Rail";
|
|
3
|
+
import { Exchange } from "./Exchange";
|
|
3
4
|
export interface Creatable {
|
|
4
5
|
counterpart: string | Rail.Address;
|
|
5
6
|
currency: isoly.Currency;
|
|
6
7
|
amount: number;
|
|
7
8
|
description: string;
|
|
9
|
+
exchange?: Exchange;
|
|
8
10
|
}
|
|
9
11
|
export declare namespace Creatable {
|
|
10
12
|
type Resolved = Creatable & {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { isly } from "isly";
|
|
3
3
|
import { Rail } from "../Rail";
|
|
4
|
+
import { Exchange } from "./Exchange";
|
|
4
5
|
export var Creatable;
|
|
5
6
|
(function (Creatable) {
|
|
6
7
|
Creatable.type = isly.object({
|
|
@@ -8,6 +9,7 @@ export var Creatable;
|
|
|
8
9
|
currency: isly.fromIs("isoly.Currency", isoly.Currency.is),
|
|
9
10
|
amount: isly.number(),
|
|
10
11
|
description: isly.string(),
|
|
12
|
+
exchange: Exchange.type.optional(),
|
|
11
13
|
});
|
|
12
14
|
})(Creatable || (Creatable = {}));
|
|
13
15
|
//# sourceMappingURL=Creatable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Transaction/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Transaction/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AASrC,MAAM,KAAW,SAAS,CASzB;AATD,WAAiB,SAAS;IAEZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;QAC1C,WAAW,EAAE,IAAI,CAAC,KAAK,CAA8C,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QACtG,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1D,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;QACrB,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE;QAC1B,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE;KAClC,CAAC,CAAA;AACH,CAAC,EATgB,SAAS,KAAT,SAAS,QASzB"}
|