@pax2pay/model-banking 0.1.311 → 0.1.313

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/Rule/Base.ts CHANGED
@@ -11,16 +11,22 @@ export interface Base {
11
11
  groups?: string[]
12
12
  }
13
13
  export namespace Base {
14
- export const kinds = ["authorization", "outbound", "inbound"] as const
15
- export type Kind = typeof kinds[number]
16
- export const categories = ["fincrime", "product", "customer"] as const
17
- export type Category = typeof categories[number]
14
+ export type Kind = typeof Kind.values[number]
15
+ export namespace Kind {
16
+ export const values = ["authorization", "outbound", "inbound"] as const
17
+ export const type = isly.string<Kind>(values)
18
+ }
19
+ export type Category = typeof Category.values[number]
20
+ export namespace Category {
21
+ export const values = ["fincrime", "product", "customer"] as const
22
+ export const type = isly.string<Category>(values)
23
+ }
18
24
  export const type = isly.object<Base>({
19
- code: isly.string(new RegExp(/^[a-z0-9\-_]+$/)),
25
+ code: isly.string(/^[a-z0-9\-_]+$/),
20
26
  name: isly.string(),
21
27
  description: isly.string(),
22
- type: isly.string(kinds),
23
- category: isly.string(categories),
28
+ type: Kind.type,
29
+ category: Category.type,
24
30
  condition: isly.string(),
25
31
  flags: isly.string().array(),
26
32
  groups: isly.string().array().optional(),
@@ -5,7 +5,10 @@ export interface Other extends Base {
5
5
  action: Other.Action
6
6
  }
7
7
  export namespace Other {
8
- export const actions = ["review", "reject", "flag"] as const
9
- export type Action = typeof actions[number]
10
- export const type = Base.type.extend<Other>({ action: isly.string<Action>(actions) })
8
+ export type Action = typeof Action.values[number]
9
+ export namespace Action {
10
+ export const values = ["review", "reject", "flag"] as const
11
+ export const type = isly.string<Action>(values)
12
+ }
13
+ export const type = Base.type.extend<Other>({ action: Action.type })
11
14
  }
@@ -9,8 +9,11 @@ export namespace Rule {
9
9
  export import Other = RuleOther
10
10
  export import Score = RuleScore
11
11
  export import Base = RuleBase
12
- export const actions = [...Other.actions, "score"] as const
13
- export type Action = typeof actions[number]
12
+ export type Action = typeof Action.values[number]
13
+ export namespace Action {
14
+ export const values = [...Other.Action.values, "score"] as const
15
+ export const type = isly.string<Action>(values)
16
+ }
14
17
  }
15
18
  // Outside of the namespace otherwise the Rule import in Card/Card.Creatable and Organization causes a circular dependency crash
16
19
  export const type = isly.union<Rule.Other | Rule.Score, Rule.Other, Rule.Score>(Rule.Other.type, Rule.Score.type)
@@ -1,15 +1,18 @@
1
1
  import { isoly } from "isoly"
2
2
  import type { Transaction as ModelTransaction } from "../../Transaction"
3
+ import { Rule } from "../Rule"
3
4
 
4
5
  export interface Transaction extends Omit<ModelTransaction.Creatable, "currency" | "amount"> {
6
+ kind: Rule.Base.Kind
5
7
  amount: number
6
8
  risk?: number
7
9
  original: { currency: isoly.Currency; amount: number }
8
10
  }
9
11
  export namespace Transaction {
10
- export function from(transaction: ModelTransaction.Creatable): Transaction {
12
+ export function from(transaction: ModelTransaction.Creatable, kind: Rule.Base.Kind): Transaction {
11
13
  return {
12
14
  ...transaction,
15
+ kind,
13
16
  amount: Math.abs(transaction.amount),
14
17
  original: { currency: transaction.currency, amount: Math.abs(transaction.amount) },
15
18
  }
@@ -1,5 +1,7 @@
1
+ import { isly } from "isly"
1
2
  import { Account as ModelAccount } from "../../Account"
2
3
  import { Transaction as ModelTransaction } from "../../Transaction"
4
+ import { Rule } from "../Rule"
3
5
  import { Account as StateAccount } from "./Account"
4
6
  import { Authorization as StateAuthorization } from "./Authorization"
5
7
  import { Card as StateCard } from "./Card"
@@ -9,39 +11,50 @@ import { Partial as StatePartial } from "./Partial"
9
11
  import { Transaction as StateTransaction } from "./Transaction"
10
12
 
11
13
  export interface State {
12
- data: StateData
13
- account: StateAccount
14
- transaction: StateTransaction
15
- authorization?: StateAuthorization
16
- card?: StateCard
17
- organization?: StateOrganization
14
+ data: State.Data
15
+ account: State.Account
16
+ transaction: State.Transaction
17
+ authorization?: State.Authorization
18
+ card?: State.Card
19
+ organization?: State.Organization
18
20
  }
19
-
20
21
  export namespace State {
22
+ export import Partial = StatePartial
23
+ export import Authorization = StateAuthorization
24
+ export import Card = StateCard
25
+ export import Account = StateAccount
26
+ export import Transaction = StateTransaction
27
+ export import Organization = StateOrganization
28
+ export type Data = StateData
29
+ export type Outcome = typeof Outcome.values[number]
30
+ export namespace Outcome {
31
+ export const values = ["approve", "reject", "review"] as const
32
+ export const type = isly.string<Outcome>(values)
33
+ }
34
+ export interface Evaluated extends State {
35
+ outcomes: Record<Rule.Other.Action, Rule[]>
36
+ outcome: Outcome
37
+ flags: string[]
38
+ notes: ModelTransaction.Note[]
39
+ }
21
40
  export function from(
22
- data: StateData,
41
+ data: Data,
23
42
  account: ModelAccount,
24
- transactions: StateAccount.Transactions,
25
- days: StateAccount.Days,
43
+ transactions: Account.Transactions,
44
+ days: Account.Days,
26
45
  transaction: ModelTransaction.Creatable,
27
- authorization?: StateAuthorization,
28
- card?: StateCard,
29
- organization?: StateOrganization
46
+ kind: Rule.Base.Kind,
47
+ authorization?: Authorization,
48
+ card?: Card,
49
+ organization?: Organization
30
50
  ): State {
31
51
  return {
32
52
  data,
33
53
  account: Account.from(account, transactions, days),
34
- transaction: Transaction.from(transaction),
54
+ transaction: Transaction.from(transaction, kind),
35
55
  authorization,
36
56
  card,
37
57
  organization,
38
58
  }
39
59
  }
40
- export import Partial = StatePartial
41
- export import Authorization = StateAuthorization
42
- export import Card = StateCard
43
- export import Account = StateAccount
44
- export import Transaction = StateTransaction
45
- export import Organization = StateOrganization
46
- export type Data = StateData
47
60
  }
package/Rule/index.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import { isoly } from "isoly"
1
2
  import { selectively } from "selectively"
2
- import { isly } from "isly"
3
+ import { Note } from "../Transaction/Note"
3
4
  import { definitions } from "./definitions"
4
5
  import { Rule as ModelRule, type as ruleType } from "./Rule"
5
6
  import { State as RuleState } from "./State"
@@ -7,24 +8,21 @@ import { State as RuleState } from "./State"
7
8
  export type Rule = ModelRule
8
9
 
9
10
  export namespace Rule {
10
- export type Action = ModelRule.Action
11
- export namespace Action {
12
- export const values = ModelRule.actions
13
- }
14
- export type Category = ModelRule.Base.Category
15
- export namespace Category {
16
- export const values = ModelRule.Base.categories
17
- }
18
- export type Kind = ModelRule.Base.Kind
19
- export namespace Kind {
20
- export const values = ModelRule.Base.kinds
21
- }
11
+ export import Action = ModelRule.Action
12
+ export import Category = ModelRule.Base.Category
13
+ export import Kind = ModelRule.Base.Kind
22
14
  export import Other = ModelRule.Other
23
15
  export import Score = ModelRule.Score
24
16
  export import State = RuleState
25
17
  export const type = ruleType
26
18
  export const is = ruleType.is
27
19
  export const flaw = ruleType.flaw
20
+ function shouldUse(kind: Rule.Kind, rule: Rule, groups: string[] | undefined): boolean {
21
+ return (
22
+ kind == rule.type &&
23
+ (!rule.groups || rule.groups.some(ruleGroup => groups?.some(organizationGroup => organizationGroup == ruleGroup)))
24
+ )
25
+ }
28
26
  function control(rule: ModelRule, state: State, macros?: Record<string, selectively.Definition>) {
29
27
  return selectively.resolve({ ...macros, ...definitions }, selectively.parse(rule.condition)).is(state)
30
28
  }
@@ -42,22 +40,32 @@ export namespace Rule {
42
40
  rules: Rule[],
43
41
  state: State,
44
42
  macros?: Record<string, selectively.Definition>
45
- ): Record<ModelRule.Other.Action, Rule[]> & { risk?: number } {
46
- const result: Record<ModelRule.Other.Action, Rule[]> & { risk?: number } = { review: [], reject: [], flag: [] }
43
+ ): State.Evaluated {
44
+ const outcomes: Record<ModelRule.Other.Action, Rule[]> = { review: [], reject: [], flag: [] }
47
45
  const [other, scorers] = rules.reduce(
48
46
  (r: [ModelRule.Other[], ModelRule.Score[]], rule) => {
49
- rule.action == "score" ? r[1].push(rule) : r[0].push(rule)
47
+ if (shouldUse(state.transaction.kind, rule, state.organization?.groups))
48
+ rule.action == "score" ? r[1].push(rule) : r[0].push(rule)
50
49
  return r
51
50
  },
52
51
  [[], []]
53
52
  )
54
53
  state.transaction.risk = score(scorers, state, macros)
55
- result.risk = state.transaction.risk
56
- other.forEach(rule => control(rule, state, macros) && result[rule.action].push(rule))
57
- return result
54
+ const notes: Note[] = []
55
+ const flags: Set<string> = new Set()
56
+ const now = isoly.DateTime.now()
57
+ for (const rule of other) {
58
+ if (control(rule, state, macros)) {
59
+ outcomes[rule.action].push(rule)
60
+ notes.push({ author: "automatic", created: now, text: rule.name, rule })
61
+ rule.flags.forEach(f => flags.add(f))
62
+ }
63
+ }
64
+ const outcome = outcomes.reject.length > 0 ? "reject" : outcomes.review.length > 0 ? "review" : "approve"
65
+ return { ...state, flags: [...flags], notes, outcomes, outcome }
58
66
  }
59
67
  export function isLegacy(rule: Rule): boolean {
60
- return !isly.string(ModelRule.Base.categories).is(rule.category)
68
+ return !ModelRule.Base.Category.type.is(rule.category)
61
69
  }
62
70
  export function fromLegacy(rule: Rule): Rule {
63
71
  return isLegacy(rule) ? { ...rule, category: "fincrime" } : rule
@@ -10,9 +10,15 @@ export interface Base {
10
10
  groups?: string[];
11
11
  }
12
12
  export declare namespace Base {
13
- const kinds: readonly ["authorization", "outbound", "inbound"];
14
- type Kind = typeof kinds[number];
15
- const categories: readonly ["fincrime", "product", "customer"];
16
- type Category = typeof categories[number];
13
+ type Kind = typeof Kind.values[number];
14
+ namespace Kind {
15
+ const values: readonly ["authorization", "outbound", "inbound"];
16
+ const type: isly.Type<"authorization" | "outbound" | "inbound">;
17
+ }
18
+ type Category = typeof Category.values[number];
19
+ namespace Category {
20
+ const values: readonly ["fincrime", "product", "customer"];
21
+ const type: isly.Type<"product" | "fincrime" | "customer">;
22
+ }
17
23
  const type: isly.object.ExtendableType<Base>;
18
24
  }
@@ -1,14 +1,22 @@
1
1
  import { isly } from "isly";
2
2
  export var Base;
3
3
  (function (Base) {
4
- Base.kinds = ["authorization", "outbound", "inbound"];
5
- Base.categories = ["fincrime", "product", "customer"];
4
+ let Kind;
5
+ (function (Kind) {
6
+ Kind.values = ["authorization", "outbound", "inbound"];
7
+ Kind.type = isly.string(Kind.values);
8
+ })(Kind = Base.Kind || (Base.Kind = {}));
9
+ let Category;
10
+ (function (Category) {
11
+ Category.values = ["fincrime", "product", "customer"];
12
+ Category.type = isly.string(Category.values);
13
+ })(Category = Base.Category || (Base.Category = {}));
6
14
  Base.type = isly.object({
7
- code: isly.string(new RegExp(/^[a-z0-9\-_]+$/)),
15
+ code: isly.string(/^[a-z0-9\-_]+$/),
8
16
  name: isly.string(),
9
17
  description: isly.string(),
10
- type: isly.string(Base.kinds),
11
- category: isly.string(Base.categories),
18
+ type: Kind.type,
19
+ category: Category.type,
12
20
  condition: isly.string(),
13
21
  flags: isly.string().array(),
14
22
  groups: isly.string().array().optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"Base.js","sourceRoot":"../","sources":["Rule/Rule/Base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAY3B,MAAM,KAAW,IAAI,CAepB;AAfD,WAAiB,IAAI;IACP,UAAK,GAAG,CAAC,eAAe,EAAE,UAAU,EAAE,SAAS,CAAU,CAAA;IAEzD,eAAU,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,CAAU,CAAA;IAEzD,SAAI,GAAG,IAAI,CAAC,MAAM,CAAO;QACrC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAC/C,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE;QAC1B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,KAAA,KAAK,CAAC;QACxB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,KAAA,UAAU,CAAC;QACjC,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,EAfgB,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5
5
  }
6
6
  export declare namespace Other {
7
- const actions: readonly ["review", "reject", "flag"];
8
- type Action = typeof actions[number];
7
+ type Action = typeof Action.values[number];
8
+ namespace Action {
9
+ const values: readonly ["review", "reject", "flag"];
10
+ const type: isly.Type<"review" | "reject" | "flag">;
11
+ }
9
12
  const type: isly.object.ExtendableType<Other>;
10
13
  }
@@ -2,7 +2,11 @@ import { isly } from "isly";
2
2
  import { Base } from "./Base";
3
3
  export var Other;
4
4
  (function (Other) {
5
- Other.actions = ["review", "reject", "flag"];
6
- Other.type = Base.type.extend({ action: isly.string(Other.actions) });
5
+ let Action;
6
+ (function (Action) {
7
+ Action.values = ["review", "reject", "flag"];
8
+ Action.type = isly.string(Action.values);
9
+ })(Action = Other.Action || (Other.Action = {}));
10
+ Other.type = Base.type.extend({ action: Action.type });
7
11
  })(Other || (Other = {}));
8
12
  //# sourceMappingURL=Other.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Other.js","sourceRoot":"../","sources":["Rule/Rule/Other.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAK7B,MAAM,KAAW,KAAK,CAIrB;AAJD,WAAiB,KAAK;IACR,aAAO,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAA;IAE/C,UAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAS,MAAA,OAAO,CAAC,EAAE,CAAC,CAAA;AACtF,CAAC,EAJgB,KAAK,KAAL,KAAK,QAIrB"}
1
+ {"version":3,"file":"Other.js","sourceRoot":"../","sources":["Rule/Rule/Other.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAK7B,MAAM,KAAW,KAAK,CAOrB;AAPD,WAAiB,KAAK;IAErB,IAAiB,MAAM,CAGtB;IAHD,WAAiB,MAAM;QACT,aAAM,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAA;QAC9C,WAAI,GAAG,IAAI,CAAC,MAAM,CAAS,OAAA,MAAM,CAAC,CAAA;IAChD,CAAC,EAHgB,MAAM,GAAN,YAAM,KAAN,YAAM,QAGtB;IACY,UAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;AACrE,CAAC,EAPgB,KAAK,KAAL,KAAK,QAOrB"}
@@ -7,7 +7,10 @@ export declare namespace Rule {
7
7
  export import Other = RuleOther;
8
8
  export import Score = RuleScore;
9
9
  export import Base = RuleBase;
10
- const actions: readonly ["review", "reject", "flag", "score"];
11
- type Action = typeof actions[number];
10
+ type Action = typeof Action.values[number];
11
+ namespace Action {
12
+ const values: readonly ["review", "reject", "flag", "score"];
13
+ const type: isly.Type<"review" | "reject" | "flag" | "score">;
14
+ }
12
15
  }
13
16
  export declare const type: isly.Type<RuleOther | RuleScore>;
@@ -7,7 +7,11 @@ export var Rule;
7
7
  Rule.Other = RuleOther;
8
8
  Rule.Score = RuleScore;
9
9
  Rule.Base = RuleBase;
10
- Rule.actions = [...Rule.Other.actions, "score"];
10
+ let Action;
11
+ (function (Action) {
12
+ Action.values = [...Rule.Other.Action.values, "score"];
13
+ Action.type = isly.string(Action.values);
14
+ })(Action = Rule.Action || (Rule.Action = {}));
11
15
  })(Rule || (Rule = {}));
12
16
  export const type = isly.union(Rule.Other.type, Rule.Score.type);
13
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Rule/Rule/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,IAAI,QAAQ,E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KAAN,WAAM,QAGtB;AACF,CAAC,EATgB,IAAI,KAAJ,IAAI,QASpB;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAkD,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA"}
@@ -1,6 +1,8 @@
1
1
  import { isoly } from "isoly";
2
2
  import type { Transaction as ModelTransaction } from "../../Transaction";
3
+ import { Rule } from "../Rule";
3
4
  export interface Transaction extends Omit<ModelTransaction.Creatable, "currency" | "amount"> {
5
+ kind: Rule.Base.Kind;
4
6
  amount: number;
5
7
  risk?: number;
6
8
  original: {
@@ -9,5 +11,5 @@ export interface Transaction extends Omit<ModelTransaction.Creatable, "currency"
9
11
  };
10
12
  }
11
13
  export declare namespace Transaction {
12
- function from(transaction: ModelTransaction.Creatable): Transaction;
14
+ function from(transaction: ModelTransaction.Creatable, kind: Rule.Base.Kind): Transaction;
13
15
  }
@@ -1,8 +1,9 @@
1
1
  export var Transaction;
2
2
  (function (Transaction) {
3
- function from(transaction) {
3
+ function from(transaction, kind) {
4
4
  return {
5
5
  ...transaction,
6
+ kind,
6
7
  amount: Math.abs(transaction.amount),
7
8
  original: { currency: transaction.currency, amount: Math.abs(transaction.amount) },
8
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Transaction.js","sourceRoot":"../","sources":["Rule/State/Transaction.ts"],"names":[],"mappings":"AAQA,MAAM,KAAW,WAAW,CAQ3B;AARD,WAAiB,WAAW;IAC3B,SAAgB,IAAI,CAAC,WAAuC;QAC3D,OAAO;YACN,GAAG,WAAW;YACd,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC;YACpC,QAAQ,EAAE,EAAE,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE;SAClF,CAAA;IACF,CAAC;IANe,gBAAI,OAMnB,CAAA;AACF,CAAC,EARgB,WAAW,KAAX,WAAW,QAQ3B"}
1
+ {"version":3,"file":"Transaction.js","sourceRoot":"../","sources":["Rule/State/Transaction.ts"],"names":[],"mappings":"AAUA,MAAM,KAAW,WAAW,CAS3B;AATD,WAAiB,WAAW;IAC3B,SAAgB,IAAI,CAAC,WAAuC,EAAE,IAAoB;QACjF,OAAO;YACN,GAAG,WAAW;YACd,IAAI;YACJ,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC;YACpC,QAAQ,EAAE,EAAE,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE;SAClF,CAAA;IACF,CAAC;IAPe,gBAAI,OAOnB,CAAA;AACF,CAAC,EATgB,WAAW,KAAX,WAAW,QAS3B"}
@@ -1,5 +1,7 @@
1
+ import { isly } from "isly";
1
2
  import { Account as ModelAccount } from "../../Account";
2
3
  import { Transaction as ModelTransaction } from "../../Transaction";
4
+ import { Rule } from "../Rule";
3
5
  import { Account as StateAccount } from "./Account";
4
6
  import { Authorization as StateAuthorization } from "./Authorization";
5
7
  import { Card as StateCard } from "./Card";
@@ -8,15 +10,14 @@ import { Organization as StateOrganization } from "./Organization";
8
10
  import { Partial as StatePartial } from "./Partial";
9
11
  import { Transaction as StateTransaction } from "./Transaction";
10
12
  export interface State {
11
- data: StateData;
12
- account: StateAccount;
13
- transaction: StateTransaction;
14
- authorization?: StateAuthorization;
15
- card?: StateCard;
16
- organization?: StateOrganization;
13
+ data: State.Data;
14
+ account: State.Account;
15
+ transaction: State.Transaction;
16
+ authorization?: State.Authorization;
17
+ card?: State.Card;
18
+ organization?: State.Organization;
17
19
  }
18
20
  export declare namespace State {
19
- function from(data: StateData, account: ModelAccount, transactions: StateAccount.Transactions, days: StateAccount.Days, transaction: ModelTransaction.Creatable, authorization?: StateAuthorization, card?: StateCard, organization?: StateOrganization): State;
20
21
  export import Partial = StatePartial;
21
22
  export import Authorization = StateAuthorization;
22
23
  export import Card = StateCard;
@@ -24,4 +25,16 @@ export declare namespace State {
24
25
  export import Transaction = StateTransaction;
25
26
  export import Organization = StateOrganization;
26
27
  type Data = StateData;
28
+ type Outcome = typeof Outcome.values[number];
29
+ namespace Outcome {
30
+ const values: readonly ["approve", "reject", "review"];
31
+ const type: isly.Type<"review" | "reject" | "approve">;
32
+ }
33
+ interface Evaluated extends State {
34
+ outcomes: Record<Rule.Other.Action, Rule[]>;
35
+ outcome: Outcome;
36
+ flags: string[];
37
+ notes: ModelTransaction.Note[];
38
+ }
39
+ function from(data: Data, account: ModelAccount, transactions: Account.Transactions, days: Account.Days, transaction: ModelTransaction.Creatable, kind: Rule.Base.Kind, authorization?: Authorization, card?: Card, organization?: Organization): State;
27
40
  }
@@ -1,3 +1,4 @@
1
+ import { isly } from "isly";
1
2
  import { Account as StateAccount } from "./Account";
2
3
  import { Authorization as StateAuthorization } from "./Authorization";
3
4
  import { Card as StateCard } from "./Card";
@@ -6,22 +7,27 @@ import { Partial as StatePartial } from "./Partial";
6
7
  import { Transaction as StateTransaction } from "./Transaction";
7
8
  export var State;
8
9
  (function (State) {
9
- function from(data, account, transactions, days, transaction, authorization, card, organization) {
10
+ State.Partial = StatePartial;
11
+ State.Authorization = StateAuthorization;
12
+ State.Card = StateCard;
13
+ State.Account = StateAccount;
14
+ State.Transaction = StateTransaction;
15
+ State.Organization = StateOrganization;
16
+ let Outcome;
17
+ (function (Outcome) {
18
+ Outcome.values = ["approve", "reject", "review"];
19
+ Outcome.type = isly.string(Outcome.values);
20
+ })(Outcome = State.Outcome || (State.Outcome = {}));
21
+ function from(data, account, transactions, days, transaction, kind, authorization, card, organization) {
10
22
  return {
11
23
  data,
12
24
  account: State.Account.from(account, transactions, days),
13
- transaction: State.Transaction.from(transaction),
25
+ transaction: State.Transaction.from(transaction, kind),
14
26
  authorization,
15
27
  card,
16
28
  organization,
17
29
  };
18
30
  }
19
31
  State.from = from;
20
- State.Partial = StatePartial;
21
- State.Authorization = StateAuthorization;
22
- State.Card = StateCard;
23
- State.Account = StateAccount;
24
- State.Transaction = StateTransaction;
25
- State.Organization = StateOrganization;
26
32
  })(State || (State = {}));
27
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Rule/State/index.ts"],"names":[],"mappings":"AAEA,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;AAW/D,MAAM,KAAW,KAAK,CA2BrB;AA3BD,WAAiB,KAAK;IACrB,SAAgB,IAAI,CACnB,IAAe,EACf,OAAqB,EACrB,YAAuC,EACvC,IAAuB,EACvB,WAAuC,EACvC,aAAkC,EAClC,IAAgB,EAChB,YAAgC;QAEhC,OAAO;YACN,IAAI;YACJ,OAAO,EAAE,MAAA,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC;YAClD,WAAW,EAAE,MAAA,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC;YAC1C,aAAa;YACb,IAAI;YACJ,YAAY;SACZ,CAAA;IACF,CAAC;IAlBe,UAAI,OAkBnB,CAAA;IACa,aAAO,GAAG,YAAY,CAAA;IACtB,mBAAa,GAAG,kBAAkB,CAAA;IAClC,UAAI,GAAG,SAAS,CAAA;IAChB,aAAO,GAAG,YAAY,CAAA;IACtB,iBAAW,GAAG,gBAAgB,CAAA;IAC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MAAA,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC;YAClD,WAAW,EAAE,MAAA,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC;YAChD,aAAa;YACb,IAAI;YACJ,YAAY;SACZ,CAAA;IACF,CAAC;IAnBe,UAAI,OAmBnB,CAAA;AACF,CAAC,EAvCgB,KAAK,KAAL,KAAK,QAuCrB"}
@@ -1,30 +1,18 @@
1
1
  import { selectively } from "selectively";
2
- import { isly } from "isly";
3
2
  import { Rule as ModelRule } from "./Rule";
4
3
  import { State as RuleState } from "./State";
5
4
  export type Rule = ModelRule;
6
5
  export declare namespace Rule {
7
- type Action = ModelRule.Action;
8
- namespace Action {
9
- const values: readonly ["review", "reject", "flag", "score"];
10
- }
11
- type Category = ModelRule.Base.Category;
12
- namespace Category {
13
- const values: readonly ["fincrime", "product", "customer"];
14
- }
15
- type Kind = ModelRule.Base.Kind;
16
- namespace Kind {
17
- const values: readonly ["authorization", "outbound", "inbound"];
18
- }
6
+ export import Action = ModelRule.Action;
7
+ export import Category = ModelRule.Base.Category;
8
+ export import Kind = ModelRule.Base.Kind;
19
9
  export import Other = ModelRule.Other;
20
10
  export import Score = ModelRule.Score;
21
11
  export import State = RuleState;
22
- const type: isly.Type<Other | Score>;
23
- const is: isly.Type.IsFunction<Other | Score>;
24
- const flaw: isly.Type.FlawFunction;
25
- function evaluate(rules: Rule[], state: State, macros?: Record<string, selectively.Definition>): Record<ModelRule.Other.Action, Rule[]> & {
26
- risk?: number;
27
- };
12
+ const type: import("isly/dist/cjs/Type").Type<Other | Score>;
13
+ const is: import("isly/dist/cjs/Type").Type.IsFunction<Other | Score>;
14
+ const flaw: import("isly/dist/cjs/Type").Type.FlawFunction;
15
+ function evaluate(rules: Rule[], state: State, macros?: Record<string, selectively.Definition>): State.Evaluated;
28
16
  function isLegacy(rule: Rule): boolean;
29
17
  function fromLegacy(rule: Rule): Rule;
30
18
  }
@@ -1,28 +1,23 @@
1
+ import { isoly } from "isoly";
1
2
  import { selectively } from "selectively";
2
- import { isly } from "isly";
3
3
  import { definitions } from "./definitions";
4
4
  import { Rule as ModelRule, type as ruleType } from "./Rule";
5
5
  import { State as RuleState } from "./State";
6
6
  export var Rule;
7
7
  (function (Rule) {
8
- let Action;
9
- (function (Action) {
10
- Action.values = ModelRule.actions;
11
- })(Action = Rule.Action || (Rule.Action = {}));
12
- let Category;
13
- (function (Category) {
14
- Category.values = ModelRule.Base.categories;
15
- })(Category = Rule.Category || (Rule.Category = {}));
16
- let Kind;
17
- (function (Kind) {
18
- Kind.values = ModelRule.Base.kinds;
19
- })(Kind = Rule.Kind || (Rule.Kind = {}));
8
+ Rule.Action = ModelRule.Action;
9
+ Rule.Category = ModelRule.Base.Category;
10
+ Rule.Kind = ModelRule.Base.Kind;
20
11
  Rule.Other = ModelRule.Other;
21
12
  Rule.Score = ModelRule.Score;
22
13
  Rule.State = RuleState;
23
14
  Rule.type = ruleType;
24
15
  Rule.is = ruleType.is;
25
16
  Rule.flaw = ruleType.flaw;
17
+ function shouldUse(kind, rule, groups) {
18
+ return (kind == rule.type &&
19
+ (!rule.groups || rule.groups.some(ruleGroup => groups?.some(organizationGroup => organizationGroup == ruleGroup))));
20
+ }
26
21
  function control(rule, state, macros) {
27
22
  return selectively.resolve({ ...macros, ...definitions }, selectively.parse(rule.condition)).is(state);
28
23
  }
@@ -30,19 +25,29 @@ export var Rule;
30
25
  return rules.reduce((r, rule) => (control(rule, state, macros) ? (r ?? 100) * (rule.risk / 100) : undefined), undefined);
31
26
  }
32
27
  function evaluate(rules, state, macros) {
33
- const result = { review: [], reject: [], flag: [] };
28
+ const outcomes = { review: [], reject: [], flag: [] };
34
29
  const [other, scorers] = rules.reduce((r, rule) => {
35
- rule.action == "score" ? r[1].push(rule) : r[0].push(rule);
30
+ if (shouldUse(state.transaction.kind, rule, state.organization?.groups))
31
+ rule.action == "score" ? r[1].push(rule) : r[0].push(rule);
36
32
  return r;
37
33
  }, [[], []]);
38
34
  state.transaction.risk = score(scorers, state, macros);
39
- result.risk = state.transaction.risk;
40
- other.forEach(rule => control(rule, state, macros) && result[rule.action].push(rule));
41
- return result;
35
+ const notes = [];
36
+ const flags = new Set();
37
+ const now = isoly.DateTime.now();
38
+ for (const rule of other) {
39
+ if (control(rule, state, macros)) {
40
+ outcomes[rule.action].push(rule);
41
+ notes.push({ author: "automatic", created: now, text: rule.name, rule });
42
+ rule.flags.forEach(f => flags.add(f));
43
+ }
44
+ }
45
+ const outcome = outcomes.reject.length > 0 ? "reject" : outcomes.review.length > 0 ? "review" : "approve";
46
+ return { ...state, flags: [...flags], notes, outcomes, outcome };
42
47
  }
43
48
  Rule.evaluate = evaluate;
44
49
  function isLegacy(rule) {
45
- return !isly.string(ModelRule.Base.categories).is(rule.category);
50
+ return !ModelRule.Base.Category.type.is(rule.category);
46
51
  }
47
52
  Rule.isLegacy = isLegacy;
48
53
  function fromLegacy(rule) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Rule/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAC5D,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,SAAS,CAAA;AAI5C,MAAM,KAAW,IAAI,CAwDpB;AAxDD,WAAiB,IAAI;IAEpB,IAAiB,MAAM,CAEtB;IAFD,WAAiB,MAAM;QACT,aAAM,GAAG,SAAS,CAAC,OAAO,CAAA;IACxC,CAAC,EAFgB,MAAM,GAAN,WAAM,KAAN,WAAM,QAEtB;IAED,IAAiB,QAAQ,CAExB;IAFD,WAAiB,QAAQ;QACX,eAAM,GAAG,SAAS,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AAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;IACjE,CAAC;IAFe,eAAU,aAEzB,CAAA;AACF,CAAC,EA/DgB,IAAI,KAAJ,IAAI,QA+DpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.311",
3
+ "version": "0.1.313",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",