@pax2pay/model-banking 0.1.489 → 0.1.491
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/Preset.ts +12 -0
- package/Card/Stack.ts +8 -1
- package/Rule/State/Transaction.ts +19 -0
- package/Rule/State/index.ts +24 -0
- package/Transaction/PreTransaction/Authorization.ts +20 -0
- package/Transaction/PreTransaction/Base.ts +23 -0
- package/Transaction/PreTransaction/Incoming.ts +42 -0
- package/Transaction/PreTransaction/Outgoing.ts +8 -0
- package/Transaction/PreTransaction/index.ts +16 -0
- package/Transaction/index.ts +5 -4
- package/dist/cjs/Card/Preset.d.ts +3 -3
- package/dist/cjs/Card/Preset.js +12 -0
- package/dist/cjs/Card/Preset.js.map +1 -1
- package/dist/cjs/Card/Stack.d.ts +2 -2
- package/dist/cjs/Card/Stack.js +8 -1
- package/dist/cjs/Card/Stack.js.map +1 -1
- package/dist/cjs/Rail/index.d.ts +1 -1
- package/dist/cjs/Rule/State/Transaction.d.ts +1 -0
- package/dist/cjs/Rule/State/Transaction.js +15 -0
- package/dist/cjs/Rule/State/Transaction.js.map +1 -1
- package/dist/cjs/Rule/State/index.d.ts +5 -0
- package/dist/cjs/Rule/State/index.js +15 -0
- package/dist/cjs/Rule/State/index.js.map +1 -1
- package/dist/cjs/Transaction/PreTransaction/Authorization.d.ts +14 -0
- package/dist/cjs/Transaction/PreTransaction/Authorization.js +17 -0
- package/dist/cjs/Transaction/PreTransaction/Authorization.js.map +1 -0
- package/dist/cjs/Transaction/PreTransaction/Base.d.ts +14 -0
- package/dist/cjs/Transaction/PreTransaction/Base.js +19 -0
- package/dist/cjs/Transaction/PreTransaction/Base.js.map +1 -0
- package/dist/cjs/Transaction/{Incoming.d.ts → PreTransaction/Incoming.d.ts} +7 -6
- package/dist/cjs/Transaction/{Incoming.js → PreTransaction/Incoming.js} +7 -5
- package/dist/cjs/Transaction/PreTransaction/Incoming.js.map +1 -0
- package/dist/cjs/Transaction/PreTransaction/Outgoing.d.ts +7 -0
- package/dist/cjs/Transaction/PreTransaction/Outgoing.js +8 -0
- package/dist/cjs/Transaction/PreTransaction/Outgoing.js.map +1 -0
- package/dist/cjs/Transaction/PreTransaction/index.d.ts +14 -0
- package/dist/cjs/Transaction/PreTransaction/index.js +13 -0
- package/dist/cjs/Transaction/PreTransaction/index.js.map +1 -0
- package/dist/cjs/Transaction/index.d.ts +3 -3
- package/dist/cjs/Transaction/index.js +3 -3
- package/dist/cjs/Transaction/index.js.map +1 -1
- package/dist/cjs/index.js +17 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/mjs/Card/Preset.d.ts +3 -3
- package/dist/mjs/Card/Preset.js +12 -0
- package/dist/mjs/Card/Preset.js.map +1 -1
- package/dist/mjs/Card/Stack.d.ts +2 -2
- package/dist/mjs/Card/Stack.js +8 -1
- package/dist/mjs/Card/Stack.js.map +1 -1
- package/dist/mjs/Rail/index.d.ts +1 -1
- package/dist/mjs/Rule/State/Transaction.d.ts +1 -0
- package/dist/mjs/Rule/State/Transaction.js +15 -0
- package/dist/mjs/Rule/State/Transaction.js.map +1 -1
- package/dist/mjs/Rule/State/index.d.ts +5 -0
- package/dist/mjs/Rule/State/index.js +15 -0
- package/dist/mjs/Rule/State/index.js.map +1 -1
- package/dist/mjs/Transaction/PreTransaction/Authorization.d.ts +14 -0
- package/dist/mjs/Transaction/PreTransaction/Authorization.js +14 -0
- package/dist/mjs/Transaction/PreTransaction/Authorization.js.map +1 -0
- package/dist/mjs/Transaction/PreTransaction/Base.d.ts +14 -0
- package/dist/mjs/Transaction/PreTransaction/Base.js +16 -0
- package/dist/mjs/Transaction/PreTransaction/Base.js.map +1 -0
- package/dist/mjs/Transaction/{Incoming.d.ts → PreTransaction/Incoming.d.ts} +7 -6
- package/dist/mjs/Transaction/{Incoming.js → PreTransaction/Incoming.js} +7 -5
- package/dist/mjs/Transaction/PreTransaction/Incoming.js.map +1 -0
- package/dist/mjs/Transaction/PreTransaction/Outgoing.d.ts +7 -0
- package/dist/mjs/Transaction/PreTransaction/Outgoing.js +5 -0
- package/dist/mjs/Transaction/PreTransaction/Outgoing.js.map +1 -0
- package/dist/mjs/Transaction/PreTransaction/index.d.ts +14 -0
- package/dist/mjs/Transaction/PreTransaction/index.js +10 -0
- package/dist/mjs/Transaction/PreTransaction/index.js.map +1 -0
- package/dist/mjs/Transaction/index.d.ts +3 -3
- package/dist/mjs/Transaction/index.js +3 -3
- package/dist/mjs/Transaction/index.js.map +1 -1
- package/package.json +4 -4
- package/tsconfig.json +1 -1
- package/vite.config.ts +2 -7
- package/dist/cjs/Transaction/Incoming.js.map +0 -1
- package/dist/mjs/Transaction/Incoming.js.map +0 -1
package/Card/Preset.ts
CHANGED
|
@@ -8,6 +8,12 @@ export type Preset = typeof Preset.names[number]
|
|
|
8
8
|
export namespace Preset {
|
|
9
9
|
export const names = [
|
|
10
10
|
"p2p-mc-200",
|
|
11
|
+
"p2p-visa-bid-115",
|
|
12
|
+
"p2p-visa-bp-140",
|
|
13
|
+
"p2p-visa-cdd-185",
|
|
14
|
+
"p2p-visa-idx-140",
|
|
15
|
+
"p2p-visa-idx-160",
|
|
16
|
+
"p2p-visa-idx-200",
|
|
11
17
|
"test-pg-200",
|
|
12
18
|
"test-pg-150",
|
|
13
19
|
"test-ta-pg-200",
|
|
@@ -22,6 +28,12 @@ export namespace Preset {
|
|
|
22
28
|
.describe("Card configuration (iin/scheme/interchange).")
|
|
23
29
|
export const presets: Record<Preset, Stack> = {
|
|
24
30
|
"p2p-mc-200": "uk-mc-tpl-marqeta",
|
|
31
|
+
"p2p-visa-bid-115": "uk-visa-tpl-marqeta",
|
|
32
|
+
"p2p-visa-bp-140": "uk-visa-tpl-marqeta",
|
|
33
|
+
"p2p-visa-cdd-185": "uk-visa-tpl-marqeta",
|
|
34
|
+
"p2p-visa-idx-140": "uk-visa-tpl-marqeta",
|
|
35
|
+
"p2p-visa-idx-160": "uk-visa-tpl-marqeta",
|
|
36
|
+
"p2p-visa-idx-200": "uk-visa-tpl-marqeta",
|
|
25
37
|
"p2p-diners-175": "uk-diners-dpg",
|
|
26
38
|
"p2p-diners-200": "uk-diners-dpg",
|
|
27
39
|
"test-pg-200": "test-paxgiro",
|
package/Card/Stack.ts
CHANGED
|
@@ -5,7 +5,13 @@ export type Stack = typeof Stack.stacks[number]
|
|
|
5
5
|
|
|
6
6
|
// realm-scheme-processor(-processor...)
|
|
7
7
|
export namespace Stack {
|
|
8
|
-
export const stacks = [
|
|
8
|
+
export const stacks = [
|
|
9
|
+
"test-paxgiro",
|
|
10
|
+
"test-tpl-paxgiro",
|
|
11
|
+
"uk-diners-dpg",
|
|
12
|
+
"uk-mc-tpl-marqeta",
|
|
13
|
+
"uk-visa-tpl-marqeta",
|
|
14
|
+
] as const
|
|
9
15
|
export const type = isly.string(stacks)
|
|
10
16
|
export function toRealm(stack: Stack): Realm {
|
|
11
17
|
return stack.split("-")[0] as Realm
|
|
@@ -69,6 +75,7 @@ export namespace Stack {
|
|
|
69
75
|
"test-tpl-paxgiro": "y",
|
|
70
76
|
"uk-mc-tpl-marqeta": "a",
|
|
71
77
|
"uk-diners-dpg": "b",
|
|
78
|
+
"uk-visa-tpl-marqeta": "c",
|
|
72
79
|
}
|
|
73
80
|
export function from(stack: Stack): Stack.Character {
|
|
74
81
|
return table[stack]
|
|
@@ -48,4 +48,23 @@ export namespace Transaction {
|
|
|
48
48
|
},
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
+
export function fromPreTransaction(
|
|
52
|
+
accountName: string,
|
|
53
|
+
transaction: ModelTransaction.PreTransaction | ModelTransaction,
|
|
54
|
+
kind: Rule.Base.Kind,
|
|
55
|
+
stage: "finalize" | "initiate"
|
|
56
|
+
): Transaction {
|
|
57
|
+
return {
|
|
58
|
+
...transaction,
|
|
59
|
+
stage,
|
|
60
|
+
kind,
|
|
61
|
+
amount: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total),
|
|
62
|
+
type: ModelTransaction.getType(transaction.counterpart, accountName),
|
|
63
|
+
original: {
|
|
64
|
+
currency: transaction.currency,
|
|
65
|
+
amount: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.original),
|
|
66
|
+
total: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total),
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
}
|
|
51
70
|
}
|
package/Rule/State/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
2
|
import { Account as ModelAccount } from "../../Account"
|
|
3
|
+
import type { Card as ModelCard } from "../../Card"
|
|
3
4
|
import { Rail } from "../../Rail"
|
|
4
5
|
import type { Transaction as ModelTransaction } from "../../Transaction"
|
|
5
6
|
import type { Rule } from "../index"
|
|
@@ -59,4 +60,27 @@ export namespace State {
|
|
|
59
60
|
organization,
|
|
60
61
|
}
|
|
61
62
|
}
|
|
63
|
+
export const type: Record<ModelTransaction.PreTransaction["type"], Rule.Base.Kind> = {
|
|
64
|
+
authorization: "authorization",
|
|
65
|
+
incoming: "inbound",
|
|
66
|
+
outgoing: "outbound",
|
|
67
|
+
}
|
|
68
|
+
export function fromPreTransaction(
|
|
69
|
+
data: Data,
|
|
70
|
+
account: ModelAccount,
|
|
71
|
+
address: Rail.Address,
|
|
72
|
+
transactions: Account.Transactions,
|
|
73
|
+
days: Account.Days,
|
|
74
|
+
transaction: ModelTransaction.PreTransaction,
|
|
75
|
+
card?: ModelCard & { statistics: Card.Statistics },
|
|
76
|
+
organization?: Organization
|
|
77
|
+
): State {
|
|
78
|
+
return {
|
|
79
|
+
data,
|
|
80
|
+
account: Account.from(account, address, transactions, days),
|
|
81
|
+
transaction: Transaction.from(account.name, transaction, type[transaction.type], "initiate"),
|
|
82
|
+
card: card ? Card.from(card, card.statistics) : undefined,
|
|
83
|
+
organization,
|
|
84
|
+
}
|
|
85
|
+
}
|
|
62
86
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { isly } from "isly"
|
|
2
|
+
import { Rail } from "../../Rail"
|
|
3
|
+
import { Base } from "./Base"
|
|
4
|
+
|
|
5
|
+
export interface Authorization extends Base {
|
|
6
|
+
type: "authorization"
|
|
7
|
+
account: Pick<Rail.Address.Card, "id" | "type">
|
|
8
|
+
counterpart: Rail.Address.Card.Counterpart
|
|
9
|
+
reference: { reference: string }
|
|
10
|
+
approvalCode?: string
|
|
11
|
+
}
|
|
12
|
+
export namespace Authorization {
|
|
13
|
+
export const type = Base.type.extend<Authorization>({
|
|
14
|
+
type: isly.string("authorization"),
|
|
15
|
+
account: Rail.Address.Card.type.pick(["id", "type"]),
|
|
16
|
+
counterpart: Rail.Address.Card.Counterpart.type,
|
|
17
|
+
reference: isly.object<{ reference: string }>({ reference: isly.string() }),
|
|
18
|
+
approvalCode: isly.string().optional(),
|
|
19
|
+
})
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
2
|
+
import { isly } from "isly"
|
|
3
|
+
import { Rail } from "../../Rail"
|
|
4
|
+
import { Exchange } from "../Exchange"
|
|
5
|
+
|
|
6
|
+
export interface Base {
|
|
7
|
+
type: "outgoing" | "incoming" | "authorization"
|
|
8
|
+
counterpart: Rail.Address
|
|
9
|
+
currency: isoly.Currency
|
|
10
|
+
amount: number
|
|
11
|
+
description: string
|
|
12
|
+
exchange?: Exchange
|
|
13
|
+
}
|
|
14
|
+
export namespace Base {
|
|
15
|
+
export const type = isly.object<Base>({
|
|
16
|
+
type: isly.string(["outgoing", "incoming", "authorization"]),
|
|
17
|
+
counterpart: Rail.Address.type,
|
|
18
|
+
currency: isly.fromIs("isoly.Currency", isoly.Currency.is),
|
|
19
|
+
amount: isly.number(),
|
|
20
|
+
description: isly.string(),
|
|
21
|
+
exchange: Exchange.type.optional(),
|
|
22
|
+
})
|
|
23
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
2
|
+
import { isly } from "isly"
|
|
3
|
+
import { Rail } from "../../Rail"
|
|
4
|
+
import { Settlement } from "../../Settlement"
|
|
5
|
+
import { Reference as TransactionReference } from "../Reference"
|
|
6
|
+
import { Base } from "./Base"
|
|
7
|
+
|
|
8
|
+
export interface Incoming extends Base {
|
|
9
|
+
type: "incoming"
|
|
10
|
+
account: Rail.Address
|
|
11
|
+
currency: isoly.Currency
|
|
12
|
+
amount: number
|
|
13
|
+
description: string
|
|
14
|
+
posted: string
|
|
15
|
+
rail?: Rail
|
|
16
|
+
reference?: TransactionReference
|
|
17
|
+
}
|
|
18
|
+
export namespace Incoming {
|
|
19
|
+
export const type = Base.type.extend<Incoming>({
|
|
20
|
+
type: isly.string("incoming"),
|
|
21
|
+
account: Rail.Address.type,
|
|
22
|
+
currency: isly.fromIs("Currency", isoly.Currency.is),
|
|
23
|
+
amount: isly.number(),
|
|
24
|
+
description: isly.string(),
|
|
25
|
+
posted: isly.string(),
|
|
26
|
+
rail: Rail.type.optional(),
|
|
27
|
+
reference: TransactionReference.type.optional(),
|
|
28
|
+
})
|
|
29
|
+
export function fromRefund(entry: Settlement.Entry.Creatable.Refund, card: Rail.Address.Card): Incoming {
|
|
30
|
+
const [currency, amount] = entry.amount
|
|
31
|
+
return {
|
|
32
|
+
type: "incoming",
|
|
33
|
+
account: card,
|
|
34
|
+
currency,
|
|
35
|
+
amount: isoly.Currency.add(currency, -amount, -(entry.fee.other[currency] ?? 0)),
|
|
36
|
+
posted: isoly.DateTime.now(),
|
|
37
|
+
counterpart: { type: "card", merchant: entry.merchant, acquirer: entry.acquirer },
|
|
38
|
+
description: "Refund transaction.",
|
|
39
|
+
rail: card.scheme,
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Rail } from "../../Rail"
|
|
2
|
+
import { Authorization as PreTransactionAuthorization } from "./Authorization"
|
|
3
|
+
import { Incoming as PreTransactionIncoming } from "./Incoming"
|
|
4
|
+
import { Outgoing as PreTransactionOutgoing } from "./Outgoing"
|
|
5
|
+
|
|
6
|
+
export type PreTransaction = PreTransaction.Outgoing | PreTransaction.Authorization | PreTransaction.Incoming
|
|
7
|
+
export namespace PreTransaction {
|
|
8
|
+
export type Resolved =
|
|
9
|
+
| (PreTransaction & { counterpart: Rail.Address; type: "outgoing" })
|
|
10
|
+
| PreTransaction.Incoming
|
|
11
|
+
| PreTransaction.Authorization
|
|
12
|
+
|
|
13
|
+
export import Authorization = PreTransactionAuthorization
|
|
14
|
+
export import Incoming = PreTransactionIncoming
|
|
15
|
+
export import Outgoing = PreTransactionOutgoing
|
|
16
|
+
}
|
package/Transaction/index.ts
CHANGED
|
@@ -9,11 +9,12 @@ import type { Rule } from "../Rule"
|
|
|
9
9
|
import { Settlement } from "../Settlement"
|
|
10
10
|
import { Creatable as TransactionCreatable } from "./Creatable"
|
|
11
11
|
import { Exchange as TransactionExchange } from "./Exchange"
|
|
12
|
-
import { Incoming as TransactionIncoming } from "./Incoming"
|
|
13
12
|
import { Note as TransactionNote } from "./Note"
|
|
13
|
+
import { PreTransaction as TransactionPreTransaction } from "./PreTransaction"
|
|
14
14
|
import { Reference as TransactionReference } from "./Reference"
|
|
15
15
|
import { Statistics as TransactionStatistics } from "./Statistics"
|
|
16
16
|
import { Status as TransactionStatus } from "./Status"
|
|
17
|
+
|
|
17
18
|
export interface Transaction {
|
|
18
19
|
counterpart: Rail.Address & { code?: string }
|
|
19
20
|
currency: isoly.Currency
|
|
@@ -100,7 +101,7 @@ export namespace Transaction {
|
|
|
100
101
|
export const directions = ["inbound", "outbound"] as const
|
|
101
102
|
export type Direction = typeof directions[number]
|
|
102
103
|
export import Creatable = TransactionCreatable
|
|
103
|
-
export import
|
|
104
|
+
export import PreTransaction = TransactionPreTransaction
|
|
104
105
|
export import Reference = TransactionReference
|
|
105
106
|
export import Note = TransactionNote
|
|
106
107
|
export import Status = TransactionStatus
|
|
@@ -311,7 +312,7 @@ export namespace Transaction {
|
|
|
311
312
|
}
|
|
312
313
|
}
|
|
313
314
|
export function fromIncoming(
|
|
314
|
-
transaction: Transaction.Incoming,
|
|
315
|
+
transaction: Transaction.PreTransaction.Incoming,
|
|
315
316
|
id: string,
|
|
316
317
|
state: Rule.State.Evaluated,
|
|
317
318
|
account: { id: string; name: string; organization: string },
|
|
@@ -347,7 +348,7 @@ export namespace Transaction {
|
|
|
347
348
|
state: Rule.State.Evaluated
|
|
348
349
|
): Transaction {
|
|
349
350
|
return {
|
|
350
|
-
...Incoming.fromRefund(refund, card),
|
|
351
|
+
...Transaction.PreTransaction.Incoming.fromRefund(refund, card),
|
|
351
352
|
amount: Amount.fromState(state),
|
|
352
353
|
type: "card",
|
|
353
354
|
direction: "inbound",
|
|
@@ -3,8 +3,8 @@ import { isly as isly2 } from "isly2";
|
|
|
3
3
|
import { Stack } from "./Stack";
|
|
4
4
|
export type Preset = typeof Preset.names[number];
|
|
5
5
|
export declare namespace Preset {
|
|
6
|
-
const names: readonly ["p2p-mc-200", "test-pg-200", "test-pg-150", "test-ta-pg-200", "test-ta-mc-200", "p2p-diners-175", "p2p-diners-200"];
|
|
7
|
-
const type: isly.Type<"p2p-mc-200" | "test-pg-200" | "test-pg-150" | "test-ta-pg-200" | "test-ta-mc-200" | "p2p-diners-175" | "p2p-diners-200">;
|
|
8
|
-
const type2: isly2.String<"p2p-mc-200" | "test-pg-200" | "test-pg-150" | "test-ta-pg-200" | "test-ta-mc-200" | "p2p-diners-175" | "p2p-diners-200">;
|
|
6
|
+
const names: readonly ["p2p-mc-200", "p2p-visa-bid-115", "p2p-visa-bp-140", "p2p-visa-cdd-185", "p2p-visa-idx-140", "p2p-visa-idx-160", "p2p-visa-idx-200", "test-pg-200", "test-pg-150", "test-ta-pg-200", "test-ta-mc-200", "p2p-diners-175", "p2p-diners-200"];
|
|
7
|
+
const type: isly.Type<"p2p-mc-200" | "p2p-visa-bid-115" | "p2p-visa-bp-140" | "p2p-visa-cdd-185" | "p2p-visa-idx-140" | "p2p-visa-idx-160" | "p2p-visa-idx-200" | "test-pg-200" | "test-pg-150" | "test-ta-pg-200" | "test-ta-mc-200" | "p2p-diners-175" | "p2p-diners-200">;
|
|
8
|
+
const type2: isly2.String<"p2p-mc-200" | "p2p-visa-bid-115" | "p2p-visa-bp-140" | "p2p-visa-cdd-185" | "p2p-visa-idx-140" | "p2p-visa-idx-160" | "p2p-visa-idx-200" | "test-pg-200" | "test-pg-150" | "test-ta-pg-200" | "test-ta-mc-200" | "p2p-diners-175" | "p2p-diners-200">;
|
|
9
9
|
const presets: Record<Preset, Stack>;
|
|
10
10
|
}
|
package/dist/cjs/Card/Preset.js
CHANGED
|
@@ -7,6 +7,12 @@ var Preset;
|
|
|
7
7
|
(function (Preset) {
|
|
8
8
|
Preset.names = [
|
|
9
9
|
"p2p-mc-200",
|
|
10
|
+
"p2p-visa-bid-115",
|
|
11
|
+
"p2p-visa-bp-140",
|
|
12
|
+
"p2p-visa-cdd-185",
|
|
13
|
+
"p2p-visa-idx-140",
|
|
14
|
+
"p2p-visa-idx-160",
|
|
15
|
+
"p2p-visa-idx-200",
|
|
10
16
|
"test-pg-200",
|
|
11
17
|
"test-pg-150",
|
|
12
18
|
"test-ta-pg-200",
|
|
@@ -21,6 +27,12 @@ var Preset;
|
|
|
21
27
|
.describe("Card configuration (iin/scheme/interchange).");
|
|
22
28
|
Preset.presets = {
|
|
23
29
|
"p2p-mc-200": "uk-mc-tpl-marqeta",
|
|
30
|
+
"p2p-visa-bid-115": "uk-visa-tpl-marqeta",
|
|
31
|
+
"p2p-visa-bp-140": "uk-visa-tpl-marqeta",
|
|
32
|
+
"p2p-visa-cdd-185": "uk-visa-tpl-marqeta",
|
|
33
|
+
"p2p-visa-idx-140": "uk-visa-tpl-marqeta",
|
|
34
|
+
"p2p-visa-idx-160": "uk-visa-tpl-marqeta",
|
|
35
|
+
"p2p-visa-idx-200": "uk-visa-tpl-marqeta",
|
|
24
36
|
"p2p-diners-175": "uk-diners-dpg",
|
|
25
37
|
"p2p-diners-200": "uk-diners-dpg",
|
|
26
38
|
"test-pg-200": "test-paxgiro",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Preset.js","sourceRoot":"","sources":["../../../Card/Preset.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,iCAAqC;AAMrC,IAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"Preset.js","sourceRoot":"","sources":["../../../Card/Preset.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,iCAAqC;AAMrC,IAAiB,MAAM,CAoCtB;AApCD,WAAiB,MAAM;IACT,YAAK,GAAG;QACpB,YAAY;QACZ,kBAAkB;QAClB,iBAAiB;QACjB,kBAAkB;QAClB,kBAAkB;QAClB,kBAAkB;QAClB,kBAAkB;QAClB,aAAa;QACb,aAAa;QACb,gBAAgB;QAChB,gBAAgB;QAChB,gBAAgB;QAChB,gBAAgB;KACP,CAAA;IACG,WAAI,GAAG,WAAI,CAAC,MAAM,CAAS,OAAA,KAAK,CAAC,CAAA;IACjC,YAAK,GAAG,YAAK;SACxB,MAAM,CAAS,OAAO,EAAE,GAAG,OAAA,KAAK,CAAC;SACjC,MAAM,CAAC,QAAQ,CAAC;SAChB,QAAQ,CAAC,8CAA8C,CAAC,CAAA;IAC7C,cAAO,GAA0B;QAC7C,YAAY,EAAE,mBAAmB;QACjC,kBAAkB,EAAE,qBAAqB;QACzC,iBAAiB,EAAE,qBAAqB;QACxC,kBAAkB,EAAE,qBAAqB;QACzC,kBAAkB,EAAE,qBAAqB;QACzC,kBAAkB,EAAE,qBAAqB;QACzC,kBAAkB,EAAE,qBAAqB;QACzC,gBAAgB,EAAE,eAAe;QACjC,gBAAgB,EAAE,eAAe;QACjC,aAAa,EAAE,cAAc;QAC7B,gBAAgB,EAAE,kBAAkB;QACpC,gBAAgB,EAAE,kBAAkB;QACpC,aAAa,EAAE,cAAc;KAC7B,CAAA;AACF,CAAC,EApCgB,MAAM,sBAAN,MAAM,QAoCtB"}
|
package/dist/cjs/Card/Stack.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { isly } from "isly";
|
|
|
2
2
|
import { Realm } from "../Realm";
|
|
3
3
|
export type Stack = typeof Stack.stacks[number];
|
|
4
4
|
export declare namespace Stack {
|
|
5
|
-
const stacks: readonly ["test-paxgiro", "test-tpl-paxgiro", "uk-diners-dpg", "uk-mc-tpl-marqeta"];
|
|
6
|
-
const type: isly.Type<"test-paxgiro" | "test-tpl-paxgiro" | "uk-diners-dpg" | "uk-mc-tpl-marqeta">;
|
|
5
|
+
const stacks: readonly ["test-paxgiro", "test-tpl-paxgiro", "uk-diners-dpg", "uk-mc-tpl-marqeta", "uk-visa-tpl-marqeta"];
|
|
6
|
+
const type: isly.Type<"test-paxgiro" | "test-tpl-paxgiro" | "uk-diners-dpg" | "uk-mc-tpl-marqeta" | "uk-visa-tpl-marqeta">;
|
|
7
7
|
function toRealm(stack: Stack): Realm;
|
|
8
8
|
function toScheme(stack: Stack): string;
|
|
9
9
|
function toProcessor(stack: Stack): string;
|
package/dist/cjs/Card/Stack.js
CHANGED
|
@@ -4,7 +4,13 @@ exports.Stack = void 0;
|
|
|
4
4
|
const isly_1 = require("isly");
|
|
5
5
|
var Stack;
|
|
6
6
|
(function (Stack) {
|
|
7
|
-
Stack.stacks = [
|
|
7
|
+
Stack.stacks = [
|
|
8
|
+
"test-paxgiro",
|
|
9
|
+
"test-tpl-paxgiro",
|
|
10
|
+
"uk-diners-dpg",
|
|
11
|
+
"uk-mc-tpl-marqeta",
|
|
12
|
+
"uk-visa-tpl-marqeta",
|
|
13
|
+
];
|
|
8
14
|
Stack.type = isly_1.isly.string(Stack.stacks);
|
|
9
15
|
function toRealm(stack) {
|
|
10
16
|
return stack.split("-")[0];
|
|
@@ -72,6 +78,7 @@ var Stack;
|
|
|
72
78
|
"test-tpl-paxgiro": "y",
|
|
73
79
|
"uk-mc-tpl-marqeta": "a",
|
|
74
80
|
"uk-diners-dpg": "b",
|
|
81
|
+
"uk-visa-tpl-marqeta": "c",
|
|
75
82
|
};
|
|
76
83
|
function from(stack) {
|
|
77
84
|
return table[stack];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.js","sourceRoot":"","sources":["../../../Card/Stack.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAM3B,IAAiB,KAAK,
|
|
1
|
+
{"version":3,"file":"Stack.js","sourceRoot":"","sources":["../../../Card/Stack.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAM3B,IAAiB,KAAK,CAmFrB;AAnFD,WAAiB,KAAK;IACR,YAAM,GAAG;QACrB,cAAc;QACd,kBAAkB;QAClB,eAAe;QACf,mBAAmB;QACnB,qBAAqB;KACZ,CAAA;IACG,UAAI,GAAG,WAAI,CAAC,MAAM,CAAC,MAAA,MAAM,CAAC,CAAA;IACvC,SAAgB,OAAO,CAAC,KAAY;QACnC,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAU,CAAA;IACpC,CAAC;IAFe,aAAO,UAEtB,CAAA;IACD,SAAgB,QAAQ,CAAC,KAAY;QACpC,IAAI,MAAc,CAAA;QAClB,QAAQ,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7B,KAAK,IAAI;gBACR,MAAM,GAAG,YAAY,CAAA;gBACrB,MAAK;YACN,KAAK,QAAQ;gBACZ,MAAM,GAAG,QAAQ,CAAA;gBACjB,MAAK;YACN,KAAK,MAAM;gBACV,MAAM,GAAG,MAAM,CAAA;gBACf,MAAK;YACN;gBACC,MAAM,GAAG,SAAS,CAAA;gBAClB,MAAK;QACP,CAAC;QACD,OAAO,MAAM,CAAA;IACd,CAAC;IAjBe,cAAQ,WAiBvB,CAAA;IACD,SAAgB,WAAW,CAAC,KAAY;QACvC,OAAO,KAAK;aACV,KAAK,CAAC,GAAG,CAAC;aACV,KAAK,CAAC,CAAC,CAAC;aACR,GAAG,CAAC,CAAC,CA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|
|
|
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", "visa", "fasterpayments", "chaps", "bacs", "transfer", "credit"];
|
|
6
|
-
const type: isly.Type<"paxgiro" | "mastercard" | "diners" | "visa" | "internal" | "paxgiro-credit" | "fasterpayments" | "chaps" | "bacs" | "
|
|
6
|
+
const type: isly.Type<"paxgiro" | "mastercard" | "diners" | "visa" | "transfer" | "internal" | "paxgiro-credit" | "fasterpayments" | "chaps" | "bacs" | "credit">;
|
|
7
7
|
export import Address = RailAddress;
|
|
8
8
|
}
|
|
@@ -20,4 +20,5 @@ export type Transaction = ModelTransaction.Creatable.Resolved & {
|
|
|
20
20
|
};
|
|
21
21
|
export declare namespace Transaction {
|
|
22
22
|
function from(accountName: string, transaction: ModelTransaction.Creatable.Resolved | ModelTransaction, kind: Rule.Base.Kind, stage: "finalize" | "initiate"): Transaction;
|
|
23
|
+
function fromPreTransaction(accountName: string, transaction: ModelTransaction.PreTransaction | ModelTransaction, kind: Rule.Base.Kind, stage: "finalize" | "initiate"): Transaction;
|
|
23
24
|
}
|
|
@@ -27,5 +27,20 @@ var Transaction;
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
Transaction.from = from;
|
|
30
|
+
function fromPreTransaction(accountName, transaction, kind, stage) {
|
|
31
|
+
return {
|
|
32
|
+
...transaction,
|
|
33
|
+
stage,
|
|
34
|
+
kind,
|
|
35
|
+
amount: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total),
|
|
36
|
+
type: Transaction_1.Transaction.getType(transaction.counterpart, accountName),
|
|
37
|
+
original: {
|
|
38
|
+
currency: transaction.currency,
|
|
39
|
+
amount: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.original),
|
|
40
|
+
total: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total),
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
Transaction.fromPreTransaction = fromPreTransaction;
|
|
30
45
|
})(Transaction || (exports.Transaction = Transaction = {}));
|
|
31
46
|
//# sourceMappingURL=Transaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../Rule/State/Transaction.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,mDAAmE;AAiBnE,IAAiB,WAAW,
|
|
1
|
+
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../Rule/State/Transaction.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,mDAAmE;AAiBnE,IAAiB,WAAW,CAmD3B;AAnDD,WAAiB,WAAW;IAC3B,SAAgB,IAAI,CACnB,WAAmB,EACnB,WAAmE,EACnE,IAAoB,EACpB,KAA8B;QAE9B,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACpB,OAAO,IAAI,WAAW;YACrB,CAAC,CAAC;gBACA,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM,IAAI,WAAW,CAAC,MAAM;gBACpE,aAAK,CAAC,QAAQ,CAAC,QAAQ,CACtB,WAAW,CAAC,QAAQ,EACpB,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK;oBAC5C,CAAC,OAAO,WAAW,CAAC,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,EACxF,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAC/E;aACA;YACH,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;QAC5C,OAAO;YACN,GAAG,WAAW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gBAC1G,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,WAAW,CAAC,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC;aACtG;SACD,CAAA;IACF,CAAC;IAlBe,8BAAkB,qBAkBjC,CAAA;AACF,CAAC,EAnDgB,WAAW,2BAAX,WAAW,QAmD3B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
2
|
import { Account as ModelAccount } from "../../Account";
|
|
3
|
+
import type { Card as ModelCard } from "../../Card";
|
|
3
4
|
import { Rail } from "../../Rail";
|
|
4
5
|
import type { Transaction as ModelTransaction } from "../../Transaction";
|
|
5
6
|
import type { Rule } from "../index";
|
|
@@ -38,4 +39,8 @@ export declare namespace State {
|
|
|
38
39
|
notes: ModelTransaction.Note[];
|
|
39
40
|
}
|
|
40
41
|
function from(data: Data, account: ModelAccount, address: Rail.Address, transactions: Account.Transactions, days: Account.Days, transaction: ModelTransaction.Creatable.Resolved | ModelTransaction, kind: Rule.Base.Kind, stage: "finalize" | "initiate", card?: Card, organization?: Organization): State;
|
|
42
|
+
const type: Record<ModelTransaction.PreTransaction["type"], Rule.Base.Kind>;
|
|
43
|
+
function fromPreTransaction(data: Data, account: ModelAccount, address: Rail.Address, transactions: Account.Transactions, days: Account.Days, transaction: ModelTransaction.PreTransaction, card?: ModelCard & {
|
|
44
|
+
statistics: Card.Statistics;
|
|
45
|
+
}, organization?: Organization): State;
|
|
41
46
|
}
|
|
@@ -32,5 +32,20 @@ var State;
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
State.from = from;
|
|
35
|
+
State.type = {
|
|
36
|
+
authorization: "authorization",
|
|
37
|
+
incoming: "inbound",
|
|
38
|
+
outgoing: "outbound",
|
|
39
|
+
};
|
|
40
|
+
function fromPreTransaction(data, account, address, transactions, days, transaction, card, organization) {
|
|
41
|
+
return {
|
|
42
|
+
data,
|
|
43
|
+
account: State.Account.from(account, address, transactions, days),
|
|
44
|
+
transaction: State.Transaction.from(account.name, transaction, State.type[transaction.type], "initiate"),
|
|
45
|
+
card: card ? State.Card.from(card, card.statistics) : undefined,
|
|
46
|
+
organization,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
State.fromPreTransaction = fromPreTransaction;
|
|
35
50
|
})(State || (exports.State = State = {}));
|
|
36
51
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Rule/State/index.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Rule/State/index.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAM3B,uCAAmD;AACnD,mDAAqE;AACrE,iCAA0C;AAE1C,iDAAkE;AAClE,uCAAmD;AACnD,+CAA+D;AAU/D,IAAiB,KAAK,CA+DrB;AA/DD,WAAiB,KAAK;IACP,aAAO,GAAG,iBAAY,CAAA;IACtB,mBAAa,GAAG,6BAAkB,CAAA;IAClC,UAAI,GAAG,WAAS,CAAA;IAChB,aAAO,GAAG,iBAAY,CAAA;IACtB,iBAAW,GAAG,yBAAgB,CAAA;IAC9B,kBAAY,GAAG,2BAAiB,CAAA;IAG9C,IAAiB,OAAO,CAGvB;IAHD,WAAiB,OAAO;QACV,cAAM,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAA;QACjD,YAAI,GAAG,WAAI,CAAC,MAAM,CAAU,QAAA,MAAM,CAAC,CAAA;IACjD,CAAC,EAHgB,OAAO,GAAP,aAAO,KAAP,aAAO,QAGvB;IAOD,SAAgB,IAAI,CACnB,IAAU,EACV,OAAqB,EACrB,OAAqB,EACrB,YAAkC,EAClC,IAAkB,EAClB,WAAmE,EACnE,IAAoB,EACpB,KAA8B,EAC9B,IAAW,EACX,YAA2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
+
type: "authorization";
|
|
5
|
+
account: Pick<Rail.Address.Card, "id" | "type">;
|
|
6
|
+
counterpart: Rail.Address.Card.Counterpart;
|
|
7
|
+
reference: {
|
|
8
|
+
reference: string;
|
|
9
|
+
};
|
|
10
|
+
approvalCode?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace Authorization {
|
|
13
|
+
const type: import("isly/dist/cjs/object").IslyObject<Authorization, Base>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Authorization = void 0;
|
|
4
|
+
const isly_1 = require("isly");
|
|
5
|
+
const Rail_1 = require("../../Rail");
|
|
6
|
+
const Base_1 = require("./Base");
|
|
7
|
+
var Authorization;
|
|
8
|
+
(function (Authorization) {
|
|
9
|
+
Authorization.type = Base_1.Base.type.extend({
|
|
10
|
+
type: isly_1.isly.string("authorization"),
|
|
11
|
+
account: Rail_1.Rail.Address.Card.type.pick(["id", "type"]),
|
|
12
|
+
counterpart: Rail_1.Rail.Address.Card.Counterpart.type,
|
|
13
|
+
reference: isly_1.isly.object({ reference: isly_1.isly.string() }),
|
|
14
|
+
approvalCode: isly_1.isly.string().optional(),
|
|
15
|
+
});
|
|
16
|
+
})(Authorization || (exports.Authorization = Authorization = {}));
|
|
17
|
+
//# sourceMappingURL=Authorization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Authorization.js","sourceRoot":"","sources":["../../../../Transaction/PreTransaction/Authorization.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,qCAAiC;AACjC,iCAA6B;AAS7B,IAAiB,aAAa,CAQ7B;AARD,WAAiB,aAAa;IAChB,kBAAI,GAAG,WAAI,CAAC,IAAI,CAAC,MAAM,CAAgB;QACnD,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,eAAe,CAAC;QAClC,OAAO,EAAE,WAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACpD,WAAW,EAAE,WAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI;QAC/C,SAAS,EAAE,WAAI,CAAC,MAAM,CAAwB,EAAE,SAAS,EAAE,WAAI,CAAC,MAAM,EAAE,EAAE,CAAC;QAC3E,YAAY,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACtC,CAAC,CAAA;AACH,CAAC,EARgB,aAAa,6BAAb,aAAa,QAQ7B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import { Rail } from "../../Rail";
|
|
3
|
+
import { Exchange } from "../Exchange";
|
|
4
|
+
export interface Base {
|
|
5
|
+
type: "outgoing" | "incoming" | "authorization";
|
|
6
|
+
counterpart: Rail.Address;
|
|
7
|
+
currency: isoly.Currency;
|
|
8
|
+
amount: number;
|
|
9
|
+
description: string;
|
|
10
|
+
exchange?: Exchange;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace Base {
|
|
13
|
+
const type: import("isly/dist/cjs/object").IslyObject<Base, object>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Base = void 0;
|
|
4
|
+
const isoly_1 = require("isoly");
|
|
5
|
+
const isly_1 = require("isly");
|
|
6
|
+
const Rail_1 = require("../../Rail");
|
|
7
|
+
const Exchange_1 = require("../Exchange");
|
|
8
|
+
var Base;
|
|
9
|
+
(function (Base) {
|
|
10
|
+
Base.type = isly_1.isly.object({
|
|
11
|
+
type: isly_1.isly.string(["outgoing", "incoming", "authorization"]),
|
|
12
|
+
counterpart: Rail_1.Rail.Address.type,
|
|
13
|
+
currency: isly_1.isly.fromIs("isoly.Currency", isoly_1.isoly.Currency.is),
|
|
14
|
+
amount: isly_1.isly.number(),
|
|
15
|
+
description: isly_1.isly.string(),
|
|
16
|
+
exchange: Exchange_1.Exchange.type.optional(),
|
|
17
|
+
});
|
|
18
|
+
})(Base || (exports.Base = Base = {}));
|
|
19
|
+
//# sourceMappingURL=Base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Base.js","sourceRoot":"","sources":["../../../../Transaction/PreTransaction/Base.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAC3B,qCAAiC;AACjC,0CAAsC;AAUtC,IAAiB,IAAI,CASpB;AATD,WAAiB,IAAI;IACP,SAAI,GAAG,WAAI,CAAC,MAAM,CAAO;QACrC,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;QAC5D,WAAW,EAAE,WAAI,CAAC,OAAO,CAAC,IAAI;QAC9B,QAAQ,EAAE,WAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,aAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1D,MAAM,EAAE,WAAI,CAAC,MAAM,EAAE;QACrB,WAAW,EAAE,WAAI,CAAC,MAAM,EAAE;QAC1B,QAAQ,EAAE,mBAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE;KAClC,CAAC,CAAA;AACH,CAAC,EATgB,IAAI,oBAAJ,IAAI,QASpB"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
|
-
import { Rail } from "
|
|
3
|
-
import { Settlement } from "
|
|
4
|
-
import { Reference as TransactionReference } from "
|
|
5
|
-
|
|
2
|
+
import { Rail } from "../../Rail";
|
|
3
|
+
import { Settlement } from "../../Settlement";
|
|
4
|
+
import { Reference as TransactionReference } from "../Reference";
|
|
5
|
+
import { Base } from "./Base";
|
|
6
|
+
export interface Incoming extends Base {
|
|
7
|
+
type: "incoming";
|
|
6
8
|
account: Rail.Address;
|
|
7
|
-
counterpart: Rail.Address;
|
|
8
9
|
currency: isoly.Currency;
|
|
9
10
|
amount: number;
|
|
10
11
|
description: string;
|
|
@@ -13,6 +14,6 @@ export interface Incoming {
|
|
|
13
14
|
reference?: TransactionReference;
|
|
14
15
|
}
|
|
15
16
|
export declare namespace Incoming {
|
|
16
|
-
const type: import("isly/dist/cjs/object").IslyObject<Incoming,
|
|
17
|
+
const type: import("isly/dist/cjs/object").IslyObject<Incoming, Base>;
|
|
17
18
|
function fromRefund(entry: Settlement.Entry.Creatable.Refund, card: Rail.Address.Card): Incoming;
|
|
18
19
|
}
|
|
@@ -3,14 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Incoming = void 0;
|
|
4
4
|
const isoly_1 = require("isoly");
|
|
5
5
|
const isly_1 = require("isly");
|
|
6
|
-
const Rail_1 = require("
|
|
7
|
-
const Reference_1 = require("
|
|
6
|
+
const Rail_1 = require("../../Rail");
|
|
7
|
+
const Reference_1 = require("../Reference");
|
|
8
|
+
const Base_1 = require("./Base");
|
|
8
9
|
var Incoming;
|
|
9
10
|
(function (Incoming) {
|
|
10
|
-
Incoming.type =
|
|
11
|
+
Incoming.type = Base_1.Base.type.extend({
|
|
12
|
+
type: isly_1.isly.string("incoming"),
|
|
11
13
|
account: Rail_1.Rail.Address.type,
|
|
12
|
-
|
|
13
|
-
currency: isly_1.isly.fromIs("isoly.Currency", isoly_1.isoly.Currency.is),
|
|
14
|
+
currency: isly_1.isly.fromIs("Currency", isoly_1.isoly.Currency.is),
|
|
14
15
|
amount: isly_1.isly.number(),
|
|
15
16
|
description: isly_1.isly.string(),
|
|
16
17
|
posted: isly_1.isly.string(),
|
|
@@ -20,6 +21,7 @@ var Incoming;
|
|
|
20
21
|
function fromRefund(entry, card) {
|
|
21
22
|
const [currency, amount] = entry.amount;
|
|
22
23
|
return {
|
|
24
|
+
type: "incoming",
|
|
23
25
|
account: card,
|
|
24
26
|
currency,
|
|
25
27
|
amount: isoly_1.isoly.Currency.add(currency, -amount, -(entry.fee.other[currency] ?? 0)),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Incoming.js","sourceRoot":"","sources":["../../../../Transaction/PreTransaction/Incoming.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAC3B,qCAAiC;AAEjC,4CAAgE;AAChE,iCAA6B;AAY7B,IAAiB,QAAQ,CAwBxB;AAxBD,WAAiB,QAAQ;IACX,aAAI,GAAG,WAAI,CAAC,IAAI,CAAC,MAAM,CAAW;QAC9C,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,UAAU,CAAC;QAC7B,OAAO,EAAE,WAAI,CAAC,OAAO,CAAC,IAAI;QAC1B,QAAQ,EAAE,WAAI,CAAC,MAAM,CAAC,UAAU,EAAE,aAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpD,MAAM,EAAE,WAAI,CAAC,MAAM,EAAE;QACrB,WAAW,EAAE,WAAI,CAAC,MAAM,EAAE;QAC1B,MAAM,EAAE,WAAI,CAAC,MAAM,EAAE;QACrB,IAAI,EAAE,WAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QAC1B,SAAS,EAAE,qBAAoB,CAAC,IAAI,CAAC,QAAQ,EAAE;KAC/C,CAAC,CAAA;IACF,SAAgB,UAAU,CAAC,KAAwC,EAAE,IAAuB;QAC3F,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAA;QACvC,OAAO;YACN,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,IAAI;YACb,QAAQ;YACR,MAAM,EAAE,aAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;YAChF,MAAM,EAAE,aAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;YAC5B,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE;YACjF,WAAW,EAAE,qBAAqB;YAClC,IAAI,EAAE,IAAI,CAAC,MAAM;SACjB,CAAA;IACF,CAAC;IAZe,mBAAU,aAYzB,CAAA;AACF,CAAC,EAxBgB,QAAQ,wBAAR,QAAQ,QAwBxB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Outgoing = void 0;
|
|
4
|
+
var Outgoing;
|
|
5
|
+
(function (Outgoing) {
|
|
6
|
+
Outgoing.dummy = true;
|
|
7
|
+
})(Outgoing || (exports.Outgoing = Outgoing = {}));
|
|
8
|
+
//# sourceMappingURL=Outgoing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Outgoing.js","sourceRoot":"","sources":["../../../../Transaction/PreTransaction/Outgoing.ts"],"names":[],"mappings":";;;AAKA,IAAiB,QAAQ,CAExB;AAFD,WAAiB,QAAQ;IACX,cAAK,GAAG,IAAI,CAAA;AAC1B,CAAC,EAFgB,QAAQ,wBAAR,QAAQ,QAExB"}
|