@pax2pay/model-banking 0.1.492 → 0.1.494
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 +2 -5
- package/Rule/Reserve.ts +2 -9
- package/Rule/State/Transaction.ts +5 -2
- package/Rule/index.ts +18 -15
- package/Transaction/Amount.ts +41 -0
- package/Transaction/index.ts +25 -59
- package/dist/cjs/Operation/Changes.d.ts +2 -2
- package/dist/cjs/Operation/Changes.js.map +1 -1
- package/dist/cjs/Rule/Reserve.js +2 -9
- package/dist/cjs/Rule/Reserve.js.map +1 -1
- package/dist/cjs/Rule/State/Transaction.d.ts +1 -1
- package/dist/cjs/Rule/State/Transaction.js +4 -1
- package/dist/cjs/Rule/State/Transaction.js.map +1 -1
- package/dist/cjs/Rule/index.js +18 -15
- package/dist/cjs/Rule/index.js.map +1 -1
- package/dist/cjs/Transaction/Amount.d.ts +14 -0
- package/dist/cjs/Transaction/Amount.js +34 -0
- package/dist/cjs/Transaction/Amount.js.map +1 -0
- package/dist/cjs/Transaction/index.d.ts +4 -14
- package/dist/cjs/Transaction/index.js +23 -52
- package/dist/cjs/Transaction/index.js.map +1 -1
- package/dist/mjs/Operation/Changes.d.ts +2 -2
- package/dist/mjs/Operation/Changes.js.map +1 -1
- package/dist/mjs/Rule/Reserve.js +2 -9
- package/dist/mjs/Rule/Reserve.js.map +1 -1
- package/dist/mjs/Rule/State/Transaction.d.ts +1 -1
- package/dist/mjs/Rule/State/Transaction.js +4 -1
- package/dist/mjs/Rule/State/Transaction.js.map +1 -1
- package/dist/mjs/Rule/index.js +18 -15
- package/dist/mjs/Rule/index.js.map +1 -1
- package/dist/mjs/Transaction/Amount.d.ts +14 -0
- package/dist/mjs/Transaction/Amount.js +31 -0
- package/dist/mjs/Transaction/Amount.js.map +1 -0
- package/dist/mjs/Transaction/index.d.ts +4 -14
- package/dist/mjs/Transaction/index.js +23 -52
- package/dist/mjs/Transaction/index.js.map +1 -1
- package/package.json +1 -1
package/Operation/Changes.ts
CHANGED
|
@@ -100,10 +100,7 @@ export namespace Changes {
|
|
|
100
100
|
export const type = isly.string<Balance>(values)
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
export function fromCapture(
|
|
104
|
-
settlement: string | undefined, // FIXME: remove | undefined when we're sure we send the id
|
|
105
|
-
amounts: { net: number; fee: number; charge?: number }
|
|
106
|
-
): Changes {
|
|
103
|
+
export function fromCapture(settlement: string, amounts: { net: number; fee: number; charge?: number }): Changes {
|
|
107
104
|
return {
|
|
108
105
|
[`${settlement}-net`]: { type: "add" as const, amount: amounts.net, status: "pending" as const },
|
|
109
106
|
[`${settlement}-fee`]: { type: "add" as const, amount: amounts.fee, status: "pending" as const },
|
|
@@ -113,7 +110,7 @@ export namespace Changes {
|
|
|
113
110
|
}
|
|
114
111
|
}
|
|
115
112
|
export function fromRefund(
|
|
116
|
-
settlement: string
|
|
113
|
+
settlement: string,
|
|
117
114
|
refund: Settlement.Entry.Creatable.Refund,
|
|
118
115
|
charge: number | undefined,
|
|
119
116
|
sum: Sum
|
package/Rule/Reserve.ts
CHANGED
|
@@ -21,10 +21,7 @@ export namespace Reserve {
|
|
|
21
21
|
}
|
|
22
22
|
export const type = Base.type.extend<Reserve>({
|
|
23
23
|
action: isly.string(Action.value),
|
|
24
|
-
reserve: isly.object({
|
|
25
|
-
percentage: isly.number(),
|
|
26
|
-
fixed: Amount.type.optional(),
|
|
27
|
-
}),
|
|
24
|
+
reserve: isly.object({ percentage: isly.number(), fixed: Amount.type.optional() }),
|
|
28
25
|
})
|
|
29
26
|
|
|
30
27
|
export interface Api extends Base {
|
|
@@ -63,11 +60,7 @@ export namespace Reserve {
|
|
|
63
60
|
macros?: Record<string, selectively.Definition>,
|
|
64
61
|
table: Exchange.Rates = {}
|
|
65
62
|
): { outcomes: Reserve[]; notes: Note[]; reserve: number } {
|
|
66
|
-
const result: ReturnType<typeof evaluate> = {
|
|
67
|
-
outcomes: [],
|
|
68
|
-
notes: [],
|
|
69
|
-
reserve: 0,
|
|
70
|
-
}
|
|
63
|
+
const result: ReturnType<typeof evaluate> = { outcomes: [], notes: [], reserve: 0 }
|
|
71
64
|
const now = isoly.DateTime.now()
|
|
72
65
|
if (
|
|
73
66
|
state.transaction.stage == "initiate" &&
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
|
+
import { Identifier } from "../../Identifier"
|
|
2
3
|
import { Transaction as ModelTransaction } from "../../Transaction"
|
|
3
4
|
import type { Rule } from "../index"
|
|
4
5
|
|
|
5
6
|
export type Transaction = ModelTransaction.Creatable.Resolved & {
|
|
7
|
+
id: string
|
|
6
8
|
kind: Rule.Base.Kind
|
|
7
9
|
stage: "finalize" | "initiate"
|
|
8
10
|
amount: number
|
|
@@ -13,7 +15,6 @@ export type Transaction = ModelTransaction.Creatable.Resolved & {
|
|
|
13
15
|
total: number
|
|
14
16
|
amount: number
|
|
15
17
|
charge?: { current: number; total: number }
|
|
16
|
-
reserve?: number
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
export namespace Transaction {
|
|
@@ -31,12 +32,13 @@ export namespace Transaction {
|
|
|
31
32
|
transaction.currency,
|
|
32
33
|
transaction.state?.transaction.original.total ??
|
|
33
34
|
(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total),
|
|
34
|
-
stage === "finalize" ? transaction.state?.transaction.original.
|
|
35
|
+
stage === "finalize" ? transaction.state?.transaction.original.charge?.total ?? 0 : 0
|
|
35
36
|
),
|
|
36
37
|
]
|
|
37
38
|
: [transaction.amount, transaction.amount]
|
|
38
39
|
return {
|
|
39
40
|
...transaction,
|
|
41
|
+
id: "id" in transaction ? transaction.id : Identifier.generate(),
|
|
40
42
|
stage,
|
|
41
43
|
kind,
|
|
42
44
|
amount: Math.abs(typeof amount == "number" ? amount : amount.total),
|
|
@@ -56,6 +58,7 @@ export namespace Transaction {
|
|
|
56
58
|
): Transaction {
|
|
57
59
|
return {
|
|
58
60
|
...transaction,
|
|
61
|
+
id: "id" in transaction ? transaction.id : Identifier.generate(),
|
|
59
62
|
stage,
|
|
60
63
|
kind,
|
|
61
64
|
amount: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total),
|
package/Rule/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { selectively } from "selectively"
|
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Exchange } from "../Exchange"
|
|
4
4
|
import { Realm } from "../Realm"
|
|
5
|
+
import type { Note } from "../Transaction/Note"
|
|
5
6
|
import { Base as RuleBase } from "./Base"
|
|
6
7
|
import { Charge as RuleCharge } from "./Charge"
|
|
7
8
|
import { control as ruleControl } from "./control"
|
|
@@ -63,30 +64,32 @@ export namespace Rule {
|
|
|
63
64
|
score: [],
|
|
64
65
|
reserve: [],
|
|
65
66
|
}
|
|
67
|
+
const notes: Note[] = []
|
|
66
68
|
const { other, chargers, scorers, reservers } = sort(rules, state)
|
|
67
69
|
const scored = Score.evaluate(scorers, state, macros)
|
|
70
|
+
notes.push(...scored.notes)
|
|
68
71
|
outcomes.score.push(...scored.outcomes)
|
|
69
72
|
state.transaction.risk = scored.risk
|
|
70
73
|
const evaluated = Other.evaluate(other, state, macros)
|
|
74
|
+
notes.push(...evaluated.notes)
|
|
71
75
|
outcomes.flag.push(...evaluated.outcomes.flag)
|
|
72
76
|
outcomes.review.push(...evaluated.outcomes.review)
|
|
73
77
|
outcomes.reject.push(...evaluated.outcomes.reject)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
state.transaction.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
notes: [...scored.notes, ...evaluated.notes, ...reserved.notes, ...charged.notes],
|
|
87
|
-
outcomes,
|
|
88
|
-
outcome,
|
|
78
|
+
if (state.transaction.stage == "initiate") {
|
|
79
|
+
const reserved = Reserve.evaluate(reservers, state, macros, table)
|
|
80
|
+
state.transaction.original.charge = { current: reserved.reserve, total: reserved.reserve }
|
|
81
|
+
state.transaction.original.total = Reserve.apply(reserved.reserve, state)
|
|
82
|
+
outcomes.reserve.push(...reserved.outcomes)
|
|
83
|
+
notes.push(...reserved.notes)
|
|
84
|
+
} else if (state.transaction.stage == "finalize") {
|
|
85
|
+
const charged = Charge.evaluate(chargers, state, macros, table)
|
|
86
|
+
outcomes.charge.push(...charged.outcomes)
|
|
87
|
+
state.transaction.original.charge = charged.charge
|
|
88
|
+
state.transaction.original.total = Charge.apply(charged.charge, state)
|
|
89
|
+
notes.push(...charged.notes)
|
|
89
90
|
}
|
|
91
|
+
const outcome = outcomes.reject.length > 0 ? "reject" : outcomes.review.length > 0 ? "review" : "approve"
|
|
92
|
+
return { ...state, flags: [...evaluated.flags], notes, outcomes, outcome }
|
|
90
93
|
}
|
|
91
94
|
function sort(
|
|
92
95
|
rules: Rule[],
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
2
|
+
import { isly } from "isly"
|
|
3
|
+
import type { Rule } from "../Rule"
|
|
4
|
+
import { Exchange } from "./Exchange"
|
|
5
|
+
|
|
6
|
+
export interface Amount {
|
|
7
|
+
original: number
|
|
8
|
+
charge: number
|
|
9
|
+
total: number
|
|
10
|
+
exchange?: Exchange
|
|
11
|
+
}
|
|
12
|
+
export namespace Amount {
|
|
13
|
+
export const type = isly.object<Amount>({
|
|
14
|
+
original: isly.number(),
|
|
15
|
+
charge: isly.number(),
|
|
16
|
+
total: isly.number(),
|
|
17
|
+
exchange: Exchange.type.optional(),
|
|
18
|
+
})
|
|
19
|
+
export function fromState(state: Rule.State): Amount {
|
|
20
|
+
const sign = ["outbound", "authorization", "capture"].some(direction => direction == state.transaction.kind)
|
|
21
|
+
? -1
|
|
22
|
+
: 1
|
|
23
|
+
return {
|
|
24
|
+
original: sign * state.transaction.original.amount,
|
|
25
|
+
charge: sign * (state.transaction.original.charge?.total ?? 0),
|
|
26
|
+
total: sign * state.transaction.original.total,
|
|
27
|
+
exchange: state?.transaction.exchange ?? state.authorization?.exchange,
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function change(
|
|
32
|
+
currency: isoly.Currency,
|
|
33
|
+
amount: Amount,
|
|
34
|
+
change: number,
|
|
35
|
+
type: Exclude<keyof Amount, "total" | "exchange">
|
|
36
|
+
): Amount {
|
|
37
|
+
amount[type] = isoly.Currency.add(currency, amount[type], change)
|
|
38
|
+
amount.total = isoly.Currency.add(currency, amount.total, change)
|
|
39
|
+
return amount
|
|
40
|
+
}
|
|
41
|
+
}
|
package/Transaction/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { Rail } from "../Rail"
|
|
|
7
7
|
import { Report } from "../Report"
|
|
8
8
|
import type { Rule } from "../Rule"
|
|
9
9
|
import { Settlement } from "../Settlement"
|
|
10
|
+
import { Amount as TransactionAmount } from "./Amount"
|
|
10
11
|
import { Creatable as TransactionCreatable } from "./Creatable"
|
|
11
12
|
import { Exchange as TransactionExchange } from "./Exchange"
|
|
12
13
|
import { Note as TransactionNote } from "./Note"
|
|
@@ -44,58 +45,7 @@ export interface Transaction {
|
|
|
44
45
|
}
|
|
45
46
|
export namespace Transaction {
|
|
46
47
|
export import Exchange = TransactionExchange
|
|
47
|
-
export
|
|
48
|
-
export namespace Amount {
|
|
49
|
-
export const type = isly.object<Amount>({
|
|
50
|
-
original: isly.number(),
|
|
51
|
-
reserved: isly.number(),
|
|
52
|
-
charge: isly.number(),
|
|
53
|
-
total: isly.number(),
|
|
54
|
-
exchange: Exchange.type.optional(),
|
|
55
|
-
})
|
|
56
|
-
export function fromState(state: Rule.State): Amount {
|
|
57
|
-
const sign = ["outbound", "authorization", "capture"].some(direction => direction == state.transaction.kind)
|
|
58
|
-
? -1
|
|
59
|
-
: 1
|
|
60
|
-
return {
|
|
61
|
-
original: sign * state.transaction.original.amount,
|
|
62
|
-
reserved: sign * (state.transaction.original.reserve ?? 0),
|
|
63
|
-
charge: sign * (state.transaction.original.charge?.total ?? 0),
|
|
64
|
-
total: sign * state.transaction.original.total,
|
|
65
|
-
exchange: state?.transaction.exchange ?? state.authorization?.exchange,
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
export function fromOperations(
|
|
69
|
-
transaction: Transaction | Transaction.Creatable,
|
|
70
|
-
operations: Operation[],
|
|
71
|
-
state?: Rule.State
|
|
72
|
-
): Amount {
|
|
73
|
-
const stateAmount = state && fromState(state)
|
|
74
|
-
const changes = Operation.sum(operations)
|
|
75
|
-
const reserved = isoly.Currency.add(
|
|
76
|
-
transaction.currency,
|
|
77
|
-
changes["reserved-incoming"] ?? 0,
|
|
78
|
-
changes["reserved-outgoing"] ?? 0
|
|
79
|
-
)
|
|
80
|
-
return {
|
|
81
|
-
original: typeof transaction.amount == "number" ? transaction.amount : transaction.amount.original,
|
|
82
|
-
reserved,
|
|
83
|
-
charge: stateAmount?.charge ?? 0,
|
|
84
|
-
total: changes.available ?? reserved ?? 0,
|
|
85
|
-
exchange: state?.transaction.exchange ?? state?.authorization?.exchange,
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
export function change(
|
|
89
|
-
currency: isoly.Currency,
|
|
90
|
-
amount: Amount,
|
|
91
|
-
change: number,
|
|
92
|
-
type: Exclude<keyof Amount, "total" | "exchange">
|
|
93
|
-
): Amount {
|
|
94
|
-
amount[type] = isoly.Currency.add(currency, amount[type], change)
|
|
95
|
-
amount.total = isoly.Currency.add(currency, amount.total, change)
|
|
96
|
-
return amount
|
|
97
|
-
}
|
|
98
|
-
}
|
|
48
|
+
export import Amount = TransactionAmount
|
|
99
49
|
export const types = ["card", "internal", "external", "system"] as const
|
|
100
50
|
export type Types = typeof types[number]
|
|
101
51
|
export const directions = ["inbound", "outbound"] as const
|
|
@@ -137,7 +87,25 @@ export namespace Transaction {
|
|
|
137
87
|
risk: isly.number().optional(),
|
|
138
88
|
state: isly.any().optional(),
|
|
139
89
|
})
|
|
140
|
-
|
|
90
|
+
export function amountFromOperations(
|
|
91
|
+
transaction: Transaction | Transaction.Creatable,
|
|
92
|
+
operations: Operation[],
|
|
93
|
+
state?: Rule.State
|
|
94
|
+
): Amount {
|
|
95
|
+
const stateAmount = state && Amount.fromState(state)
|
|
96
|
+
const changes = Operation.sum(operations)
|
|
97
|
+
const reserved = isoly.Currency.add(
|
|
98
|
+
transaction.currency,
|
|
99
|
+
changes["reserved-incoming"] ?? 0,
|
|
100
|
+
changes["reserved-outgoing"] ?? 0
|
|
101
|
+
)
|
|
102
|
+
return {
|
|
103
|
+
original: typeof transaction.amount == "number" ? transaction.amount : transaction.amount.original,
|
|
104
|
+
charge: stateAmount?.charge ?? 0,
|
|
105
|
+
total: changes.available ?? reserved ?? 0,
|
|
106
|
+
exchange: state?.transaction.exchange ?? state?.authorization?.exchange,
|
|
107
|
+
}
|
|
108
|
+
}
|
|
141
109
|
export interface Legacy extends Omit<Transaction, "amount"> {
|
|
142
110
|
amount: number
|
|
143
111
|
}
|
|
@@ -154,7 +122,6 @@ export namespace Transaction {
|
|
|
154
122
|
transaction.state?.transaction.original.amount ??
|
|
155
123
|
isoly.Currency.subtract(transaction.currency, transaction.amount, transaction.charge ?? 0),
|
|
156
124
|
charge: transaction.state?.transaction.original.charge?.total ?? transaction.charge ?? 0,
|
|
157
|
-
reserved: transaction.state?.transaction.original.reserve ?? 0,
|
|
158
125
|
total: transaction.state?.transaction.original.total ?? transaction.amount,
|
|
159
126
|
},
|
|
160
127
|
}
|
|
@@ -232,7 +199,7 @@ export namespace Transaction {
|
|
|
232
199
|
): Transaction {
|
|
233
200
|
return {
|
|
234
201
|
...creatable,
|
|
235
|
-
amount: { original: creatable.amount,
|
|
202
|
+
amount: { original: creatable.amount, charge: 0, total: creatable.amount },
|
|
236
203
|
type: getType(creatable.counterpart, account.name),
|
|
237
204
|
direction: "inbound",
|
|
238
205
|
organization: account.organization,
|
|
@@ -258,7 +225,7 @@ export namespace Transaction {
|
|
|
258
225
|
): Transaction {
|
|
259
226
|
return {
|
|
260
227
|
...creatable,
|
|
261
|
-
amount: { original: 0,
|
|
228
|
+
amount: { original: 0, charge: 0, total: 0 },
|
|
262
229
|
type: getType(creatable.counterpart, account.name),
|
|
263
230
|
direction: "inbound",
|
|
264
231
|
organization: account.organization,
|
|
@@ -292,7 +259,7 @@ export namespace Transaction {
|
|
|
292
259
|
name: account.name,
|
|
293
260
|
organization: account.organization,
|
|
294
261
|
},
|
|
295
|
-
amount: { original: 0,
|
|
262
|
+
amount: { original: 0, charge: 0, total: 0 },
|
|
296
263
|
type: "internal",
|
|
297
264
|
direction: "inbound",
|
|
298
265
|
organization: account.organization,
|
|
@@ -313,7 +280,6 @@ export namespace Transaction {
|
|
|
313
280
|
}
|
|
314
281
|
export function fromIncoming(
|
|
315
282
|
transaction: Transaction.PreTransaction.Incoming,
|
|
316
|
-
id: string,
|
|
317
283
|
state: Rule.State.Evaluated,
|
|
318
284
|
account: { id: string; name: string; organization: string },
|
|
319
285
|
balance: { actual: number; reserved: number; available: number }
|
|
@@ -329,7 +295,7 @@ export namespace Transaction {
|
|
|
329
295
|
accountId: account.id,
|
|
330
296
|
accountName: account.name,
|
|
331
297
|
balance,
|
|
332
|
-
id,
|
|
298
|
+
id: state.transaction.id,
|
|
333
299
|
status,
|
|
334
300
|
flags: state.flags,
|
|
335
301
|
oldFlags: [],
|
|
@@ -37,10 +37,10 @@ export declare namespace Changes {
|
|
|
37
37
|
const type: isly.Type<"available" | "reserved-incoming" | "reserved-outgoing" | "reserved-buffer">;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function fromCapture(settlement: string
|
|
40
|
+
function fromCapture(settlement: string, amounts: {
|
|
41
41
|
net: number;
|
|
42
42
|
fee: number;
|
|
43
43
|
charge?: number;
|
|
44
44
|
}): Changes;
|
|
45
|
-
function fromRefund(settlement: string
|
|
45
|
+
function fromRefund(settlement: string, refund: Settlement.Entry.Creatable.Refund, charge: number | undefined, sum: Sum): Changes;
|
|
46
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Changes.js","sourceRoot":"","sources":["../../../Operation/Changes.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAC3B,wCAAsD;AAGtD,qCAAiC;AAGjC,IAAiB,OAAO,
|
|
1
|
+
{"version":3,"file":"Changes.js","sourceRoot":"","sources":["../../../Operation/Changes.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAC3B,wCAAsD;AAGtD,qCAAiC;AAGjC,IAAiB,OAAO,CA6HvB;AA7HD,WAAiB,OAAO;IACvB,SAAgB,SAAS,CAAC,OAAoB,EAAE,QAAwB,EAAE,SAAkB,KAAK;QAChG,OAAO,MAAM;YACZ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAC9B,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,CACtB,aAAK,CAAC,QAAQ,CAAC,GAAG,CACjB,QAAQ,EACR,CAAC,EACD,iBAAc,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;gBACzC,CAAC,CAAC,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;gBAC5F,CAAC,CAAC,CAAC,CACJ,EACF,CAAC,CACA;YACH,CAAC,CAAC,WAAW,IAAI,OAAO;gBACxB,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC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AC,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE;YACvG,CAAC,mBAAmB,CAAC,EAAE;gBACtB,IAAI,EAAE,UAAU;gBAChB,MAAM,EAAE,GAAG,CAAC,mBAAmB,CAAC,IAAI,CAAC;gBACrC,MAAM,EAAE,SAAS;aACjB;YACD,GAAG,CAAC,MAAM,IAAI;gBACb,CAAC,GAAG,UAAU,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,KAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAkB,EAAE;aAC9F,CAAC;SACF,CAAA;IACF,CAAC;IArBe,kBAAU,aAqBzB,CAAA;AACF,CAAC,EA7HgB,OAAO,uBAAP,OAAO,QA6HvB"}
|
package/dist/cjs/Rule/Reserve.js
CHANGED
|
@@ -16,10 +16,7 @@ var Reserve;
|
|
|
16
16
|
})(Action = Reserve.Action || (Reserve.Action = {}));
|
|
17
17
|
Reserve.type = Base_1.Base.type.extend({
|
|
18
18
|
action: isly_1.isly.string(Action.value),
|
|
19
|
-
reserve: isly_1.isly.object({
|
|
20
|
-
percentage: isly_1.isly.number(),
|
|
21
|
-
fixed: Amount_1.Amount.type.optional(),
|
|
22
|
-
}),
|
|
19
|
+
reserve: isly_1.isly.object({ percentage: isly_1.isly.number(), fixed: Amount_1.Amount.type.optional() }),
|
|
23
20
|
});
|
|
24
21
|
let Api;
|
|
25
22
|
(function (Api) {
|
|
@@ -44,11 +41,7 @@ var Reserve;
|
|
|
44
41
|
}
|
|
45
42
|
Reserve.fromApi = fromApi;
|
|
46
43
|
function evaluate(rules, state, macros, table = {}) {
|
|
47
|
-
const result = {
|
|
48
|
-
outcomes: [],
|
|
49
|
-
notes: [],
|
|
50
|
-
reserve: 0,
|
|
51
|
-
};
|
|
44
|
+
const result = { outcomes: [], notes: [], reserve: 0 };
|
|
52
45
|
const now = isoly_1.isoly.DateTime.now();
|
|
53
46
|
if (state.transaction.stage == "initiate" &&
|
|
54
47
|
["authorization", "outbound"].some(kind => kind == state.transaction.kind) &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Reserve.js","sourceRoot":"","sources":["../../../Rule/Reserve.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAE7B,+BAA2B;AAC3B,sCAAkC;AAClC,0CAAsC;AACtC,oCAAgC;AAEhC,iCAA6B;AAC7B,uCAAmC;AAQnC,IAAiB,OAAO,
|
|
1
|
+
{"version":3,"file":"Reserve.js","sourceRoot":"","sources":["../../../Rule/Reserve.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAE7B,+BAA2B;AAC3B,sCAAkC;AAClC,0CAAsC;AACtC,oCAAgC;AAEhC,iCAA6B;AAC7B,uCAAmC;AAQnC,IAAiB,OAAO,CAyFvB;AAzFD,WAAiB,OAAO;IAEvB,IAAiB,MAAM,CAEtB;IAFD,WAAiB,MAAM;QACT,YAAK,GAAG,SAAS,CAAA;IAC/B,CAAC,EAFgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAEtB;IACY,YAAI,GAAG,WAAI,CAAC,IAAI,CAAC,MAAM,CAAU;QAC7C,MAAM,EAAE,WAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;QACjC,OAAO,EAAE,WAAI,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,WAAI,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,eAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;KAClF,CAAC,CAAA;IASF,IAAiB,GAAG,CAQnB;IARD,WAAiB,GAAG;QACN,QAAI,GAAG,WAAI,CAAC,IAAI,CAAC,MAAM,CAAM;YACzC,MAAM,EAAE,WAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;YACjC,OAAO,EAAE,WAAI,CAAC,MAAM,CAAC;gBACpB,UAAU,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC,Q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C,IAAI,CAAC,CAAA;oBAC1B,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;gBAChF,CAAC;QACH,OAAO,MAAM,CAAA;IACd,CAAC;IAzCe,gBAAQ,WAyCvB,CAAA;IACD,SAAgB,KAAK,CAAC,OAAe,EAAE,KAAY;QAClD,OAAO,KAAK,CAAC,WAAW,CAAC,IAAI,IAAI,eAAe;YAC/C,KAAK,CAAC,WAAW,CAAC,IAAI,IAAI,UAAU;YACpC,KAAK,CAAC,WAAW,CAAC,IAAI,IAAI,SAAS;YACnC,CAAC,CAAC,aAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;YACpG,CAAC,CAAC,aAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC3G,CAAC;IANe,aAAK,QAMpB,CAAA;AACF,CAAC,EAzFgB,OAAO,uBAAP,OAAO,QAyFvB"}
|
|
@@ -2,6 +2,7 @@ import { isoly } from "isoly";
|
|
|
2
2
|
import { Transaction as ModelTransaction } from "../../Transaction";
|
|
3
3
|
import type { Rule } from "../index";
|
|
4
4
|
export type Transaction = ModelTransaction.Creatable.Resolved & {
|
|
5
|
+
id: string;
|
|
5
6
|
kind: Rule.Base.Kind;
|
|
6
7
|
stage: "finalize" | "initiate";
|
|
7
8
|
amount: number;
|
|
@@ -15,7 +16,6 @@ export type Transaction = ModelTransaction.Creatable.Resolved & {
|
|
|
15
16
|
current: number;
|
|
16
17
|
total: number;
|
|
17
18
|
};
|
|
18
|
-
reserve?: number;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
export declare namespace Transaction {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Transaction = void 0;
|
|
4
4
|
const isoly_1 = require("isoly");
|
|
5
|
+
const Identifier_1 = require("../../Identifier");
|
|
5
6
|
const Transaction_1 = require("../../Transaction");
|
|
6
7
|
var Transaction;
|
|
7
8
|
(function (Transaction) {
|
|
@@ -10,11 +11,12 @@ var Transaction;
|
|
|
10
11
|
? [
|
|
11
12
|
transaction.state?.transaction.original.amount ?? transaction.amount,
|
|
12
13
|
isoly_1.isoly.Currency.subtract(transaction.currency, transaction.state?.transaction.original.total ??
|
|
13
|
-
(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total), stage === "finalize" ? transaction.state?.transaction.original.
|
|
14
|
+
(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total), stage === "finalize" ? transaction.state?.transaction.original.charge?.total ?? 0 : 0),
|
|
14
15
|
]
|
|
15
16
|
: [transaction.amount, transaction.amount];
|
|
16
17
|
return {
|
|
17
18
|
...transaction,
|
|
19
|
+
id: "id" in transaction ? transaction.id : Identifier_1.Identifier.generate(),
|
|
18
20
|
stage,
|
|
19
21
|
kind,
|
|
20
22
|
amount: Math.abs(typeof amount == "number" ? amount : amount.total),
|
|
@@ -30,6 +32,7 @@ var Transaction;
|
|
|
30
32
|
function fromPreTransaction(accountName, transaction, kind, stage) {
|
|
31
33
|
return {
|
|
32
34
|
...transaction,
|
|
35
|
+
id: "id" in transaction ? transaction.id : Identifier_1.Identifier.generate(),
|
|
33
36
|
stage,
|
|
34
37
|
kind,
|
|
35
38
|
amount: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../Rule/State/Transaction.ts"],"names":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AM,CAAC,QAAQ,CAAC;gBAC1G,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,WAAW,CAAC,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC;aACtG;SACD,CAAA;IACF,CAAC;IAnBe,8BAAkB,qBAmBjC,CAAA;AACF,CAAC,EArDgB,WAAW,2BAAX,WAAW,QAqD3B"}
|
package/dist/cjs/Rule/index.js
CHANGED
|
@@ -53,30 +53,33 @@ var Rule;
|
|
|
53
53
|
score: [],
|
|
54
54
|
reserve: [],
|
|
55
55
|
};
|
|
56
|
+
const notes = [];
|
|
56
57
|
const { other, chargers, scorers, reservers } = sort(rules, state);
|
|
57
58
|
const scored = Rule.Score.evaluate(scorers, state, macros);
|
|
59
|
+
notes.push(...scored.notes);
|
|
58
60
|
outcomes.score.push(...scored.outcomes);
|
|
59
61
|
state.transaction.risk = scored.risk;
|
|
60
62
|
const evaluated = Rule.Other.evaluate(other, state, macros);
|
|
63
|
+
notes.push(...evaluated.notes);
|
|
61
64
|
outcomes.flag.push(...evaluated.outcomes.flag);
|
|
62
65
|
outcomes.review.push(...evaluated.outcomes.review);
|
|
63
66
|
outcomes.reject.push(...evaluated.outcomes.reject);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
state.transaction.
|
|
67
|
+
if (state.transaction.stage == "initiate") {
|
|
68
|
+
const reserved = Rule.Reserve.evaluate(reservers, state, macros, table);
|
|
69
|
+
state.transaction.original.charge = { current: reserved.reserve, total: reserved.reserve };
|
|
70
|
+
state.transaction.original.total = Rule.Reserve.apply(reserved.reserve, state);
|
|
71
|
+
outcomes.reserve.push(...reserved.outcomes);
|
|
72
|
+
notes.push(...reserved.notes);
|
|
73
|
+
}
|
|
74
|
+
else if (state.transaction.stage == "finalize") {
|
|
75
|
+
const charged = Rule.Charge.evaluate(chargers, state, macros, table);
|
|
76
|
+
outcomes.charge.push(...charged.outcomes);
|
|
77
|
+
state.transaction.original.charge = charged.charge;
|
|
78
|
+
state.transaction.original.total = Rule.Charge.apply(charged.charge, state);
|
|
79
|
+
notes.push(...charged.notes);
|
|
80
|
+
}
|
|
72
81
|
const outcome = outcomes.reject.length > 0 ? "reject" : outcomes.review.length > 0 ? "review" : "approve";
|
|
73
|
-
return {
|
|
74
|
-
...state,
|
|
75
|
-
flags: [...evaluated.flags],
|
|
76
|
-
notes: [...scored.notes, ...evaluated.notes, ...reserved.notes, ...charged.notes],
|
|
77
|
-
outcomes,
|
|
78
|
-
outcome,
|
|
79
|
-
};
|
|
82
|
+
return { ...state, flags: [...evaluated.flags], notes, outcomes, outcome };
|
|
80
83
|
}
|
|
81
84
|
Rule.evaluate = evaluate;
|
|
82
85
|
function sort(rules, state) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../Rule/index.ts"],"names":[],"mappings":";;;AACA,+BAA2B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../Rule/index.ts"],"names":[],"mappings":";;;AACA,+BAA2B;AAI3B,iCAAyC;AACzC,qCAA+C;AAC/C,uCAAkD;AAClD,mCAA4C;AAC5C,uCAAkD;AAClD,mCAA4C;AAC5C,mCAA4C;AAC5C,iCAAyC;AAGzC,IAAiB,IAAI,CAuGpB;AAvGD,WAAiB,IAAI;IACN,UAAK,GAAG,aAAS,CAAA;IACjB,UAAK,GAAG,aAAS,CAAA;IACjB,WAAM,GAAG,eAAU,CAAA;IACnB,UAAK,GAAG,aAAS,CAAA;IACjB,YAAO,GAAG,iBAAW,CAAA;IACrB,SAAI,GAAG,WAAQ,CAAA;IACf,SAAI,GAAG,KAAA,IAAI,CAAC,IAAI,CAAA;IAChB,aAAQ,GAAG,KAAA,IAAI,CAAC,QAAQ,CAAA;IACzB,YAAO,GAAG,iBA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AI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;IACjE,CAAC;IAFe,eAAU,aAEzB,CAAA;AACF,CAAC,EAvGgB,IAAI,oBAAJ,IAAI,QAuGpB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import type { Rule } from "../Rule";
|
|
3
|
+
import { Exchange } from "./Exchange";
|
|
4
|
+
export interface Amount {
|
|
5
|
+
original: number;
|
|
6
|
+
charge: number;
|
|
7
|
+
total: number;
|
|
8
|
+
exchange?: Exchange;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace Amount {
|
|
11
|
+
const type: import("isly/dist/cjs/object").IslyObject<Amount, object>;
|
|
12
|
+
function fromState(state: Rule.State): Amount;
|
|
13
|
+
function change(currency: isoly.Currency, amount: Amount, change: number, type: Exclude<keyof Amount, "total" | "exchange">): Amount;
|
|
14
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Amount = void 0;
|
|
4
|
+
const isoly_1 = require("isoly");
|
|
5
|
+
const isly_1 = require("isly");
|
|
6
|
+
const Exchange_1 = require("./Exchange");
|
|
7
|
+
var Amount;
|
|
8
|
+
(function (Amount) {
|
|
9
|
+
Amount.type = isly_1.isly.object({
|
|
10
|
+
original: isly_1.isly.number(),
|
|
11
|
+
charge: isly_1.isly.number(),
|
|
12
|
+
total: isly_1.isly.number(),
|
|
13
|
+
exchange: Exchange_1.Exchange.type.optional(),
|
|
14
|
+
});
|
|
15
|
+
function fromState(state) {
|
|
16
|
+
const sign = ["outbound", "authorization", "capture"].some(direction => direction == state.transaction.kind)
|
|
17
|
+
? -1
|
|
18
|
+
: 1;
|
|
19
|
+
return {
|
|
20
|
+
original: sign * state.transaction.original.amount,
|
|
21
|
+
charge: sign * (state.transaction.original.charge?.total ?? 0),
|
|
22
|
+
total: sign * state.transaction.original.total,
|
|
23
|
+
exchange: state?.transaction.exchange ?? state.authorization?.exchange,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
Amount.fromState = fromState;
|
|
27
|
+
function change(currency, amount, change, type) {
|
|
28
|
+
amount[type] = isoly_1.isoly.Currency.add(currency, amount[type], change);
|
|
29
|
+
amount.total = isoly_1.isoly.Currency.add(currency, amount.total, change);
|
|
30
|
+
return amount;
|
|
31
|
+
}
|
|
32
|
+
Amount.change = change;
|
|
33
|
+
})(Amount || (exports.Amount = Amount = {}));
|
|
34
|
+
//# sourceMappingURL=Amount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Amount.js","sourceRoot":"","sources":["../../../Transaction/Amount.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAE3B,yCAAqC;AAQrC,IAAiB,MAAM,CA6BtB;AA7BD,WAAiB,MAAM;IACT,WAAI,GAAG,WAAI,CAAC,MAAM,CAAS;QACvC,QAAQ,EAAE,WAAI,CAAC,MAAM,EAAE;QACvB,MAAM,EAAE,WAAI,CAAC,MAAM,EAAE;QACrB,KAAK,EAAE,WAAI,CAAC,MAAM,EAAE;QACpB,QAAQ,EAAE,mBAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE;KAClC,CAAC,CAAA;IACF,SAAgB,SAAS,CAAC,KAAiB;QAC1C,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC;YAC3G,CAAC,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC,CAAA;QACJ,OAAO;YACN,QAAQ,EAAE,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM;YAClD,MAAM,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC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