@pax2pay/model-banking 0.1.498 → 0.1.499
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/dist/cjs/reports/visa/Data/Cards.d.ts +2 -1
- package/dist/cjs/reports/visa/Data/Cards.js +5 -3
- package/dist/cjs/reports/visa/Data/Cards.js.map +1 -1
- package/dist/mjs/reports/visa/Data/Cards.d.ts +2 -1
- package/dist/mjs/reports/visa/Data/Cards.js +5 -3
- package/dist/mjs/reports/visa/Data/Cards.js.map +1 -1
- package/package.json +1 -1
- package/reports/visa/Data/Cards.ts +10 -4
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { Card } from "../../../Card";
|
|
3
3
|
import { Iin } from "./Iin";
|
|
4
|
+
import { NonMonthly } from "./NonMonthly";
|
|
4
5
|
export type Cards = Record<"Total Number of Cards" | "Total Number of Active Cards" | "Total Number of Accounts" | "Number of Accounts - International Enabled" | "Total Number of Active Accounts", Partial<Record<Iin, number>>>;
|
|
5
6
|
export declare namespace Cards {
|
|
6
7
|
function empty(): Cards;
|
|
7
|
-
function report(previous:
|
|
8
|
+
function report(previous: NonMonthly, cards: Card[], range: {
|
|
8
9
|
start: isoly.Date;
|
|
9
10
|
end: isoly.Date;
|
|
10
11
|
}): Cards;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Cards = void 0;
|
|
4
|
+
const isoly_1 = require("isoly");
|
|
4
5
|
const Iin_1 = require("./Iin");
|
|
5
6
|
var Cards;
|
|
6
7
|
(function (Cards) {
|
|
@@ -23,10 +24,11 @@ var Cards;
|
|
|
23
24
|
accounts > 0 &&
|
|
24
25
|
(result["Number of Accounts - International Enabled"][iin] = result["Total Number of Accounts"][iin] =
|
|
25
26
|
accounts);
|
|
26
|
-
const iinCardsWithinRange = iinCards.filter(card =>
|
|
27
|
+
const iinCardsWithinRange = iinCards.filter((card, i) => {
|
|
28
|
+
return (isoly_1.isoly.DateTime.getDate(card.created) >= range.start && isoly_1.isoly.DateTime.getDate(card.created) <= range.end);
|
|
29
|
+
});
|
|
27
30
|
iinCardsWithinRange.length > 0 && (result["Total Number of Cards"][iin] = iinCardsWithinRange.length);
|
|
28
|
-
const activeCards = iinCardsWithinRange.filter(card => card.history.some(history => history.status == "cancelled" && history.created > range.end) ||
|
|
29
|
-
!card.history.some(history => history.status == "cancelled"));
|
|
31
|
+
const activeCards = iinCardsWithinRange.filter(card => card.history.some(history => history.status == "cancelled" && isoly_1.isoly.DateTime.getDate(history.created) > range.end) || !card.history.some(history => history.status == "cancelled"));
|
|
30
32
|
activeCards.length > 0 && (result["Total Number of Active Cards"][iin] = activeCards.length);
|
|
31
33
|
const accountsWithActive = new Set(activeCards.map(card => card.account)).size;
|
|
32
34
|
accountsWithActive > 0 && (result["Total Number of Active Accounts"][iin] = accountsWithActive);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cards.js","sourceRoot":"","sources":["../../../../../reports/visa/Data/Cards.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Cards.js","sourceRoot":"","sources":["../../../../../reports/visa/Data/Cards.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAE7B,+BAA2B;AAW3B,IAAiB,KAAK,CAqDrB;AArDD,WAAiB,KAAK;IACrB,SAAgB,KAAK;QACpB,OAAO;YACN,4CAA4C,EAAE,EAAE;YAChD,0BAA0B,EAAE,EAAE;YAC9B,8BAA8B,EAAE,EAAE;YAClC,uBAAuB,EAAE,EAAE;YAC3B,iCAAiC,EAAE,EAAE;SACrC,CAAA;IACF,CAAC;IARe,WAAK,QAQpB,CAAA;IACD,SAAgB,MAAM,CAAC,QAAoB,EAAE,KAAa,EAAE,KAA6C;QACxG,MAAM,MAAM,GAAG,QAAQ,CAAA;QACvB,KAAK,MAAM,GAAG,IAAI,SAAG,CA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O,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC,CAClE,CAAA;gBACD,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,CAAA;gBAG5F,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA;gBAC9E,kBAAkB,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,iCAAiC,CAAC,CAAC,GAAG,CAAC,GAAG,kBAAkB,CAAC,CAAA;YAChG,CAAC;QAGF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;YACpC,IAAI,GAAG,KAAK,gEAAgE;gBAC3E,MAAM,CAAC,GAAkB,CAAC,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAkB,CAAC,CAAC,CAAC,MAAM,CACxF,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,EAClC,CAAC,CACD,CAAA;QAEH,OAAO,MAAM,CAAA;IACd,CAAC;IA1Ce,YAAM,SA0CrB,CAAA;AACF,CAAC,EArDgB,KAAK,qBAAL,KAAK,QAqDrB"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { Card } from "../../../Card";
|
|
3
3
|
import { Iin } from "./Iin";
|
|
4
|
+
import { NonMonthly } from "./NonMonthly";
|
|
4
5
|
export type Cards = Record<"Total Number of Cards" | "Total Number of Active Cards" | "Total Number of Accounts" | "Number of Accounts - International Enabled" | "Total Number of Active Accounts", Partial<Record<Iin, number>>>;
|
|
5
6
|
export declare namespace Cards {
|
|
6
7
|
function empty(): Cards;
|
|
7
|
-
function report(previous:
|
|
8
|
+
function report(previous: NonMonthly, cards: Card[], range: {
|
|
8
9
|
start: isoly.Date;
|
|
9
10
|
end: isoly.Date;
|
|
10
11
|
}): Cards;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
1
2
|
import { Iin } from "./Iin";
|
|
2
3
|
export var Cards;
|
|
3
4
|
(function (Cards) {
|
|
@@ -20,10 +21,11 @@ export var Cards;
|
|
|
20
21
|
accounts > 0 &&
|
|
21
22
|
(result["Number of Accounts - International Enabled"][iin] = result["Total Number of Accounts"][iin] =
|
|
22
23
|
accounts);
|
|
23
|
-
const iinCardsWithinRange = iinCards.filter(card =>
|
|
24
|
+
const iinCardsWithinRange = iinCards.filter((card, i) => {
|
|
25
|
+
return (isoly.DateTime.getDate(card.created) >= range.start && isoly.DateTime.getDate(card.created) <= range.end);
|
|
26
|
+
});
|
|
24
27
|
iinCardsWithinRange.length > 0 && (result["Total Number of Cards"][iin] = iinCardsWithinRange.length);
|
|
25
|
-
const activeCards = iinCardsWithinRange.filter(card => card.history.some(history => history.status == "cancelled" && history.created > range.end) ||
|
|
26
|
-
!card.history.some(history => history.status == "cancelled"));
|
|
28
|
+
const activeCards = iinCardsWithinRange.filter(card => card.history.some(history => history.status == "cancelled" && isoly.DateTime.getDate(history.created) > range.end) || !card.history.some(history => history.status == "cancelled"));
|
|
27
29
|
activeCards.length > 0 && (result["Total Number of Active Cards"][iin] = activeCards.length);
|
|
28
30
|
const accountsWithActive = new Set(activeCards.map(card => card.account)).size;
|
|
29
31
|
accountsWithActive > 0 && (result["Total Number of Active Accounts"][iin] = accountsWithActive);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cards.js","sourceRoot":"","sources":["../../../../../reports/visa/Data/Cards.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Cards.js","sourceRoot":"","sources":["../../../../../reports/visa/Data/Cards.ts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C,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,EAClC,CAAC,CACD,CAAA;QAEH,OAAO,MAAM,CAAA;IACd,CAAC;IA1Ce,YAAM,SA0CrB,CAAA;AACF,CAAC,EArDgB,KAAK,KAAL,KAAK,QAqDrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { Card } from "../../../Card"
|
|
3
3
|
import { Iin } from "./Iin"
|
|
4
|
+
import { NonMonthly } from "./NonMonthly"
|
|
4
5
|
|
|
5
6
|
export type Cards = Record<
|
|
6
7
|
| "Total Number of Cards"
|
|
@@ -20,7 +21,7 @@ export namespace Cards {
|
|
|
20
21
|
"Total Number of Active Accounts": {},
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
|
-
export function report(previous:
|
|
24
|
+
export function report(previous: NonMonthly, cards: Card[], range: { start: isoly.Date; end: isoly.Date }): Cards {
|
|
24
25
|
const result = previous
|
|
25
26
|
for (const iin of Iin.values)
|
|
26
27
|
if (iin !== "totalIdx") {
|
|
@@ -32,14 +33,19 @@ export namespace Cards {
|
|
|
32
33
|
accounts)
|
|
33
34
|
|
|
34
35
|
// Total number of cards in range
|
|
35
|
-
const iinCardsWithinRange = iinCards.filter(card =>
|
|
36
|
+
const iinCardsWithinRange = iinCards.filter((card, i) => {
|
|
37
|
+
return (
|
|
38
|
+
isoly.DateTime.getDate(card.created) >= range.start && isoly.DateTime.getDate(card.created) <= range.end
|
|
39
|
+
)
|
|
40
|
+
})
|
|
36
41
|
iinCardsWithinRange.length > 0 && (result["Total Number of Cards"][iin] = iinCardsWithinRange.length)
|
|
37
42
|
|
|
38
43
|
// Total number of active cards at end of range
|
|
39
44
|
const activeCards = iinCardsWithinRange.filter(
|
|
40
45
|
card =>
|
|
41
|
-
card.history.some(
|
|
42
|
-
|
|
46
|
+
card.history.some(
|
|
47
|
+
history => history.status == "cancelled" && isoly.DateTime.getDate(history.created) > range.end
|
|
48
|
+
) || !card.history.some(history => history.status == "cancelled")
|
|
43
49
|
)
|
|
44
50
|
activeCards.length > 0 && (result["Total Number of Active Cards"][iin] = activeCards.length)
|
|
45
51
|
|