@pax2pay/model-banking 0.1.384 → 0.1.386
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/Card/Creatable.ts +2 -1
- package/Card/index.ts +2 -1
- package/Operation/Changes.ts +25 -0
- package/Operation/Creatable.ts +1 -18
- package/Organization/index.ts +2 -1
- package/Rule/{Rule/Base.ts → Base.ts} +7 -0
- package/Rule/Charge.ts +108 -0
- package/Rule/Other.ts +48 -0
- package/Rule/Reserve.ts +111 -0
- package/Rule/Score.ts +45 -0
- package/Rule/State/Transaction.ts +17 -4
- package/Rule/State/index.ts +3 -2
- package/Rule/control.ts +8 -0
- package/Rule/index.ts +76 -97
- package/Rule/type.ts +13 -0
- package/Transaction/index.ts +3 -3
- package/dist/Authorization/Status.d.ts +1 -1
- package/dist/Card/Creatable.d.ts +1 -1
- package/dist/Card/Creatable.js +1 -1
- package/dist/Card/Creatable.js.map +1 -1
- package/dist/Card/index.d.ts +1 -1
- package/dist/Card/index.js +1 -1
- package/dist/Card/index.js.map +1 -1
- package/dist/Operation/Changes.d.ts +2 -0
- package/dist/Operation/Changes.js +20 -0
- package/dist/Operation/Changes.js.map +1 -1
- package/dist/Operation/Creatable.d.ts +1 -1
- package/dist/Operation/Creatable.js +1 -13
- package/dist/Operation/Creatable.js.map +1 -1
- package/dist/Organization/index.d.ts +3 -3
- package/dist/Organization/index.js +1 -1
- package/dist/Organization/index.js.map +1 -1
- package/dist/Rail/index.d.ts +1 -1
- package/dist/Rule/{Rule/Base.d.ts → Base.d.ts} +1 -0
- package/dist/Rule/{Rule/Base.js → Base.js} +6 -0
- package/dist/Rule/Base.js.map +1 -0
- package/dist/Rule/Charge.d.ts +40 -0
- package/dist/Rule/Charge.js +68 -0
- package/dist/Rule/Charge.js.map +1 -0
- package/dist/Rule/{Rule/Other.d.ts → Other.d.ts} +8 -0
- package/dist/Rule/Other.js +38 -0
- package/dist/Rule/Other.js.map +1 -0
- package/dist/Rule/Reserve.d.ts +38 -0
- package/dist/Rule/Reserve.js +76 -0
- package/dist/Rule/Reserve.js.map +1 -0
- package/dist/Rule/{Rule/Score.d.ts → Score.d.ts} +6 -0
- package/dist/Rule/Score.js +30 -0
- package/dist/Rule/Score.js.map +1 -0
- package/dist/Rule/State/Transaction.d.ts +9 -4
- package/dist/Rule/State/Transaction.js +7 -2
- package/dist/Rule/State/Transaction.js.map +1 -1
- package/dist/Rule/State/index.d.ts +3 -3
- package/dist/Rule/State/index.js +2 -2
- package/dist/Rule/State/index.js.map +1 -1
- package/dist/Rule/control.d.ts +4 -0
- package/dist/Rule/control.js +6 -0
- package/dist/Rule/control.js.map +1 -0
- package/dist/Rule/index.d.ts +29 -13
- package/dist/Rule/index.js +68 -70
- package/dist/Rule/index.js.map +1 -1
- package/dist/Rule/type.d.ts +3 -0
- package/dist/Rule/type.js +7 -0
- package/dist/Rule/type.js.map +1 -0
- package/dist/Transaction/Status.d.ts +1 -1
- package/dist/Transaction/index.js +3 -3
- package/dist/Transaction/index.js.map +1 -1
- package/package.json +1 -1
- package/Rule/Rule/Charge.ts +0 -48
- package/Rule/Rule/Other.ts +0 -14
- package/Rule/Rule/Score.ts +0 -21
- package/Rule/Rule/index.ts +0 -37
- package/dist/Rule/Rule/Base.js.map +0 -1
- package/dist/Rule/Rule/Charge.d.ts +0 -29
- package/dist/Rule/Rule/Charge.js +0 -34
- package/dist/Rule/Rule/Charge.js.map +0 -1
- package/dist/Rule/Rule/Other.js +0 -12
- package/dist/Rule/Rule/Other.js.map +0 -1
- package/dist/Rule/Rule/Score.js +0 -16
- package/dist/Rule/Rule/Score.js.map +0 -1
- package/dist/Rule/Rule/index.d.ts +0 -24
- package/dist/Rule/Rule/index.js +0 -27
- package/dist/Rule/Rule/index.js.map +0 -1
package/Rule/index.ts
CHANGED
|
@@ -1,129 +1,108 @@
|
|
|
1
|
-
import { isoly } from "isoly"
|
|
2
1
|
import { selectively } from "selectively"
|
|
2
|
+
import { isly } from "isly"
|
|
3
3
|
import { Exchange } from "../Exchange"
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { Realm } from "../Realm"
|
|
5
|
+
import { Base as RuleBase } from "./Base"
|
|
6
|
+
import { Charge as RuleCharge } from "./Charge"
|
|
7
|
+
import { control as ruleControl } from "./control"
|
|
8
|
+
import { Other as RuleOther } from "./Other"
|
|
9
|
+
import { Reserve as RuleReserve } from "./Reserve"
|
|
10
|
+
import { Score as RuleScore } from "./Score"
|
|
7
11
|
import { State as RuleState } from "./State"
|
|
12
|
+
import { type as ruleType } from "./type"
|
|
8
13
|
|
|
9
|
-
export type Rule =
|
|
10
|
-
|
|
14
|
+
export type Rule = Rule.Other | Rule.Score | Rule.Charge | Rule.Reserve
|
|
11
15
|
export namespace Rule {
|
|
12
|
-
export import
|
|
13
|
-
export import
|
|
14
|
-
export import
|
|
15
|
-
export import Kind = ModelRule.Base.Kind
|
|
16
|
-
export import Other = ModelRule.Other
|
|
17
|
-
export import Score = ModelRule.Score
|
|
18
|
-
export import Charge = ModelRule.Charge
|
|
16
|
+
export import Other = RuleOther
|
|
17
|
+
export import Score = RuleScore
|
|
18
|
+
export import Charge = RuleCharge
|
|
19
19
|
export import State = RuleState
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
export import Reserve = RuleReserve
|
|
21
|
+
export import Base = RuleBase
|
|
22
|
+
export import Kind = Base.Kind
|
|
23
|
+
export import Category = Base.Category
|
|
24
|
+
export const control = ruleControl
|
|
25
|
+
export type Api = Rule.Other | Rule.Score | Rule.Charge.Api | Rule.Reserve.Api
|
|
26
|
+
export namespace Api {
|
|
27
|
+
export const type = isly.union<Api, Rule.Other, Rule.Score, Rule.Charge.Api, Rule.Reserve.Api>(
|
|
28
|
+
Rule.Other.type,
|
|
29
|
+
Rule.Score.type,
|
|
30
|
+
Rule.Charge.Api.type,
|
|
31
|
+
Rule.Reserve.Api.type
|
|
27
32
|
)
|
|
28
33
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
34
|
+
export function fromApi(rule: Rule.Api, realm: Realm): Rule {
|
|
35
|
+
return rule.action == "charge"
|
|
36
|
+
? Charge.fromApi(rule, realm)
|
|
37
|
+
: rule.action == "reserve"
|
|
38
|
+
? Reserve.fromApi(rule, realm)
|
|
39
|
+
: rule
|
|
31
40
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
function charge(
|
|
43
|
-
rules: ModelRule.Charge[],
|
|
44
|
-
state: State,
|
|
45
|
-
macros?: Record<string, selectively.Definition>,
|
|
46
|
-
table: Exchange.Rates = {}
|
|
47
|
-
): { outcomes: Rule[]; charge: number } {
|
|
48
|
-
const result: { outcomes: Rule[]; charge: number } = { outcomes: [], charge: 0 }
|
|
49
|
-
for (const rule of rules) {
|
|
50
|
-
if (control(rule, state, macros)) {
|
|
51
|
-
if (rule.charge.percentage)
|
|
52
|
-
result.charge = isoly.Currency.add(
|
|
53
|
-
state.transaction.currency,
|
|
54
|
-
result.charge,
|
|
55
|
-
isoly.Currency.multiply(state.transaction.currency, state.transaction.amount, rule.charge.percentage / 100)
|
|
56
|
-
)
|
|
57
|
-
if (rule.charge.fixed) {
|
|
58
|
-
const charge =
|
|
59
|
-
state.transaction.currency === rule.charge.fixed[0]
|
|
60
|
-
? rule.charge.fixed[1]
|
|
61
|
-
: Exchange.convert(rule.charge.fixed[1], rule.charge.fixed[0], state.transaction.currency, table) ?? 0
|
|
62
|
-
result.charge = isoly.Currency.add(state.transaction.currency, result.charge, charge)
|
|
63
|
-
}
|
|
64
|
-
result.outcomes.push(rule)
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return result
|
|
41
|
+
export type Action = typeof Action.values[number]
|
|
42
|
+
export namespace Action {
|
|
43
|
+
export const values = [
|
|
44
|
+
...Other.Action.values,
|
|
45
|
+
Score.Action.value,
|
|
46
|
+
Charge.Action.value,
|
|
47
|
+
Reserve.Action.value,
|
|
48
|
+
] as const
|
|
49
|
+
export const type = isly.string<Action>(values)
|
|
68
50
|
}
|
|
51
|
+
export const type = ruleType
|
|
69
52
|
export function evaluate(
|
|
70
53
|
rules: Rule[],
|
|
71
|
-
state:
|
|
54
|
+
state: RuleState,
|
|
72
55
|
macros?: Record<string, selectively.Definition>,
|
|
73
56
|
table: Exchange.Rates = {}
|
|
74
|
-
):
|
|
75
|
-
const outcomes: Record<
|
|
57
|
+
): RuleState.Evaluated {
|
|
58
|
+
const outcomes: Record<Rule.Action, Rule[]> = {
|
|
76
59
|
review: [],
|
|
77
60
|
reject: [],
|
|
78
61
|
flag: [],
|
|
79
62
|
charge: [],
|
|
63
|
+
score: [],
|
|
64
|
+
reserve: [],
|
|
80
65
|
}
|
|
81
|
-
const { other, chargers, scorers } = rules
|
|
82
|
-
|
|
83
|
-
|
|
66
|
+
const { other, chargers, scorers, reservers } = sort(rules, state)
|
|
67
|
+
const scored = Score.evaluate(scorers, state, macros)
|
|
68
|
+
outcomes.score.push(...scored.outcomes)
|
|
69
|
+
state.transaction.risk = scored.risk
|
|
70
|
+
const evaluated = Other.evaluate(other, state, macros)
|
|
71
|
+
outcomes.flag.push(...evaluated.outcomes.flag)
|
|
72
|
+
outcomes.review.push(...evaluated.outcomes.review)
|
|
73
|
+
outcomes.reject.push(...evaluated.outcomes.reject)
|
|
74
|
+
const reserved = Reserve.evaluate(reservers, state, macros, table)
|
|
75
|
+
outcomes.reserve.push(...reserved.outcomes)
|
|
76
|
+
state.transaction.original.reserve = reserved.reserve
|
|
77
|
+
state.transaction.original.total = Reserve.apply(reserved.reserve, state)
|
|
78
|
+
const charged = Charge.evaluate(chargers, state, macros, table)
|
|
79
|
+
outcomes.charge.push(...charged.outcomes)
|
|
80
|
+
state.transaction.original.charge = charged.charge
|
|
81
|
+
state.transaction.original.total = Charge.apply(charged.charge, state)
|
|
82
|
+
const outcome = outcomes.reject.length > 0 ? "reject" : outcomes.review.length > 0 ? "review" : "approve"
|
|
83
|
+
return { ...state, flags: [...evaluated.flags], notes: evaluated.notes, outcomes, outcome }
|
|
84
|
+
}
|
|
85
|
+
function sort(
|
|
86
|
+
rules: Rule[],
|
|
87
|
+
state: State
|
|
88
|
+
): { other: Rule.Other[]; chargers: Rule.Charge[]; scorers: Rule.Score[]; reservers: Rule.Reserve[] } {
|
|
89
|
+
return rules.reduce(
|
|
90
|
+
(r: ReturnType<typeof sort>, rule) => {
|
|
91
|
+
if (Base.Kind.is(state.transaction.kind, rule, state.organization?.groups))
|
|
84
92
|
rule.action == "score"
|
|
85
93
|
? r.scorers.push(rule)
|
|
86
94
|
: rule.action == "charge"
|
|
87
95
|
? r.chargers.push(rule)
|
|
96
|
+
: rule.action == "reserve"
|
|
97
|
+
? r.reservers.push(rule)
|
|
88
98
|
: r.other.push(rule)
|
|
89
99
|
return r
|
|
90
100
|
},
|
|
91
|
-
{ other: [], chargers: [], scorers: [] }
|
|
101
|
+
{ other: [], chargers: [], scorers: [], reservers: [] }
|
|
92
102
|
)
|
|
93
|
-
state.transaction.risk = score(scorers, state, macros)
|
|
94
|
-
const notes: Note[] = []
|
|
95
|
-
const flags: Set<string> = new Set()
|
|
96
|
-
const now = isoly.DateTime.now()
|
|
97
|
-
for (const rule of other) {
|
|
98
|
-
if (control(rule, state, macros)) {
|
|
99
|
-
outcomes[rule.action].push(rule)
|
|
100
|
-
notes.push({ author: "automatic", created: now, text: rule.name, rule })
|
|
101
|
-
rule.flags.forEach(f => flags.add(f))
|
|
102
|
-
rule.action == "review" && flags.add("review")
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
const charged = charge(chargers, state, macros, table)
|
|
106
|
-
state.transaction.original.charge = isoly.Currency.add(
|
|
107
|
-
state.transaction.original.currency,
|
|
108
|
-
state.transaction.original.charge ?? 0,
|
|
109
|
-
charged.charge
|
|
110
|
-
)
|
|
111
|
-
state.transaction.original.total =
|
|
112
|
-
state.transaction.kind == "authorization" ||
|
|
113
|
-
state.transaction.kind == "outbound" ||
|
|
114
|
-
state.transaction.kind == "capture"
|
|
115
|
-
? isoly.Currency.add(state.transaction.original.currency, state.transaction.original.amount, charged.charge)
|
|
116
|
-
: isoly.Currency.subtract(
|
|
117
|
-
state.transaction.original.currency,
|
|
118
|
-
state.transaction.original.amount,
|
|
119
|
-
charged.charge
|
|
120
|
-
)
|
|
121
|
-
outcomes.charge.push(...charged.outcomes)
|
|
122
|
-
const outcome = outcomes.reject.length > 0 ? "reject" : outcomes.review.length > 0 ? "review" : "approve"
|
|
123
|
-
return { ...state, flags: [...flags], notes, outcomes, outcome }
|
|
124
103
|
}
|
|
125
104
|
export function isLegacy(rule: Rule): boolean {
|
|
126
|
-
return !
|
|
105
|
+
return !Rule.Base.Category.type.is(rule.category)
|
|
127
106
|
}
|
|
128
107
|
export function fromLegacy(rule: Rule): Rule {
|
|
129
108
|
return isLegacy(rule) ? { ...rule, category: "fincrime" } : rule
|
package/Rule/type.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isly } from "isly"
|
|
2
|
+
import { Charge } from "./Charge"
|
|
3
|
+
import type { Rule } from "./index"
|
|
4
|
+
import { Other } from "./Other"
|
|
5
|
+
import { Reserve } from "./Reserve"
|
|
6
|
+
import { Score } from "./Score"
|
|
7
|
+
|
|
8
|
+
export const type = isly.union<Rule, Other, Score, Charge.Api, Reserve>(
|
|
9
|
+
Other.type,
|
|
10
|
+
Score.type,
|
|
11
|
+
Charge.Api.type,
|
|
12
|
+
Reserve.type
|
|
13
|
+
)
|
package/Transaction/index.ts
CHANGED
|
@@ -138,7 +138,7 @@ export namespace Transaction {
|
|
|
138
138
|
notes: state.notes,
|
|
139
139
|
state,
|
|
140
140
|
risk: state.transaction.risk,
|
|
141
|
-
...(state.transaction.original.charge && { charge: state.transaction.original.charge }),
|
|
141
|
+
...(state.transaction.original.charge && { charge: state.transaction.original.charge.total }),
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
export function system(
|
|
@@ -259,7 +259,7 @@ export namespace Transaction {
|
|
|
259
259
|
notes: state.notes,
|
|
260
260
|
state,
|
|
261
261
|
risk: state.transaction.risk,
|
|
262
|
-
...(state.transaction.original.charge && { charge: state.transaction.original.charge }),
|
|
262
|
+
...(state.transaction.original.charge && { charge: state.transaction.original.charge.total }),
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
export function fromRefund(
|
|
@@ -286,7 +286,7 @@ export namespace Transaction {
|
|
|
286
286
|
flags: [],
|
|
287
287
|
oldFlags: [],
|
|
288
288
|
notes: [],
|
|
289
|
-
...(state.transaction.original.charge && { charge: state.transaction.original.charge }),
|
|
289
|
+
...(state.transaction.original.charge && { charge: state.transaction.original.charge.total }),
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
export function isIdentifier(value: string | any): value is string {
|
|
@@ -8,5 +8,5 @@ export declare namespace Status {
|
|
|
8
8
|
namespace Failed {
|
|
9
9
|
function from(error: gracely.Error | Transaction.Status.Reason): Failed;
|
|
10
10
|
}
|
|
11
|
-
const type: isly.Type<"denied" | "other" | "
|
|
11
|
+
const type: isly.Type<"denied" | "other" | "insufficient funds" | "cancelled card" | "card expired" | "exceeds limit" | "invalid csc" | "system failure" | "invalid request" | "expired" | "card not found" | "account not found" | "approved">;
|
|
12
12
|
}
|
package/dist/Card/Creatable.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { isly } from "isly";
|
|
3
3
|
import { Amount } from "../Amount";
|
|
4
|
-
import { Rule } from "../Rule
|
|
4
|
+
import type { Rule } from "../Rule";
|
|
5
5
|
import { Expiry } from "./Expiry";
|
|
6
6
|
import { Meta } from "./Meta";
|
|
7
7
|
import { Preset } from "./Preset";
|
package/dist/Card/Creatable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { isly } from "isly";
|
|
3
|
-
import { type as ruleType } from "../Rule/
|
|
3
|
+
import { type as ruleType } from "../Rule/type";
|
|
4
4
|
import { Expiry } from "./Expiry";
|
|
5
5
|
import { Meta } from "./Meta";
|
|
6
6
|
import { Preset } from "./Preset";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Card/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Card/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAgBjC,MAAM,KAAW,SAAS,CAezB;AAfD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;QAC1C,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;QACtB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;YACpB,MAAM,EAAE,MAAM,CAAC,IAAI;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;SACrB,CAAC;QACF,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;QAClF,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;QAClC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;QAClD,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC7B,CAAC,CAAA;IACW,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAfgB,SAAS,KAAT,SAAS,QAezB"}
|
package/dist/Card/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { isoly } from "isoly";
|
|
|
2
2
|
import { isly } from "isly";
|
|
3
3
|
import { Amount } from "../Amount";
|
|
4
4
|
import { Realm } from "../Realm";
|
|
5
|
-
import { Rule } from "../Rule
|
|
5
|
+
import type { Rule } from "../Rule";
|
|
6
6
|
import { Changeable as CardChangeable } from "./Changeable";
|
|
7
7
|
import { Creatable as CardCreatable } from "./Creatable";
|
|
8
8
|
import { Expiry as CardExpiry } from "./Expiry";
|
package/dist/Card/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { isoly } from "isoly";
|
|
|
2
2
|
import { isly } from "isly";
|
|
3
3
|
import { Realm } from "../Realm";
|
|
4
4
|
import { Report } from "../Report";
|
|
5
|
-
import { type as ruleType } from "../Rule/
|
|
5
|
+
import { type as ruleType } from "../Rule/type";
|
|
6
6
|
import { Changeable as CardChangeable } from "./Changeable";
|
|
7
7
|
import { Creatable as CardCreatable } from "./Creatable";
|
|
8
8
|
import { Expiry as CardExpiry } from "./Expiry";
|
package/dist/Card/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MA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AAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EACvC,GAAG,CACH,CACD,EACD,GAAG,CACH,CAAA;IACF,CAAC;IAXe,UAAK,QAWpB,CAAA;AACF,CAAC,EArEgB,IAAI,KAAJ,IAAI,QAqEpB"}
|
|
@@ -2,6 +2,7 @@ import { isoly } from "isoly";
|
|
|
2
2
|
import { isly } from "isly";
|
|
3
3
|
import { Balance as AccountBalance } from "../Balance";
|
|
4
4
|
import { Counterbalance as CounterbalanceOperation } from "../Counterbalance";
|
|
5
|
+
import type { Settlement } from "../Settlement";
|
|
5
6
|
import { Change } from "./Change";
|
|
6
7
|
export type Changes = Partial<Record<Changes.Entry.Balance, Change>> & Record<Changes.Entry.Counterbalance, Change>;
|
|
7
8
|
export declare namespace Changes {
|
|
@@ -43,4 +44,5 @@ export declare namespace Changes {
|
|
|
43
44
|
fee: number;
|
|
44
45
|
charge?: number;
|
|
45
46
|
}): Changes;
|
|
47
|
+
function fromRefund(settlement: string | undefined, refund: Settlement.Entry.Refund.Creatable, charge: number | undefined, sum: Sum): Changes;
|
|
46
48
|
}
|
|
@@ -86,5 +86,25 @@ export var Changes;
|
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
Changes.fromCapture = fromCapture;
|
|
89
|
+
function fromRefund(settlement, refund, charge, sum) {
|
|
90
|
+
const currency = refund.amount[0];
|
|
91
|
+
const fee = refund.fee.other[currency] ?? 0;
|
|
92
|
+
const net = refund.amount[1];
|
|
93
|
+
const available = isoly.Currency.subtract(currency, isoly.Currency.add(currency, fee, net), charge ?? 0);
|
|
94
|
+
return {
|
|
95
|
+
available: { type: available > 0 ? "add" : "subtract", amount: Math.abs(available), status: "pending" },
|
|
96
|
+
["reserved-incoming"]: {
|
|
97
|
+
type: "subtract",
|
|
98
|
+
amount: sum["reserved-incoming"] ?? 0,
|
|
99
|
+
status: "pending",
|
|
100
|
+
},
|
|
101
|
+
[`${settlement}-net`]: { type: "subtract", amount: net, status: "pending" },
|
|
102
|
+
[`${settlement}-fee`]: { type: "subtract", amount: fee, status: "pending" },
|
|
103
|
+
...(charge && {
|
|
104
|
+
[`${settlement}-charge`]: { type: "add", amount: charge, status: "pending" },
|
|
105
|
+
}),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
Changes.fromRefund = fromRefund;
|
|
89
109
|
})(Changes || (Changes = {}));
|
|
90
110
|
//# sourceMappingURL=Changes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Changes.js","sourceRoot":"../","sources":["Operation/Changes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"Changes.js","sourceRoot":"../","sources":["Operation/Changes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,YAAY,CAAA;AAGtD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGjC,MAAM,KAAW,OAAO,CAoIvB;AApID,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,KAAK,CAAC,QAAQ,CAAC,GAAG,CACjB,QAAQ,EACR,CAAC,EACD,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,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C;IAvBe,kBAAU,aAuBzB,CAAA;AACF,CAAC,EApIgB,OAAO,KAAP,OAAO,QAoIvB"}
|
|
@@ -15,5 +15,5 @@ export declare namespace Creatable {
|
|
|
15
15
|
const type: isly.object.ExtendableType<Creatable>;
|
|
16
16
|
const is: isly.Type.IsFunction<Creatable>;
|
|
17
17
|
const flaw: isly.Type.FlawFunction;
|
|
18
|
-
function fromRefund(account: string, settlement: string, entry: Settlement.Entry.Refund.Creatable
|
|
18
|
+
function fromRefund(account: string, settlement: string, entry: Settlement.Entry.Refund.Creatable): Creatable;
|
|
19
19
|
}
|
|
@@ -29,7 +29,7 @@ export var Creatable;
|
|
|
29
29
|
});
|
|
30
30
|
Creatable.is = Creatable.type.is;
|
|
31
31
|
Creatable.flaw = Creatable.type.flaw;
|
|
32
|
-
function fromRefund(account, settlement, entry
|
|
32
|
+
function fromRefund(account, settlement, entry) {
|
|
33
33
|
const [currency, entryAmount] = entry.amount;
|
|
34
34
|
const operationNet = Math.abs(entryAmount);
|
|
35
35
|
const operationFee = Math.abs(entry.fee.other[currency] ?? 0);
|
|
@@ -53,18 +53,6 @@ export var Creatable;
|
|
|
53
53
|
amount: operationFee,
|
|
54
54
|
status: "pending",
|
|
55
55
|
},
|
|
56
|
-
...(charge > 0 && {
|
|
57
|
-
[`${settlement}-charge`]: {
|
|
58
|
-
type: "add",
|
|
59
|
-
amount: charge,
|
|
60
|
-
status: "pending",
|
|
61
|
-
},
|
|
62
|
-
available: {
|
|
63
|
-
type: "subtract",
|
|
64
|
-
amount: charge,
|
|
65
|
-
status: "pending",
|
|
66
|
-
},
|
|
67
|
-
}),
|
|
68
56
|
},
|
|
69
57
|
};
|
|
70
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Operation/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,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MAAM,CAAA;QAC5C,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QAC1C,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;QAC7D,OAAO;YACN,OAAO,EAAE,OAAO;YAChB,QAAQ;YACR,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACR,mBAAmB,EAAE;oBACpB,IAAI,EAAE,KAAK;oBACX,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,CAAC;oBAChE,MAAM,EAAE,SAAS;iBACjB;gBACD,CAAC,GAAG,UAAU,MAAM,CAAC,EAAE;oBACtB,IAAI,EAAE,UAAmB;oBACzB,MAAM,EAAE,YAAY;oBACpB,MAAM,EAAE,SAAkB;iBAC1B;gBACD,CAAC,GAAG,UAAU,MAAM,CAAC,EAAE;oBACtB,IAAI,EAAE,UAAmB;oBACzB,MAAM,EAAE,YAAY;oBACpB,MAAM,EAAE,SAAkB;iBAC1B;aACD;SACD,CAAA;IACF,CAAC;IA5Be,oBAAU,aA4BzB,CAAA;AACF,CAAC,EAxDgB,SAAS,KAAT,SAAS,QAwDzB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
2
|
import { Realm } from "../Realm";
|
|
3
|
-
import { Rule } from "../Rule
|
|
3
|
+
import { Rule } from "../Rule";
|
|
4
4
|
import { Changeable as OrganizationChangeable } from "./Changeable";
|
|
5
5
|
import { Contact as OrganizationContact } from "./Contact";
|
|
6
6
|
export interface Organization {
|
|
@@ -12,8 +12,8 @@ export interface Organization {
|
|
|
12
12
|
groups?: string[];
|
|
13
13
|
}
|
|
14
14
|
export declare namespace Organization {
|
|
15
|
-
const type: isly.object.ExtendableType<Organization>;
|
|
16
|
-
const is: isly.Type.IsFunction<Organization>;
|
|
15
|
+
const type: isly.object.ExtendableType<Rule.State.Organization>;
|
|
16
|
+
const is: isly.Type.IsFunction<Rule.State.Organization>;
|
|
17
17
|
const flaw: isly.Type.FlawFunction;
|
|
18
18
|
type Changeable = OrganizationChangeable;
|
|
19
19
|
const Changeable: typeof OrganizationChangeable;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
2
|
import { Realm } from "../Realm";
|
|
3
|
-
import { type as ruleType } from "../Rule/
|
|
3
|
+
import { type as ruleType } from "../Rule/type";
|
|
4
4
|
import { Changeable as OrganizationChangeable } from "./Changeable";
|
|
5
5
|
import { Contact as OrganizationContact } from "./Contact";
|
|
6
6
|
export var Organization;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Organization/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Organization/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAEhC,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,UAAU,IAAI,sBAAsB,EAAE,MAAM,cAAc,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAU1D,MAAM,KAAW,YAAY,CAmB5B;AAnBD,WAAiB,YAAY;IACf,iBAAI,GAAG,IAAI,CAAC,MAAM,CAAe;QAC7C,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC;QAClD,KAAK,EAAE,KAAK,CAAC,IAAI;QACjB,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE;QACvB,OAAO,EAAE,mBAAmB,CAAC,IAAI,CAAC,QAAQ,EAAE;QAC5C,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;KACxC,CAAC,CAAA;IACW,eAAE,GAAG,aAAA,IAAI,CAAC,EAAE,CAAA;IACZ,iBAAI,GAAG,aAAA,IAAI,CAAC,IAAI,CAAA;IAEhB,uBAAU,GAAG,sBAAsB,CAAA;IAEnC,oBAAO,GAAG,mBAAmB,CAAA;AAK3C,CAAC,EAnBgB,YAAY,KAAZ,YAAY,QAmB5B"}
|
package/dist/Rail/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ import { Address as RailAddress } from "./Address";
|
|
|
3
3
|
export type Rail = typeof Rail.rails[number];
|
|
4
4
|
export declare namespace Rail {
|
|
5
5
|
const rails: readonly ["internal", "paxgiro", "paxgiro-credit", "mastercard", "diners", "fasterpayments", "chaps", "bacs", "transfer", "credit"];
|
|
6
|
-
const type: isly.Type<"paxgiro" | "
|
|
6
|
+
const type: isly.Type<"paxgiro" | "internal" | "mastercard" | "diners" | "paxgiro-credit" | "fasterpayments" | "chaps" | "bacs" | "transfer" | "credit">;
|
|
7
7
|
export import Address = RailAddress;
|
|
8
8
|
}
|
|
@@ -14,6 +14,7 @@ export declare namespace Base {
|
|
|
14
14
|
namespace Kind {
|
|
15
15
|
const values: readonly ["authorization", "outbound", "inbound", "capture", "refund"];
|
|
16
16
|
const type: isly.Type<"authorization" | "outbound" | "inbound" | "capture" | "refund">;
|
|
17
|
+
function is(kind: Kind, rule: Base, groups: string[] | undefined): boolean;
|
|
17
18
|
}
|
|
18
19
|
type Category = typeof Category.values[number];
|
|
19
20
|
namespace Category {
|
|
@@ -5,6 +5,12 @@ export var Base;
|
|
|
5
5
|
(function (Kind) {
|
|
6
6
|
Kind.values = ["authorization", "outbound", "inbound", "capture", "refund"];
|
|
7
7
|
Kind.type = isly.string(Kind.values);
|
|
8
|
+
function is(kind, rule, groups) {
|
|
9
|
+
return (kind == rule.type &&
|
|
10
|
+
(!rule.groups ||
|
|
11
|
+
rule.groups.some(ruleGroup => groups?.some(organizationGroup => organizationGroup == ruleGroup))));
|
|
12
|
+
}
|
|
13
|
+
Kind.is = is;
|
|
8
14
|
})(Kind = Base.Kind || (Base.Kind = {}));
|
|
9
15
|
let Category;
|
|
10
16
|
(function (Category) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Base.js","sourceRoot":"../","sources":["Rule/Base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAY3B,MAAM,KAAW,IAAI,CA4BpB;AA5BD,WAAiB,IAAI;IAEpB,IAAiB,IAAI,CAUpB;IAVD,WAAiB,IAAI;QACP,WAAM,GAAG,CAAC,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAA;QAC/E,SAAI,GAAG,IAAI,CAAC,MAAM,CAAO,KAAA,MAAM,CAAC,CAAA;QAC7C,SAAgB,EAAE,CAAC,IAAU,EAAE,IAAU,EAAE,MAA4B;YACtE,OAAO,CACN,IAAI,IAAI,IAAI,CAAC,IAAI;gBACjB,CAAC,CAAC,IAAI,CAAC,MAAM;oBACZ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,iBAAiB,IAAI,SAAS,CAAC,CAAC,CAAC,CAClG,CAAA;QACF,CAAC;QANe,OAAE,KAMjB,CAAA;IACF,CAAC,EAVgB,IAAI,GAAJ,SAAI,KAAJ,SAAI,QAUpB;IAED,IAAiB,QAAQ,CAGxB;IAHD,WAAiB,QAAQ;QACX,eAAM,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,CAAU,CAAA;QACrD,aAAI,GAAG,IAAI,CAAC,MAAM,CAAW,SAAA,MAAM,CAAC,CAAA;IAClD,CAAC,EAHgB,QAAQ,GAAR,aAAQ,KAAR,aAAQ,QAGxB;IACY,SAAI,GAAG,IAAI,CAAC,MAAM,CAAO;QACrC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;QACnC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE;QAC1B,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,QAAQ,EAAE,QAAQ,CAAC,IAAI;QACvB,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE;QACxB,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;QAC5B,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;KACxC,CAAC,CAAA;AACH,CAAC,EA5BgB,IAAI,KAAJ,IAAI,QA4BpB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import { selectively } from "selectively";
|
|
3
|
+
import { isly } from "isly";
|
|
4
|
+
import { Amount } from "../Amount";
|
|
5
|
+
import { Exchange } from "../Exchange";
|
|
6
|
+
import { Realm } from "../Realm";
|
|
7
|
+
import { Base } from "./Base";
|
|
8
|
+
import type { State } from "./State";
|
|
9
|
+
export interface Charge extends Charge.Api {
|
|
10
|
+
charge: {
|
|
11
|
+
percentage?: number;
|
|
12
|
+
fixed?: Amount;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare namespace Charge {
|
|
16
|
+
type Action = typeof Action.value;
|
|
17
|
+
namespace Action {
|
|
18
|
+
const value = "charge";
|
|
19
|
+
}
|
|
20
|
+
interface Api extends Base {
|
|
21
|
+
action: Charge.Action;
|
|
22
|
+
charge: {
|
|
23
|
+
percentage?: number;
|
|
24
|
+
fixed?: number | Amount;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
namespace Api {
|
|
28
|
+
const type: isly.object.ExtendableType<Api>;
|
|
29
|
+
}
|
|
30
|
+
function fromApi(rule: Api, realm: Realm): Charge;
|
|
31
|
+
function fromApi(rule: Api, currency: isoly.Currency): Charge;
|
|
32
|
+
function evaluate(rules: Charge[], state: State, macros?: Record<string, selectively.Definition>, table?: Exchange.Rates): {
|
|
33
|
+
outcomes: Charge[];
|
|
34
|
+
charge: Required<State["transaction"]["original"]>["charge"];
|
|
35
|
+
};
|
|
36
|
+
function apply(charge: {
|
|
37
|
+
current: number;
|
|
38
|
+
total: number;
|
|
39
|
+
}, state: State): number;
|
|
40
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import { isly } from "isly";
|
|
3
|
+
import { Amount } from "../Amount";
|
|
4
|
+
import { Exchange } from "../Exchange";
|
|
5
|
+
import { Realm } from "../Realm";
|
|
6
|
+
import { Base } from "./Base";
|
|
7
|
+
import { control } from "./control";
|
|
8
|
+
export var Charge;
|
|
9
|
+
(function (Charge) {
|
|
10
|
+
let Action;
|
|
11
|
+
(function (Action) {
|
|
12
|
+
Action.value = "charge";
|
|
13
|
+
})(Action = Charge.Action || (Charge.Action = {}));
|
|
14
|
+
let Api;
|
|
15
|
+
(function (Api) {
|
|
16
|
+
Api.type = Base.type.extend({
|
|
17
|
+
action: isly.string(Action.value),
|
|
18
|
+
charge: isly.object({
|
|
19
|
+
percentage: isly.number().optional(),
|
|
20
|
+
fixed: isly.union(Amount.type, isly.number()).optional(),
|
|
21
|
+
}),
|
|
22
|
+
});
|
|
23
|
+
})(Api = Charge.Api || (Charge.Api = {}));
|
|
24
|
+
function fromApi(rule, currency) {
|
|
25
|
+
return {
|
|
26
|
+
...rule,
|
|
27
|
+
charge: {
|
|
28
|
+
...rule.charge,
|
|
29
|
+
fixed: typeof rule.charge.fixed == "number"
|
|
30
|
+
? [Realm.is(currency) ? Realm.currency[currency] : currency, rule.charge.fixed]
|
|
31
|
+
: rule.charge.fixed,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
Charge.fromApi = fromApi;
|
|
36
|
+
function evaluate(rules, state, macros, table = {}) {
|
|
37
|
+
const result = {
|
|
38
|
+
outcomes: [],
|
|
39
|
+
charge: { current: 0, total: state.transaction.original.charge?.total ?? 0 },
|
|
40
|
+
};
|
|
41
|
+
if (state.transaction.stage == "finalize" && ["card", "external"].some(type => type == state.transaction.type))
|
|
42
|
+
for (const rule of rules) {
|
|
43
|
+
if (control(rule, state, macros)) {
|
|
44
|
+
if (rule.charge.percentage)
|
|
45
|
+
result.charge.current = isoly.Currency.add(state.transaction.original.currency, result.charge.current, isoly.Currency.multiply(state.transaction.original.currency, state.transaction.original.amount, rule.charge.percentage / 100));
|
|
46
|
+
if (rule.charge.fixed) {
|
|
47
|
+
const charge = state.transaction.original.currency === rule.charge.fixed[0]
|
|
48
|
+
? rule.charge.fixed[1]
|
|
49
|
+
: Exchange.convert(rule.charge.fixed[1], rule.charge.fixed[0], state.transaction.original.currency, table) ?? 0;
|
|
50
|
+
result.charge.current = isoly.Currency.add(state.transaction.original.currency, result.charge.current, charge);
|
|
51
|
+
}
|
|
52
|
+
result.outcomes.push(rule);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
result.charge.total = isoly.Currency.add(state.transaction.original.currency, result.charge.current, result.charge.total);
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
Charge.evaluate = evaluate;
|
|
59
|
+
function apply(charge, state) {
|
|
60
|
+
return state.transaction.kind == "authorization" ||
|
|
61
|
+
state.transaction.kind == "outbound" ||
|
|
62
|
+
state.transaction.kind == "capture"
|
|
63
|
+
? isoly.Currency.add(state.transaction.original.currency, state.transaction.original.total, charge.current)
|
|
64
|
+
: isoly.Currency.subtract(state.transaction.original.currency, state.transaction.original.total, charge.current);
|
|
65
|
+
}
|
|
66
|
+
Charge.apply = apply;
|
|
67
|
+
})(Charge || (Charge = {}));
|
|
68
|
+
//# sourceMappingURL=Charge.js.map
|