@pax2pay/model-banking 0.1.244 → 0.1.245
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/Transaction/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { Status as TransactionStatus } from "./Status"
|
|
|
14
14
|
export interface Transaction extends Transaction.Creatable {
|
|
15
15
|
organization: string
|
|
16
16
|
accountId: string
|
|
17
|
+
accountName?: string
|
|
17
18
|
account: Rail.Address
|
|
18
19
|
readonly id: cryptly.Identifier
|
|
19
20
|
readonly reference?: Transaction.Reference
|
|
@@ -54,6 +55,7 @@ export namespace Transaction {
|
|
|
54
55
|
export const type = Creatable.type.extend<Transaction>({
|
|
55
56
|
organization: isly.string(),
|
|
56
57
|
accountId: isly.string(),
|
|
58
|
+
accountName: isly.string().optional(),
|
|
57
59
|
account: isly.fromIs("Rail", Rail.Address.is),
|
|
58
60
|
id: isly.fromIs("cryptly.Identifier", cryptly.Identifier.is).readonly(),
|
|
59
61
|
reference: Reference.type.readonly().optional(),
|
|
@@ -78,6 +80,7 @@ export namespace Transaction {
|
|
|
78
80
|
export function fromCreatable(
|
|
79
81
|
organization: string,
|
|
80
82
|
accountId: string,
|
|
83
|
+
accountName: string,
|
|
81
84
|
account: Rail.Address,
|
|
82
85
|
rail: Rail,
|
|
83
86
|
transaction: Creatable,
|
|
@@ -94,6 +97,7 @@ export namespace Transaction {
|
|
|
94
97
|
...transaction,
|
|
95
98
|
organization,
|
|
96
99
|
accountId,
|
|
100
|
+
accountName,
|
|
97
101
|
account,
|
|
98
102
|
id,
|
|
99
103
|
posted: isoly.DateTime.now(),
|
|
@@ -110,6 +114,7 @@ export namespace Transaction {
|
|
|
110
114
|
export function fromIncoming(
|
|
111
115
|
organization: string,
|
|
112
116
|
accountId: string,
|
|
117
|
+
accountName: string,
|
|
113
118
|
transaction: Incoming,
|
|
114
119
|
operations: Operation.Creatable[],
|
|
115
120
|
balance: {
|
|
@@ -123,6 +128,7 @@ export namespace Transaction {
|
|
|
123
128
|
...transaction,
|
|
124
129
|
organization,
|
|
125
130
|
accountId,
|
|
131
|
+
accountName,
|
|
126
132
|
balance,
|
|
127
133
|
id,
|
|
128
134
|
operations: operations.map(o => Operation.fromCreatable(id, o)),
|
|
@@ -12,6 +12,7 @@ import { Status as TransactionStatus } from "./Status";
|
|
|
12
12
|
export interface Transaction extends Transaction.Creatable {
|
|
13
13
|
organization: string;
|
|
14
14
|
accountId: string;
|
|
15
|
+
accountName?: string;
|
|
15
16
|
account: Rail.Address;
|
|
16
17
|
readonly id: cryptly.Identifier;
|
|
17
18
|
readonly reference?: Transaction.Reference;
|
|
@@ -53,12 +54,12 @@ export declare namespace Transaction {
|
|
|
53
54
|
const is: isly.Type.IsFunction<Transaction>;
|
|
54
55
|
const flaw: isly.Type.FlawFunction;
|
|
55
56
|
const get: isly.Type.GetFunction<Transaction>;
|
|
56
|
-
function fromCreatable(organization: string, accountId: string, account: Rail.Address, rail: Rail, transaction: Creatable, operations: Operation.Creatable[], balance: {
|
|
57
|
+
function fromCreatable(organization: string, accountId: string, accountName: string, account: Rail.Address, rail: Rail, transaction: Creatable, operations: Operation.Creatable[], balance: {
|
|
57
58
|
actual: number;
|
|
58
59
|
reserved: number;
|
|
59
60
|
available: number;
|
|
60
61
|
}, by?: string): Transaction;
|
|
61
|
-
function fromIncoming(organization: string, accountId: string, transaction: Incoming, operations: Operation.Creatable[], balance: {
|
|
62
|
+
function fromIncoming(organization: string, accountId: string, accountName: string, transaction: Incoming, operations: Operation.Creatable[], balance: {
|
|
62
63
|
actual: number;
|
|
63
64
|
reserved: number;
|
|
64
65
|
available: number;
|
|
@@ -21,6 +21,7 @@ export var Transaction;
|
|
|
21
21
|
Transaction.type = Transaction.Creatable.type.extend({
|
|
22
22
|
organization: isly.string(),
|
|
23
23
|
accountId: isly.string(),
|
|
24
|
+
accountName: isly.string().optional(),
|
|
24
25
|
account: isly.fromIs("Rail", Rail.Address.is),
|
|
25
26
|
id: isly.fromIs("cryptly.Identifier", cryptly.Identifier.is).readonly(),
|
|
26
27
|
reference: Transaction.Reference.type.readonly().optional(),
|
|
@@ -42,12 +43,13 @@ export var Transaction;
|
|
|
42
43
|
Transaction.is = Transaction.type.is;
|
|
43
44
|
Transaction.flaw = Transaction.type.flaw;
|
|
44
45
|
Transaction.get = Transaction.type.get;
|
|
45
|
-
function fromCreatable(organization, accountId, account, rail, transaction, operations, balance, by) {
|
|
46
|
+
function fromCreatable(organization, accountId, accountName, account, rail, transaction, operations, balance, by) {
|
|
46
47
|
const id = Identifier.generate();
|
|
47
48
|
return {
|
|
48
49
|
...transaction,
|
|
49
50
|
organization,
|
|
50
51
|
accountId,
|
|
52
|
+
accountName,
|
|
51
53
|
account,
|
|
52
54
|
id,
|
|
53
55
|
posted: isoly.DateTime.now(),
|
|
@@ -62,12 +64,13 @@ export var Transaction;
|
|
|
62
64
|
};
|
|
63
65
|
}
|
|
64
66
|
Transaction.fromCreatable = fromCreatable;
|
|
65
|
-
function fromIncoming(organization, accountId, transaction, operations, balance) {
|
|
67
|
+
function fromIncoming(organization, accountId, accountName, transaction, operations, balance) {
|
|
66
68
|
const id = Identifier.generate();
|
|
67
69
|
return {
|
|
68
70
|
...transaction,
|
|
69
71
|
organization,
|
|
70
72
|
accountId,
|
|
73
|
+
accountName,
|
|
71
74
|
balance,
|
|
72
75
|
id,
|
|
73
76
|
operations: operations.map(o => Operation.fromCreatable(id, o)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Transaction/index.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,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAA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