@cobre-npm/library-portal-core 0.48.0 → 0.51.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.
package/README.md CHANGED
@@ -241,27 +241,37 @@ hasCountryISOFlag("col") // true — whether a flag asset is avai
241
241
  import {
242
242
  getMovementTypes, queryMovementTypes, type MovementType, type MovementTypeGroupLabel,
243
243
  type MovementTypeOption, type MovementTypeQuery,
244
+ type ClassificationLine, type ClassificationCategory,
244
245
  getMovementStatuses, queryMovementStatuses, type MovementStatus, type MovementStatusType,
245
246
  type MovementStatusOption, type MovementStatusQuery,
246
247
  } from "@cobre-npm/library-portal-core/movements"
247
248
 
248
- getMovementTypes("en").ach.label // "ACH"
249
+ getMovementTypes("en").ach.label // "Transfer · ACH"
249
250
  getMovementTypes("en").on_ramp.groupLabel // "Stablecoin"
250
- getMovementTypes("en").on_ramp.label // "On Ramp" (individual label, unchanged)
251
+ getMovementTypes("en").on_ramp.label // "Conversion to stablecoin" (individual label)
252
+ getMovementTypes("en").spei.category // "payments"
253
+ queryMovementTypes({ lang: "en", category: "top_up" }) // r2p_top_up_bancolombia, r2p_top_up_pse
251
254
  queryMovementTypes({ lang: "en", groupLabel: "Stablecoin" }) // global, off_ramp, on_ramp, stable_payout
252
255
  getMovementStatuses("en").completed // { code: "completed", label: "Completed", type: "success", icon: "icon-check" }
253
256
  queryMovementStatuses({ lang: "en", type: "error" }) // error, failed, rejected — localized
254
257
  ```
255
258
 
256
- - **types** (i18n): movement types (ACH, SPEI, R2P, …). `on_ramp`/`off_ramp`/`stable_payout`/`global`
259
+ - **types** (i18n): movement types, usually labelled as "what you did · rail" (`Transfer · SPEI`,
260
+ `Collection · Bre-B`). Movement and transaction types share one classification, carried on each record as
261
+ codes, not translated text (nothing displays them yet): `line: ClassificationLine`
262
+ (`payin | payout | cbmm | stable | unclassified`) and `category: ClassificationCategory`
263
+ (`payments | collections | conversions | international | between_accounts | top_up | adjustment |
264
+ reward | unclassified`). Both types are exported from `/movements` and `/transactions` (the same types on
265
+ both subpaths). `on_ramp`/`off_ramp`/`stable_payout`/`global`
257
266
  additionally carry `groupLabel: "Stablecoin"` — a display grouping for views that need to show them
258
267
  under one label. `getMovementTypes()` keeps returning each rail's own individual `label` unchanged; a
259
268
  consumer that wants the grouped label picks `groupLabel ?? label`. There's no separate `getXLabel`
260
269
  for this — the value already comes back inside `getMovementTypes()`, same as everything else in this
261
270
  catalog.
262
271
  - **types query** (i18n `queryX()`): `queryMovementTypes({ lang, ...filters })` — same rules as
263
- `queryTransactionTypes`/`queryDocumentTypes`, no default field. `groupLabel` is the only filterable
264
- field besides `code`, and it's optional on the record: **a key that is present always filters**, so
272
+ `queryTransactionTypes`/`queryDocumentTypes`, no default field. `code`, `line`, `category`, `group` and
273
+ `groupLabel` are filterable (equality only; a list matches any of its values). Filter by `group`, not
274
+ `groupLabel` — the label is display text. Both are optional on the record: **a key that is present always filters**, so
265
275
  `groupLabel: undefined` matches the 19 rails that don't carry a group, not "no filter". An optional UI
266
276
  filter has to be spread in conditionally:
267
277
 
@@ -405,19 +415,31 @@ And two on rule 1: `{ minAmount: 1 }` is equality, not `>=`, which is rarely wha
405
415
  ```ts
406
416
  import {
407
417
  getTransactionTypes, queryTransactionTypes, type TransactionType, type TransactionTypeQuery,
418
+ type ClassificationLine, type ClassificationCategory,
408
419
  type Transaction, type EnrichedTransaction, /* ...interfaces */
409
420
  } from "@cobre-npm/library-portal-core/transactions"
410
421
 
411
- getTransactionTypes("en").spei_debit.label // "Debit via SPEI"
412
- queryTransactionTypes({ lang: "en", code: "spei_debit" }) // [ { code: "spei_debit", label: "Debit via SPEI" } ]
422
+ getTransactionTypes("en").spei_debit.label // "Outgoing transfer · SPEI"
423
+ getTransactionTypes("es-mex").spei_debit.label // "Transferencia enviada · SPEI"
424
+ queryTransactionTypes({ lang: "en", code: "spei_debit" }) // [ { code: "spei_debit", creditDebitType: "debit", line: "payout", category: "payments", label: "Outgoing transfer · SPEI" } ]
425
+ queryTransactionTypes({ lang: "en", category: "top_up" }) // col_top_up_credit
413
426
  ```
414
427
 
415
428
  - **types** (i18n): `getTransactionTypes(lang)`; each record carries `code`, `creditDebitType`
416
- (`"credit" | "debit"` — the same `CreditDebitType` used by the `Transaction` interface) and `label`.
429
+ (`"credit" | "debit"` — the same `CreditDebitType` used by the `Transaction` interface), `label`, and the same
430
+ `line: ClassificationLine` / `category: ClassificationCategory` codes as movement types (value sets
431
+ listed under [`movements`](#movements)). Labels are usually "what you did · rail" (`Outgoing transfer ·
432
+ SPEI`). Types that stand for a collapsed matrix row (`cbmm_*`, `internal_*`, `mex_*`, `col_debit`/`col_credit`, `misc_*`,
433
+ `adjustment_*`, `col_cb_*`, the corridors, ramps and `stable_payout_*`, plus `transfer_credit`) add a
434
+ "· débito" / "· crédito" (en "· debit" / "· credit") suffix; elsewhere the direction is in the verb
435
+ ("Outgoing transfer", "Incoming transfer"). `col_cb_*` keeps "Cobre Balance" in its label. `misc_*`,
436
+ `internal_*` and `adjustment_*` have `line: "unclassified"`, and `misc_*` also `category: "unclassified"`.
417
437
  - **types query** (i18n `queryX()`): `queryTransactionTypes({ lang, ...filters })` — `lang` is **required inside
418
438
  the query object**, not a separate argument, so the result is already localized. There is no default field
419
439
  (unlike `currencies`' `scope`): every transaction type comes back when only `lang` is given.
420
- `queryTransactionTypes({ lang: "en", creditDebitType: "credit" })` narrows to only the credits.
440
+ `queryTransactionTypes({ lang: "en", creditDebitType: "credit" })` narrows to only the credits;
441
+ `line` and `category` are filterable the same way (equality, a list matches any of its values), e.g.
442
+ `queryTransactionTypes({ lang: "en", line: "payin", category: "collections" })`.
421
443
  - **interfaces**: `Transaction`, `EnrichedTransaction`, `TransactionMetadata`, `CreditDebitType`.
422
444
 
423
445
  ### `search` / `trustedSessions`
@@ -53,7 +53,7 @@
53
53
  "pr_col_1803": "Powwi",
54
54
  "pr_col_1811": "RappiPay",
55
55
  "pr_col_1813": "Santander Consumer",
56
- "pr_col_1019": "Scotiabank Colpatria",
56
+ "pr_col_1019": "Davibank",
57
57
  "pr_col_1804": "Uala",
58
58
  "pr_mex_40133": "Actinver",
59
59
  "pr_mex_40062": "Afirme",
@@ -53,7 +53,7 @@
53
53
  "pr_col_1803": "Powwi",
54
54
  "pr_col_1811": "RappiPay",
55
55
  "pr_col_1813": "Santander Consumer",
56
- "pr_col_1019": "Scotiabank Colpatria",
56
+ "pr_col_1019": "Davibank",
57
57
  "pr_col_1804": "Ualá",
58
58
  "pr_mex_40133": "Actinver",
59
59
  "pr_mex_40062": "Afirme",
@@ -1,4 +1,4 @@
1
- export type { MovementType, MovementTypeGroup, MovementTypeGroupLabel } from "./types/catalog";
1
+ export type { ClassificationCategory, ClassificationLine, MovementType, MovementTypeGroup, MovementTypeGroupLabel } 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,82 +1,135 @@
1
+ export type ClassificationLine = "payin" | "payout" | "cbmm" | "stable" | "unclassified";
2
+ export type ClassificationCategory = "payments" | "collections" | "conversions" | "international" | "between_accounts" | "top_up" | "adjustment" | "reward" | "unclassified";
1
3
  export type MovementTypeGroup = "stablecoin";
2
4
  export type MovementTypeGroupLabel = "Stablecoin";
3
5
  export declare const MOVEMENT_TYPES: {
4
6
  readonly ach: {
5
7
  readonly code: "ach";
8
+ readonly line: "payout";
9
+ readonly category: "payments";
6
10
  };
7
11
  readonly fast_pay: {
8
12
  readonly code: "fast_pay";
13
+ readonly line: "payout";
14
+ readonly category: "payments";
9
15
  };
10
16
  readonly spei: {
11
17
  readonly code: "spei";
18
+ readonly line: "payout";
19
+ readonly category: "payments";
12
20
  };
13
21
  readonly spei_card: {
14
22
  readonly code: "spei_card";
23
+ readonly line: "payout";
24
+ readonly category: "payments";
15
25
  };
16
26
  readonly spei_return: {
17
27
  readonly code: "spei_return";
28
+ readonly line: "payout";
29
+ readonly category: "payments";
18
30
  };
19
31
  readonly r2p: {
20
32
  readonly code: "r2p";
33
+ readonly line: "payin";
34
+ readonly category: "collections";
21
35
  };
22
36
  readonly r2p_bancolombia: {
23
37
  readonly code: "r2p_bancolombia";
38
+ readonly line: "payin";
39
+ readonly category: "collections";
24
40
  };
25
41
  readonly r2p_nequi: {
26
42
  readonly code: "r2p_nequi";
43
+ readonly line: "payin";
44
+ readonly category: "collections";
27
45
  };
28
46
  readonly r2p_pse: {
29
47
  readonly code: "r2p_pse";
48
+ readonly line: "payin";
49
+ readonly category: "collections";
30
50
  };
31
51
  readonly direct_debit: {
32
52
  readonly code: "direct_debit";
53
+ readonly line: "payin";
54
+ readonly category: "collections";
33
55
  };
34
56
  readonly r2p_breb: {
35
57
  readonly code: "r2p_breb";
58
+ readonly line: "payin";
59
+ readonly category: "collections";
36
60
  };
37
61
  readonly r2p_top_up_pse: {
38
62
  readonly code: "r2p_top_up_pse";
63
+ readonly line: "payin";
64
+ readonly category: "top_up";
39
65
  };
40
66
  readonly r2p_top_up_bancolombia: {
41
67
  readonly code: "r2p_top_up_bancolombia";
68
+ readonly line: "payin";
69
+ readonly category: "top_up";
42
70
  };
43
71
  readonly global: {
44
72
  readonly code: "global";
73
+ readonly line: "stable";
74
+ readonly category: "conversions";
45
75
  readonly group: "stablecoin";
46
76
  readonly groupLabel: "Stablecoin";
47
77
  };
48
78
  readonly r2p_spei: {
49
79
  readonly code: "r2p_spei";
80
+ readonly line: "payin";
81
+ readonly category: "collections";
50
82
  };
51
83
  readonly on_ramp: {
52
84
  readonly code: "on_ramp";
85
+ readonly line: "stable";
86
+ readonly category: "conversions";
53
87
  readonly group: "stablecoin";
54
88
  readonly groupLabel: "Stablecoin";
55
89
  };
56
90
  readonly off_ramp: {
57
91
  readonly code: "off_ramp";
92
+ readonly line: "stable";
93
+ readonly category: "conversions";
58
94
  readonly group: "stablecoin";
59
95
  readonly groupLabel: "Stablecoin";
60
96
  };
61
97
  readonly fedwire: {
62
98
  readonly code: "fedwire";
99
+ readonly line: "payout";
100
+ readonly category: "payments";
63
101
  };
64
102
  readonly global_pay_to_usa: {
65
103
  readonly code: "global_pay_to_usa";
104
+ readonly line: "cbmm";
105
+ readonly category: "international";
66
106
  };
67
107
  readonly usa_pay_to_global: {
68
108
  readonly code: "usa_pay_to_global";
109
+ readonly line: "cbmm";
110
+ readonly category: "international";
111
+ };
112
+ readonly cross_border: {
113
+ readonly code: "cross_border";
114
+ readonly line: "cbmm";
115
+ readonly category: "international";
69
116
  };
70
117
  readonly stable_payout: {
71
118
  readonly code: "stable_payout";
119
+ readonly line: "stable";
120
+ readonly category: "conversions";
72
121
  readonly group: "stablecoin";
73
122
  readonly groupLabel: "Stablecoin";
74
123
  };
75
124
  readonly breb: {
76
125
  readonly code: "breb";
126
+ readonly line: "payout";
127
+ readonly category: "payments";
77
128
  };
78
129
  readonly global_pay_to_generic: {
79
130
  readonly code: "global_pay_to_generic";
131
+ readonly line: "payout";
132
+ readonly category: "payments";
80
133
  };
81
134
  };
82
135
  export type MovementType = keyof typeof MOVEMENT_TYPES;
@@ -2,27 +2,28 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MOVEMENT_TYPES = void 0;
4
4
  exports.MOVEMENT_TYPES = {
5
- ach: { code: "ach" },
6
- fast_pay: { code: "fast_pay" },
7
- spei: { code: "spei" },
8
- spei_card: { code: "spei_card" },
9
- spei_return: { code: "spei_return" },
10
- r2p: { code: "r2p" },
11
- r2p_bancolombia: { code: "r2p_bancolombia" },
12
- r2p_nequi: { code: "r2p_nequi" },
13
- r2p_pse: { code: "r2p_pse" },
14
- direct_debit: { code: "direct_debit" },
15
- r2p_breb: { code: "r2p_breb" },
16
- r2p_top_up_pse: { code: "r2p_top_up_pse" },
17
- r2p_top_up_bancolombia: { code: "r2p_top_up_bancolombia" },
18
- global: { code: "global", group: "stablecoin", groupLabel: "Stablecoin" },
19
- r2p_spei: { code: "r2p_spei" },
20
- on_ramp: { code: "on_ramp", group: "stablecoin", groupLabel: "Stablecoin" },
21
- off_ramp: { code: "off_ramp", group: "stablecoin", groupLabel: "Stablecoin" },
22
- fedwire: { code: "fedwire" },
23
- global_pay_to_usa: { code: "global_pay_to_usa" },
24
- usa_pay_to_global: { code: "usa_pay_to_global" },
25
- stable_payout: { code: "stable_payout", group: "stablecoin", groupLabel: "Stablecoin" },
26
- breb: { code: "breb" },
27
- global_pay_to_generic: { code: "global_pay_to_generic" },
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" },
28
29
  };
@@ -1,27 +1,28 @@
1
1
  {
2
2
  "movementTypes": {
3
- "ach": "ACH",
4
- "fast_pay": "Fast Pay",
5
- "spei": "SPEI",
6
- "spei_card": "SPEI Card",
7
- "spei_return": "SPEI Refund",
8
- "r2p": "Request",
9
- "r2p_bancolombia": "Collection - Bancolombia Button",
10
- "r2p_nequi": "Collection - Nequi Button",
11
- "r2p_pse": "Collection - PSE",
12
- "direct_debit": "Direct Debit",
13
- "r2p_breb": "R2P Bre-B",
14
- "r2p_top_up_pse": "R2P - PSE",
15
- "r2p_top_up_bancolombia": "R2P - Bancolombia",
3
+ "ach": "Transfer · ACH",
4
+ "fast_pay": "Real-time payment · Fast Pay",
5
+ "spei": "Transfer · SPEI",
6
+ "spei_card": "Transfer · SPEI to debit card",
7
+ "spei_return": "Return · SPEI",
8
+ "r2p": "Payment button collection · Legacy",
9
+ "r2p_bancolombia": "Payment button collection · Bancolombia",
10
+ "r2p_nequi": "Payment button collection · Nequi",
11
+ "r2p_pse": "Payment button collection · PSE",
12
+ "direct_debit": "Direct debit",
13
+ "r2p_breb": "Collection · Bre-B",
14
+ "r2p_top_up_pse": "Own balance top-up · PSE",
15
+ "r2p_top_up_bancolombia": "Own balance top-up · Bancolombia",
16
16
  "global": "Global payout",
17
- "r2p_spei": "R2P SPEI",
18
- "on_ramp": "On Ramp",
19
- "off_ramp": "Off Ramp",
20
- "fedwire": "Fedwire",
21
- "global_pay_to_usa": "FBO Top-Up",
22
- "usa_pay_to_global": "Global Top-Up",
23
- "stable_payout": "Stable payout",
24
- "breb": "Bre-B",
25
- "global_pay_to_generic": "Generic Transfer"
17
+ "r2p_spei": "Collection · SPEI",
18
+ "on_ramp": "Conversion to stablecoin",
19
+ "off_ramp": "Conversion to local currency",
20
+ "fedwire": "International transfer · Fedwire",
21
+ "global_pay_to_usa": "International transfer · USA corridor",
22
+ "usa_pay_to_global": "International transfer · Global corridor",
23
+ "cross_border": "International",
24
+ "stable_payout": "Stablecoin payment · Direct",
25
+ "breb": "Instant payment · Bre-B",
26
+ "global_pay_to_generic": "International payment"
26
27
  }
27
28
  }
@@ -1,27 +1,28 @@
1
1
  {
2
2
  "movementTypes": {
3
- "ach": "ACH",
4
- "fast_pay": "Fast Pay",
5
- "spei": "SPEI",
6
- "spei_card": "SPEI Card",
7
- "spei_return": "Retorno SPEI",
8
- "r2p": "Solicitud",
9
- "r2p_bancolombia": "Recaudo - Botón Bancolombia",
10
- "r2p_nequi": "Recaudo - Botón Nequi",
11
- "r2p_pse": "Recaudo - PSE",
12
- "direct_debit": "Débito a cuenta",
13
- "r2p_breb": "Recaudo Bre-B",
14
- "r2p_top_up_pse": "Recarga - PSE",
15
- "r2p_top_up_bancolombia": "Recarga - Bancolombia",
3
+ "ach": "Transferencia · ACH",
4
+ "fast_pay": "Pago real time · Fast Pay",
5
+ "spei": "Transferencia · SPEI",
6
+ "spei_card": "Transferencia · SPEI a tarjeta de débito",
7
+ "spei_return": "Devolución · SPEI",
8
+ "r2p": "Recaudo con botón de pago · Legacy",
9
+ "r2p_bancolombia": "Recaudo con botón de pago · Bancolombia",
10
+ "r2p_nequi": "Recaudo con botón de pago · Nequi",
11
+ "r2p_pse": "Recaudo con botón de pago · PSE",
12
+ "direct_debit": "Débito automático",
13
+ "r2p_breb": "Recaudo · Bre-B",
14
+ "r2p_top_up_pse": "Recarga de saldo propio · PSE",
15
+ "r2p_top_up_bancolombia": "Recarga de saldo propio · Bancolombia",
16
16
  "global": "Pago global",
17
- "r2p_spei": "Recaudo SPEI",
18
- "on_ramp": "On Ramp",
19
- "off_ramp": "Off Ramp",
20
- "fedwire": "Fedwire",
21
- "global_pay_to_usa": "Recarga FBO",
22
- "usa_pay_to_global": "Recarga Global",
23
- "stable_payout": "Pago stable",
24
- "breb": "Bre-B",
25
- "global_pay_to_generic": "Pago Genérico"
17
+ "r2p_spei": "Recaudo · SPEI",
18
+ "on_ramp": "Conversión a stablecoin",
19
+ "off_ramp": "Conversión a moneda local",
20
+ "fedwire": "Transferencia internacional · Fedwire",
21
+ "global_pay_to_usa": "Transferencia internacional · Corredor USA",
22
+ "usa_pay_to_global": "Transferencia internacional · Corredor Global",
23
+ "cross_border": "Internacional",
24
+ "stable_payout": "Pago en stablecoin · Directo",
25
+ "breb": "Pago instantáneo · Bre-B",
26
+ "global_pay_to_generic": "Pago internacional"
26
27
  }
27
28
  }
@@ -1,3 +1,4 @@
1
+ export type { ClassificationCategory, ClassificationLine } from "../movements/types/catalog";
1
2
  export type { TransactionType } from "./types/catalog";
2
3
  export * from "./types/utils/transaction-type.utils";
3
4
  export * from "./interfaces/response.interface";