@pax2pay/model-banking 0.1.496 → 0.1.498

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.
@@ -0,0 +1,11 @@
1
+ import { isoly } from "isoly";
2
+ import { Card } from "../../../Card";
3
+ import { Iin } from "./Iin";
4
+ 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
+ export declare namespace Cards {
6
+ function empty(): Cards;
7
+ function report(previous: Cards, cards: Card[], range: {
8
+ start: isoly.Date;
9
+ end: isoly.Date;
10
+ }): Cards;
11
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Cards = void 0;
4
+ const Iin_1 = require("./Iin");
5
+ var Cards;
6
+ (function (Cards) {
7
+ function empty() {
8
+ return {
9
+ "Number of Accounts - International Enabled": {},
10
+ "Total Number of Accounts": {},
11
+ "Total Number of Active Cards": {},
12
+ "Total Number of Cards": {},
13
+ "Total Number of Active Accounts": {},
14
+ };
15
+ }
16
+ Cards.empty = empty;
17
+ function report(previous, cards, range) {
18
+ const result = previous;
19
+ for (const iin of Iin_1.Iin.values)
20
+ if (iin !== "totalIdx") {
21
+ const iinCards = cards.filter(card => card.details.iin == iin);
22
+ const accounts = new Set(iinCards.map(card => card.account)).size;
23
+ accounts > 0 &&
24
+ (result["Number of Accounts - International Enabled"][iin] = result["Total Number of Accounts"][iin] =
25
+ accounts);
26
+ const iinCardsWithinRange = iinCards.filter(card => card.created >= range.start && card.created <= range.end);
27
+ 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"));
30
+ activeCards.length > 0 && (result["Total Number of Active Cards"][iin] = activeCards.length);
31
+ const accountsWithActive = new Set(activeCards.map(card => card.account)).size;
32
+ accountsWithActive > 0 && (result["Total Number of Active Accounts"][iin] = accountsWithActive);
33
+ }
34
+ for (const iin of Object.keys(result))
35
+ if (iin !== "Payments Transactions Declined for Insufficient Funds - Number")
36
+ result[iin]["totalIdx"] = Object.values(result[iin]).reduce((sum, value) => sum + (value ?? 0), 0);
37
+ return result;
38
+ }
39
+ Cards.report = report;
40
+ })(Cards || (exports.Cards = Cards = {}));
41
+ //# sourceMappingURL=Cards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cards.js","sourceRoot":"","sources":["../../../../../reports/visa/Data/Cards.ts"],"names":[],"mappings":";;;AAEA,+BAA2B;AAU3B,IAAiB,KAAK,CAgDrB;AAhDD,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,QAAe,EAAE,KAAa,EAAE,KAA6C;QACnG,MAAM,MAAM,GAAG,QAAQ,CAAA;QACvB,KAAK,MAAM,GAAG,IAAI,SAAG,CAAC,MAAM;YAC3B,IAAI,GAAG,KAAK,UAAU,EAAE,CAAC;gBAExB,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAA;gBAC9D,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA;gBACjE,QAAQ,GAAG,CAAC;oBACX,CAAC,MAAM,CAAC,4CAA4C,CAAC,CAAC,GAA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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;IArCe,YAAM,SAqCrB,CAAA;AACF,CAAC,EAhDgB,KAAK,qBAAL,KAAK,QAgDrB"}
@@ -1,7 +1,10 @@
1
1
  import { Transaction } from "../../../Transaction";
2
2
  import { rows } from "../rows";
3
+ import { Cards } from "./Cards";
3
4
  import { Iin } from "./Iin";
4
- export type NonMonthly = Record<"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", Partial<Record<Iin, number>>>;
5
+ export type NonMonthly = {
6
+ "Payments Transactions Declined for Insufficient Funds - Number": Partial<Record<Iin, number>>;
7
+ } & Cards;
5
8
  export declare namespace NonMonthly {
6
9
  function empty(): NonMonthly;
7
10
  function update(previous: NonMonthly, transaction: Transaction.CardTransaction): NonMonthly;
@@ -1,16 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NonMonthly = void 0;
4
+ const Cards_1 = require("./Cards");
4
5
  const Iin_1 = require("./Iin");
5
6
  var NonMonthly;
6
7
  (function (NonMonthly) {
7
8
  function empty() {
8
9
  return {
9
- "Number of Accounts - International Enabled": {},
10
10
  "Payments Transactions Declined for Insufficient Funds - Number": {},
11
- "Total Number of Accounts": {},
12
- "Total Number of Active Cards": {},
13
- "Total Number of Cards": {},
11
+ ...Cards_1.Cards.empty(),
14
12
  };
15
13
  }
16
14
  NonMonthly.empty = empty;
@@ -1 +1 @@
1
- {"version":3,"file":"NonMonthly.js","sourceRoot":"","sources":["../../../../../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AAG,CAAA;QAChB,KAAK,MAAM,GAAG,IAAI,SAAG,CAAC,MAAM;YAC3B,MAAM,IAAI,IAAI,IAAI,CAAC,GAAuB,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAA;QACxD,MAAM,IAAI,IAAI,CAAA;QACd,OAAO,MAAM,CAAA;IACd,CAAC;IANe,mBAAQ,WAMvB,CAAA;IACD,SAAgB,KAAK,CAAC,QAAoB,EAAE,QAAoB;QAC/D,MAAM,MAAM,GAAe,KAAK,EAAE,CAAA;QAClC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAyB;YAC5D,KAAK,MAAM,GAAG,IAAI,SAAG,CAAC,MAAM;gBAC3B,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;QAC9E,OAAO,MAAM,CAAA;IACd,CAAC;IANe,gBAAK,QAMpB,CAAA;AACF,CAAC,EA7BgB,UAAU,0BAAV,UAAU,QA6B1B"}
@@ -1,3 +1,5 @@
1
+ import { isoly } from "isoly";
2
+ import { Card } from "../../../Card";
1
3
  import { Transaction } from "../../../Transaction";
2
4
  import { rows } from "../rows";
3
5
  import { Country as DataCountry } from "./Country";
@@ -12,7 +14,10 @@ export interface Data {
12
14
  export declare namespace Data {
13
15
  export import Iin = DataIin;
14
16
  export import Country = DataCountry;
15
- function create(transactions: Transaction.CardTransaction[]): Data;
17
+ function create(transactions: Transaction.CardTransaction[], cards: Card[], range: {
18
+ start: isoly.Date;
19
+ end: isoly.Date;
20
+ }): Data;
16
21
  function merge(previous: Data, addition: Data): Data;
17
22
  function toCsv(data: Data, row: rows.NonZero): string;
18
23
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Data = void 0;
4
+ const Cards_1 = require("./Cards");
4
5
  const Country_1 = require("./Country");
5
6
  const Iin_1 = require("./Iin");
6
7
  const NonMonthly_1 = require("./NonMonthly");
@@ -9,13 +10,18 @@ var Data;
9
10
  (function (Data) {
10
11
  Data.Iin = Iin_1.Iin;
11
12
  Data.Country = Country_1.Country;
12
- function create(transactions) {
13
- const result = { regional: {}, nonMonthly: NonMonthly_1.NonMonthly.empty(), country: {} };
13
+ function create(transactions, cards, range) {
14
+ const result = {
15
+ regional: {},
16
+ nonMonthly: NonMonthly_1.NonMonthly.empty(),
17
+ country: {},
18
+ };
14
19
  for (const transaction of transactions) {
15
20
  result.nonMonthly = NonMonthly_1.NonMonthly.update(result.nonMonthly, transaction);
16
21
  result.regional = Regional_1.Regional.update(result.regional, transaction);
17
22
  result.country = Data.Country.update(result.country, transaction);
18
23
  }
24
+ result.nonMonthly = { ...result.nonMonthly, ...Cards_1.Cards.report(result.nonMonthly, cards, range) };
19
25
  return result;
20
26
  }
21
27
  Data.create = create;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../reports/visa/Data/index.ts"],"names":[],"mappings":";;;AAEA,uCAAkD;AAClD,+BAAsC;AACtC,6CAAyC;AACzC,yCAAqC;AAOrC,IAAiB,IAAI,CA4BpB;AA5BD,WAAiB,IAAI;IACN,QAAG,GAAG,SAAO,CAAA;IACb,YAAO,GAAG,iBAAW,CAAA;IACnC,SAAgB,MAAM,CAAC,YAA2C;QACjE,MAAM,MAAM,GAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,uBAAU,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAA;QAClF,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;YACxC,MAAM,CAAC,UAAU,GAAG,uBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,CAAA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Q,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC;SAC/D,CAAA;QACD,OAAO,MAAM,CAAA;IACd,CAAC;IAPe,UAAK,QAOpB,CAAA;IACD,SAAgB,KAAK,CAAC,IAAU,EAAE,GAAiB;QAClD,IAAI,MAAc,CAAA;QAClB,IAAI,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC;YAC1B,MAAM,GAAG,mBAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;;YAE9C,MAAM,GAAG,uBAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;QACnD,OAAO,MAAM,CAAA;IACd,CAAC;IAPe,UAAK,QAOpB,CAAA;AACF,CAAC,EArCgB,IAAI,oBAAJ,IAAI,QAqCpB"}
@@ -3,8 +3,8 @@ export declare namespace rows {
3
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
4
  type NonZero = typeof NonZero.values[number];
5
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">;
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", "Total Number of Active 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" | "Total Number of Active Accounts" | "Payments Transactions Declined for Insufficient Funds - Number">;
8
8
  }
9
9
  type Blank = typeof Blank.values[number];
10
10
  namespace Blank {
@@ -114,6 +114,7 @@ var rows;
114
114
  "Total Number of Cards",
115
115
  "Total Number of Active Cards",
116
116
  "Total Number of Accounts",
117
+ "Total Number of Active Accounts",
117
118
  "Number of Accounts - International Enabled",
118
119
  "Payments Transactions Declined for Insufficient Funds - Number",
119
120
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"rows.js","sourceRoot":"","sources":["../../../../reports/visa/rows.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAE3B,IAAiB,IAAI,CAoJpB;AApJD,WAAiB,IAAI;IACP,QAAG,GAAG;QAClB,gCAAgC;QAChC,iCAAiC;QACjC,mDAAmD;QACnD,oDAAoD;QACpD,wCAAwC;QACxC,yCAAyC;QACzC,yCAAyC;QACzC,0CAA0C;QAC1C,mCAAmC;QACnC,oCAAoC;QACpC,gCAAgC;QAChC,iCAAiC;QACjC,mCAAmC;QACnC,oCAAoC;QACpC,sDAAsD;QACtD,uDAAuD;QACvD,2CAA2C;QAC3C,4CAA4C;QAC5C,4CAA4C;QAC5C,6CAA6C;QAC7C,sCAAsC;QACtC,uCAAuC;QACvC,mCAAmC;QACnC,oCAAoC;QACpC,yDAAyD;QACzD,0DAA0D;QAC1D,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AC;IAFe,UAAK,QAEpB,CAAA;AACF,CAAC,EApJgB,IAAI,oBAAJ,IAAI,QAoJpB"}
1
+ {"version":3,"file":"rows.js","sourceRoot":"","sources":["../../../../reports/visa/rows.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAE3B,IAAiB,IAAI,CAqJpB;AArJD,WAAiB,IAAI;IACP,QAAG,GAAG;QAClB,gCAAgC;QAChC,iCAAiC;QACjC,mDAAmD;QACnD,oDAAoD;QACpD,wCAAwC;QACxC,yCAAyC;QACzC,yCAAyC;QACzC,0CAA0C;QAC1C,mCAAmC;QACnC,oCAAoC;QACpC,gCAAgC;QAChC,iCAAiC;QACjC,mCAAmC;QACnC,oCAAoC;QACpC,sDAAsD;QACtD,uDAAuD;QACvD,2CAA2C;QAC3C,4CAA4C;QAC5C,4CAA4C;QAC5C,6CAA6C;QAC7C,sCAAsC;QACtC,uCAAuC;QACvC,mCAAmC;QACnC,oCAAoC;QACpC,yDAAyD;QACzD,0DAA0D;QAC1D,4EAA4E;QAC5E,6EAA6E;QAC7E,iEAAiE;QACjE,kEAAkE;QAClE,kEAAkE;QAClE,mEAAmE;QACnE,4DAA4D;QAC5D,6DAA6D;QAC7D,yDAAyD;QACzD,0DAA0D;QAC1D,kDAAkD;QAClD,mDAAmD;QACnD,qEAAqE;QACrE,sEAAsE;QACtE,0DAA0D;QAC1D,2DAA2D;QAC3D,2DAA2D;QAC3D,4DAA4D;QAC5D,qDAAqD;QACrD,sDAAsD;QACtD,kDAAkD;QAClD,mDAAmD;QACnD,yDAAyD;QACzD,0DAA0D;QAC1D,4EAA4E;QAC5E,6EAA6E;QAC7E,iEAAiE;QACjE,kEAAkE;QAClE,kEAAkE;QAClE,mEAAmE;QACnE,4DAA4D;QAC5D,6DAA6D;QAC7D,yDAAyD;QACzD,0DAA0D;QAC1D,uBAAuB;QACvB,mCAAmC;QACnC,yCAAyC;QACzC,gDAAgD;QAChD,sDAAsD;QACtD,8BAA8B;QAC9B,qDAAqD;QACrD,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AAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAA;QACtC,CAAC;QAFe,cAAQ,WAEvB,CAAA;IACF,CAAC,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,EArJgB,IAAI,oBAAJ,IAAI,QAqJpB"}
@@ -0,0 +1,11 @@
1
+ import { isoly } from "isoly";
2
+ import { Card } from "../../../Card";
3
+ import { Iin } from "./Iin";
4
+ 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
+ export declare namespace Cards {
6
+ function empty(): Cards;
7
+ function report(previous: Cards, cards: Card[], range: {
8
+ start: isoly.Date;
9
+ end: isoly.Date;
10
+ }): Cards;
11
+ }
@@ -0,0 +1,38 @@
1
+ import { Iin } from "./Iin";
2
+ export var Cards;
3
+ (function (Cards) {
4
+ function empty() {
5
+ return {
6
+ "Number of Accounts - International Enabled": {},
7
+ "Total Number of Accounts": {},
8
+ "Total Number of Active Cards": {},
9
+ "Total Number of Cards": {},
10
+ "Total Number of Active Accounts": {},
11
+ };
12
+ }
13
+ Cards.empty = empty;
14
+ function report(previous, cards, range) {
15
+ const result = previous;
16
+ for (const iin of Iin.values)
17
+ if (iin !== "totalIdx") {
18
+ const iinCards = cards.filter(card => card.details.iin == iin);
19
+ const accounts = new Set(iinCards.map(card => card.account)).size;
20
+ accounts > 0 &&
21
+ (result["Number of Accounts - International Enabled"][iin] = result["Total Number of Accounts"][iin] =
22
+ accounts);
23
+ const iinCardsWithinRange = iinCards.filter(card => card.created >= range.start && card.created <= range.end);
24
+ 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"));
27
+ activeCards.length > 0 && (result["Total Number of Active Cards"][iin] = activeCards.length);
28
+ const accountsWithActive = new Set(activeCards.map(card => card.account)).size;
29
+ accountsWithActive > 0 && (result["Total Number of Active Accounts"][iin] = accountsWithActive);
30
+ }
31
+ for (const iin of Object.keys(result))
32
+ if (iin !== "Payments Transactions Declined for Insufficient Funds - Number")
33
+ result[iin]["totalIdx"] = Object.values(result[iin]).reduce((sum, value) => sum + (value ?? 0), 0);
34
+ return result;
35
+ }
36
+ Cards.report = report;
37
+ })(Cards || (Cards = {}));
38
+ //# sourceMappingURL=Cards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cards.js","sourceRoot":"","sources":["../../../../../reports/visa/Data/Cards.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAU3B,MAAM,KAAW,KAAK,CAgDrB;AAhDD,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;I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CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC,CAC7D,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;IArCe,YAAM,SAqCrB,CAAA;AACF,CAAC,EAhDgB,KAAK,KAAL,KAAK,QAgDrB"}
@@ -1,7 +1,10 @@
1
1
  import { Transaction } from "../../../Transaction";
2
2
  import { rows } from "../rows";
3
+ import { Cards } from "./Cards";
3
4
  import { Iin } from "./Iin";
4
- export type NonMonthly = Record<"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", Partial<Record<Iin, number>>>;
5
+ export type NonMonthly = {
6
+ "Payments Transactions Declined for Insufficient Funds - Number": Partial<Record<Iin, number>>;
7
+ } & Cards;
5
8
  export declare namespace NonMonthly {
6
9
  function empty(): NonMonthly;
7
10
  function update(previous: NonMonthly, transaction: Transaction.CardTransaction): NonMonthly;
@@ -1,13 +1,11 @@
1
+ import { Cards } from "./Cards";
1
2
  import { Iin } from "./Iin";
2
3
  export var NonMonthly;
3
4
  (function (NonMonthly) {
4
5
  function empty() {
5
6
  return {
6
- "Number of Accounts - International Enabled": {},
7
7
  "Payments Transactions Declined for Insufficient Funds - Number": {},
8
- "Total Number of Accounts": {},
9
- "Total Number of Active Cards": {},
10
- "Total Number of Cards": {},
8
+ ...Cards.empty(),
11
9
  };
12
10
  }
13
11
  NonMonthly.empty = empty;
@@ -1 +1 @@
1
- {"version":3,"file":"NonMonthly.js","sourceRoot":"","sources":["../../../../../reports/visa/Data/NonMonthly.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAU3B,MAAM,KAAW,UAAU,CAgC1B;AAhCD,WAAiB,UAAU;IAC1B,SAAgB,KAAK;QACpB,OAAO;YACN,4CAA4C,EAAE,EAAE;YAChD,gEAAgE,EAAE,EAAE;YACpE,0BAA0B,EAAE,EAAE;YAC9B,8BAA8B,EAAE,EAAE;YAClC,uBAAuB,EAAE,EAAE;SAC3B,CAAA;IACF,CAAC;IARe,gBAAK,QAQpB,CAAA;IACD,SAAgB,MAAM,CAAC,QAAoB,EAAE,WAAwC;QACpF,MAAM,MAAM,GAAG,QAAQ,CAAA;QACvB,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,oBAAoB;YACrF,MAAM,CAAC,gEAAgE,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,GAAU,CAAC;gBACvG,CAAC,MAAM,CAAC,gEAAgE,CAAC,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,GAAU,CAAC;oBAC1G,CAAC,CAAC,GAAG,CAAC,CAAA;QACT,OAAO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AA;QAC9E,OAAO,MAAM,CAAA;IACd,CAAC;IANe,gBAAK,QAMpB,CAAA;AACF,CAAC,EA7BgB,UAAU,KAAV,UAAU,QA6B1B"}
@@ -1,3 +1,5 @@
1
+ import { isoly } from "isoly";
2
+ import { Card } from "../../../Card";
1
3
  import { Transaction } from "../../../Transaction";
2
4
  import { rows } from "../rows";
3
5
  import { Country as DataCountry } from "./Country";
@@ -12,7 +14,10 @@ export interface Data {
12
14
  export declare namespace Data {
13
15
  export import Iin = DataIin;
14
16
  export import Country = DataCountry;
15
- function create(transactions: Transaction.CardTransaction[]): Data;
17
+ function create(transactions: Transaction.CardTransaction[], cards: Card[], range: {
18
+ start: isoly.Date;
19
+ end: isoly.Date;
20
+ }): Data;
16
21
  function merge(previous: Data, addition: Data): Data;
17
22
  function toCsv(data: Data, row: rows.NonZero): string;
18
23
  }
@@ -1,3 +1,4 @@
1
+ import { Cards } from "./Cards";
1
2
  import { Country as DataCountry } from "./Country";
2
3
  import { Iin as DataIin } from "./Iin";
3
4
  import { NonMonthly } from "./NonMonthly";
@@ -6,13 +7,18 @@ export var Data;
6
7
  (function (Data) {
7
8
  Data.Iin = DataIin;
8
9
  Data.Country = DataCountry;
9
- function create(transactions) {
10
- const result = { regional: {}, nonMonthly: NonMonthly.empty(), country: {} };
10
+ function create(transactions, cards, range) {
11
+ const result = {
12
+ regional: {},
13
+ nonMonthly: NonMonthly.empty(),
14
+ country: {},
15
+ };
11
16
  for (const transaction of transactions) {
12
17
  result.nonMonthly = NonMonthly.update(result.nonMonthly, transaction);
13
18
  result.regional = Regional.update(result.regional, transaction);
14
19
  result.country = Data.Country.update(result.country, transaction);
15
20
  }
21
+ result.nonMonthly = { ...result.nonMonthly, ...Cards.report(result.nonMonthly, cards, range) };
16
22
  return result;
17
23
  }
18
24
  Data.create = create;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../reports/visa/Data/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,O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IACd,CAAC;IAPe,UAAK,QAOpB,CAAA;AACF,CAAC,EArCgB,IAAI,KAAJ,IAAI,QAqCpB"}
@@ -3,8 +3,8 @@ export declare namespace rows {
3
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
4
  type NonZero = typeof NonZero.values[number];
5
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">;
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", "Total Number of Active 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" | "Total Number of Active Accounts" | "Payments Transactions Declined for Insufficient Funds - Number">;
8
8
  }
9
9
  type Blank = typeof Blank.values[number];
10
10
  namespace Blank {
@@ -111,6 +111,7 @@ export var rows;
111
111
  "Total Number of Cards",
112
112
  "Total Number of Active Cards",
113
113
  "Total Number of Accounts",
114
+ "Total Number of Active Accounts",
114
115
  "Number of Accounts - International Enabled",
115
116
  "Payments Transactions Declined for Insufficient Funds - Number",
116
117
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"rows.js","sourceRoot":"","sources":["../../../../reports/visa/rows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,MAAM,KAAW,IAAI,CAoJpB;AApJD,WAAiB,IAAI;IACP,QAAG,GAAG;QAClB,gCAAgC;QAChC,iCAAiC;QACjC,mDAAmD;QACnD,oDAAoD;QACpD,wCAAwC;QACxC,yCAAyC;QACzC,yCAAyC;QACzC,0CAA0C;QAC1C,mCAAmC;QACnC,oCAAoC;QACpC,gCAAgC;QAChC,iCAAiC;QACjC,mCAAmC;QACnC,oCAAoC;QACpC,sDAAsD;QACtD,uDAAuD;QACvD,2CAA2C;QAC3C,4CAA4C;QAC5C,4CAA4C;QAC5C,6CAA6C;QAC7C,sCAAsC;QACtC,uCAAuC;QACvC,mCAAmC;QACnC,oCAAoC;QACpC,yDAAyD;QACzD,0DAA0D;QAC1D,4EAA4E;QAC5E,6EAA6E;QAC7E,iEAAiE;QACjE,kEAAkE;QAClE,kEAAkE;QAClE,mEAAmE;QACnE,4DAA4D;QAC5D,6DAA6D;QAC7D,yDAAyD;QACzD,0DAA0D;QAC1D,kDAAkD;QAClD,mDAAmD;QACnD,qEAAqE;QACrE,sEAAsE;QACtE,0DAA0D;QAC1D,2DAA2D;QAC3D,2DAA2D;QAC3D,4DAA4D;QAC5D,qDAAqD;QACrD,sDAAsD;QACtD,kDAAkD;QAClD,mDAAmD;QACnD,yDAAyD;QACzD,0DAA0D;QAC1D,4EAA4E;QAC5E,6EAA6E;QAC7E,iEAAiE;QACjE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AC,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,EArJgB,IAAI,KAAJ,IAAI,QAqJpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.496",
3
+ "version": "0.1.498",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",
@@ -0,0 +1,61 @@
1
+ import { isoly } from "isoly"
2
+ import { Card } from "../../../Card"
3
+ import { Iin } from "./Iin"
4
+
5
+ export type Cards = Record<
6
+ | "Total Number of Cards"
7
+ | "Total Number of Active Cards"
8
+ | "Total Number of Accounts"
9
+ | "Number of Accounts - International Enabled"
10
+ | "Total Number of Active Accounts",
11
+ Partial<Record<Iin, number>>
12
+ >
13
+ export namespace Cards {
14
+ export function empty(): Cards {
15
+ return {
16
+ "Number of Accounts - International Enabled": {},
17
+ "Total Number of Accounts": {},
18
+ "Total Number of Active Cards": {},
19
+ "Total Number of Cards": {},
20
+ "Total Number of Active Accounts": {},
21
+ }
22
+ }
23
+ export function report(previous: Cards, cards: Card[], range: { start: isoly.Date; end: isoly.Date }): Cards {
24
+ const result = previous
25
+ for (const iin of Iin.values)
26
+ if (iin !== "totalIdx") {
27
+ // number of customers who have or have had active Visa products, ever
28
+ const iinCards = cards.filter(card => card.details.iin == iin)
29
+ const accounts = new Set(iinCards.map(card => card.account)).size
30
+ accounts > 0 &&
31
+ (result["Number of Accounts - International Enabled"][iin] = result["Total Number of Accounts"][iin] =
32
+ accounts)
33
+
34
+ // Total number of cards in range
35
+ const iinCardsWithinRange = iinCards.filter(card => card.created >= range.start && card.created <= range.end)
36
+ iinCardsWithinRange.length > 0 && (result["Total Number of Cards"][iin] = iinCardsWithinRange.length)
37
+
38
+ // Total number of active cards at end of range
39
+ const activeCards = iinCardsWithinRange.filter(
40
+ card =>
41
+ card.history.some(history => history.status == "cancelled" && history.created > range.end) ||
42
+ !card.history.some(history => history.status == "cancelled")
43
+ )
44
+ activeCards.length > 0 && (result["Total Number of Active Cards"][iin] = activeCards.length)
45
+
46
+ // Total number of customers who have active Visa card(s) at the end of the quarter
47
+ const accountsWithActive = new Set(activeCards.map(card => card.account)).size
48
+ accountsWithActive > 0 && (result["Total Number of Active Accounts"][iin] = accountsWithActive)
49
+ }
50
+
51
+ // All iin numbers are summed up to totalIdx
52
+ for (const iin of Object.keys(result))
53
+ if (iin !== "Payments Transactions Declined for Insufficient Funds - Number")
54
+ result[iin as keyof Cards]["totalIdx"] = Object.values(result[iin as keyof Cards]).reduce(
55
+ (sum, value) => sum + (value ?? 0),
56
+ 0
57
+ )
58
+
59
+ return result
60
+ }
61
+ }
@@ -1,23 +1,16 @@
1
1
  import { Transaction } from "../../../Transaction"
2
2
  import { rows } from "../rows"
3
+ import { Cards } from "./Cards"
3
4
  import { Iin } from "./Iin"
4
5
 
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
- >
6
+ export type NonMonthly = {
7
+ "Payments Transactions Declined for Insufficient Funds - Number": Partial<Record<Iin, number>>
8
+ } & Cards
13
9
  export namespace NonMonthly {
14
10
  export function empty(): NonMonthly {
15
11
  return {
16
- "Number of Accounts - International Enabled": {},
17
12
  "Payments Transactions Declined for Insufficient Funds - Number": {},
18
- "Total Number of Accounts": {},
19
- "Total Number of Active Cards": {},
20
- "Total Number of Cards": {},
13
+ ...Cards.empty(),
21
14
  }
22
15
  }
23
16
  export function update(previous: NonMonthly, transaction: Transaction.CardTransaction): NonMonthly {
@@ -1,5 +1,8 @@
1
+ import { isoly } from "isoly"
2
+ import { Card } from "../../../Card"
1
3
  import { Transaction } from "../../../Transaction"
2
4
  import { rows } from "../rows"
5
+ import { Cards } from "./Cards"
3
6
  import { Country as DataCountry } from "./Country"
4
7
  import { Iin as DataIin } from "./Iin"
5
8
  import { NonMonthly } from "./NonMonthly"
@@ -13,13 +16,22 @@ export interface Data {
13
16
  export namespace Data {
14
17
  export import Iin = DataIin
15
18
  export import Country = DataCountry
16
- export function create(transactions: Transaction.CardTransaction[]): Data {
17
- const result: Data = { regional: {}, nonMonthly: NonMonthly.empty(), country: {} }
19
+ export function create(
20
+ transactions: Transaction.CardTransaction[],
21
+ cards: Card[],
22
+ range: { start: isoly.Date; end: isoly.Date }
23
+ ): Data {
24
+ const result: Data = {
25
+ regional: {},
26
+ nonMonthly: NonMonthly.empty(),
27
+ country: {},
28
+ }
18
29
  for (const transaction of transactions) {
19
30
  result.nonMonthly = NonMonthly.update(result.nonMonthly, transaction)
20
31
  result.regional = Regional.update(result.regional, transaction)
21
32
  result.country = Country.update(result.country, transaction)
22
33
  }
34
+ result.nonMonthly = { ...result.nonMonthly, ...Cards.report(result.nonMonthly, cards, range) }
23
35
  return result
24
36
  }
25
37
  export function merge(previous: Data, addition: Data): Data {
@@ -111,6 +111,7 @@ export namespace rows {
111
111
  "Total Number of Cards",
112
112
  "Total Number of Active Cards",
113
113
  "Total Number of Accounts",
114
+ "Total Number of Active Accounts",
114
115
  "Number of Accounts - International Enabled",
115
116
  "Payments Transactions Declined for Insufficient Funds - Number",
116
117
  ] as const