@pax2pay/model-banking 0.1.138 → 0.1.139
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/Client/Organizations/Rules.ts +3 -3
- package/Organization/Creatable.ts +2 -2
- package/Organization/index.ts +0 -8
- package/Realm.ts +8 -0
- package/Rule/State/Account.ts +11 -4
- package/Rule/State/Transaction.ts +2 -2
- package/Rule/State/index.ts +5 -4
- package/Transaction/Note.ts +3 -3
- package/Transaction/index.ts +4 -0
- package/dist/Client/Organizations/Rules.d.ts +2 -2
- package/dist/Client/Organizations/Rules.js.map +1 -1
- package/dist/Organization/Creatable.d.ts +1 -1
- package/dist/Organization/Creatable.js +2 -2
- package/dist/Organization/Creatable.js.map +1 -1
- package/dist/Organization/index.d.ts +0 -6
- package/dist/Organization/index.js +0 -2
- package/dist/Organization/index.js.map +1 -1
- package/dist/Realm.d.ts +2 -0
- package/dist/Realm.js +7 -0
- package/dist/Realm.js.map +1 -1
- package/dist/Rule/State/Account.d.ts +28 -2
- package/dist/Rule/State/Account.js +2 -2
- package/dist/Rule/State/Account.js.map +1 -1
- package/dist/Rule/State/Transaction.d.ts +2 -2
- package/dist/Rule/State/Transaction.js.map +1 -1
- package/dist/Rule/State/index.d.ts +2 -2
- package/dist/Rule/State/index.js +3 -3
- package/dist/Rule/State/index.js.map +1 -1
- package/dist/Transaction/Note.d.ts +1 -0
- package/dist/Transaction/Note.js +2 -3
- package/dist/Transaction/Note.js.map +1 -1
- package/dist/Transaction/index.d.ts +1 -0
- package/dist/Transaction/index.js +3 -0
- package/dist/Transaction/index.js.map +1 -1
- package/package.json +1 -1
- package/Organization/Rule.ts +0 -43
- package/dist/Organization/Rule.d.ts +0 -26
- package/dist/Organization/Rule.js +0 -28
- package/dist/Organization/Rule.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { gracely } from "gracely"
|
|
2
2
|
import { http } from "cloudly-http"
|
|
3
3
|
import * as rest from "cloudly-rest"
|
|
4
|
-
import {
|
|
4
|
+
import { Rule } from "../../Rule"
|
|
5
5
|
|
|
6
6
|
export class Rules extends rest.Collection<gracely.Error> {
|
|
7
7
|
constructor(client: http.Client) {
|
|
8
8
|
super(client)
|
|
9
9
|
}
|
|
10
|
-
async replace(organization: string, rules:
|
|
11
|
-
return this.client.put<
|
|
10
|
+
async replace(organization: string, rules: Rule[]): Promise<Rule[] | gracely.Error> {
|
|
11
|
+
return this.client.put<Rule[]>(`/organization/rule`, rules, {
|
|
12
12
|
organization: organization,
|
|
13
13
|
})
|
|
14
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
2
|
import { Realm } from "../Realm"
|
|
3
|
+
import { Rule } from "../Rule"
|
|
3
4
|
import { Contact } from "./Contact"
|
|
4
|
-
import { Rule } from "./Rule"
|
|
5
5
|
|
|
6
6
|
export interface Creatable {
|
|
7
7
|
name: string
|
|
@@ -14,7 +14,7 @@ export namespace Creatable {
|
|
|
14
14
|
export const type = isly.object<Creatable>({
|
|
15
15
|
name: isly.string(),
|
|
16
16
|
realm: Realm.type,
|
|
17
|
-
rules:
|
|
17
|
+
rules: Rule.type.array(),
|
|
18
18
|
contact: Contact.type.optional(),
|
|
19
19
|
})
|
|
20
20
|
export const is = type.is
|
package/Organization/index.ts
CHANGED
|
@@ -2,12 +2,10 @@ import * as cryptly from "cryptly"
|
|
|
2
2
|
import { Changeable as OrganizationChangeable } from "./Changeable"
|
|
3
3
|
import { Contact as OrganizationContact } from "./Contact"
|
|
4
4
|
import { Creatable as OrganizationCreatable } from "./Creatable"
|
|
5
|
-
import { Rule as OrganizationRule } from "./Rule"
|
|
6
5
|
|
|
7
6
|
export interface Organization extends OrganizationCreatable {
|
|
8
7
|
readonly id: cryptly.Identifier
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
export namespace Organization {
|
|
12
10
|
export function is(value: Organization | any): value is Organization {
|
|
13
11
|
return value && OrganizationCreatable.is({ ...value }) && typeof value.id == "string"
|
|
@@ -18,7 +16,6 @@ export namespace Organization {
|
|
|
18
16
|
export function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier {
|
|
19
17
|
return cryptly.Identifier.is(value, 8)
|
|
20
18
|
}
|
|
21
|
-
|
|
22
19
|
export type Creatable = OrganizationCreatable
|
|
23
20
|
export const Creatable = OrganizationCreatable
|
|
24
21
|
export type Changeable = OrganizationChangeable
|
|
@@ -29,9 +26,4 @@ export namespace Organization {
|
|
|
29
26
|
export type Address = OrganizationContact.Address
|
|
30
27
|
export type Addresses = OrganizationContact.Addresses
|
|
31
28
|
}
|
|
32
|
-
export type Rule = OrganizationRule
|
|
33
|
-
export const Rule = OrganizationRule
|
|
34
|
-
export namespace Rule {
|
|
35
|
-
export type Result = OrganizationRule.Result
|
|
36
|
-
}
|
|
37
29
|
}
|
package/Realm.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
1
2
|
import { isly } from "isly"
|
|
2
3
|
import { Supplier as modelSupplier } from "./Supplier"
|
|
3
4
|
|
|
@@ -11,6 +12,13 @@ export namespace Realm {
|
|
|
11
12
|
export function toString(): string {
|
|
12
13
|
return realms.toString().replaceAll(",", ", ") + "."
|
|
13
14
|
}
|
|
15
|
+
export const currency: Record<Realm, isoly.Currency> = {
|
|
16
|
+
test: "EUR",
|
|
17
|
+
upcheck: "EUR",
|
|
18
|
+
testUK: "GBP",
|
|
19
|
+
uk: "GBP",
|
|
20
|
+
eu: "EUR",
|
|
21
|
+
}
|
|
14
22
|
export const suppliers: Record<Realm, modelSupplier[]> = {
|
|
15
23
|
test: ["paxgiro"],
|
|
16
24
|
testUK: ["clearbank"],
|
package/Rule/State/Account.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { Account as ModelAccount } from "../../Account"
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export interface Account extends ModelAccount {
|
|
4
|
+
transactions: Account.Transactions
|
|
5
|
+
}
|
|
5
6
|
export namespace Account {
|
|
6
|
-
export
|
|
7
|
-
|
|
7
|
+
export interface Transactions {
|
|
8
|
+
today: { count: number; amount: number }
|
|
9
|
+
incoming: { today: { count: number; amount: number } }
|
|
10
|
+
outgoing: { today: { count: number; amount: number } }
|
|
11
|
+
card: { today: { count: number; amount: number } }
|
|
12
|
+
}
|
|
13
|
+
export function from(account: ModelAccount, transactions: Transactions): Account {
|
|
14
|
+
return { ...account, transactions }
|
|
8
15
|
}
|
|
9
16
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Transaction as ModelTransaction } from "../../Transaction"
|
|
2
2
|
|
|
3
|
-
export type Transaction = ModelTransaction
|
|
3
|
+
export type Transaction = ModelTransaction.Creatable
|
|
4
4
|
|
|
5
5
|
export namespace Transaction {
|
|
6
|
-
export function from(transaction: ModelTransaction): Transaction {
|
|
6
|
+
export function from(transaction: ModelTransaction.Creatable): Transaction {
|
|
7
7
|
return transaction
|
|
8
8
|
}
|
|
9
9
|
}
|
package/Rule/State/index.ts
CHANGED
|
@@ -10,23 +10,24 @@ import { Transaction as StateTransaction } from "./Transaction"
|
|
|
10
10
|
|
|
11
11
|
export interface State {
|
|
12
12
|
account: StateAccount
|
|
13
|
+
transaction: StateTransaction
|
|
13
14
|
authorization?: StateAuthorization
|
|
14
15
|
card?: StateCard
|
|
15
|
-
transaction: StateTransaction
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export namespace State {
|
|
19
19
|
export function from(
|
|
20
20
|
account: ModelAccount,
|
|
21
|
-
|
|
21
|
+
transactions: StateAccount.Transactions,
|
|
22
|
+
transaction: ModelTransaction.Creatable,
|
|
22
23
|
authorization?: ModelAuthorization.Creatable,
|
|
23
24
|
card?: ModelCard
|
|
24
25
|
): State {
|
|
25
26
|
return {
|
|
26
|
-
account: Account.from(account),
|
|
27
|
+
account: Account.from(account, transactions),
|
|
28
|
+
transaction: Transaction.from(transaction),
|
|
27
29
|
authorization: authorization && Authorization.from(authorization),
|
|
28
30
|
card: card && Card.from(card),
|
|
29
|
-
transaction: Transaction.from(transaction),
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
export type Partial = StatePartial
|
package/Transaction/Note.ts
CHANGED
|
@@ -13,19 +13,19 @@ export namespace Note {
|
|
|
13
13
|
export interface Creatable {
|
|
14
14
|
text?: string
|
|
15
15
|
action?: "approve" | "reject"
|
|
16
|
+
flags?: string[]
|
|
16
17
|
}
|
|
17
18
|
export namespace Creatable {
|
|
18
19
|
export const type = isly.object<Creatable>({
|
|
19
20
|
text: isly.string().optional(),
|
|
20
21
|
action: isly.string(["approve", "reject"]).optional(),
|
|
22
|
+
flags: isly.string().array().optional(),
|
|
21
23
|
})
|
|
22
24
|
export const is = type.is
|
|
23
25
|
}
|
|
24
|
-
export const type =
|
|
26
|
+
export const type = Creatable.type.extend<Note>({
|
|
25
27
|
author: isly.string(),
|
|
26
28
|
created: isly.string(),
|
|
27
|
-
text: isly.string().optional(),
|
|
28
|
-
action: isly.string(["approve", "reject"]).optional(),
|
|
29
29
|
})
|
|
30
30
|
export const is = type.is
|
|
31
31
|
}
|
package/Transaction/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ export interface Transaction extends TransactionCreatable {
|
|
|
20
20
|
operations: Operation[]
|
|
21
21
|
status: "created" | "approved" | "rejected" | "processing" | "finalized"
|
|
22
22
|
flags: ("review" | string)[]
|
|
23
|
+
oldFlags: string[]
|
|
23
24
|
notes: TransactionNote[]
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -36,6 +37,7 @@ export namespace Transaction {
|
|
|
36
37
|
operations: isly.array(isly.fromIs("Operation", Operation.is)),
|
|
37
38
|
status: isly.string(["created", "approved", "rejected", "processing", "finalized"]),
|
|
38
39
|
flags: isly.array(isly.string() || "review"),
|
|
40
|
+
oldFlags: isly.string().array(),
|
|
39
41
|
notes: isly.array(isly.fromIs("TransactionNote", TransactionNote.is)),
|
|
40
42
|
})
|
|
41
43
|
export const is = type.is
|
|
@@ -65,6 +67,7 @@ export namespace Transaction {
|
|
|
65
67
|
operations: transaction.operations.map(o => Operation.fromCreatable(id, o)),
|
|
66
68
|
status: "created",
|
|
67
69
|
flags: [],
|
|
70
|
+
oldFlags: [],
|
|
68
71
|
notes: [],
|
|
69
72
|
}
|
|
70
73
|
}
|
|
@@ -89,6 +92,7 @@ export namespace Transaction {
|
|
|
89
92
|
operations: transaction.operations.map(o => Operation.fromCreatable(id, o)),
|
|
90
93
|
status: "created",
|
|
91
94
|
flags: [],
|
|
95
|
+
oldFlags: [],
|
|
92
96
|
notes: [],
|
|
93
97
|
}
|
|
94
98
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { gracely } from "gracely";
|
|
2
2
|
import { http } from "cloudly-http";
|
|
3
3
|
import * as rest from "cloudly-rest";
|
|
4
|
-
import {
|
|
4
|
+
import { Rule } from "../../Rule";
|
|
5
5
|
export declare class Rules extends rest.Collection<gracely.Error> {
|
|
6
6
|
constructor(client: http.Client);
|
|
7
|
-
replace(organization: string, rules:
|
|
7
|
+
replace(organization: string, rules: Rule[]): Promise<Rule[] | gracely.Error>;
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/Organizations/Rules.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,KAAM,SAAQ,IAAI,CAAC,UAAyB;IACxD,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,YAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/Organizations/Rules.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,KAAM,SAAQ,IAAI,CAAC,UAAyB;IACxD,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,YAAoB,EAAE,KAAa;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAS,oBAAoB,EAAE,KAAK,EAAE;YAC3D,YAAY,EAAE,YAAY;SAC1B,CAAC,CAAA;IACH,CAAC;CACD"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
2
|
import { Realm } from "../Realm";
|
|
3
|
+
import { Rule } from "../Rule";
|
|
3
4
|
import { Contact } from "./Contact";
|
|
4
|
-
import { Rule } from "./Rule";
|
|
5
5
|
export var Creatable;
|
|
6
6
|
(function (Creatable) {
|
|
7
7
|
Creatable.type = isly.object({
|
|
8
8
|
name: isly.string(),
|
|
9
9
|
realm: Realm.type,
|
|
10
|
-
rules:
|
|
10
|
+
rules: Rule.type.array(),
|
|
11
11
|
contact: Contact.type.optional(),
|
|
12
12
|
});
|
|
13
13
|
Creatable.is = Creatable.type.is;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Organization/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Organization/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AASnC,MAAM,KAAW,SAAS,CASzB;AATD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;QAC1C,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,KAAK,EAAE,KAAK,CAAC,IAAI;QACjB,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;QACxB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE;KAChC,CAAC,CAAA;IACW,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;IACZ,cAAI,GAAG,UAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EATgB,SAAS,KAAT,SAAS,QASzB"}
|
|
@@ -2,7 +2,6 @@ import * as cryptly from "cryptly";
|
|
|
2
2
|
import { Changeable as OrganizationChangeable } from "./Changeable";
|
|
3
3
|
import { Contact as OrganizationContact } from "./Contact";
|
|
4
4
|
import { Creatable as OrganizationCreatable } from "./Creatable";
|
|
5
|
-
import { Rule as OrganizationRule } from "./Rule";
|
|
6
5
|
export interface Organization extends OrganizationCreatable {
|
|
7
6
|
readonly id: cryptly.Identifier;
|
|
8
7
|
}
|
|
@@ -20,9 +19,4 @@ export declare namespace Organization {
|
|
|
20
19
|
type Address = OrganizationContact.Address;
|
|
21
20
|
type Addresses = OrganizationContact.Addresses;
|
|
22
21
|
}
|
|
23
|
-
type Rule = OrganizationRule;
|
|
24
|
-
const Rule: typeof OrganizationRule;
|
|
25
|
-
namespace Rule {
|
|
26
|
-
type Result = OrganizationRule.Result;
|
|
27
|
-
}
|
|
28
22
|
}
|
|
@@ -2,7 +2,6 @@ import * as cryptly from "cryptly";
|
|
|
2
2
|
import { Changeable as OrganizationChangeable } from "./Changeable";
|
|
3
3
|
import { Contact as OrganizationContact } from "./Contact";
|
|
4
4
|
import { Creatable as OrganizationCreatable } from "./Creatable";
|
|
5
|
-
import { Rule as OrganizationRule } from "./Rule";
|
|
6
5
|
export var Organization;
|
|
7
6
|
(function (Organization) {
|
|
8
7
|
function is(value) {
|
|
@@ -20,6 +19,5 @@ export var Organization;
|
|
|
20
19
|
Organization.Creatable = OrganizationCreatable;
|
|
21
20
|
Organization.Changeable = OrganizationChangeable;
|
|
22
21
|
Organization.Contact = OrganizationContact;
|
|
23
|
-
Organization.Rule = OrganizationRule;
|
|
24
22
|
})(Organization || (Organization = {}));
|
|
25
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Organization/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,UAAU,IAAI,sBAAsB,EAAE,MAAM,cAAc,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAC1D,OAAO,EAAE,SAAS,IAAI,qBAAqB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Organization/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,UAAU,IAAI,sBAAsB,EAAE,MAAM,cAAc,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAC1D,OAAO,EAAE,SAAS,IAAI,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAKhE,MAAM,KAAW,YAAY,CAoB5B;AApBD,WAAiB,YAAY;IAC5B,SAAgB,EAAE,CAAC,KAAyB;QAC3C,OAAO,KAAK,IAAI,qBAAqB,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,IAAI,OAAO,KAAK,CAAC,EAAE,IAAI,QAAQ,CAAA;IACtF,CAAC;IAFe,eAAE,KAEjB,CAAA;IACD,SAAgB,aAAa,CAAC,YAAuB;QACpD,OAAO,EAAE,GAAG,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/D,CAAC;IAFe,0BAAa,gBAE5B,CAAA;IACD,SAAgB,YAAY,CAAC,KAA+B;QAC3D,OAAO,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IACvC,CAAC;IAFe,yBAAY,eAE3B,CAAA;IAEY,sBAAS,GAAG,qBAAqB,CAAA;IAEjC,uBAAU,GAAG,sBAAsB,CAAA;IAEnC,oBAAO,GAAG,mBAAmB,CAAA;AAK3C,CAAC,EApBgB,YAAY,KAAZ,YAAY,QAoB5B"}
|
package/dist/Realm.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
1
2
|
import { isly } from "isly";
|
|
2
3
|
import { Supplier as modelSupplier } from "./Supplier";
|
|
3
4
|
export type Realm = typeof Realm.realms[number];
|
|
@@ -7,6 +8,7 @@ export declare namespace Realm {
|
|
|
7
8
|
const is: isly.Type.IsFunction<"eu" | "uk" | "test" | "testUK" | "upcheck">;
|
|
8
9
|
const flaw: isly.Type.FlawFunction;
|
|
9
10
|
function toString(): string;
|
|
11
|
+
const currency: Record<Realm, isoly.Currency>;
|
|
10
12
|
const suppliers: Record<Realm, modelSupplier[]>;
|
|
11
13
|
interface Suppliers extends Record<Realm, modelSupplier[]> {
|
|
12
14
|
test: ["paxgiro"];
|
package/dist/Realm.js
CHANGED
|
@@ -9,6 +9,13 @@ export var Realm;
|
|
|
9
9
|
return Realm.realms.toString().replaceAll(",", ", ") + ".";
|
|
10
10
|
}
|
|
11
11
|
Realm.toString = toString;
|
|
12
|
+
Realm.currency = {
|
|
13
|
+
test: "EUR",
|
|
14
|
+
upcheck: "EUR",
|
|
15
|
+
testUK: "GBP",
|
|
16
|
+
uk: "GBP",
|
|
17
|
+
eu: "EUR",
|
|
18
|
+
};
|
|
12
19
|
Realm.suppliers = {
|
|
13
20
|
test: ["paxgiro"],
|
|
14
21
|
testUK: ["clearbank"],
|
package/dist/Realm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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R,cAAQ,KAAR,cAAQ,QAIxB;AACF,CAAC,EAnCgB,KAAK,KAAL,KAAK,QAmCrB"}
|
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
import type { Account as ModelAccount } from "../../Account";
|
|
2
|
-
export
|
|
2
|
+
export interface Account extends ModelAccount {
|
|
3
|
+
transactions: Account.Transactions;
|
|
4
|
+
}
|
|
3
5
|
export declare namespace Account {
|
|
4
|
-
|
|
6
|
+
interface Transactions {
|
|
7
|
+
today: {
|
|
8
|
+
count: number;
|
|
9
|
+
amount: number;
|
|
10
|
+
};
|
|
11
|
+
incoming: {
|
|
12
|
+
today: {
|
|
13
|
+
count: number;
|
|
14
|
+
amount: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
outgoing: {
|
|
18
|
+
today: {
|
|
19
|
+
count: number;
|
|
20
|
+
amount: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
card: {
|
|
24
|
+
today: {
|
|
25
|
+
count: number;
|
|
26
|
+
amount: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function from(account: ModelAccount, transactions: Transactions): Account;
|
|
5
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.js","sourceRoot":"../","sources":["Rule/State/Account.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Account.js","sourceRoot":"../","sources":["Rule/State/Account.ts"],"names":[],"mappings":"AAKA,MAAM,KAAW,OAAO,CAUvB;AAVD,WAAiB,OAAO;IAOvB,SAAgB,IAAI,CAAC,OAAqB,EAAE,YAA0B;QACrE,OAAO,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,CAAA;IACpC,CAAC;IAFe,YAAI,OAEnB,CAAA;AACF,CAAC,EAVgB,OAAO,KAAP,OAAO,QAUvB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Transaction as ModelTransaction } from "../../Transaction";
|
|
2
|
-
export type Transaction = ModelTransaction;
|
|
2
|
+
export type Transaction = ModelTransaction.Creatable;
|
|
3
3
|
export declare namespace Transaction {
|
|
4
|
-
function from(transaction: ModelTransaction): Transaction;
|
|
4
|
+
function from(transaction: ModelTransaction.Creatable): Transaction;
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"../","sources":["Rule/State/Transaction.ts"],"names":[],"mappings":"AAIA,MAAM,KAAW,WAAW,CAI3B;AAJD,WAAiB,WAAW;IAC3B,SAAgB,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"Transaction.js","sourceRoot":"../","sources":["Rule/State/Transaction.ts"],"names":[],"mappings":"AAIA,MAAM,KAAW,WAAW,CAI3B;AAJD,WAAiB,WAAW;IAC3B,SAAgB,IAAI,CAAC,WAAuC;QAC3D,OAAO,WAAW,CAAA;IACnB,CAAC;IAFe,gBAAI,OAEnB,CAAA;AACF,CAAC,EAJgB,WAAW,KAAX,WAAW,QAI3B"}
|
|
@@ -9,12 +9,12 @@ import { Partial as StatePartial } from "./Partial";
|
|
|
9
9
|
import { Transaction as StateTransaction } from "./Transaction";
|
|
10
10
|
export interface State {
|
|
11
11
|
account: StateAccount;
|
|
12
|
+
transaction: StateTransaction;
|
|
12
13
|
authorization?: StateAuthorization;
|
|
13
14
|
card?: StateCard;
|
|
14
|
-
transaction: StateTransaction;
|
|
15
15
|
}
|
|
16
16
|
export declare namespace State {
|
|
17
|
-
function from(account: ModelAccount, transaction: ModelTransaction, authorization?: ModelAuthorization.Creatable, card?: ModelCard): State;
|
|
17
|
+
function from(account: ModelAccount, transactions: StateAccount.Transactions, transaction: ModelTransaction.Creatable, authorization?: ModelAuthorization.Creatable, card?: ModelCard): State;
|
|
18
18
|
type Partial = StatePartial;
|
|
19
19
|
const Partial: typeof StatePartial;
|
|
20
20
|
type Account = StateAccount;
|
package/dist/Rule/State/index.js
CHANGED
|
@@ -5,12 +5,12 @@ import { Partial as StatePartial } from "./Partial";
|
|
|
5
5
|
import { Transaction as StateTransaction } from "./Transaction";
|
|
6
6
|
export var State;
|
|
7
7
|
(function (State) {
|
|
8
|
-
function from(account, transaction, authorization, card) {
|
|
8
|
+
function from(account, transactions, transaction, authorization, card) {
|
|
9
9
|
return {
|
|
10
|
-
account: State.Account.from(account),
|
|
10
|
+
account: State.Account.from(account, transactions),
|
|
11
|
+
transaction: State.Transaction.from(transaction),
|
|
11
12
|
authorization: authorization && State.Authorization.from(authorization),
|
|
12
13
|
card: card && State.Card.from(card),
|
|
13
|
-
transaction: State.Transaction.from(transaction),
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
State.from = from;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Rule/State/index.ts"],"names":[],"mappings":"AAIA,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;AAC1C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAS/D,MAAM,KAAW,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Rule/State/index.ts"],"names":[],"mappings":"AAIA,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;AAC1C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAS/D,MAAM,KAAW,KAAK,CAyBrB;AAzBD,WAAiB,KAAK;IACrB,SAAgB,IAAI,CACnB,OAAqB,EACrB,YAAuC,EACvC,WAAuC,EACvC,aAA4C,EAC5C,IAAgB;QAEhB,OAAO;YACN,OAAO,EAAE,MAAA,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC;YAC5C,WAAW,EAAE,MAAA,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC;YAC1C,aAAa,EAAE,aAAa,IAAI,MAAA,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC;YACjE,IAAI,EAAE,IAAI,IAAI,MAAA,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;SAC7B,CAAA;IACF,CAAC;IAbe,UAAI,OAanB,CAAA;IAEY,aAAO,GAAG,YAAY,CAAA;IAEtB,aAAO,GAAG,YAAY,CAAA;IAEtB,mBAAa,GAAG,kBAAkB,CAAA;IAElC,UAAI,GAAG,SAAS,CAAA;IAEhB,iBAAW,GAAG,gBAAgB,CAAA;AAC5C,CAAC,EAzBgB,KAAK,KAAL,KAAK,QAyBrB"}
|
package/dist/Transaction/Note.js
CHANGED
|
@@ -11,14 +11,13 @@ export var Note;
|
|
|
11
11
|
Creatable.type = isly.object({
|
|
12
12
|
text: isly.string().optional(),
|
|
13
13
|
action: isly.string(["approve", "reject"]).optional(),
|
|
14
|
+
flags: isly.string().array().optional(),
|
|
14
15
|
});
|
|
15
16
|
Creatable.is = Creatable.type.is;
|
|
16
17
|
})(Creatable = Note.Creatable || (Note.Creatable = {}));
|
|
17
|
-
Note.type =
|
|
18
|
+
Note.type = Creatable.type.extend({
|
|
18
19
|
author: isly.string(),
|
|
19
20
|
created: isly.string(),
|
|
20
|
-
text: isly.string().optional(),
|
|
21
|
-
action: isly.string(["approve", "reject"]).optional(),
|
|
22
21
|
});
|
|
23
22
|
Note.is = Note.type.is;
|
|
24
23
|
})(Note || (Note = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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,CAAA;IAC1B,CAAC,EAPgB,SAAS,GAAT,cAAS,KAAT,cAAS,QAOzB;IACY,SAAI,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAO;QAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;QACrB,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;KACtB,CAAC,CAAA;IACW,OAAE,GAAG,KAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAtBgB,IAAI,KAAJ,IAAI,QAsBpB"}
|
|
@@ -19,6 +19,7 @@ export interface Transaction extends TransactionCreatable {
|
|
|
19
19
|
operations: Operation[];
|
|
20
20
|
status: "created" | "approved" | "rejected" | "processing" | "finalized";
|
|
21
21
|
flags: ("review" | string)[];
|
|
22
|
+
oldFlags: string[];
|
|
22
23
|
notes: TransactionNote[];
|
|
23
24
|
}
|
|
24
25
|
export declare namespace Transaction {
|
|
@@ -21,6 +21,7 @@ export var Transaction;
|
|
|
21
21
|
operations: isly.array(isly.fromIs("Operation", Operation.is)),
|
|
22
22
|
status: isly.string(["created", "approved", "rejected", "processing", "finalized"]),
|
|
23
23
|
flags: isly.array(isly.string() || "review"),
|
|
24
|
+
oldFlags: isly.string().array(),
|
|
24
25
|
notes: isly.array(isly.fromIs("TransactionNote", TransactionNote.is)),
|
|
25
26
|
});
|
|
26
27
|
Transaction.is = Transaction.type.is;
|
|
@@ -44,6 +45,7 @@ export var Transaction;
|
|
|
44
45
|
operations: transaction.operations.map(o => Operation.fromCreatable(id, o)),
|
|
45
46
|
status: "created",
|
|
46
47
|
flags: [],
|
|
48
|
+
oldFlags: [],
|
|
47
49
|
notes: [],
|
|
48
50
|
};
|
|
49
51
|
}
|
|
@@ -63,6 +65,7 @@ export var Transaction;
|
|
|
63
65
|
operations: transaction.operations.map(o => Operation.fromCreatable(id, o)),
|
|
64
66
|
status: "created",
|
|
65
67
|
flags: [],
|
|
68
|
+
oldFlags: [],
|
|
66
69
|
notes: [],
|
|
67
70
|
};
|
|
68
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Transaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,SAAS,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,EAAE,QAAQ,IAAI,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,QAAQ,CAAA;AAChD,OAAO,EAAE,SAAS,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Transaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,SAAS,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,EAAE,QAAQ,IAAI,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,QAAQ,CAAA;AAChD,OAAO,EAAE,SAAS,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAkB/D,MAAM,KAAW,WAAW,CAsF3B;AAtFD,WAAiB,WAAW;IACd,gBAAI,GAAG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,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;YAC3E,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,EAAE;YACT,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,EAAE;SACT,CAAA;IACF,CAAC;IAvBe,wBAAY,eAuB3B,CAAA;IACD,SAAgB,YAAY,CAAC,KAA+B;QAC3D,OAAO,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IACvC,CAAC;IAFe,wBAAY,eAE3B,CAAA;IAGY,qBAAS,GAAG,oBAAoB,CAAA;IAEhC,oBAAQ,GAAG,mBAAmB,CAAA;IAG9B,gBAAI,GAAG,eAAe,CAAA;AAIpC,CAAC,EAtFgB,WAAW,KAAX,WAAW,QAsF3B"}
|
package/package.json
CHANGED
package/Organization/Rule.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { selectively } from "selectively"
|
|
2
|
-
|
|
3
|
-
const action = ["review", "reject", "flag"] as const
|
|
4
|
-
const type = ["authorization", "outbound", "inbound"] as const
|
|
5
|
-
export interface Rule {
|
|
6
|
-
name: string
|
|
7
|
-
description: string
|
|
8
|
-
action: typeof action[number]
|
|
9
|
-
type: typeof type[number]
|
|
10
|
-
condition: string
|
|
11
|
-
flags: string[]
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface RuleResult {
|
|
15
|
-
rule: Rule
|
|
16
|
-
definition: selectively.Definition
|
|
17
|
-
outcome: boolean
|
|
18
|
-
}
|
|
19
|
-
namespace RuleResult {
|
|
20
|
-
export function stringify(data: RuleResult): string {
|
|
21
|
-
return `rule: ${Rule.stringify(data.rule)}, \n definition: { definition: ${
|
|
22
|
-
data.definition.definition
|
|
23
|
-
}, arguments: ${data.definition.arguments.toString()} }, \n outcome: ${data.outcome}`
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export namespace Rule {
|
|
27
|
-
export type Result = RuleResult
|
|
28
|
-
export const Result = RuleResult
|
|
29
|
-
export function is(value: Rule): value is Rule {
|
|
30
|
-
return (
|
|
31
|
-
value &&
|
|
32
|
-
typeof value == "object" &&
|
|
33
|
-
typeof value.name == "string" &&
|
|
34
|
-
action.includes(value.action) &&
|
|
35
|
-
type.includes(value.type) &&
|
|
36
|
-
typeof value.condition == "string" &&
|
|
37
|
-
typeof value.description == "string"
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
export function stringify(rule: Rule): string {
|
|
41
|
-
return `{ label: ${rule.name}, action: ${rule.action}, type: ${rule.type}, condition: ${rule.condition}, description: ${rule.description}. }`
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { selectively } from "selectively";
|
|
2
|
-
declare const action: readonly ["review", "reject", "flag"];
|
|
3
|
-
declare const type: readonly ["authorization", "outbound", "inbound"];
|
|
4
|
-
export interface Rule {
|
|
5
|
-
name: string;
|
|
6
|
-
description: string;
|
|
7
|
-
action: typeof action[number];
|
|
8
|
-
type: typeof type[number];
|
|
9
|
-
condition: string;
|
|
10
|
-
flags: string[];
|
|
11
|
-
}
|
|
12
|
-
interface RuleResult {
|
|
13
|
-
rule: Rule;
|
|
14
|
-
definition: selectively.Definition;
|
|
15
|
-
outcome: boolean;
|
|
16
|
-
}
|
|
17
|
-
declare namespace RuleResult {
|
|
18
|
-
function stringify(data: RuleResult): string;
|
|
19
|
-
}
|
|
20
|
-
export declare namespace Rule {
|
|
21
|
-
type Result = RuleResult;
|
|
22
|
-
const Result: typeof RuleResult;
|
|
23
|
-
function is(value: Rule): value is Rule;
|
|
24
|
-
function stringify(rule: Rule): string;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const action = ["review", "reject", "flag"];
|
|
2
|
-
const type = ["authorization", "outbound", "inbound"];
|
|
3
|
-
var RuleResult;
|
|
4
|
-
(function (RuleResult) {
|
|
5
|
-
function stringify(data) {
|
|
6
|
-
return `rule: ${Rule.stringify(data.rule)}, \n definition: { definition: ${data.definition.definition}, arguments: ${data.definition.arguments.toString()} }, \n outcome: ${data.outcome}`;
|
|
7
|
-
}
|
|
8
|
-
RuleResult.stringify = stringify;
|
|
9
|
-
})(RuleResult || (RuleResult = {}));
|
|
10
|
-
export var Rule;
|
|
11
|
-
(function (Rule) {
|
|
12
|
-
Rule.Result = RuleResult;
|
|
13
|
-
function is(value) {
|
|
14
|
-
return (value &&
|
|
15
|
-
typeof value == "object" &&
|
|
16
|
-
typeof value.name == "string" &&
|
|
17
|
-
action.includes(value.action) &&
|
|
18
|
-
type.includes(value.type) &&
|
|
19
|
-
typeof value.condition == "string" &&
|
|
20
|
-
typeof value.description == "string");
|
|
21
|
-
}
|
|
22
|
-
Rule.is = is;
|
|
23
|
-
function stringify(rule) {
|
|
24
|
-
return `{ label: ${rule.name}, action: ${rule.action}, type: ${rule.type}, condition: ${rule.condition}, description: ${rule.description}. }`;
|
|
25
|
-
}
|
|
26
|
-
Rule.stringify = stringify;
|
|
27
|
-
})(Rule || (Rule = {}));
|
|
28
|
-
//# sourceMappingURL=Rule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Rule.js","sourceRoot":"../","sources":["Organization/Rule.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAA;AACpD,MAAM,IAAI,GAAG,CAAC,eAAe,EAAE,UAAU,EAAE,SAAS,CAAU,CAAA;AAe9D,IAAU,UAAU,CAMnB;AAND,WAAU,UAAU;IACnB,SAAgB,SAAS,CAAC,IAAgB;QACzC,OAAO,SAAS,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,kCACxC,IAAI,CAAC,UAAU,CAAC,UACjB,gBAAgB,IAAI,CAAC,UAAU,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