@cobre-npm/library-portal-core 0.55.0 → 0.56.0

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.
Files changed (51) hide show
  1. package/README.md +86 -23
  2. package/dist/cjs/businessLines/catalog.d.ts +19 -0
  3. package/dist/cjs/businessLines/catalog.js +10 -0
  4. package/dist/cjs/businessLines/index.d.ts +2 -0
  5. package/dist/cjs/businessLines/index.js +17 -0
  6. package/dist/cjs/businessLines/utils/business-line.utils.d.ts +2 -0
  7. package/dist/cjs/businessLines/utils/business-line.utils.js +6 -0
  8. package/dist/cjs/filterClassification/categoryFamilies/catalog.d.ts +33 -0
  9. package/dist/cjs/filterClassification/categoryFamilies/catalog.js +12 -0
  10. package/dist/cjs/filterClassification/categoryFamilies/locales/en.json +11 -0
  11. package/dist/cjs/filterClassification/categoryFamilies/locales/es-mex.json +11 -0
  12. package/dist/cjs/filterClassification/categoryFamilies/utils/filter-classification-category-family.utils.d.ts +8 -0
  13. package/dist/cjs/filterClassification/categoryFamilies/utils/filter-classification-category-family.utils.js +19 -0
  14. package/dist/cjs/filterClassification/index.d.ts +7 -0
  15. package/dist/cjs/filterClassification/index.js +20 -0
  16. package/dist/cjs/filterClassification/interfaces/filter-classification.interface.d.ts +14 -0
  17. package/dist/cjs/filterClassification/interfaces/filter-classification.interface.js +2 -0
  18. package/dist/cjs/filterClassification/sections/catalog.d.ts +28 -0
  19. package/dist/cjs/filterClassification/sections/catalog.js +13 -0
  20. package/dist/cjs/filterClassification/sections/locales/en.json +12 -0
  21. package/dist/cjs/filterClassification/sections/locales/es-mex.json +12 -0
  22. package/dist/cjs/filterClassification/sections/utils/filter-classification-section.utils.d.ts +7 -0
  23. package/dist/cjs/filterClassification/sections/utils/filter-classification-section.utils.js +20 -0
  24. package/dist/cjs/filterClassification/utils/type-group.utils.d.ts +9 -0
  25. package/dist/cjs/filterClassification/utils/type-group.utils.js +21 -0
  26. package/dist/cjs/filterClassification/utils/type-label.utils.d.ts +9 -0
  27. package/dist/cjs/filterClassification/utils/type-label.utils.js +17 -0
  28. package/dist/cjs/movements/index.d.ts +1 -1
  29. package/dist/cjs/movements/types/catalog.d.ts +27 -16
  30. package/dist/cjs/movements/types/catalog.js +26 -26
  31. package/dist/cjs/movements/types/utils/movement-type.utils.d.ts +1 -8
  32. package/dist/cjs/movements/types/utils/movement-type.utils.js +1 -8
  33. package/dist/cjs/transactions/index.d.ts +0 -1
  34. package/dist/esm/businessLines/catalog.js +7 -0
  35. package/dist/esm/businessLines/index.js +1 -0
  36. package/dist/esm/businessLines/utils/business-line.utils.js +2 -0
  37. package/dist/esm/filterClassification/categoryFamilies/catalog.js +9 -0
  38. package/dist/esm/filterClassification/categoryFamilies/locales/en.json +11 -0
  39. package/dist/esm/filterClassification/categoryFamilies/locales/es-mex.json +11 -0
  40. package/dist/esm/filterClassification/categoryFamilies/utils/filter-classification-category-family.utils.js +12 -0
  41. package/dist/esm/filterClassification/index.js +4 -0
  42. package/dist/esm/filterClassification/interfaces/filter-classification.interface.js +1 -0
  43. package/dist/esm/filterClassification/sections/catalog.js +10 -0
  44. package/dist/esm/filterClassification/sections/locales/en.json +12 -0
  45. package/dist/esm/filterClassification/sections/locales/es-mex.json +12 -0
  46. package/dist/esm/filterClassification/sections/utils/filter-classification-section.utils.js +13 -0
  47. package/dist/esm/filterClassification/utils/type-group.utils.js +16 -0
  48. package/dist/esm/filterClassification/utils/type-label.utils.js +13 -0
  49. package/dist/esm/movements/types/catalog.js +26 -26
  50. package/dist/esm/movements/types/utils/movement-type.utils.js +1 -8
  51. package/package.json +11 -1
package/README.md CHANGED
@@ -39,12 +39,14 @@ import { getCountries } from "@cobre-npm/library-portal-core/countries"
39
39
  | `@cobre-npm/library-portal-core/counterparties` | Counterparty types + `Counterparty` interfaces |
40
40
  | `@cobre-npm/library-portal-core/countries` | Countries (base) and ISO countries (dialing codes, etc.) |
41
41
  | `@cobre-npm/library-portal-core/movements` | Movement types and statuses |
42
+ | `@cobre-npm/library-portal-core/businessLines` | Cobre's lines of business (LoB) |
42
43
  | `@cobre-npm/library-portal-core/subclients` | Subclient statuses + `Subclient`/`SubclientPerson` interfaces |
43
44
  | `@cobre-npm/library-portal-core/documentTypes` | Document types (definition + per-country applicability) |
44
45
  | `@cobre-npm/library-portal-core/currencies` | Currencies |
45
46
  | `@cobre-npm/library-portal-core/transactions` | Transaction types + interfaces |
46
47
  | `@cobre-npm/library-portal-core/canonicalTransactions` | Canonical transaction/money-movement detail interfaces |
47
48
  | `@cobre-npm/library-portal-core/search` | Search / aggregation interfaces |
49
+ | `@cobre-npm/library-portal-core/filterClassification` | Grouped type-filter vocabulary (families, sections, categories), `splitTypeLabel`, group-selection helpers |
48
50
  | `@cobre-npm/library-portal-core/trustedSessions` | Trusted session (OTP elevation window) interfaces + constants |
49
51
  | `@cobre-npm/library-portal-core/exports` | Export request/response entity + the engine's format/operator allow-lists |
50
52
  | `@cobre-npm/library-portal-core/financialInstitutions` | Financial institutions (banks) by country, with labels |
@@ -254,44 +256,37 @@ queryCountries({ lang, ...(codes ? { code: codes } : {}) })
254
256
 
255
257
  ```ts
256
258
  import {
257
- getMovementTypes, queryMovementTypes, type MovementType, type MovementTypeGroupLabel,
259
+ getMovementTypes, queryMovementTypes, type MovementType,
258
260
  type MovementTypeOption, type MovementTypeQuery,
259
- type ClassificationLine, type ClassificationCategory,
260
261
  getMovementStatuses, queryMovementStatuses, type MovementStatus, type MovementStatusType,
261
262
  type MovementStatusOption, type MovementStatusQuery,
262
263
  } from "@cobre-npm/library-portal-core/movements"
263
264
 
264
265
  getMovementTypes("en").ach.label // "Transfer · ACH"
265
- getMovementTypes("en").on_ramp.groupLabel // "Stablecoin"
266
+ getMovementTypes("en").on_ramp.section // "stablecoin"
266
267
  getMovementTypes("en").on_ramp.label // "Conversion to stablecoin" (individual label)
267
268
  getMovementTypes("en").spei.category // "payments"
268
269
  queryMovementTypes({ lang: "en", category: "top_up" }) // r2p_top_up_bancolombia, r2p_top_up_pse
269
- queryMovementTypes({ lang: "en", groupLabel: "Stablecoin" }) // global, off_ramp, on_ramp, stable_payout
270
+ queryMovementTypes({ lang: "en", section: "stablecoin" }) // global, off_ramp, on_ramp, stable_payout
270
271
  getMovementStatuses("en").completed // { code: "completed", label: "Completed", type: "success", icon: "icon-check" }
271
272
  queryMovementStatuses({ lang: "en", type: "error" }) // error, failed, rejected — localized
272
273
  ```
273
274
 
274
275
  - **types** (i18n): movement types, usually labelled as "what you did · rail" (`Transfer · SPEI`,
275
276
  `Collection · Bre-B`). Movement and transaction types share one classification, carried on each record as
276
- codes, not translated text (nothing displays them yet): `line: ClassificationLine`
277
- (`payin | payout | cbmm | stable | unclassified`) and `category: ClassificationCategory`
278
- (`payments | collections | conversions | international | between_accounts | top_up | adjustment |
279
- reward | unclassified`). Both types are exported from `/movements` and `/transactions` (the same types on
280
- both subpaths). `on_ramp`/`off_ramp`/`stable_payout`/`global`
281
- additionally carry `groupLabel: "Stablecoin"` — a display grouping for views that need to show them
282
- under one label. `getMovementTypes()` keeps returning each rail's own individual `label` unchanged; a
283
- consumer that wants the grouped label picks `groupLabel ?? label`. There's no separate `getXLabel`
284
- for this — the value already comes back inside `getMovementTypes()`, same as everything else in this
285
- catalog.
277
+ codes, not translated text (nothing displays them yet): `line: BusinessLine`
278
+ (`payin | payout | cbmm | stable | unclassified`, defined in [`businessLines`](#businesslines)) and
279
+ `category: FilterClassificationCategory` (`payments | collections | conversions | international | between_accounts | top_up |
280
+ adjustment | reward | unclassified`, defined in [`filterClassification`](#filterclassification)). Each movement type also carries a
281
+ `section: FilterClassificationSection` (`cop | mxn | usd_global | eur | corridors | stablecoin | …`), the heading it
282
+ is listed under in grouped filters. `getMovementTypes()` returns each rail's own `label` unchanged.
286
283
  - **types query** (i18n `queryX()`): `queryMovementTypes({ lang, ...filters })` — same rules as
287
- `queryTransactionTypes`/`queryDocumentTypes`, no default field. `code`, `line`, `category`, `group` and
288
- `groupLabel` are filterable (equality only; a list matches any of its values). Filter by `group`, not
289
- `groupLabel` — the label is display text. Both are optional on the record: **a key that is present always filters**, so
290
- `groupLabel: undefined` matches the rails that don't carry a group, not "no filter". An optional UI
284
+ `queryTransactionTypes`/`queryDocumentTypes`, no default field. `code`, `line`, `category` and `section` are
285
+ filterable (equality only; a list matches any of its values). A present key always filters, so an optional UI
291
286
  filter has to be spread in conditionally:
292
287
 
293
288
  ```ts
294
- queryMovementTypes({ lang, ...(group.value ? { groupLabel: group.value } : {}) })
289
+ queryMovementTypes({ lang, ...(section.value ? { section: section.value } : {}) })
295
290
  ```
296
291
  - **status** (i18n): movement statuses (`initiated`, `processing`, `completed`, …). Each record also
297
292
  carries `type: MovementStatusType` (`success | warning | error | info | neutral | pending`) — a
@@ -306,6 +301,21 @@ queryMovementStatuses({ lang: "en", type: "error" }) // error, failed, rejected
306
301
  the real use case: `queryMovementStatuses({ lang, type: "error" })` returns `error`, `failed`,
307
302
  `rejected`, replacing a hand-maintained list of codes with a query.
308
303
 
304
+ ### `businessLines`
305
+
306
+ Cobre's lines of business (LoB). No i18n (no labels exist yet), so `getBusinessLines()` takes no arguments.
307
+
308
+ ```ts
309
+ import { getBusinessLines, type BusinessLine } from "@cobre-npm/library-portal-core/businessLines"
310
+
311
+ getBusinessLines().cbmm // { code: "cbmm" }
312
+ ```
313
+
314
+ - **lines**: `payin`, `payout`, `cbmm`, `stable`, `unclassified`. `BusinessLine` is the type of the `line` field of
315
+ movement and transaction types.
316
+ - `/movements` and `/transactions` no longer re-export the line/category types (formerly `ClassificationLine` /
317
+ `ClassificationCategory`): use `BusinessLine` from `/businessLines` and `FilterClassificationCategory` from [`/filterClassification`](#filterclassification).
318
+
309
319
  ### `subclients`
310
320
 
311
321
  ```ts
@@ -430,7 +440,6 @@ And two on rule 1: `{ minAmount: 1 }` is equality, not `>=`, which is rarely wha
430
440
  ```ts
431
441
  import {
432
442
  getTransactionTypes, queryTransactionTypes, type TransactionType, type TransactionTypeQuery,
433
- type ClassificationLine, type ClassificationCategory,
434
443
  type Transaction, type EnrichedTransaction, /* ...interfaces */
435
444
  } from "@cobre-npm/library-portal-core/transactions"
436
445
 
@@ -442,7 +451,7 @@ queryTransactionTypes({ lang: "en", category: "top_up" }) // col_top_up_credit
442
451
 
443
452
  - **types** (i18n): `getTransactionTypes(lang)`; each record carries `code`, `creditDebitType`
444
453
  (`"credit" | "debit"` — the same `CreditDebitType` used by the `Transaction` interface), `label`, and the same
445
- `line: ClassificationLine` / `category: ClassificationCategory` codes as movement types (value sets
454
+ `line: BusinessLine` / `category: FilterClassificationCategory` codes as movement types (value sets
446
455
  listed under [`movements`](#movements)). Labels are usually "what you did · rail" (`Outgoing transfer ·
447
456
  SPEI`). Types that stand for a collapsed matrix row (`cbmm_*`, `internal_*`, `mex_*`, `col_debit`/`col_credit`, `misc_*`,
448
457
  `adjustment_*`, `col_cb_*`, the corridors, ramps and `stable_payout_*`, plus `transfer_credit`) add a
@@ -457,12 +466,66 @@ queryTransactionTypes({ lang: "en", category: "top_up" }) // col_top_up_credit
457
466
  `queryTransactionTypes({ lang: "en", line: "payin", category: "collections" })`.
458
467
  - **interfaces**: `Transaction`, `EnrichedTransaction`, `TransactionMetadata`, `CreditDebitType`.
459
468
 
460
- ### `search` / `trustedSessions`
469
+ ### `search`
461
470
 
462
- Interfaces only (pure types):
471
+ Interfaces only (pure types): the Cobre Search request/response contract.
463
472
 
464
473
  ```ts
465
474
  import type { SearchRequest, SearchResponse, SearchFilter } from "@cobre-npm/library-portal-core/search"
475
+ ```
476
+
477
+ ### `filterClassification`
478
+
479
+ The vocabulary of the grouped type filter, shared by movement and transaction types and owned by neither (some
480
+ transactions, like adjustments and rewards, have no money movement): **families** are the chips, **sections** are
481
+ the headings inside a chip, and **types** (movement / transaction types) are the options.
482
+
483
+ ```ts
484
+ import {
485
+ getFilterClassificationCategoryFamilies, getFilterClassificationSections, splitTypeLabel,
486
+ expandGroupSelection, getGroupSelectionState,
487
+ type FilterClassificationCategoryFamily, type FilterClassificationSection,
488
+ type FilterClassificationCategory, type FilterClassificationRecord,
489
+ } from "@cobre-npm/library-portal-core/filterClassification"
490
+
491
+ declare const types: { category: FilterClassificationCategory }[] // e.g. Object.values(getMovementTypes("en"))
492
+ declare const record: { section: FilterClassificationSection } // one of those types
493
+ declare const groups: FilterClassificationRecord<string>[] // the UI's group records
494
+ declare const group: FilterClassificationRecord<string> // one of them
495
+ declare const selectedCodes: string[] // what the user has ticked
496
+
497
+ const families = getFilterClassificationCategoryFamilies("en")
498
+ families.between_accounts.label // "Between accounts"
499
+ families.between_accounts.categories // ["between_accounts", "adjustment", "reward"]
500
+ types.filter(type => families.between_accounts.categories.includes(type.category)) // group types by family
501
+ getFilterClassificationSections("es-mex")[record.section].label // "Corredores"
502
+ splitTypeLabel("Transfer · ACH") // { title: "Transfer", rail: "ACH" }
503
+ splitTypeLabel("International") // { title: "International" } — no empty rail
504
+ expandGroupSelection(["stablecoin_group", "ach"], groups) // member codes + "ach"; the group code is never returned
505
+ getGroupSelectionState(group, selectedCodes) // "checked" | "indeterminate" | "unchecked"
506
+ ```
507
+
508
+ - **Family** (`FilterClassificationCategoryFamily`): the chips of the grouped type filter, in chip order: `payments`, `collections`,
509
+ `international`, `conversions`, `top_up`, `between_accounts` and `unclassified`. Each family lists the
510
+ `categories` it groups, and a category belongs to exactly one family (`adjustment` and `reward` fold into
511
+ `between_accounts`). `getFilterClassificationCategoryFamilies(lang)` returns each family with its label and categories; `lang` is required.
512
+ - **Category** (`FilterClassificationCategory`): derived from the families' lists: `payments`, `collections`, `conversions`,
513
+ `international`, `between_accounts`, `top_up`, `adjustment`, `reward`, `unclassified`. The family is never stored
514
+ per record: group types by family with `getFilterClassificationCategoryFamilies(lang)[family].categories.includes(type.category)`.
515
+ - **Section** (`FilterClassificationSection`): groups types by currency, rail or corridor (`cop`, `mxn`, `usd_global`, `eur`,
516
+ `corridors`, `stablecoin`). It is stored per type, used as a heading in the grouped filter, never selectable and
517
+ never sent to an API. `getFilterClassificationSections(lang)`. `internal` and `connected_account` exist but no movement type uses
518
+ them yet.
519
+ - **`splitTypeLabel(label)`**: splits at the first `" · "` into `{ title, rail? }` for two-line options.
520
+ - **group helpers**: `FilterClassificationRecord<Code>` (`code`, `members`, `line`, `category`, `section`). A group code is a UI
521
+ identifier: `expandGroupSelection` swaps it for its members before calling an API, and `getGroupSelectionState`
522
+ gives the checkbox state from the selected member codes.
523
+
524
+ ### `trustedSessions`
525
+
526
+ Interfaces only (pure types):
527
+
528
+ ```ts
466
529
  import type { TrustedSessionStatus } from "@cobre-npm/library-portal-core/trustedSessions"
467
530
  ```
468
531
 
@@ -0,0 +1,19 @@
1
+ export declare const BUSINESS_LINES: {
2
+ readonly payin: {
3
+ readonly code: "payin";
4
+ };
5
+ readonly payout: {
6
+ readonly code: "payout";
7
+ };
8
+ readonly cbmm: {
9
+ readonly code: "cbmm";
10
+ };
11
+ readonly stable: {
12
+ readonly code: "stable";
13
+ };
14
+ readonly unclassified: {
15
+ readonly code: "unclassified";
16
+ };
17
+ };
18
+ export type BusinessLine = keyof typeof BUSINESS_LINES;
19
+ export type BusinessLineRecord = (typeof BUSINESS_LINES)[BusinessLine];
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BUSINESS_LINES = void 0;
4
+ exports.BUSINESS_LINES = {
5
+ payin: { code: "payin" },
6
+ payout: { code: "payout" },
7
+ cbmm: { code: "cbmm" },
8
+ stable: { code: "stable" },
9
+ unclassified: { code: "unclassified" },
10
+ };
@@ -0,0 +1,2 @@
1
+ export type { BusinessLine, BusinessLineRecord } from "./catalog";
2
+ export * from "./utils/business-line.utils";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./utils/business-line.utils"), exports);
@@ -0,0 +1,2 @@
1
+ import type { BusinessLine, BusinessLineRecord } from "../catalog";
2
+ export declare const getBusinessLines: () => Record<BusinessLine, BusinessLineRecord>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBusinessLines = void 0;
4
+ const catalog_1 = require("../catalog");
5
+ const getBusinessLines = () => catalog_1.BUSINESS_LINES;
6
+ exports.getBusinessLines = getBusinessLines;
@@ -0,0 +1,33 @@
1
+ export declare const FILTER_CLASSIFICATION_CATEGORY_FAMILIES: {
2
+ readonly payments: {
3
+ readonly code: "payments";
4
+ readonly categories: readonly ["payments"];
5
+ };
6
+ readonly collections: {
7
+ readonly code: "collections";
8
+ readonly categories: readonly ["collections"];
9
+ };
10
+ readonly international: {
11
+ readonly code: "international";
12
+ readonly categories: readonly ["international"];
13
+ };
14
+ readonly conversions: {
15
+ readonly code: "conversions";
16
+ readonly categories: readonly ["conversions"];
17
+ };
18
+ readonly top_up: {
19
+ readonly code: "top_up";
20
+ readonly categories: readonly ["top_up"];
21
+ };
22
+ readonly between_accounts: {
23
+ readonly code: "between_accounts";
24
+ readonly categories: readonly ["between_accounts", "adjustment", "reward"];
25
+ };
26
+ readonly unclassified: {
27
+ readonly code: "unclassified";
28
+ readonly categories: readonly ["unclassified"];
29
+ };
30
+ };
31
+ export type FilterClassificationCategoryFamily = keyof typeof FILTER_CLASSIFICATION_CATEGORY_FAMILIES;
32
+ export type FilterClassificationCategoryFamilyRecord = (typeof FILTER_CLASSIFICATION_CATEGORY_FAMILIES)[FilterClassificationCategoryFamily];
33
+ export type FilterClassificationCategory = FilterClassificationCategoryFamilyRecord["categories"][number];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FILTER_CLASSIFICATION_CATEGORY_FAMILIES = void 0;
4
+ exports.FILTER_CLASSIFICATION_CATEGORY_FAMILIES = {
5
+ payments: { code: "payments", categories: ["payments"] },
6
+ collections: { code: "collections", categories: ["collections"] },
7
+ international: { code: "international", categories: ["international"] },
8
+ conversions: { code: "conversions", categories: ["conversions"] },
9
+ top_up: { code: "top_up", categories: ["top_up"] },
10
+ between_accounts: { code: "between_accounts", categories: ["between_accounts", "adjustment", "reward"] },
11
+ unclassified: { code: "unclassified", categories: ["unclassified"] },
12
+ };
@@ -0,0 +1,11 @@
1
+ {
2
+ "categoryFamilies": {
3
+ "payments": "Payments",
4
+ "collections": "Collections",
5
+ "international": "International",
6
+ "conversions": "Conversions",
7
+ "top_up": "Top-up",
8
+ "between_accounts": "Between accounts",
9
+ "unclassified": "Unclassified"
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "categoryFamilies": {
3
+ "payments": "Pagos",
4
+ "collections": "Recaudos",
5
+ "international": "Internacional",
6
+ "conversions": "Conversiones",
7
+ "top_up": "Recarga",
8
+ "between_accounts": "Entre cuentas",
9
+ "unclassified": "Sin clasificar"
10
+ }
11
+ }
@@ -0,0 +1,8 @@
1
+ import type { FilterClassificationCategory, FilterClassificationCategoryFamily } from "../catalog";
2
+ import type { Locale } from "../../../lang";
3
+ export type FilterClassificationCategoryFamilyOption = {
4
+ code: FilterClassificationCategoryFamily;
5
+ categories: readonly FilterClassificationCategory[];
6
+ label: string;
7
+ };
8
+ export declare const getFilterClassificationCategoryFamilies: (lang: Locale) => Record<FilterClassificationCategoryFamily, FilterClassificationCategoryFamilyOption>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getFilterClassificationCategoryFamilies = void 0;
7
+ const catalog_1 = require("../catalog");
8
+ const en_json_1 = __importDefault(require("../locales/en.json"));
9
+ const es_mex_json_1 = __importDefault(require("../locales/es-mex.json"));
10
+ const locales = { en: en_json_1.default, "es-mex": es_mex_json_1.default };
11
+ const getFilterClassificationCategoryFamilies = (lang) => {
12
+ const locale = locales[lang];
13
+ const result = {};
14
+ for (const record of Object.values(catalog_1.FILTER_CLASSIFICATION_CATEGORY_FAMILIES)) {
15
+ result[record.code] = { ...record, label: locale.categoryFamilies[record.code] };
16
+ }
17
+ return result;
18
+ };
19
+ exports.getFilterClassificationCategoryFamilies = getFilterClassificationCategoryFamilies;
@@ -0,0 +1,7 @@
1
+ export type { FilterClassificationRecord } from "./interfaces/filter-classification.interface";
2
+ export type { FilterClassificationCategory, FilterClassificationCategoryFamily } from "./categoryFamilies/catalog";
3
+ export * from "./categoryFamilies/utils/filter-classification-category-family.utils";
4
+ export type { FilterClassificationSection } from "./sections/catalog";
5
+ export * from "./sections/utils/filter-classification-section.utils";
6
+ export * from "./utils/type-label.utils";
7
+ export * from "./utils/type-group.utils";
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./categoryFamilies/utils/filter-classification-category-family.utils"), exports);
18
+ __exportStar(require("./sections/utils/filter-classification-section.utils"), exports);
19
+ __exportStar(require("./utils/type-label.utils"), exports);
20
+ __exportStar(require("./utils/type-group.utils"), exports);
@@ -0,0 +1,14 @@
1
+ import type { BusinessLine } from "../../businessLines/catalog";
2
+ import type { FilterClassificationCategory } from "../categoryFamilies/catalog";
3
+ import type { FilterClassificationSection } from "../sections/catalog";
4
+ /**
5
+ * A selectable group of type codes (one checkbox that stands for several types). The group `code` is a UI
6
+ * identifier: it is never sent to an API, only its `members` are — see `expandGroupSelection`.
7
+ */
8
+ export type FilterClassificationRecord<Code extends string> = {
9
+ readonly code: Code;
10
+ readonly members: readonly Code[];
11
+ readonly line: BusinessLine;
12
+ readonly category: FilterClassificationCategory;
13
+ readonly section: FilterClassificationSection;
14
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,28 @@
1
+ export declare const FILTER_CLASSIFICATION_SECTIONS: {
2
+ readonly cop: {
3
+ readonly code: "cop";
4
+ };
5
+ readonly mxn: {
6
+ readonly code: "mxn";
7
+ };
8
+ readonly usd_global: {
9
+ readonly code: "usd_global";
10
+ };
11
+ readonly eur: {
12
+ readonly code: "eur";
13
+ };
14
+ readonly corridors: {
15
+ readonly code: "corridors";
16
+ };
17
+ readonly stablecoin: {
18
+ readonly code: "stablecoin";
19
+ };
20
+ readonly internal: {
21
+ readonly code: "internal";
22
+ };
23
+ readonly connected_account: {
24
+ readonly code: "connected_account";
25
+ };
26
+ };
27
+ export type FilterClassificationSection = keyof typeof FILTER_CLASSIFICATION_SECTIONS;
28
+ export type FilterClassificationSectionRecord = (typeof FILTER_CLASSIFICATION_SECTIONS)[FilterClassificationSection];
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FILTER_CLASSIFICATION_SECTIONS = void 0;
4
+ exports.FILTER_CLASSIFICATION_SECTIONS = {
5
+ cop: { code: "cop" },
6
+ mxn: { code: "mxn" },
7
+ usd_global: { code: "usd_global" },
8
+ eur: { code: "eur" },
9
+ corridors: { code: "corridors" },
10
+ stablecoin: { code: "stablecoin" },
11
+ internal: { code: "internal" },
12
+ connected_account: { code: "connected_account" },
13
+ };
@@ -0,0 +1,12 @@
1
+ {
2
+ "sections": {
3
+ "cop": "COP",
4
+ "mxn": "MXN",
5
+ "usd_global": "USD / Global",
6
+ "eur": "EUR",
7
+ "corridors": "Corridors",
8
+ "stablecoin": "Stablecoin",
9
+ "internal": "Internal",
10
+ "connected_account": "Connected account"
11
+ }
12
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "sections": {
3
+ "cop": "COP",
4
+ "mxn": "MXN",
5
+ "usd_global": "USD / Global",
6
+ "eur": "EUR",
7
+ "corridors": "Corredores",
8
+ "stablecoin": "Stablecoin",
9
+ "internal": "Internas",
10
+ "connected_account": "Cuenta conectada"
11
+ }
12
+ }
@@ -0,0 +1,7 @@
1
+ import type { FilterClassificationSection, FilterClassificationSectionRecord } from "../catalog";
2
+ import type { Locale } from "../../../lang";
3
+ export type FilterClassificationSectionOption = FilterClassificationSectionRecord & {
4
+ label: string;
5
+ };
6
+ /** The section headings indexed by code, each with its label. A section is a heading: never selectable, never sent to an API. */
7
+ export declare const getFilterClassificationSections: (lang: Locale) => Record<FilterClassificationSection, FilterClassificationSectionOption>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getFilterClassificationSections = void 0;
7
+ const catalog_1 = require("../catalog");
8
+ const en_json_1 = __importDefault(require("../locales/en.json"));
9
+ const es_mex_json_1 = __importDefault(require("../locales/es-mex.json"));
10
+ const locales = { en: en_json_1.default, "es-mex": es_mex_json_1.default };
11
+ /** The section headings indexed by code, each with its label. A section is a heading: never selectable, never sent to an API. */
12
+ const getFilterClassificationSections = (lang) => {
13
+ const locale = locales[lang];
14
+ const result = {};
15
+ for (const record of Object.values(catalog_1.FILTER_CLASSIFICATION_SECTIONS)) {
16
+ result[record.code] = { ...record, label: locale.sections[record.code] };
17
+ }
18
+ return result;
19
+ };
20
+ exports.getFilterClassificationSections = getFilterClassificationSections;
@@ -0,0 +1,9 @@
1
+ import type { FilterClassificationRecord } from "../interfaces/filter-classification.interface";
2
+ export type GroupSelectionState = "checked" | "indeterminate" | "unchecked";
3
+ /**
4
+ * The codes to send to an API: each selected group code is replaced by its members, anything else passes
5
+ * through. The group code itself never appears in the output, and repeated codes are dropped.
6
+ */
7
+ export declare const expandGroupSelection: <Code extends string>(selected: readonly Code[], groups: readonly FilterClassificationRecord<Code>[]) => Code[];
8
+ /** checked = every member selected, indeterminate = some, unchecked = none (or a group without members). */
9
+ export declare const getGroupSelectionState: <Code extends string>(group: FilterClassificationRecord<Code>, selected: readonly Code[]) => GroupSelectionState;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getGroupSelectionState = exports.expandGroupSelection = void 0;
4
+ /**
5
+ * The codes to send to an API: each selected group code is replaced by its members, anything else passes
6
+ * through. The group code itself never appears in the output, and repeated codes are dropped.
7
+ */
8
+ const expandGroupSelection = (selected, groups) => {
9
+ const membersByGroup = new Map(groups.map(group => [group.code, group.members]));
10
+ const expanded = selected.flatMap(code => membersByGroup.get(code) ?? [code]);
11
+ return [...new Set(expanded)];
12
+ };
13
+ exports.expandGroupSelection = expandGroupSelection;
14
+ /** checked = every member selected, indeterminate = some, unchecked = none (or a group without members). */
15
+ const getGroupSelectionState = (group, selected) => {
16
+ const count = group.members.filter(member => selected.includes(member)).length;
17
+ if (count === 0)
18
+ return "unchecked";
19
+ return count === group.members.length ? "checked" : "indeterminate";
20
+ };
21
+ exports.getGroupSelectionState = getGroupSelectionState;
@@ -0,0 +1,9 @@
1
+ export type SplitTypeLabel = {
2
+ title: string;
3
+ rail?: string;
4
+ };
5
+ /**
6
+ * Splits a type label ("Transfer · ACH") at its FIRST " · " into a title and a rail, for two-line options.
7
+ * A label without the separator, or with nothing after it, comes back as `{ title }` alone — never an empty `rail`.
8
+ */
9
+ export declare const splitTypeLabel: (label: string) => SplitTypeLabel;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.splitTypeLabel = void 0;
4
+ const SEPARATOR = " · ";
5
+ /**
6
+ * Splits a type label ("Transfer · ACH") at its FIRST " · " into a title and a rail, for two-line options.
7
+ * A label without the separator, or with nothing after it, comes back as `{ title }` alone — never an empty `rail`.
8
+ */
9
+ const splitTypeLabel = (label) => {
10
+ const index = label.indexOf(SEPARATOR);
11
+ if (index === -1)
12
+ return { title: label };
13
+ const title = label.slice(0, index);
14
+ const rail = label.slice(index + SEPARATOR.length);
15
+ return rail === "" ? { title } : { title, rail };
16
+ };
17
+ exports.splitTypeLabel = splitTypeLabel;
@@ -1,4 +1,4 @@
1
- export type { ClassificationCategory, ClassificationLine, MovementType, MovementTypeGroup, MovementTypeGroupLabel } from "./types/catalog";
1
+ export type { MovementType } from "./types/catalog";
2
2
  export * from "./types/utils/movement-type.utils";
3
3
  export type { MovementStatus, MovementStatusType } from "./status/catalog";
4
4
  export * from "./status/utils/movement-status.utils";
@@ -1,149 +1,160 @@
1
- export type ClassificationLine = "payin" | "payout" | "cbmm" | "stable" | "unclassified";
2
- export type ClassificationCategory = "payments" | "collections" | "conversions" | "international" | "between_accounts" | "top_up" | "adjustment" | "reward" | "unclassified";
3
- export type MovementTypeGroup = "stablecoin";
4
- export type MovementTypeGroupLabel = "Stablecoin";
5
1
  export declare const MOVEMENT_TYPES: {
6
2
  readonly ach: {
7
3
  readonly code: "ach";
8
4
  readonly line: "payout";
9
5
  readonly category: "payments";
6
+ readonly section: "cop";
10
7
  };
11
8
  readonly fast_pay: {
12
9
  readonly code: "fast_pay";
13
10
  readonly line: "payout";
14
11
  readonly category: "payments";
12
+ readonly section: "cop";
15
13
  };
16
14
  readonly spei: {
17
15
  readonly code: "spei";
18
16
  readonly line: "payout";
19
17
  readonly category: "payments";
18
+ readonly section: "mxn";
20
19
  };
21
20
  readonly spei_card: {
22
21
  readonly code: "spei_card";
23
22
  readonly line: "payout";
24
23
  readonly category: "payments";
24
+ readonly section: "mxn";
25
25
  };
26
26
  readonly spei_return: {
27
27
  readonly code: "spei_return";
28
28
  readonly line: "payout";
29
29
  readonly category: "payments";
30
+ readonly section: "mxn";
30
31
  };
31
32
  readonly r2p: {
32
33
  readonly code: "r2p";
33
34
  readonly line: "payin";
34
35
  readonly category: "collections";
36
+ readonly section: "cop";
35
37
  };
36
38
  readonly r2p_bancolombia: {
37
39
  readonly code: "r2p_bancolombia";
38
40
  readonly line: "payin";
39
41
  readonly category: "collections";
42
+ readonly section: "cop";
40
43
  };
41
44
  readonly r2p_nequi: {
42
45
  readonly code: "r2p_nequi";
43
46
  readonly line: "payin";
44
47
  readonly category: "collections";
48
+ readonly section: "cop";
45
49
  };
46
50
  readonly r2p_pse: {
47
51
  readonly code: "r2p_pse";
48
52
  readonly line: "payin";
49
53
  readonly category: "collections";
54
+ readonly section: "cop";
50
55
  };
51
56
  readonly direct_debit: {
52
57
  readonly code: "direct_debit";
53
58
  readonly line: "payin";
54
59
  readonly category: "collections";
60
+ readonly section: "cop";
55
61
  };
56
62
  readonly r2p_breb: {
57
63
  readonly code: "r2p_breb";
58
64
  readonly line: "payin";
59
65
  readonly category: "collections";
66
+ readonly section: "cop";
60
67
  };
61
68
  readonly r2p_top_up_pse: {
62
69
  readonly code: "r2p_top_up_pse";
63
70
  readonly line: "payin";
64
71
  readonly category: "top_up";
72
+ readonly section: "cop";
65
73
  };
66
74
  readonly r2p_top_up_bancolombia: {
67
75
  readonly code: "r2p_top_up_bancolombia";
68
76
  readonly line: "payin";
69
77
  readonly category: "top_up";
78
+ readonly section: "cop";
70
79
  };
71
80
  readonly global: {
72
81
  readonly code: "global";
73
82
  readonly line: "stable";
74
83
  readonly category: "conversions";
75
- readonly group: "stablecoin";
76
- readonly groupLabel: "Stablecoin";
84
+ readonly section: "stablecoin";
77
85
  };
78
86
  readonly r2p_spei: {
79
87
  readonly code: "r2p_spei";
80
88
  readonly line: "payin";
81
89
  readonly category: "collections";
90
+ readonly section: "mxn";
82
91
  };
83
92
  readonly on_ramp: {
84
93
  readonly code: "on_ramp";
85
94
  readonly line: "stable";
86
95
  readonly category: "conversions";
87
- readonly group: "stablecoin";
88
- readonly groupLabel: "Stablecoin";
96
+ readonly section: "stablecoin";
89
97
  };
90
98
  readonly off_ramp: {
91
99
  readonly code: "off_ramp";
92
100
  readonly line: "stable";
93
101
  readonly category: "conversions";
94
- readonly group: "stablecoin";
95
- readonly groupLabel: "Stablecoin";
102
+ readonly section: "stablecoin";
96
103
  };
97
104
  readonly fedwire: {
98
105
  readonly code: "fedwire";
99
106
  readonly line: "payout";
100
107
  readonly category: "payments";
108
+ readonly section: "usd_global";
101
109
  };
102
110
  readonly global_pay_to_usa: {
103
111
  readonly code: "global_pay_to_usa";
104
112
  readonly line: "cbmm";
105
113
  readonly category: "international";
114
+ readonly section: "corridors";
106
115
  };
107
116
  readonly usa_pay_to_global: {
108
117
  readonly code: "usa_pay_to_global";
109
118
  readonly line: "cbmm";
110
119
  readonly category: "international";
120
+ readonly section: "corridors";
111
121
  };
112
122
  readonly cross_border: {
113
123
  readonly code: "cross_border";
114
124
  readonly line: "cbmm";
115
125
  readonly category: "international";
126
+ readonly section: "corridors";
116
127
  };
117
128
  readonly stable_payout: {
118
129
  readonly code: "stable_payout";
119
130
  readonly line: "stable";
120
131
  readonly category: "conversions";
121
- readonly group: "stablecoin";
122
- readonly groupLabel: "Stablecoin";
132
+ readonly section: "stablecoin";
123
133
  };
124
134
  readonly breb: {
125
135
  readonly code: "breb";
126
136
  readonly line: "payout";
127
137
  readonly category: "payments";
138
+ readonly section: "cop";
128
139
  };
129
140
  readonly global_pay_to_generic: {
130
141
  readonly code: "global_pay_to_generic";
131
142
  readonly line: "payout";
132
143
  readonly category: "payments";
144
+ readonly section: "usd_global";
133
145
  };
134
146
  readonly swift: {
135
147
  readonly code: "swift";
136
148
  readonly line: "payout";
137
149
  readonly category: "payments";
150
+ readonly section: "usd_global";
138
151
  };
139
152
  readonly sepa: {
140
153
  readonly code: "sepa";
141
154
  readonly line: "payout";
142
155
  readonly category: "payments";
156
+ readonly section: "eur";
143
157
  };
144
158
  };
145
159
  export type MovementType = keyof typeof MOVEMENT_TYPES;
146
- export type MovementTypeRecord = (typeof MOVEMENT_TYPES)[MovementType] & {
147
- readonly group?: MovementTypeGroup;
148
- readonly groupLabel?: MovementTypeGroupLabel;
149
- };
160
+ export type MovementTypeRecord = (typeof MOVEMENT_TYPES)[MovementType];
@@ -2,30 +2,30 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MOVEMENT_TYPES = void 0;
4
4
  exports.MOVEMENT_TYPES = {
5
- ach: { code: "ach", line: "payout", category: "payments" },
6
- fast_pay: { code: "fast_pay", line: "payout", category: "payments" },
7
- spei: { code: "spei", line: "payout", category: "payments" },
8
- spei_card: { code: "spei_card", line: "payout", category: "payments" },
9
- spei_return: { code: "spei_return", line: "payout", category: "payments" },
10
- r2p: { code: "r2p", line: "payin", category: "collections" },
11
- r2p_bancolombia: { code: "r2p_bancolombia", line: "payin", category: "collections" },
12
- r2p_nequi: { code: "r2p_nequi", line: "payin", category: "collections" },
13
- r2p_pse: { code: "r2p_pse", line: "payin", category: "collections" },
14
- direct_debit: { code: "direct_debit", line: "payin", category: "collections" },
15
- r2p_breb: { code: "r2p_breb", line: "payin", category: "collections" },
16
- r2p_top_up_pse: { code: "r2p_top_up_pse", line: "payin", category: "top_up" },
17
- r2p_top_up_bancolombia: { code: "r2p_top_up_bancolombia", line: "payin", category: "top_up" },
18
- global: { code: "global", line: "stable", category: "conversions", group: "stablecoin", groupLabel: "Stablecoin" },
19
- r2p_spei: { code: "r2p_spei", line: "payin", category: "collections" },
20
- on_ramp: { code: "on_ramp", line: "stable", category: "conversions", group: "stablecoin", groupLabel: "Stablecoin" },
21
- off_ramp: { code: "off_ramp", line: "stable", category: "conversions", group: "stablecoin", groupLabel: "Stablecoin" },
22
- fedwire: { code: "fedwire", line: "payout", category: "payments" },
23
- global_pay_to_usa: { code: "global_pay_to_usa", line: "cbmm", category: "international" },
24
- usa_pay_to_global: { code: "usa_pay_to_global", line: "cbmm", category: "international" },
25
- cross_border: { code: "cross_border", line: "cbmm", category: "international" },
26
- stable_payout: { code: "stable_payout", line: "stable", category: "conversions", group: "stablecoin", groupLabel: "Stablecoin" },
27
- breb: { code: "breb", line: "payout", category: "payments" },
28
- global_pay_to_generic: { code: "global_pay_to_generic", line: "payout", category: "payments" },
29
- swift: { code: "swift", line: "payout", category: "payments" },
30
- sepa: { code: "sepa", line: "payout", category: "payments" },
5
+ ach: { code: "ach", line: "payout", category: "payments", section: "cop" },
6
+ fast_pay: { code: "fast_pay", line: "payout", category: "payments", section: "cop" },
7
+ spei: { code: "spei", line: "payout", category: "payments", section: "mxn" },
8
+ spei_card: { code: "spei_card", line: "payout", category: "payments", section: "mxn" },
9
+ spei_return: { code: "spei_return", line: "payout", category: "payments", section: "mxn" },
10
+ r2p: { code: "r2p", line: "payin", category: "collections", section: "cop" },
11
+ r2p_bancolombia: { code: "r2p_bancolombia", line: "payin", category: "collections", section: "cop" },
12
+ r2p_nequi: { code: "r2p_nequi", line: "payin", category: "collections", section: "cop" },
13
+ r2p_pse: { code: "r2p_pse", line: "payin", category: "collections", section: "cop" },
14
+ direct_debit: { code: "direct_debit", line: "payin", category: "collections", section: "cop" },
15
+ r2p_breb: { code: "r2p_breb", line: "payin", category: "collections", section: "cop" },
16
+ r2p_top_up_pse: { code: "r2p_top_up_pse", line: "payin", category: "top_up", section: "cop" },
17
+ r2p_top_up_bancolombia: { code: "r2p_top_up_bancolombia", line: "payin", category: "top_up", section: "cop" },
18
+ global: { code: "global", line: "stable", category: "conversions", section: "stablecoin" },
19
+ r2p_spei: { code: "r2p_spei", line: "payin", category: "collections", section: "mxn" },
20
+ on_ramp: { code: "on_ramp", line: "stable", category: "conversions", section: "stablecoin" },
21
+ off_ramp: { code: "off_ramp", line: "stable", category: "conversions", section: "stablecoin" },
22
+ fedwire: { code: "fedwire", line: "payout", category: "payments", section: "usd_global" },
23
+ global_pay_to_usa: { code: "global_pay_to_usa", line: "cbmm", category: "international", section: "corridors" },
24
+ usa_pay_to_global: { code: "usa_pay_to_global", line: "cbmm", category: "international", section: "corridors" },
25
+ cross_border: { code: "cross_border", line: "cbmm", category: "international", section: "corridors" },
26
+ stable_payout: { code: "stable_payout", line: "stable", category: "conversions", section: "stablecoin" },
27
+ breb: { code: "breb", line: "payout", category: "payments", section: "cop" },
28
+ global_pay_to_generic: { code: "global_pay_to_generic", line: "payout", category: "payments", section: "usd_global" },
29
+ swift: { code: "swift", line: "payout", category: "payments", section: "usd_global" },
30
+ sepa: { code: "sepa", line: "payout", category: "payments", section: "eur" },
31
31
  };
@@ -9,12 +9,5 @@ export declare const getMovementTypes: (lang: Locale) => Record<MovementType, Mo
9
9
  export type MovementTypeQuery = CatalogQuery<MovementTypeRecord> & {
10
10
  lang: Locale;
11
11
  };
12
- /**
13
- * The catalog as a list narrowed by the query, each record enriched with its label for `query.lang`.
14
- * Filter by `group`, not `groupLabel` — the label is display text, not a stable filter key.
15
- *
16
- * `group` is optional on the record, so `group: undefined` is a present key like any other — it
17
- * matches the records that don't carry a group, not "no filter". A UI filter fed from an optional
18
- * ref has to be spread in conditionally: `{ lang, ...(group ? { group } : {}) }`.
19
- */
12
+ /** The catalog as a list narrowed by the query, each record enriched with its label for `query.lang`. */
20
13
  export declare const queryMovementTypes: (query: MovementTypeQuery) => MovementTypeOption[];
@@ -18,14 +18,7 @@ const getMovementTypes = (lang) => {
18
18
  return result;
19
19
  };
20
20
  exports.getMovementTypes = getMovementTypes;
21
- /**
22
- * The catalog as a list narrowed by the query, each record enriched with its label for `query.lang`.
23
- * Filter by `group`, not `groupLabel` — the label is display text, not a stable filter key.
24
- *
25
- * `group` is optional on the record, so `group: undefined` is a present key like any other — it
26
- * matches the records that don't carry a group, not "no filter". A UI filter fed from an optional
27
- * ref has to be spread in conditionally: `{ lang, ...(group ? { group } : {}) }`.
28
- */
21
+ /** The catalog as a list narrowed by the query, each record enriched with its label for `query.lang`. */
29
22
  const queryMovementTypes = (query) => {
30
23
  const { lang, ...filters } = query;
31
24
  return Object.values(catalog_1.MOVEMENT_TYPES)
@@ -1,4 +1,3 @@
1
- export type { ClassificationCategory, ClassificationLine } from "../movements/types/catalog";
2
1
  export type { TransactionType } from "./types/catalog";
3
2
  export * from "./types/utils/transaction-type.utils";
4
3
  export * from "./interfaces/response.interface";
@@ -0,0 +1,7 @@
1
+ export const BUSINESS_LINES = {
2
+ payin: { code: "payin" },
3
+ payout: { code: "payout" },
4
+ cbmm: { code: "cbmm" },
5
+ stable: { code: "stable" },
6
+ unclassified: { code: "unclassified" },
7
+ };
@@ -0,0 +1 @@
1
+ export * from "./utils/business-line.utils";
@@ -0,0 +1,2 @@
1
+ import { BUSINESS_LINES } from "../catalog";
2
+ export const getBusinessLines = () => BUSINESS_LINES;
@@ -0,0 +1,9 @@
1
+ export const FILTER_CLASSIFICATION_CATEGORY_FAMILIES = {
2
+ payments: { code: "payments", categories: ["payments"] },
3
+ collections: { code: "collections", categories: ["collections"] },
4
+ international: { code: "international", categories: ["international"] },
5
+ conversions: { code: "conversions", categories: ["conversions"] },
6
+ top_up: { code: "top_up", categories: ["top_up"] },
7
+ between_accounts: { code: "between_accounts", categories: ["between_accounts", "adjustment", "reward"] },
8
+ unclassified: { code: "unclassified", categories: ["unclassified"] },
9
+ };
@@ -0,0 +1,11 @@
1
+ {
2
+ "categoryFamilies": {
3
+ "payments": "Payments",
4
+ "collections": "Collections",
5
+ "international": "International",
6
+ "conversions": "Conversions",
7
+ "top_up": "Top-up",
8
+ "between_accounts": "Between accounts",
9
+ "unclassified": "Unclassified"
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "categoryFamilies": {
3
+ "payments": "Pagos",
4
+ "collections": "Recaudos",
5
+ "international": "Internacional",
6
+ "conversions": "Conversiones",
7
+ "top_up": "Recarga",
8
+ "between_accounts": "Entre cuentas",
9
+ "unclassified": "Sin clasificar"
10
+ }
11
+ }
@@ -0,0 +1,12 @@
1
+ import { FILTER_CLASSIFICATION_CATEGORY_FAMILIES } from "../catalog";
2
+ import enLocale from "../locales/en.json";
3
+ import esMexLocale from "../locales/es-mex.json";
4
+ const locales = { en: enLocale, "es-mex": esMexLocale };
5
+ export const getFilterClassificationCategoryFamilies = (lang) => {
6
+ const locale = locales[lang];
7
+ const result = {};
8
+ for (const record of Object.values(FILTER_CLASSIFICATION_CATEGORY_FAMILIES)) {
9
+ result[record.code] = { ...record, label: locale.categoryFamilies[record.code] };
10
+ }
11
+ return result;
12
+ };
@@ -0,0 +1,4 @@
1
+ export * from "./categoryFamilies/utils/filter-classification-category-family.utils";
2
+ export * from "./sections/utils/filter-classification-section.utils";
3
+ export * from "./utils/type-label.utils";
4
+ export * from "./utils/type-group.utils";
@@ -0,0 +1,10 @@
1
+ export const FILTER_CLASSIFICATION_SECTIONS = {
2
+ cop: { code: "cop" },
3
+ mxn: { code: "mxn" },
4
+ usd_global: { code: "usd_global" },
5
+ eur: { code: "eur" },
6
+ corridors: { code: "corridors" },
7
+ stablecoin: { code: "stablecoin" },
8
+ internal: { code: "internal" },
9
+ connected_account: { code: "connected_account" },
10
+ };
@@ -0,0 +1,12 @@
1
+ {
2
+ "sections": {
3
+ "cop": "COP",
4
+ "mxn": "MXN",
5
+ "usd_global": "USD / Global",
6
+ "eur": "EUR",
7
+ "corridors": "Corridors",
8
+ "stablecoin": "Stablecoin",
9
+ "internal": "Internal",
10
+ "connected_account": "Connected account"
11
+ }
12
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "sections": {
3
+ "cop": "COP",
4
+ "mxn": "MXN",
5
+ "usd_global": "USD / Global",
6
+ "eur": "EUR",
7
+ "corridors": "Corredores",
8
+ "stablecoin": "Stablecoin",
9
+ "internal": "Internas",
10
+ "connected_account": "Cuenta conectada"
11
+ }
12
+ }
@@ -0,0 +1,13 @@
1
+ import { FILTER_CLASSIFICATION_SECTIONS } from "../catalog";
2
+ import enLocale from "../locales/en.json";
3
+ import esMexLocale from "../locales/es-mex.json";
4
+ const locales = { en: enLocale, "es-mex": esMexLocale };
5
+ /** The section headings indexed by code, each with its label. A section is a heading: never selectable, never sent to an API. */
6
+ export const getFilterClassificationSections = (lang) => {
7
+ const locale = locales[lang];
8
+ const result = {};
9
+ for (const record of Object.values(FILTER_CLASSIFICATION_SECTIONS)) {
10
+ result[record.code] = { ...record, label: locale.sections[record.code] };
11
+ }
12
+ return result;
13
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The codes to send to an API: each selected group code is replaced by its members, anything else passes
3
+ * through. The group code itself never appears in the output, and repeated codes are dropped.
4
+ */
5
+ export const expandGroupSelection = (selected, groups) => {
6
+ const membersByGroup = new Map(groups.map(group => [group.code, group.members]));
7
+ const expanded = selected.flatMap(code => membersByGroup.get(code) ?? [code]);
8
+ return [...new Set(expanded)];
9
+ };
10
+ /** checked = every member selected, indeterminate = some, unchecked = none (or a group without members). */
11
+ export const getGroupSelectionState = (group, selected) => {
12
+ const count = group.members.filter(member => selected.includes(member)).length;
13
+ if (count === 0)
14
+ return "unchecked";
15
+ return count === group.members.length ? "checked" : "indeterminate";
16
+ };
@@ -0,0 +1,13 @@
1
+ const SEPARATOR = " · ";
2
+ /**
3
+ * Splits a type label ("Transfer · ACH") at its FIRST " · " into a title and a rail, for two-line options.
4
+ * A label without the separator, or with nothing after it, comes back as `{ title }` alone — never an empty `rail`.
5
+ */
6
+ export const splitTypeLabel = (label) => {
7
+ const index = label.indexOf(SEPARATOR);
8
+ if (index === -1)
9
+ return { title: label };
10
+ const title = label.slice(0, index);
11
+ const rail = label.slice(index + SEPARATOR.length);
12
+ return rail === "" ? { title } : { title, rail };
13
+ };
@@ -1,28 +1,28 @@
1
1
  export const MOVEMENT_TYPES = {
2
- ach: { code: "ach", line: "payout", category: "payments" },
3
- fast_pay: { code: "fast_pay", line: "payout", category: "payments" },
4
- spei: { code: "spei", line: "payout", category: "payments" },
5
- spei_card: { code: "spei_card", line: "payout", category: "payments" },
6
- spei_return: { code: "spei_return", line: "payout", category: "payments" },
7
- r2p: { code: "r2p", line: "payin", category: "collections" },
8
- r2p_bancolombia: { code: "r2p_bancolombia", line: "payin", category: "collections" },
9
- r2p_nequi: { code: "r2p_nequi", line: "payin", category: "collections" },
10
- r2p_pse: { code: "r2p_pse", line: "payin", category: "collections" },
11
- direct_debit: { code: "direct_debit", line: "payin", category: "collections" },
12
- r2p_breb: { code: "r2p_breb", line: "payin", category: "collections" },
13
- r2p_top_up_pse: { code: "r2p_top_up_pse", line: "payin", category: "top_up" },
14
- r2p_top_up_bancolombia: { code: "r2p_top_up_bancolombia", line: "payin", category: "top_up" },
15
- global: { code: "global", line: "stable", category: "conversions", group: "stablecoin", groupLabel: "Stablecoin" },
16
- r2p_spei: { code: "r2p_spei", line: "payin", category: "collections" },
17
- on_ramp: { code: "on_ramp", line: "stable", category: "conversions", group: "stablecoin", groupLabel: "Stablecoin" },
18
- off_ramp: { code: "off_ramp", line: "stable", category: "conversions", group: "stablecoin", groupLabel: "Stablecoin" },
19
- fedwire: { code: "fedwire", line: "payout", category: "payments" },
20
- global_pay_to_usa: { code: "global_pay_to_usa", line: "cbmm", category: "international" },
21
- usa_pay_to_global: { code: "usa_pay_to_global", line: "cbmm", category: "international" },
22
- cross_border: { code: "cross_border", line: "cbmm", category: "international" },
23
- stable_payout: { code: "stable_payout", line: "stable", category: "conversions", group: "stablecoin", groupLabel: "Stablecoin" },
24
- breb: { code: "breb", line: "payout", category: "payments" },
25
- global_pay_to_generic: { code: "global_pay_to_generic", line: "payout", category: "payments" },
26
- swift: { code: "swift", line: "payout", category: "payments" },
27
- sepa: { code: "sepa", line: "payout", category: "payments" },
2
+ ach: { code: "ach", line: "payout", category: "payments", section: "cop" },
3
+ fast_pay: { code: "fast_pay", line: "payout", category: "payments", section: "cop" },
4
+ spei: { code: "spei", line: "payout", category: "payments", section: "mxn" },
5
+ spei_card: { code: "spei_card", line: "payout", category: "payments", section: "mxn" },
6
+ spei_return: { code: "spei_return", line: "payout", category: "payments", section: "mxn" },
7
+ r2p: { code: "r2p", line: "payin", category: "collections", section: "cop" },
8
+ r2p_bancolombia: { code: "r2p_bancolombia", line: "payin", category: "collections", section: "cop" },
9
+ r2p_nequi: { code: "r2p_nequi", line: "payin", category: "collections", section: "cop" },
10
+ r2p_pse: { code: "r2p_pse", line: "payin", category: "collections", section: "cop" },
11
+ direct_debit: { code: "direct_debit", line: "payin", category: "collections", section: "cop" },
12
+ r2p_breb: { code: "r2p_breb", line: "payin", category: "collections", section: "cop" },
13
+ r2p_top_up_pse: { code: "r2p_top_up_pse", line: "payin", category: "top_up", section: "cop" },
14
+ r2p_top_up_bancolombia: { code: "r2p_top_up_bancolombia", line: "payin", category: "top_up", section: "cop" },
15
+ global: { code: "global", line: "stable", category: "conversions", section: "stablecoin" },
16
+ r2p_spei: { code: "r2p_spei", line: "payin", category: "collections", section: "mxn" },
17
+ on_ramp: { code: "on_ramp", line: "stable", category: "conversions", section: "stablecoin" },
18
+ off_ramp: { code: "off_ramp", line: "stable", category: "conversions", section: "stablecoin" },
19
+ fedwire: { code: "fedwire", line: "payout", category: "payments", section: "usd_global" },
20
+ global_pay_to_usa: { code: "global_pay_to_usa", line: "cbmm", category: "international", section: "corridors" },
21
+ usa_pay_to_global: { code: "usa_pay_to_global", line: "cbmm", category: "international", section: "corridors" },
22
+ cross_border: { code: "cross_border", line: "cbmm", category: "international", section: "corridors" },
23
+ stable_payout: { code: "stable_payout", line: "stable", category: "conversions", section: "stablecoin" },
24
+ breb: { code: "breb", line: "payout", category: "payments", section: "cop" },
25
+ global_pay_to_generic: { code: "global_pay_to_generic", line: "payout", category: "payments", section: "usd_global" },
26
+ swift: { code: "swift", line: "payout", category: "payments", section: "usd_global" },
27
+ sepa: { code: "sepa", line: "payout", category: "payments", section: "eur" },
28
28
  };
@@ -11,14 +11,7 @@ export const getMovementTypes = (lang) => {
11
11
  }
12
12
  return result;
13
13
  };
14
- /**
15
- * The catalog as a list narrowed by the query, each record enriched with its label for `query.lang`.
16
- * Filter by `group`, not `groupLabel` — the label is display text, not a stable filter key.
17
- *
18
- * `group` is optional on the record, so `group: undefined` is a present key like any other — it
19
- * matches the records that don't carry a group, not "no filter". A UI filter fed from an optional
20
- * ref has to be spread in conditionally: `{ lang, ...(group ? { group } : {}) }`.
21
- */
14
+ /** The catalog as a list narrowed by the query, each record enriched with its label for `query.lang`. */
22
15
  export const queryMovementTypes = (query) => {
23
16
  const { lang, ...filters } = query;
24
17
  return Object.values(MOVEMENT_TYPES)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cobre-npm/library-portal-core",
3
- "version": "0.55.0",
3
+ "version": "0.56.0",
4
4
  "description": "Shared configurations and resources for Portal MFEs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -36,6 +36,11 @@
36
36
  "import": "./dist/esm/movements/index.js",
37
37
  "require": "./dist/cjs/movements/index.js"
38
38
  },
39
+ "./businessLines": {
40
+ "types": "./dist/cjs/businessLines/index.d.ts",
41
+ "import": "./dist/esm/businessLines/index.js",
42
+ "require": "./dist/cjs/businessLines/index.js"
43
+ },
39
44
  "./subclients": {
40
45
  "types": "./dist/cjs/subclients/index.d.ts",
41
46
  "import": "./dist/esm/subclients/index.js",
@@ -61,6 +66,11 @@
61
66
  "import": "./dist/esm/search/index.js",
62
67
  "require": "./dist/cjs/search/index.js"
63
68
  },
69
+ "./filterClassification": {
70
+ "types": "./dist/cjs/filterClassification/index.d.ts",
71
+ "import": "./dist/esm/filterClassification/index.js",
72
+ "require": "./dist/cjs/filterClassification/index.js"
73
+ },
64
74
  "./trustedSessions": {
65
75
  "types": "./dist/cjs/trustedSessions/index.d.ts",
66
76
  "import": "./dist/esm/trustedSessions/index.js",