@pax2pay/model-banking 0.1.464 → 0.1.466
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 +0 -8
- package/Card/Stack.ts +1 -12
- package/Rail/Address/index.ts +0 -2
- package/Realm.ts +1 -7
- package/Transaction/Statistics.ts +6 -23
- package/dist/Card/Preset.d.ts +2 -2
- package/dist/Card/Preset.js +0 -8
- package/dist/Card/Preset.js.map +1 -1
- package/dist/Card/Stack.d.ts +2 -2
- package/dist/Card/Stack.js +1 -12
- package/dist/Card/Stack.js.map +1 -1
- package/dist/Identity.d.ts +1 -1
- package/dist/Rail/Address/index.js +0 -2
- package/dist/Rail/Address/index.js.map +1 -1
- package/dist/Realm.d.ts +1 -3
- package/dist/Realm.js +1 -5
- package/dist/Realm.js.map +1 -1
- package/dist/Transaction/Statistics.js +1 -4
- package/dist/Transaction/Statistics.js.map +1 -1
- package/dist/pax2pay.d.ts +1 -0
- package/dist/pax2pay.js +1 -0
- package/dist/pax2pay.js.map +1 -1
- package/dist/reports/index.d.ts +4 -0
- package/dist/reports/index.js +6 -0
- package/dist/reports/index.js.map +1 -0
- package/dist/reports/visa/Data/Country.d.ts +15 -0
- package/dist/reports/visa/Data/Country.js +43 -0
- package/dist/reports/visa/Data/Country.js.map +1 -0
- package/dist/reports/visa/Data/Iin.d.ts +10 -0
- package/dist/reports/visa/Data/Iin.js +11 -0
- package/dist/reports/visa/Data/Iin.js.map +1 -0
- package/dist/reports/visa/Data/Monthly.d.ts +14 -0
- package/dist/reports/visa/Data/Monthly.js +34 -0
- package/dist/reports/visa/Data/Monthly.js.map +1 -0
- package/dist/reports/visa/Data/NonMonthly.d.ts +9 -0
- package/dist/reports/visa/Data/NonMonthly.js +29 -0
- package/dist/reports/visa/Data/NonMonthly.js.map +1 -0
- package/dist/reports/visa/Data/Region.d.ts +10 -0
- package/dist/reports/visa/Data/Region.js +72 -0
- package/dist/reports/visa/Data/Region.js.map +1 -0
- package/dist/reports/visa/Data/Regional.d.ts +8 -0
- package/dist/reports/visa/Data/Regional.js +27 -0
- package/dist/reports/visa/Data/Regional.js.map +1 -0
- package/dist/reports/visa/Data/index.d.ts +17 -0
- package/dist/reports/visa/Data/index.js +29 -0
- package/dist/reports/visa/Data/index.js.map +1 -0
- package/dist/reports/visa/index.d.ts +7 -0
- package/dist/reports/visa/index.js +33 -0
- package/dist/reports/visa/index.js.map +1 -0
- package/dist/reports/visa/rows.d.ts +17 -0
- package/dist/reports/visa/rows.js +155 -0
- package/dist/reports/visa/rows.js.map +1 -0
- package/package.json +1 -1
- package/pax2pay.ts +1 -0
- package/reports/index.ts +5 -0
- package/reports/visa/Data/Country.ts +59 -0
- package/reports/visa/Data/Iin.ts +11 -0
- package/reports/visa/Data/Monthly.ts +45 -0
- package/reports/visa/Data/NonMonthly.ts +36 -0
- package/reports/visa/Data/Region.ts +71 -0
- package/reports/visa/Data/Regional.ts +26 -0
- package/reports/visa/Data/index.ts +33 -0
- package/reports/visa/index.ts +37 -0
- package/reports/visa/rows.ts +151 -0
- package/reports/visa/visa.csv +227 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import { isly } from "isly";
|
|
3
|
+
export type Region = typeof Region.values[number];
|
|
4
|
+
export declare namespace Region {
|
|
5
|
+
const values: readonly ["National Payments", "International - Intra-Regional Payments", "International - Non-EEA Payments", "International - Inter-Regional Payments"];
|
|
6
|
+
const type: isly.Type<"National Payments" | "International - Intra-Regional Payments" | "International - Non-EEA Payments" | "International - Inter-Regional Payments">;
|
|
7
|
+
const regions: Record<Region, isoly.CountryCode.Alpha2[]>;
|
|
8
|
+
function find(country: isoly.CountryCode.Alpha2): Region;
|
|
9
|
+
function fromRow(row: string): Region;
|
|
10
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { isly } from "isly";
|
|
2
|
+
export var Region;
|
|
3
|
+
(function (Region) {
|
|
4
|
+
Region.values = [
|
|
5
|
+
"National Payments",
|
|
6
|
+
"International - Intra-Regional Payments",
|
|
7
|
+
"International - Non-EEA Payments",
|
|
8
|
+
"International - Inter-Regional Payments",
|
|
9
|
+
];
|
|
10
|
+
Region.type = isly.string(Region.values);
|
|
11
|
+
Region.regions = {
|
|
12
|
+
"National Payments": ["GB"],
|
|
13
|
+
"International - Intra-Regional Payments": [
|
|
14
|
+
"AT",
|
|
15
|
+
"BE",
|
|
16
|
+
"BG",
|
|
17
|
+
"HR",
|
|
18
|
+
"CY",
|
|
19
|
+
"CZ",
|
|
20
|
+
"DK",
|
|
21
|
+
"EE",
|
|
22
|
+
"FI",
|
|
23
|
+
"FR",
|
|
24
|
+
"DE",
|
|
25
|
+
"GR",
|
|
26
|
+
"HU",
|
|
27
|
+
"IE",
|
|
28
|
+
"IT",
|
|
29
|
+
"LV",
|
|
30
|
+
"LT",
|
|
31
|
+
"LU",
|
|
32
|
+
"MT",
|
|
33
|
+
"NL",
|
|
34
|
+
"PL",
|
|
35
|
+
"PT",
|
|
36
|
+
"RO",
|
|
37
|
+
"SK",
|
|
38
|
+
"SI",
|
|
39
|
+
"ES",
|
|
40
|
+
"SE",
|
|
41
|
+
],
|
|
42
|
+
"International - Non-EEA Payments": [],
|
|
43
|
+
"International - Inter-Regional Payments": ["IS", "NO", "LI"],
|
|
44
|
+
};
|
|
45
|
+
function find(country) {
|
|
46
|
+
let result;
|
|
47
|
+
if (Region.regions["National Payments"].includes(country))
|
|
48
|
+
result = "National Payments";
|
|
49
|
+
else if (Region.regions["International - Intra-Regional Payments"].includes(country))
|
|
50
|
+
result = "International - Intra-Regional Payments";
|
|
51
|
+
else if (Region.regions["International - Inter-Regional Payments"].includes(country))
|
|
52
|
+
result = "International - Inter-Regional Payments";
|
|
53
|
+
else
|
|
54
|
+
result = "International - Non-EEA Payments";
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
Region.find = find;
|
|
58
|
+
function fromRow(row) {
|
|
59
|
+
let result;
|
|
60
|
+
if (row.startsWith("National"))
|
|
61
|
+
result = "National Payments";
|
|
62
|
+
else if (row.startsWith("International - Inter-Regional"))
|
|
63
|
+
result = "International - Inter-Regional Payments";
|
|
64
|
+
else if (row.startsWith("International - Intra-Regional"))
|
|
65
|
+
result = "International - Intra-Regional Payments";
|
|
66
|
+
else
|
|
67
|
+
result = "International - Non-EEA Payments";
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
Region.fromRow = fromRow;
|
|
71
|
+
})(Region || (Region = {}));
|
|
72
|
+
//# sourceMappingURL=Region.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Region.js","sourceRoot":"../","sources":["reports/visa/Data/Region.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,MAAM,KAAW,MAAM,CAkEtB;AAlED,WAAiB,MAAM;IACT,aAAM,GAAG;QACrB,mBAAmB;QACnB,yCAAyC;QACzC,kCAAkC;QAClC,yCAAyC;KAChC,CAAA;IACG,WAAI,GAAG,IAAI,CAAC,MAAM,CAAS,OAAA,MAAM,CAAC,CAAA;IAClC,cAAO,GAA+C;QAClE,mBAAmB,EAAE,CAAC,IAAI,CAAC;QAC3B,yCAAyC,EAAE;YAC1C,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;SACJ;QACD,kCAAkC,EAAE,EAAE;QACtC,yCAAyC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;KAC7D,CAAA;IACD,SAAgB,IAAI,CAAC,OAAiC;QACrD,IAAI,MAAc,CAAA;QAClB,IAAI,OAAA,OAAO,CAAC,mBAAmB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;YACjD,MAAM,GAAG,mBAAmB,CAAA;aACxB,IAAI,OAAA,OAAO,CAAC,yCAAyC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;YAC5E,MAAM,GAAG,yCAAyC,CAAA;aAC9C,IAAI,OAAA,OAAO,CAAC,yCAAyC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;YAC5E,MAAM,GAAG,yCAAyC,CAAA;;YAElD,MAAM,GAAG,kCAAkC,CAAA;QAC5C,OAAO,MAAM,CAAA;IACd,CAAC;IAXe,WAAI,OAWnB,CAAA;IACD,SAAgB,OAAO,CAAC,GAAW;QAClC,IAAI,MAAc,CAAA;QAClB,IAAI,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC;YAC7B,MAAM,GAAG,mBAAmB,CAAA;aACxB,IAAI,GAAG,CAAC,UAAU,CAAC,gCAAgC,CAAC;YACxD,MAAM,GAAG,yCAAyC,CAAA;aAC9C,IAAI,GAAG,CAAC,UAAU,CAAC,gCAAgC,CAAC;YACxD,MAAM,GAAG,yCAAyC,CAAA;;YAElD,MAAM,GAAG,kCAAkC,CAAA;QAC5C,OAAO,MAAM,CAAA;IACd,CAAC;IAXe,cAAO,UAWtB,CAAA;AACF,CAAC,EAlEgB,MAAM,KAAN,MAAM,QAkEtB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Transaction } from "../../../Transaction";
|
|
2
|
+
import { Monthly } from "./Monthly";
|
|
3
|
+
import { Region } from "./Region";
|
|
4
|
+
export type Regional = Partial<Record<Region, Monthly>>;
|
|
5
|
+
export declare namespace Regional {
|
|
6
|
+
function update(previous: Regional, transaction: Transaction.CardTransaction): Regional;
|
|
7
|
+
function toCsvRow(regional: Regional, row: string): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Iin } from "./Iin";
|
|
2
|
+
import { Monthly } from "./Monthly";
|
|
3
|
+
import { Region } from "./Region";
|
|
4
|
+
export var Regional;
|
|
5
|
+
(function (Regional) {
|
|
6
|
+
function update(previous, transaction) {
|
|
7
|
+
const region = Region.find(transaction.counterpart.merchant.country);
|
|
8
|
+
const result = previous;
|
|
9
|
+
result[region] = Monthly.update(result[region], transaction);
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
Regional.update = update;
|
|
13
|
+
function toCsvRow(regional, row) {
|
|
14
|
+
let result = "";
|
|
15
|
+
const region = Region.fromRow(row);
|
|
16
|
+
const key = row.includes("Count") ? "count" : "volume";
|
|
17
|
+
for (const month of Monthly.Month.values) {
|
|
18
|
+
result += row.replace("Month x", `Month ${month}`);
|
|
19
|
+
for (const iin of Iin.values)
|
|
20
|
+
result += `|${regional[region]?.[month][key][iin] ?? 0}`;
|
|
21
|
+
result += "\n";
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
Regional.toCsvRow = toCsvRow;
|
|
26
|
+
})(Regional || (Regional = {}));
|
|
27
|
+
//# sourceMappingURL=Regional.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Regional.js","sourceRoot":"../","sources":["reports/visa/Data/Regional.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGjC,MAAM,KAAW,QAAQ,CAmBxB;AAnBD,WAAiB,QAAQ;IACxB,SAAgB,MAAM,CAAC,QAAkB,EAAE,WAAwC;QAClF,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QACpE,MAAM,MAAM,GAAa,QAAQ,CAAA;QACjC,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAAA;QAC5D,OAAO,MAAM,CAAA;IACd,CAAC;IALe,eAAM,SAKrB,CAAA;IACD,SAAgB,QAAQ,CAAC,QAAkB,EAAE,GAAW;QACvD,IAAI,MAAM,GAAG,EAAE,CAAA;QACf,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QAClC,MAAM,GAAG,GAAuB,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAA;QAC1E,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAC1C,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,KAAK,EAAE,CAAC,CAAA;YAClD,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM;gBAC3B,MAAM,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAA;YACzD,MAAM,IAAI,IAAI,CAAA;QACf,CAAC;QACD,OAAO,MAAM,CAAA;IACd,CAAC;IAXe,iBAAQ,WAWvB,CAAA;AACF,CAAC,EAnBgB,QAAQ,KAAR,QAAQ,QAmBxB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Transaction } from "../../../Transaction";
|
|
2
|
+
import { rows } from "../rows";
|
|
3
|
+
import { Country as DataCountry } from "./Country";
|
|
4
|
+
import { Iin as DataIin } from "./Iin";
|
|
5
|
+
import { NonMonthly } from "./NonMonthly";
|
|
6
|
+
import { Regional } from "./Regional";
|
|
7
|
+
export type Data = {
|
|
8
|
+
regional: Regional;
|
|
9
|
+
nonMonthly: NonMonthly;
|
|
10
|
+
country: Data.Country;
|
|
11
|
+
};
|
|
12
|
+
export declare namespace Data {
|
|
13
|
+
export import Iin = DataIin;
|
|
14
|
+
export import Country = DataCountry;
|
|
15
|
+
function create(transactions: Transaction.CardTransaction[]): Data;
|
|
16
|
+
function toCsv(data: Data, row: rows.NonZero): string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Country as DataCountry } from "./Country";
|
|
2
|
+
import { Iin as DataIin } from "./Iin";
|
|
3
|
+
import { NonMonthly } from "./NonMonthly";
|
|
4
|
+
import { Regional } from "./Regional";
|
|
5
|
+
export var Data;
|
|
6
|
+
(function (Data) {
|
|
7
|
+
Data.Iin = DataIin;
|
|
8
|
+
Data.Country = DataCountry;
|
|
9
|
+
function create(transactions) {
|
|
10
|
+
const result = { regional: {}, nonMonthly: NonMonthly.empty, country: {} };
|
|
11
|
+
for (const transaction of transactions) {
|
|
12
|
+
result.nonMonthly = NonMonthly.update(result.nonMonthly, transaction);
|
|
13
|
+
result.regional = Regional.update(result.regional, transaction);
|
|
14
|
+
result.country = Data.Country.update(result.country, transaction);
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
Data.create = create;
|
|
19
|
+
function toCsv(data, row) {
|
|
20
|
+
let result;
|
|
21
|
+
if (row.endsWith("Month x"))
|
|
22
|
+
result = Regional.toCsvRow(data.regional, row);
|
|
23
|
+
else
|
|
24
|
+
result = NonMonthly.toCsvRow(data.nonMonthly, row);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
Data.toCsv = toCsv;
|
|
28
|
+
})(Data || (Data = {}));
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["reports/visa/Data/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,GAAG,IAAI,O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@@
|
|
|
1
|
+
import { Data as visaData } from "./Data";
|
|
2
|
+
import { rows as visaRows } from "./rows";
|
|
3
|
+
export var visa;
|
|
4
|
+
(function (visa) {
|
|
5
|
+
visa.Data = visaData;
|
|
6
|
+
visa.rows = visaRows;
|
|
7
|
+
const headers = [
|
|
8
|
+
"Product Local Name",
|
|
9
|
+
"Visa IDX - 45672555",
|
|
10
|
+
"Visa IDX - 4567255",
|
|
11
|
+
"Visa IDX 1.4% - 45672557",
|
|
12
|
+
"Total Visa IDX products",
|
|
13
|
+
"Visa Business Prepaid - 44260108",
|
|
14
|
+
"Visa Corporate Deferred Debit - 49359119",
|
|
15
|
+
"Visa Business Immediate Debit - BIN: 45672554",
|
|
16
|
+
];
|
|
17
|
+
function toCsv(data) {
|
|
18
|
+
let csv = headers.join("|") + "\n";
|
|
19
|
+
for (const row of visa.rows.all)
|
|
20
|
+
if (visa.rows.Blank.type.is(row))
|
|
21
|
+
csv += visa.rows.Blank.toCsvRow(row, headers.length - 1);
|
|
22
|
+
else if (visa.rows.NonZero.type.is(row))
|
|
23
|
+
csv += visa.Data.toCsv(data, row);
|
|
24
|
+
else if (row.endsWith("Month x"))
|
|
25
|
+
csv += visa.rows.monthlyZeroRows(row, headers.length - 1);
|
|
26
|
+
else
|
|
27
|
+
csv += visa.rows.zeros(row, headers.length - 1);
|
|
28
|
+
csv += visa.Data.Country.toCsv(data.country);
|
|
29
|
+
return csv;
|
|
30
|
+
}
|
|
31
|
+
visa.toCsv = toCsv;
|
|
32
|
+
})(visa || (visa = {}));
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["reports/visa/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEzC,MAAM,KAAW,IA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|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isly } from "isly";
|
|
2
|
+
export declare namespace rows {
|
|
3
|
+
const all: readonly ["On-Us Payments Count - Month x", "On-Us Payments Volume - Month x", "On-Us Account Funding Transaction Count - Month x", "On-Us Account Funding Transaction Volume - Month x", "On-Us Original Credits Count - Month x", "On-Us Original Credits Volume - Month x", "On-Us ATM Cash Advances Count - Month x", "On-Us ATM Cash Advances Volume - Month x", "On-Us Manual Cash Count - Month x", "On-Us Manual Cash Volume - Month x", "On-Us Cashback Count - Month x", "On-Us Cashback Volume - Month x", "National Payments Count - Month x", "National Payments Volume - Month x", "National Account Funding Transaction Count - Month x", "National Account Funding Transaction Volume - Month x", "National Original Credits Count - Month x", "National Original Credits Volume - Month x", "National ATM Cash Advances Count - Month x", "National ATM Cash Advances Volume - Month x", "National Manual Cash Count - Month x", "National Manual Cash Volume - Month x", "National Cashback Count - Month x", "National Cashback Volume - Month x", "International - Intra-Regional Payments Count - Month x", "International - Intra-Regional Payments Volume - Month x", "International - Intra-Regional Account Funding Transaction Count - Month x", "International - Intra-Regional Account Funding Transaction Volume - Month x", "International - Intra-Regional Original Credits Count - Month x", "International - Intra-Regional Original Credits Volume - Month x", "International - Intra-Regional ATM Cash Advances Count - Month x", "International - Intra-Regional ATM Cash Advances Volume - Month x", "International - Intra-Regional Manual Cash Count - Month x", "International - Intra-Regional Manual Cash Volume - Month x", "International - Intra-Regional Cashback Count - Month x", "International - Intra-Regional Cashback Volume - Month x", "International - Non-EEA Payments Count - Month x", "International - Non-EEA Payments Volume - Month x", "International - Non-EEA Account Funding Transaction Count - Month x", "International - Non-EEA Account Funding Transaction Volume - Month x", "International - Non-EEA Original Credits Count - Month x", "International - Non-EEA Original Credits Volume - Month x", "International - Non-EEA ATM Cash Advances Count - Month x", "International - Non-EEA ATM Cash Advances Volume - Month x", "International - Non-EEA Manual Cash Count - Month x", "International - Non-EEA Manual Cash Volume - Month x", "International - Non-EEA Cashback Count - Month x", "International - Non-EEA Cashback Volume - Month x", "International - Inter-Regional Payments Count - Month x", "International - Inter-Regional Payments Volume - Month x", "International - Inter-Regional Account Funding Transaction Count - Month x", "International - Inter-Regional Account Funding Transaction Volume - Month x", "International - Inter-Regional Original Credits Count - Month x", "International - Inter-Regional Original Credits Volume - Month x", "International - Inter-Regional ATM Cash Advances Count - Month x", "International - Inter-Regional ATM Cash Advances Volume - Month x", "International - Inter-Regional Manual Cash Count - Month x", "International - Inter-Regional Manual Cash Volume - Month x", "International - Inter-Regional Cashback Count - Month x", "International - Inter-Regional Cashback Volume - Month x", "Total Number of Cards", "Number of Cards - Magnetic Stripe", "Number of Cards - Magnetic Stripe, Chip", "Number of Cards - Magnetic Stripe, Contactless", "Number of Cards - Magnetic Stripe, Chip, Contactless", "Total Number of Active Cards", "Number of Active Cards - used at Contactless device", "Number of Devices with Visa Contactless - Micro Tags", "Number of Devices with Visa Contactless - Mobile Phones", "Number of Devices with Visa Contactless - Other Devices", "Total Number of Accounts", "Number of Accounts - Domestic Use Only", "Number of Accounts - International Enabled", "Total Number of Active Accounts", "Total Number of Personal Deposit Accounts", "Number of Savings Accounts", "Number of Regular Checking Accounts", "Fraud Recoveries - Domestic - Cash Disbursements - Amount", "Fraud Recoveries - Domestic - Payments - Amount", "Fraud Recoveries - International - Cash Disbursements - Amount", "Fraud Recoveries - International - Payments - Amount", "Gross Fraud Losses - Number of Accounts", "Gross Fraud Losses - Number of Recovered Accounts", "Gross Fraud Losses - Domestic - Cash Disbursements - Count", "Gross Fraud Losses - Domestic - Cash Disbursements - Volume", "Gross Fraud Losses - Domestic - Payments - Count", "Gross Fraud Losses - Domestic - Payments - Volume", "Gross Fraud Losses - International - Cash Disbursements - Count", "Gross Fraud Losses - International - Cash Disbursements - Volume", "Gross Fraud Losses - International - Payments - Count", "Gross Fraud Losses - International - Payments - Volume", "Total Product Balance - Volume", "Payments Transactions Declined for Insufficient Funds - Number", "Cash Transactions Declined for Insufficient Funds - Number"];
|
|
4
|
+
type NonZero = typeof NonZero.values[number];
|
|
5
|
+
namespace NonZero {
|
|
6
|
+
const values: readonly ["National Payments Count - Month x", "National Payments Volume - Month x", "International - Intra-Regional Payments Count - Month x", "International - Intra-Regional Payments Volume - Month x", "International - Non-EEA Payments Count - Month x", "International - Non-EEA Payments Volume - Month x", "International - Inter-Regional Payments Count - Month x", "International - Inter-Regional Payments Volume - Month x", "Total Number of Cards", "Total Number of Active Cards", "Total Number of Accounts", "Number of Accounts - International Enabled", "Payments Transactions Declined for Insufficient Funds - Number"];
|
|
7
|
+
const type: isly.Type<"National Payments Count - Month x" | "National Payments Volume - Month x" | "International - Intra-Regional Payments Count - Month x" | "International - Intra-Regional Payments Volume - Month x" | "International - Non-EEA Payments Count - Month x" | "International - Non-EEA Payments Volume - Month x" | "International - Inter-Regional Payments Count - Month x" | "International - Inter-Regional Payments Volume - Month x" | "Total Number of Cards" | "Total Number of Active Cards" | "Total Number of Accounts" | "Number of Accounts - International Enabled" | "Payments Transactions Declined for Insufficient Funds - Number">;
|
|
8
|
+
}
|
|
9
|
+
type Blank = typeof Blank.values[number];
|
|
10
|
+
namespace Blank {
|
|
11
|
+
const values: readonly ["Fraud Recoveries - Domestic - Cash Disbursements - Amount", "Fraud Recoveries - Domestic - Payments - Amount", "Fraud Recoveries - International - Cash Disbursements - Amount", "Fraud Recoveries - International - Payments - Amount", "Gross Fraud Losses - Number of Accounts", "Gross Fraud Losses - Number of Recovered Accounts", "Gross Fraud Losses - Domestic - Cash Disbursements - Count", "Gross Fraud Losses - Domestic - Cash Disbursements - Volume", "Gross Fraud Losses - Domestic - Payments - Count", "Gross Fraud Losses - Domestic - Payments - Volume", "Gross Fraud Losses - International - Cash Disbursements - Count", "Gross Fraud Losses - International - Cash Disbursements - Volume", "Gross Fraud Losses - International - Payments - Count", "Gross Fraud Losses - International - Payments - Volume"];
|
|
12
|
+
const type: isly.Type<"Fraud Recoveries - Domestic - Cash Disbursements - Amount" | "Fraud Recoveries - Domestic - Payments - Amount" | "Fraud Recoveries - International - Cash Disbursements - Amount" | "Fraud Recoveries - International - Payments - Amount" | "Gross Fraud Losses - Number of Accounts" | "Gross Fraud Losses - Number of Recovered Accounts" | "Gross Fraud Losses - Domestic - Cash Disbursements - Count" | "Gross Fraud Losses - Domestic - Cash Disbursements - Volume" | "Gross Fraud Losses - Domestic - Payments - Count" | "Gross Fraud Losses - Domestic - Payments - Volume" | "Gross Fraud Losses - International - Cash Disbursements - Count" | "Gross Fraud Losses - International - Cash Disbursements - Volume" | "Gross Fraud Losses - International - Payments - Count" | "Gross Fraud Losses - International - Payments - Volume">;
|
|
13
|
+
function toCsvRow(row: Blank, count: number): string;
|
|
14
|
+
}
|
|
15
|
+
function monthlyZeroRows(row: string, zeroes: number): string;
|
|
16
|
+
function zeros(row: string, zeroes: number): string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { isly } from "isly";
|
|
2
|
+
export var rows;
|
|
3
|
+
(function (rows) {
|
|
4
|
+
rows.all = [
|
|
5
|
+
"On-Us Payments Count - Month x",
|
|
6
|
+
"On-Us Payments Volume - Month x",
|
|
7
|
+
"On-Us Account Funding Transaction Count - Month x",
|
|
8
|
+
"On-Us Account Funding Transaction Volume - Month x",
|
|
9
|
+
"On-Us Original Credits Count - Month x",
|
|
10
|
+
"On-Us Original Credits Volume - Month x",
|
|
11
|
+
"On-Us ATM Cash Advances Count - Month x",
|
|
12
|
+
"On-Us ATM Cash Advances Volume - Month x",
|
|
13
|
+
"On-Us Manual Cash Count - Month x",
|
|
14
|
+
"On-Us Manual Cash Volume - Month x",
|
|
15
|
+
"On-Us Cashback Count - Month x",
|
|
16
|
+
"On-Us Cashback Volume - Month x",
|
|
17
|
+
"National Payments Count - Month x",
|
|
18
|
+
"National Payments Volume - Month x",
|
|
19
|
+
"National Account Funding Transaction Count - Month x",
|
|
20
|
+
"National Account Funding Transaction Volume - Month x",
|
|
21
|
+
"National Original Credits Count - Month x",
|
|
22
|
+
"National Original Credits Volume - Month x",
|
|
23
|
+
"National ATM Cash Advances Count - Month x",
|
|
24
|
+
"National ATM Cash Advances Volume - Month x",
|
|
25
|
+
"National Manual Cash Count - Month x",
|
|
26
|
+
"National Manual Cash Volume - Month x",
|
|
27
|
+
"National Cashback Count - Month x",
|
|
28
|
+
"National Cashback Volume - Month x",
|
|
29
|
+
"International - Intra-Regional Payments Count - Month x",
|
|
30
|
+
"International - Intra-Regional Payments Volume - Month x",
|
|
31
|
+
"International - Intra-Regional Account Funding Transaction Count - Month x",
|
|
32
|
+
"International - Intra-Regional Account Funding Transaction Volume - Month x",
|
|
33
|
+
"International - Intra-Regional Original Credits Count - Month x",
|
|
34
|
+
"International - Intra-Regional Original Credits Volume - Month x",
|
|
35
|
+
"International - Intra-Regional ATM Cash Advances Count - Month x",
|
|
36
|
+
"International - Intra-Regional ATM Cash Advances Volume - Month x",
|
|
37
|
+
"International - Intra-Regional Manual Cash Count - Month x",
|
|
38
|
+
"International - Intra-Regional Manual Cash Volume - Month x",
|
|
39
|
+
"International - Intra-Regional Cashback Count - Month x",
|
|
40
|
+
"International - Intra-Regional Cashback Volume - Month x",
|
|
41
|
+
"International - Non-EEA Payments Count - Month x",
|
|
42
|
+
"International - Non-EEA Payments Volume - Month x",
|
|
43
|
+
"International - Non-EEA Account Funding Transaction Count - Month x",
|
|
44
|
+
"International - Non-EEA Account Funding Transaction Volume - Month x",
|
|
45
|
+
"International - Non-EEA Original Credits Count - Month x",
|
|
46
|
+
"International - Non-EEA Original Credits Volume - Month x",
|
|
47
|
+
"International - Non-EEA ATM Cash Advances Count - Month x",
|
|
48
|
+
"International - Non-EEA ATM Cash Advances Volume - Month x",
|
|
49
|
+
"International - Non-EEA Manual Cash Count - Month x",
|
|
50
|
+
"International - Non-EEA Manual Cash Volume - Month x",
|
|
51
|
+
"International - Non-EEA Cashback Count - Month x",
|
|
52
|
+
"International - Non-EEA Cashback Volume - Month x",
|
|
53
|
+
"International - Inter-Regional Payments Count - Month x",
|
|
54
|
+
"International - Inter-Regional Payments Volume - Month x",
|
|
55
|
+
"International - Inter-Regional Account Funding Transaction Count - Month x",
|
|
56
|
+
"International - Inter-Regional Account Funding Transaction Volume - Month x",
|
|
57
|
+
"International - Inter-Regional Original Credits Count - Month x",
|
|
58
|
+
"International - Inter-Regional Original Credits Volume - Month x",
|
|
59
|
+
"International - Inter-Regional ATM Cash Advances Count - Month x",
|
|
60
|
+
"International - Inter-Regional ATM Cash Advances Volume - Month x",
|
|
61
|
+
"International - Inter-Regional Manual Cash Count - Month x",
|
|
62
|
+
"International - Inter-Regional Manual Cash Volume - Month x",
|
|
63
|
+
"International - Inter-Regional Cashback Count - Month x",
|
|
64
|
+
"International - Inter-Regional Cashback Volume - Month x",
|
|
65
|
+
"Total Number of Cards",
|
|
66
|
+
"Number of Cards - Magnetic Stripe",
|
|
67
|
+
"Number of Cards - Magnetic Stripe, Chip",
|
|
68
|
+
"Number of Cards - Magnetic Stripe, Contactless",
|
|
69
|
+
"Number of Cards - Magnetic Stripe, Chip, Contactless",
|
|
70
|
+
"Total Number of Active Cards",
|
|
71
|
+
"Number of Active Cards - used at Contactless device",
|
|
72
|
+
"Number of Devices with Visa Contactless - Micro Tags",
|
|
73
|
+
"Number of Devices with Visa Contactless - Mobile Phones",
|
|
74
|
+
"Number of Devices with Visa Contactless - Other Devices",
|
|
75
|
+
"Total Number of Accounts",
|
|
76
|
+
"Number of Accounts - Domestic Use Only",
|
|
77
|
+
"Number of Accounts - International Enabled",
|
|
78
|
+
"Total Number of Active Accounts",
|
|
79
|
+
"Total Number of Personal Deposit Accounts",
|
|
80
|
+
"Number of Savings Accounts",
|
|
81
|
+
"Number of Regular Checking Accounts",
|
|
82
|
+
"Fraud Recoveries - Domestic - Cash Disbursements - Amount",
|
|
83
|
+
"Fraud Recoveries - Domestic - Payments - Amount",
|
|
84
|
+
"Fraud Recoveries - International - Cash Disbursements - Amount",
|
|
85
|
+
"Fraud Recoveries - International - Payments - Amount",
|
|
86
|
+
"Gross Fraud Losses - Number of Accounts",
|
|
87
|
+
"Gross Fraud Losses - Number of Recovered Accounts",
|
|
88
|
+
"Gross Fraud Losses - Domestic - Cash Disbursements - Count",
|
|
89
|
+
"Gross Fraud Losses - Domestic - Cash Disbursements - Volume",
|
|
90
|
+
"Gross Fraud Losses - Domestic - Payments - Count",
|
|
91
|
+
"Gross Fraud Losses - Domestic - Payments - Volume",
|
|
92
|
+
"Gross Fraud Losses - International - Cash Disbursements - Count",
|
|
93
|
+
"Gross Fraud Losses - International - Cash Disbursements - Volume",
|
|
94
|
+
"Gross Fraud Losses - International - Payments - Count",
|
|
95
|
+
"Gross Fraud Losses - International - Payments - Volume",
|
|
96
|
+
"Total Product Balance - Volume",
|
|
97
|
+
"Payments Transactions Declined for Insufficient Funds - Number",
|
|
98
|
+
"Cash Transactions Declined for Insufficient Funds - Number",
|
|
99
|
+
];
|
|
100
|
+
let NonZero;
|
|
101
|
+
(function (NonZero) {
|
|
102
|
+
NonZero.values = [
|
|
103
|
+
"National Payments Count - Month x",
|
|
104
|
+
"National Payments Volume - Month x",
|
|
105
|
+
"International - Intra-Regional Payments Count - Month x",
|
|
106
|
+
"International - Intra-Regional Payments Volume - Month x",
|
|
107
|
+
"International - Non-EEA Payments Count - Month x",
|
|
108
|
+
"International - Non-EEA Payments Volume - Month x",
|
|
109
|
+
"International - Inter-Regional Payments Count - Month x",
|
|
110
|
+
"International - Inter-Regional Payments Volume - Month x",
|
|
111
|
+
"Total Number of Cards",
|
|
112
|
+
"Total Number of Active Cards",
|
|
113
|
+
"Total Number of Accounts",
|
|
114
|
+
"Number of Accounts - International Enabled",
|
|
115
|
+
"Payments Transactions Declined for Insufficient Funds - Number",
|
|
116
|
+
];
|
|
117
|
+
NonZero.type = isly.string(NonZero.values);
|
|
118
|
+
})(NonZero = rows.NonZero || (rows.NonZero = {}));
|
|
119
|
+
let Blank;
|
|
120
|
+
(function (Blank) {
|
|
121
|
+
Blank.values = [
|
|
122
|
+
"Fraud Recoveries - Domestic - Cash Disbursements - Amount",
|
|
123
|
+
"Fraud Recoveries - Domestic - Payments - Amount",
|
|
124
|
+
"Fraud Recoveries - International - Cash Disbursements - Amount",
|
|
125
|
+
"Fraud Recoveries - International - Payments - Amount",
|
|
126
|
+
"Gross Fraud Losses - Number of Accounts",
|
|
127
|
+
"Gross Fraud Losses - Number of Recovered Accounts",
|
|
128
|
+
"Gross Fraud Losses - Domestic - Cash Disbursements - Count",
|
|
129
|
+
"Gross Fraud Losses - Domestic - Cash Disbursements - Volume",
|
|
130
|
+
"Gross Fraud Losses - Domestic - Payments - Count",
|
|
131
|
+
"Gross Fraud Losses - Domestic - Payments - Volume",
|
|
132
|
+
"Gross Fraud Losses - International - Cash Disbursements - Count",
|
|
133
|
+
"Gross Fraud Losses - International - Cash Disbursements - Volume",
|
|
134
|
+
"Gross Fraud Losses - International - Payments - Count",
|
|
135
|
+
"Gross Fraud Losses - International - Payments - Volume",
|
|
136
|
+
];
|
|
137
|
+
Blank.type = isly.string(Blank.values);
|
|
138
|
+
function toCsvRow(row, count) {
|
|
139
|
+
return row + "|".repeat(count) + "\n";
|
|
140
|
+
}
|
|
141
|
+
Blank.toCsvRow = toCsvRow;
|
|
142
|
+
})(Blank = rows.Blank || (rows.Blank = {}));
|
|
143
|
+
function monthlyZeroRows(row, zeroes) {
|
|
144
|
+
let result = "";
|
|
145
|
+
for (let i = 1; 3 >= i; i++)
|
|
146
|
+
result += row.replace("Month x", `Month ${i}`) + "|0".repeat(zeroes) + "\n";
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
rows.monthlyZeroRows = monthlyZeroRows;
|
|
150
|
+
function zeros(row, zeroes) {
|
|
151
|
+
return row + "|0".repeat(zeroes) + "\n";
|
|
152
|
+
}
|
|
153
|
+
rows.zeros = zeros;
|
|
154
|
+
})(rows || (rows = {}));
|
|
155
|
+
//# sourceMappingURL=rows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rows.js","sourceRoot":"../","sources":["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C,EArBgB,KAAK,GAAL,UAAK,KAAL,UAAK,QAqBrB;IACD,SAAgB,eAAe,CAAC,GAAW,EAAE,MAAc;QAC1D,IAAI,MAAM,GAAG,EAAE,CAAA;QACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YAC1B,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;QAC5E,OAAO,MAAM,CAAA;IACd,CAAC;IALe,oBAAe,kBAK9B,CAAA;IACD,SAAgB,KAAK,CAAC,GAAW,EAAE,MAAc;QAChD,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;IACxC,CAAC;IAFe,UAAK,QAEpB,CAAA;AACF,CAAC,EApJgB,IAAI,KAAJ,IAAI,QAoJpB"}
|
package/package.json
CHANGED
package/pax2pay.ts
CHANGED
package/reports/index.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
2
|
+
import { Transaction } from "../../../Transaction"
|
|
3
|
+
import { Iin } from "./Iin"
|
|
4
|
+
import { Monthly } from "./Monthly"
|
|
5
|
+
import { Region } from "./Region"
|
|
6
|
+
|
|
7
|
+
// data for rows of format:
|
|
8
|
+
// "Country X - Region X Payments Card Present Count - Month x",
|
|
9
|
+
// "Country X - Region X Payments Card Present Volume - Month x",
|
|
10
|
+
// "Country X - Region X Payments Card Not Present Count - Month x",
|
|
11
|
+
// "Country X - Region X Payments Card Not Present Volume - Month x",
|
|
12
|
+
type PerCountry = { present?: Monthly; notPresent?: Monthly }
|
|
13
|
+
export type Country = Partial<Record<isoly.CountryCode.Alpha2, PerCountry>>
|
|
14
|
+
export namespace Country {
|
|
15
|
+
export function toCsv(country: Country): string {
|
|
16
|
+
let result = ""
|
|
17
|
+
for (const [countryCode, perCountry] of Object.entries(country)) {
|
|
18
|
+
const region = Region.find(countryCode as isoly.CountryCode.Alpha2)
|
|
19
|
+
result += csvLine(countryCode, region, perCountry, "present", "count")
|
|
20
|
+
result += csvLine(countryCode, region, perCountry, "present", "volume")
|
|
21
|
+
result += csvLine(countryCode, region, perCountry, "notPresent", "count")
|
|
22
|
+
result += csvLine(countryCode, region, perCountry, "notPresent", "volume")
|
|
23
|
+
}
|
|
24
|
+
return result
|
|
25
|
+
}
|
|
26
|
+
export function csvLine(
|
|
27
|
+
country: string,
|
|
28
|
+
region: Region,
|
|
29
|
+
data: PerCountry,
|
|
30
|
+
presence: "present" | "notPresent",
|
|
31
|
+
type: "count" | "volume"
|
|
32
|
+
): string {
|
|
33
|
+
let result = ""
|
|
34
|
+
if (data[presence])
|
|
35
|
+
for (const month of Monthly.Month.values) {
|
|
36
|
+
result += `Country ${country} - ${region} Card ${presence == "present" ? "Present" : "Not Present"} ${
|
|
37
|
+
type == "count" ? "Count" : "Volume"
|
|
38
|
+
} - Month ${month}`
|
|
39
|
+
for (const iin of Iin.values)
|
|
40
|
+
result += `|${data[presence][month][type][iin] ?? 0}`
|
|
41
|
+
result += "\n"
|
|
42
|
+
}
|
|
43
|
+
return result
|
|
44
|
+
}
|
|
45
|
+
export function update(country: Country, transaction: Transaction.CardTransaction): Country {
|
|
46
|
+
const result: Country = country
|
|
47
|
+
result[transaction.counterpart.merchant.country] = updatePerCountry(
|
|
48
|
+
result[transaction.counterpart.merchant.country] ?? {},
|
|
49
|
+
transaction
|
|
50
|
+
)
|
|
51
|
+
return result
|
|
52
|
+
}
|
|
53
|
+
function updatePerCountry(input: PerCountry, transaction: Transaction.CardTransaction): PerCountry {
|
|
54
|
+
const result = input
|
|
55
|
+
const key = transaction.counterpart.present === true ? "present" : "notPresent"
|
|
56
|
+
result[key] = Monthly.update(result[key], transaction)
|
|
57
|
+
return result
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isly } from "isly"
|
|
2
|
+
|
|
3
|
+
export type Iin = typeof Iin.values[number]
|
|
4
|
+
export namespace Iin {
|
|
5
|
+
export type Idx = typeof Idx.values[number]
|
|
6
|
+
export namespace Idx {
|
|
7
|
+
export const values = ["45672555", "4567255", "45672557"] as const
|
|
8
|
+
export const type = isly.string<Idx>(values)
|
|
9
|
+
}
|
|
10
|
+
export const values = [...Idx.values, "totalIdx", "44260108", "49359119", "45672554"] as const
|
|
11
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
2
|
+
import { Transaction } from "../../../Transaction"
|
|
3
|
+
import { Iin } from "./Iin"
|
|
4
|
+
|
|
5
|
+
export type Monthly = Record<
|
|
6
|
+
Monthly.Month,
|
|
7
|
+
{ count: Partial<Record<Iin, number>>; volume: Partial<Record<Iin, number>> }
|
|
8
|
+
>
|
|
9
|
+
export namespace Monthly {
|
|
10
|
+
export type Month = typeof Month.values[number]
|
|
11
|
+
export namespace Month {
|
|
12
|
+
export const values = [1, 2, 3] as const
|
|
13
|
+
}
|
|
14
|
+
// returns which number of the month in the quarter the transaction is in
|
|
15
|
+
export function getMonth(transaction: Transaction.CardTransaction): Monthly.Month {
|
|
16
|
+
const month = isoly.DateTime.getMonth(transaction.transacted ?? transaction.posted)
|
|
17
|
+
return (((month - 1) % 3) + 1) as Monthly.Month
|
|
18
|
+
}
|
|
19
|
+
export function update(previous: Monthly | undefined, transaction: Transaction.CardTransaction): Monthly {
|
|
20
|
+
const result: Monthly = previous ?? {
|
|
21
|
+
"1": { count: {}, volume: {} },
|
|
22
|
+
"2": { count: {}, volume: {} },
|
|
23
|
+
"3": { count: {}, volume: {} },
|
|
24
|
+
}
|
|
25
|
+
if (transaction.direction == "outbound" && transaction.status == "finalized") {
|
|
26
|
+
const month = getMonth(transaction)
|
|
27
|
+
result[month].count[transaction.account.iin as Iin] =
|
|
28
|
+
(result[month].count[transaction.account.iin as Iin] ?? 0) + 1
|
|
29
|
+
result[month].volume[transaction.account.iin as Iin] = isoly.Currency.add(
|
|
30
|
+
"GBP",
|
|
31
|
+
result[month].volume[transaction.account.iin as Iin] ?? 0,
|
|
32
|
+
Math.abs(transaction.amount.original)
|
|
33
|
+
)
|
|
34
|
+
if (Iin.Idx.type.is(transaction.account.iin)) {
|
|
35
|
+
result[month].count["totalIdx"] = (result[month].count["totalIdx"] ?? 0) + 1
|
|
36
|
+
result[month].volume["totalIdx"] = isoly.Currency.add(
|
|
37
|
+
"GBP",
|
|
38
|
+
result[month].volume["totalIdx"] ?? 0,
|
|
39
|
+
Math.abs(transaction.amount.original)
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return result
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Transaction } from "../../../Transaction"
|
|
2
|
+
import { rows } from "../rows"
|
|
3
|
+
import { Iin } from "./Iin"
|
|
4
|
+
|
|
5
|
+
export type NonMonthly = Record<
|
|
6
|
+
| "Total Number of Cards"
|
|
7
|
+
| "Total Number of Active Cards"
|
|
8
|
+
| "Total Number of Accounts"
|
|
9
|
+
| "Number of Accounts - International Enabled"
|
|
10
|
+
| "Payments Transactions Declined for Insufficient Funds - Number",
|
|
11
|
+
Partial<Record<Iin, number>>
|
|
12
|
+
>
|
|
13
|
+
export namespace NonMonthly {
|
|
14
|
+
export const empty: NonMonthly = {
|
|
15
|
+
"Number of Accounts - International Enabled": {},
|
|
16
|
+
"Payments Transactions Declined for Insufficient Funds - Number": {},
|
|
17
|
+
"Total Number of Accounts": {},
|
|
18
|
+
"Total Number of Active Cards": {},
|
|
19
|
+
"Total Number of Cards": {},
|
|
20
|
+
}
|
|
21
|
+
export function update(previous: NonMonthly, transaction: Transaction.CardTransaction): NonMonthly {
|
|
22
|
+
const result = previous
|
|
23
|
+
if (Array.isArray(transaction.status) && transaction.status[1] == "insufficient funds")
|
|
24
|
+
result["Payments Transactions Declined for Insufficient Funds - Number"][transaction.account.iin as Iin] =
|
|
25
|
+
(result["Payments Transactions Declined for Insufficient Funds - Number"]?.[transaction.account.iin as Iin] ??
|
|
26
|
+
0) + 1
|
|
27
|
+
return result
|
|
28
|
+
}
|
|
29
|
+
export function toCsvRow(data: NonMonthly, row: rows.NonZero): string {
|
|
30
|
+
let result = row
|
|
31
|
+
for (const iin of Iin.values)
|
|
32
|
+
result += `|${data[row as keyof NonMonthly][iin] ?? 0}`
|
|
33
|
+
result += "\n"
|
|
34
|
+
return result
|
|
35
|
+
}
|
|
36
|
+
}
|