@cobre-npm/library-portal-core 0.28.0 → 0.29.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
@@ -41,7 +41,7 @@ import { getCountries } from "@cobre-npm/library-portal-core/countries"
41
41
  | `@cobre-npm/library-portal-core/movements` | Movement types and statuses |
42
42
  | `@cobre-npm/library-portal-core/documentTypes` | Document types (definition + per-country applicability) |
43
43
  | `@cobre-npm/library-portal-core/currencies` | Currencies |
44
- | `@cobre-npm/library-portal-core/transactions` | Transaction interfaces |
44
+ | `@cobre-npm/library-portal-core/transactions` | Transaction types + interfaces |
45
45
  | `@cobre-npm/library-portal-core/canonicalTransactions` | Canonical transaction/money-movement detail interfaces |
46
46
  | `@cobre-npm/library-portal-core/search` | Search / aggregation interfaces |
47
47
  | `@cobre-npm/library-portal-core/trustedSessions` | Trusted session (OTP elevation window) interfaces |
@@ -123,14 +123,16 @@ Every use case comes out of this, without the consumer having to walk internal s
123
123
  returns the list already narrowed, with a safe default.
124
124
 
125
125
  `currencies` is the first: see [`currencies`](#currencies) for the query rules, which every later `queryX()`
126
- will follow. Until a domain has one, `.filter()` is still the way and it stays fine for one-off
127
- predicates even where `queryX()` exists.
126
+ will follow. `transactions/types` is the second, and the first **i18n** one: `lang` travels **inside** the
127
+ query object (required there, no default) rather than as a positional argument — see
128
+ [`transactions`](#transactions) for what that changes. Until a domain has one, `.filter()` is still the
129
+ way — and it stays fine for one-off predicates even where `queryX()` exists.
128
130
 
129
131
  ### Two classes of domain
130
132
 
131
133
  | Class | When | Signature | Examples |
132
134
  |---|---|---|---|
133
- | **With i18n** | the label depends on the language | `getX(lang)` | accountTypes, counterpartyTypes, movementTypes, countries, countriesISO, documentTypes |
135
+ | **With i18n** | the label depends on the language | `getX(lang)` | accountTypes, counterpartyTypes, movementTypes, transactionTypes, countries, countriesISO, documentTypes |
134
136
  | **Without i18n** | the label is fixed (or there is none) | `getX()` | currencies (inline label), accountProviders, movementStatus |
135
137
 
136
138
  `currencies`/`providers`/`status` **don't take `lang`** because there's no translation — the signature is honest.
@@ -298,12 +300,29 @@ Watch out for two consequences of rule 3:
298
300
  And two on rule 1: `{ minAmount: 1 }` is equality, not `>=`, which is rarely what you want; and
299
301
  `flagAsset`/`label` are presentation details that make poor business criteria.
300
302
 
301
- ### `transactions` / `search` / `trustedSessions`
303
+ ### `transactions`
304
+
305
+ ```ts
306
+ import {
307
+ getTransactionTypes, queryTransactionTypes, type TransactionType, type TransactionTypeQuery,
308
+ type Transaction, type EnrichedTransaction, /* ...interfaces */
309
+ } from "@cobre-npm/library-portal-core/transactions"
310
+
311
+ getTransactionTypes("en").spei_debit.label // "Debit via SPEI"
312
+ queryTransactionTypes({ lang: "en", code: "spei_debit" }) // [ { code: "spei_debit", label: "Debit via SPEI" } ]
313
+ ```
314
+
315
+ - **types** (i18n): `getTransactionTypes(lang)`; each record carries `code` and `label`.
316
+ - **types query** (i18n `queryX()`): `queryTransactionTypes({ lang, ...filters })` — `lang` is **required inside
317
+ the query object**, not a separate argument, so the result is already localized. There is no default field
318
+ (unlike `currencies`' `scope`): every transaction type comes back when only `lang` is given.
319
+ - **interfaces**: `Transaction`, `EnrichedTransaction`, `TransactionMetadata`, `CreditDebitType`.
320
+
321
+ ### `search` / `trustedSessions`
302
322
 
303
323
  Interfaces only (pure types):
304
324
 
305
325
  ```ts
306
- import type { Transaction, EnrichedTransaction } from "@cobre-npm/library-portal-core/transactions"
307
326
  import type { SearchRequest, SearchResponse, SearchFilter } from "@cobre-npm/library-portal-core/search"
308
327
  import type { TrustedSessionStatus } from "@cobre-npm/library-portal-core/trustedSessions"
309
328
  ```
@@ -1,2 +1,4 @@
1
+ export type { TransactionType } from "./types/catalog";
2
+ export * from "./types/utils/transaction-type.utils";
1
3
  export * from "./interfaces/response.interface";
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transactions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transactions/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,cAAc,sCAAsC,CAAA;AAEpD,cAAc,iCAAiC,CAAA"}
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types/utils/transaction-type.utils"), exports);
17
18
  __exportStar(require("./interfaces/response.interface"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transactions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAA+C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transactions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,uEAAoD;AAEpD,kEAA+C"}
@@ -0,0 +1,137 @@
1
+ export declare const TRANSACTION_TYPES: {
2
+ readonly spei_debit: {
3
+ readonly code: "spei_debit";
4
+ };
5
+ readonly spei_credit: {
6
+ readonly code: "spei_credit";
7
+ };
8
+ readonly spei_return: {
9
+ readonly code: "spei_return";
10
+ };
11
+ readonly spei_rejected: {
12
+ readonly code: "spei_rejected";
13
+ };
14
+ readonly internal_spei_debit: {
15
+ readonly code: "internal_spei_debit";
16
+ };
17
+ readonly internal_spei_credit: {
18
+ readonly code: "internal_spei_credit";
19
+ };
20
+ readonly adjustment_credit: {
21
+ readonly code: "adjustment_credit";
22
+ };
23
+ readonly adjustment_debit: {
24
+ readonly code: "adjustment_debit";
25
+ };
26
+ readonly mex_debit: {
27
+ readonly code: "mex_debit";
28
+ };
29
+ readonly mex_credit: {
30
+ readonly code: "mex_credit";
31
+ };
32
+ readonly col_debit: {
33
+ readonly code: "col_debit";
34
+ };
35
+ readonly col_credit: {
36
+ readonly code: "col_credit";
37
+ };
38
+ readonly misc_debit: {
39
+ readonly code: "misc_debit";
40
+ };
41
+ readonly misc_credit: {
42
+ readonly code: "misc_credit";
43
+ };
44
+ readonly internal_credit: {
45
+ readonly code: "internal_credit";
46
+ };
47
+ readonly internal_debit: {
48
+ readonly code: "internal_debit";
49
+ };
50
+ readonly r2p_credit: {
51
+ readonly code: "r2p_credit";
52
+ };
53
+ readonly cbmm_debit: {
54
+ readonly code: "cbmm_debit";
55
+ };
56
+ readonly cbmm_credit: {
57
+ readonly code: "cbmm_credit";
58
+ };
59
+ readonly dd_credit: {
60
+ readonly code: "dd_credit";
61
+ };
62
+ readonly col_cb_credit: {
63
+ readonly code: "col_cb_credit";
64
+ };
65
+ readonly col_cb_debit: {
66
+ readonly code: "col_cb_debit";
67
+ };
68
+ readonly breb_credit: {
69
+ readonly code: "breb_credit";
70
+ };
71
+ readonly breb_debit: {
72
+ readonly code: "breb_debit";
73
+ };
74
+ readonly r2p_breb_credit: {
75
+ readonly code: "r2p_breb_credit";
76
+ };
77
+ readonly breb_rejected: {
78
+ readonly code: "breb_rejected";
79
+ };
80
+ readonly col_top_up_credit: {
81
+ readonly code: "col_top_up_credit";
82
+ };
83
+ readonly global_debit: {
84
+ readonly code: "global_debit";
85
+ };
86
+ readonly global_credit: {
87
+ readonly code: "global_credit";
88
+ };
89
+ readonly r2p_spei_credit: {
90
+ readonly code: "r2p_spei_credit";
91
+ };
92
+ readonly transfer_credit: {
93
+ readonly code: "transfer_credit";
94
+ };
95
+ readonly fedwire_debit: {
96
+ readonly code: "fedwire_debit";
97
+ };
98
+ readonly fedwire_credit: {
99
+ readonly code: "fedwire_credit";
100
+ };
101
+ readonly reward_credit: {
102
+ readonly code: "reward_credit";
103
+ };
104
+ readonly global_pay_to_usa_debit: {
105
+ readonly code: "global_pay_to_usa_debit";
106
+ };
107
+ readonly global_pay_to_usa_credit: {
108
+ readonly code: "global_pay_to_usa_credit";
109
+ };
110
+ readonly usa_pay_to_global_debit: {
111
+ readonly code: "usa_pay_to_global_debit";
112
+ };
113
+ readonly usa_pay_to_global_credit: {
114
+ readonly code: "usa_pay_to_global_credit";
115
+ };
116
+ readonly onramp_credit: {
117
+ readonly code: "onramp_credit";
118
+ };
119
+ readonly offramp_debit: {
120
+ readonly code: "offramp_debit";
121
+ };
122
+ readonly stable_payout_debit: {
123
+ readonly code: "stable_payout_debit";
124
+ };
125
+ readonly stable_payout_credit: {
126
+ readonly code: "stable_payout_credit";
127
+ };
128
+ readonly global_pay_to_generic_debit: {
129
+ readonly code: "global_pay_to_generic_debit";
130
+ };
131
+ readonly global_pay_to_generic_credit: {
132
+ readonly code: "global_pay_to_generic_credit";
133
+ };
134
+ };
135
+ export type TransactionType = keyof typeof TRANSACTION_TYPES;
136
+ export type TransactionTypeRecord = (typeof TRANSACTION_TYPES)[TransactionType];
137
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/transactions/types/catalog.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CpB,CAAA;AAEV,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,iBAAiB,CAAA;AAC5D,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,eAAe,CAAC,CAAA"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TRANSACTION_TYPES = void 0;
4
+ exports.TRANSACTION_TYPES = {
5
+ spei_debit: { code: "spei_debit" },
6
+ spei_credit: { code: "spei_credit" },
7
+ spei_return: { code: "spei_return" },
8
+ spei_rejected: { code: "spei_rejected" },
9
+ internal_spei_debit: { code: "internal_spei_debit" },
10
+ internal_spei_credit: { code: "internal_spei_credit" },
11
+ adjustment_credit: { code: "adjustment_credit" },
12
+ adjustment_debit: { code: "adjustment_debit" },
13
+ mex_debit: { code: "mex_debit" },
14
+ mex_credit: { code: "mex_credit" },
15
+ col_debit: { code: "col_debit" },
16
+ col_credit: { code: "col_credit" },
17
+ misc_debit: { code: "misc_debit" },
18
+ misc_credit: { code: "misc_credit" },
19
+ internal_credit: { code: "internal_credit" },
20
+ internal_debit: { code: "internal_debit" },
21
+ r2p_credit: { code: "r2p_credit" },
22
+ cbmm_debit: { code: "cbmm_debit" },
23
+ cbmm_credit: { code: "cbmm_credit" },
24
+ dd_credit: { code: "dd_credit" },
25
+ col_cb_credit: { code: "col_cb_credit" },
26
+ col_cb_debit: { code: "col_cb_debit" },
27
+ breb_credit: { code: "breb_credit" },
28
+ breb_debit: { code: "breb_debit" },
29
+ r2p_breb_credit: { code: "r2p_breb_credit" },
30
+ breb_rejected: { code: "breb_rejected" },
31
+ col_top_up_credit: { code: "col_top_up_credit" },
32
+ global_debit: { code: "global_debit" },
33
+ global_credit: { code: "global_credit" },
34
+ r2p_spei_credit: { code: "r2p_spei_credit" },
35
+ transfer_credit: { code: "transfer_credit" },
36
+ fedwire_debit: { code: "fedwire_debit" },
37
+ fedwire_credit: { code: "fedwire_credit" },
38
+ reward_credit: { code: "reward_credit" },
39
+ global_pay_to_usa_debit: { code: "global_pay_to_usa_debit" },
40
+ global_pay_to_usa_credit: { code: "global_pay_to_usa_credit" },
41
+ usa_pay_to_global_debit: { code: "usa_pay_to_global_debit" },
42
+ usa_pay_to_global_credit: { code: "usa_pay_to_global_credit" },
43
+ onramp_credit: { code: "onramp_credit" },
44
+ offramp_debit: { code: "offramp_debit" },
45
+ stable_payout_debit: { code: "stable_payout_debit" },
46
+ stable_payout_credit: { code: "stable_payout_credit" },
47
+ global_pay_to_generic_debit: { code: "global_pay_to_generic_debit" },
48
+ global_pay_to_generic_credit: { code: "global_pay_to_generic_credit" },
49
+ };
50
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../src/transactions/types/catalog.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG;IAC/B,UAAU,EAAoB,EAAE,IAAI,EAAE,YAAY,EAAE;IACpD,WAAW,EAAmB,EAAE,IAAI,EAAE,aAAa,EAAE;IACrD,WAAW,EAAmB,EAAE,IAAI,EAAE,aAAa,EAAE;IACrD,aAAa,EAAiB,EAAE,IAAI,EAAE,eAAe,EAAE;IACvD,mBAAmB,EAAW,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC7D,oBAAoB,EAAU,EAAE,IAAI,EAAE,sBAAsB,EAAE;IAC9D,iBAAiB,EAAa,EAAE,IAAI,EAAE,mBAAmB,EAAE;IAC3D,gBAAgB,EAAc,EAAE,IAAI,EAAE,kBAAkB,EAAE;IAC1D,SAAS,EAAqB,EAAE,IAAI,EAAE,WAAW,EAAE;IACnD,UAAU,EAAoB,EAAE,IAAI,EAAE,YAAY,EAAE;IACpD,SAAS,EAAqB,EAAE,IAAI,EAAE,WAAW,EAAE;IACnD,UAAU,EAAoB,EAAE,IAAI,EAAE,YAAY,EAAE;IACpD,UAAU,EAAoB,EAAE,IAAI,EAAE,YAAY,EAAE;IACpD,WAAW,EAAmB,EAAE,IAAI,EAAE,aAAa,EAAE;IACrD,eAAe,EAAe,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACzD,cAAc,EAAgB,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACxD,UAAU,EAAoB,EAAE,IAAI,EAAE,YAAY,EAAE;IACpD,UAAU,EAAoB,EAAE,IAAI,EAAE,YAAY,EAAE;IACpD,WAAW,EAAmB,EAAE,IAAI,EAAE,aAAa,EAAE;IACrD,SAAS,EAAqB,EAAE,IAAI,EAAE,WAAW,EAAE;IACnD,aAAa,EAAiB,EAAE,IAAI,EAAE,eAAe,EAAE;IACvD,YAAY,EAAkB,EAAE,IAAI,EAAE,cAAc,EAAE;IACtD,WAAW,EAAmB,EAAE,IAAI,EAAE,aAAa,EAAE;IACrD,UAAU,EAAoB,EAAE,IAAI,EAAE,YAAY,EAAE;IACpD,eAAe,EAAe,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACzD,aAAa,EAAiB,EAAE,IAAI,EAAE,eAAe,EAAE;IACvD,iBAAiB,EAAa,EAAE,IAAI,EAAE,mBAAmB,EAAE;IAC3D,YAAY,EAAkB,EAAE,IAAI,EAAE,cAAc,EAAE;IACtD,aAAa,EAAiB,EAAE,IAAI,EAAE,eAAe,EAAE;IACvD,eAAe,EAAe,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACzD,eAAe,EAAe,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACzD,aAAa,EAAiB,EAAE,IAAI,EAAE,eAAe,EAAE;IACvD,cAAc,EAAgB,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACxD,aAAa,EAAiB,EAAE,IAAI,EAAE,eAAe,EAAE;IACvD,uBAAuB,EAAO,EAAE,IAAI,EAAE,yBAAyB,EAAE;IACjE,wBAAwB,EAAM,EAAE,IAAI,EAAE,0BAA0B,EAAE;IAClE,uBAAuB,EAAO,EAAE,IAAI,EAAE,yBAAyB,EAAE;IACjE,wBAAwB,EAAM,EAAE,IAAI,EAAE,0BAA0B,EAAE;IAClE,aAAa,EAAiB,EAAE,IAAI,EAAE,eAAe,EAAE;IACvD,aAAa,EAAiB,EAAE,IAAI,EAAE,eAAe,EAAE;IACvD,mBAAmB,EAAW,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC7D,oBAAoB,EAAU,EAAE,IAAI,EAAE,sBAAsB,EAAE;IAC9D,2BAA2B,EAAG,EAAE,IAAI,EAAE,6BAA6B,EAAE;IACrE,4BAA4B,EAAE,EAAE,IAAI,EAAE,8BAA8B,EAAE;CAC9D,CAAA"}
@@ -0,0 +1,48 @@
1
+ {
2
+ "transactionTypes": {
3
+ "spei_debit": "Debit via SPEI",
4
+ "spei_credit": "Credit via SPEI",
5
+ "spei_return": "Refund via SPEI",
6
+ "spei_rejected": "SPEI Rejected",
7
+ "internal_spei_debit": "Internal debit through SPEI",
8
+ "internal_spei_credit": "Internal credit through SPEI",
9
+ "adjustment_credit": "Credit adjustment",
10
+ "adjustment_debit": "Debit adjustment",
11
+ "mex_debit": "Debit in Mexico",
12
+ "mex_credit": "Credit in Mexico",
13
+ "col_debit": "Debit in Colombia",
14
+ "col_credit": "Credit in Colombia",
15
+ "misc_debit": "Debit",
16
+ "misc_credit": "Credit",
17
+ "internal_credit": "Internal credit",
18
+ "internal_debit": "Internal debit",
19
+ "r2p_credit": "R2P Credit",
20
+ "cbmm_debit": "Debit Cross Border",
21
+ "cbmm_credit": "Credit Cross Border",
22
+ "dd_credit": "Direct Debit Credit",
23
+ "col_cb_credit": "Cobre Balance Credit in Colombia",
24
+ "col_cb_debit": "Cobre Balance Debit in Colombia",
25
+ "breb_credit": "Credit by Bre-B",
26
+ "breb_debit": "Debit by Bre-B",
27
+ "r2p_breb_credit": "R2P Credit by Bre-B",
28
+ "breb_rejected": "Bre-B Rejected",
29
+ "col_top_up_credit": "Cobre Balance Credit in Colombia",
30
+ "global_debit": "Global Debit",
31
+ "global_credit": "Global Credit",
32
+ "r2p_spei_credit": "R2P Credit SPEI",
33
+ "transfer_credit": "Transfer Credit",
34
+ "fedwire_debit": "Fedwire Debit",
35
+ "fedwire_credit": "Fedwire Credit",
36
+ "reward_credit": "Rewards credit",
37
+ "global_pay_to_usa_debit": "Global account debit",
38
+ "global_pay_to_usa_credit": "FBO account credit",
39
+ "usa_pay_to_global_debit": "FBO account debit",
40
+ "usa_pay_to_global_credit": "Global account credit",
41
+ "onramp_credit": "Onramp Credit",
42
+ "offramp_debit": "Offramp Debit",
43
+ "stable_payout_debit": "Stable Payout",
44
+ "stable_payout_credit": "Stable Payout Credit",
45
+ "global_pay_to_generic_debit": "Generic Payment Debit",
46
+ "global_pay_to_generic_credit": "Generic Payment Credit"
47
+ }
48
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "transactionTypes": {
3
+ "spei_debit": "Débito a través de SPEI",
4
+ "spei_credit": "Crédito a través de SPEI",
5
+ "spei_return": "Reembolso a través de SPEI",
6
+ "spei_rejected": "Retorno de SPEI",
7
+ "internal_spei_debit": "Débito interno a través de SPEI",
8
+ "internal_spei_credit": "Crédito interno a través de SPEI",
9
+ "adjustment_credit": "Ajuste de crédito",
10
+ "adjustment_debit": "Ajuste de débito",
11
+ "mex_debit": "Débito en México",
12
+ "mex_credit": "Crédito en México",
13
+ "col_debit": "Débito en Colombia",
14
+ "col_credit": "Crédito en Colombia",
15
+ "misc_debit": "Débito",
16
+ "misc_credit": "Crédito",
17
+ "internal_credit": "Crédito Interno",
18
+ "internal_debit": "Débito Interno",
19
+ "r2p_credit": "Crédito por recaudo",
20
+ "cbmm_debit": "Débito Internacional",
21
+ "cbmm_credit": "Crédito Internacional",
22
+ "dd_credit": "Crédito Débito a cuenta",
23
+ "col_cb_credit": "Crédito Cobre Balance",
24
+ "col_cb_debit": "Débito Cobre Balance",
25
+ "breb_credit": "Crédito a través de Bre-B",
26
+ "breb_debit": "Débito a través de Bre-B",
27
+ "r2p_breb_credit": "Crédito por recaudo Bre-B",
28
+ "breb_rejected": "Retorno de Bre-B",
29
+ "col_top_up_credit": "Recarga Cobre Balance",
30
+ "global_debit": "Débito Global",
31
+ "global_credit": "Crédito Global",
32
+ "r2p_spei_credit": "Crédito por recaudo SPEI",
33
+ "transfer_credit": "Crédito de transferencia",
34
+ "fedwire_debit": "Débito Fedwire",
35
+ "fedwire_credit": "Crédito Fedwire",
36
+ "reward_credit": "Crédito por recompensa",
37
+ "global_pay_to_usa_debit": "Débito cuenta global",
38
+ "global_pay_to_usa_credit": "Crédito cuenta FBO",
39
+ "usa_pay_to_global_debit": "Débito cuenta FBO",
40
+ "usa_pay_to_global_credit": "Crédito cuenta global",
41
+ "onramp_credit": "Crédito onramp",
42
+ "offramp_debit": "Débito offramp",
43
+ "stable_payout_debit": "Stable Payout",
44
+ "stable_payout_credit": "Crédito Stable Payout",
45
+ "global_pay_to_generic_debit": "Débito pago genérico",
46
+ "global_pay_to_generic_credit": "Retorno pago genérico"
47
+ }
48
+ }
@@ -0,0 +1,18 @@
1
+ import type { TransactionType, TransactionTypeRecord } from "../catalog";
2
+ import type { Locale } from "../../../lang";
3
+ import type { CatalogQuery } from "../../../utils/catalog-query.utils";
4
+ export type TransactionTypeOption = TransactionTypeRecord & {
5
+ label: string;
6
+ };
7
+ /**
8
+ * The catalog indexed by code (same shape as TRANSACTION_TYPES), each record enriched
9
+ * with its label for the given language. Access by code directly, or Object.values for a list.
10
+ */
11
+ export declare const getTransactionTypes: (lang: Locale) => Record<TransactionType, TransactionTypeOption>;
12
+ /** i18n domain: `lang` is required, inside the query object — see matchesQuery for the matching rules. */
13
+ export type TransactionTypeQuery = CatalogQuery<TransactionTypeRecord> & {
14
+ lang: Locale;
15
+ };
16
+ /** The catalog as a list narrowed by the query, each record enriched with its label for `query.lang`. */
17
+ export declare const queryTransactionTypes: (query: TransactionTypeQuery) => TransactionTypeOption[];
18
+ //# sourceMappingURL=transaction-type.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction-type.utils.d.ts","sourceRoot":"","sources":["../../../../src/transactions/types/utils/transaction-type.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAGxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AAItE,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7E;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,KAAG,MAAM,CAAC,eAAe,EAAE,qBAAqB,CAS/F,CAAA;AAED,0GAA0G;AAC1G,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,qBAAqB,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAEzF,yGAAyG;AACzG,eAAO,MAAM,qBAAqB,GAAI,OAAO,oBAAoB,KAAG,qBAAqB,EAIxF,CAAA"}
@@ -0,0 +1,31 @@
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.queryTransactionTypes = exports.getTransactionTypes = 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 catalog_query_utils_1 = require("../../../utils/catalog-query.utils");
11
+ const locales = { en: en_json_1.default, "es-mex": es_mex_json_1.default };
12
+ /**
13
+ * The catalog indexed by code (same shape as TRANSACTION_TYPES), each record enriched
14
+ * with its label for the given language. Access by code directly, or Object.values for a list.
15
+ */
16
+ const getTransactionTypes = (lang) => {
17
+ const locale = locales[lang];
18
+ const result = {};
19
+ for (const record of Object.values(catalog_1.TRANSACTION_TYPES)) {
20
+ result[record.code] = { ...record, label: locale.transactionTypes[record.code] };
21
+ }
22
+ return result;
23
+ };
24
+ exports.getTransactionTypes = getTransactionTypes;
25
+ /** The catalog as a list narrowed by the query, each record enriched with its label for `query.lang`. */
26
+ const queryTransactionTypes = (query) => {
27
+ const { lang, ...filters } = query;
28
+ return Object.values((0, exports.getTransactionTypes)(lang)).filter(option => (0, catalog_query_utils_1.matchesQuery)(option, filters));
29
+ };
30
+ exports.queryTransactionTypes = queryTransactionTypes;
31
+ //# sourceMappingURL=transaction-type.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction-type.utils.js","sourceRoot":"","sources":["../../../../src/transactions/types/utils/transaction-type.utils.ts"],"names":[],"mappings":";;;;;;AAAA,wCAA8C;AAE9C,iEAAyC;AACzC,yEAAgD;AAEhD,4EAAiE;AAGjE,MAAM,OAAO,GAAuC,EAAE,EAAE,EAAE,iBAAQ,EAAE,QAAQ,EAAE,qBAAW,EAAE,CAAA;AAI3F;;;GAGG;AACI,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAkD,EAAE;IAClG,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,MAAM,GAAG,EAAoD,CAAA;IAEnE,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,2BAAiB,CAAC,EAAE,CAAC;QACtD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAA;IAClF,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AATY,QAAA,mBAAmB,uBAS/B;AAKD,yGAAyG;AAClG,MAAM,qBAAqB,GAAG,CAAC,KAA2B,EAA2B,EAAE;IAC5F,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAA;IAElC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAA,2BAAmB,EAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAA,kCAAY,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AACjG,CAAC,CAAA;AAJY,QAAA,qBAAqB,yBAIjC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cobre-npm/library-portal-core",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "description": "Shared configurations and resources for Portal MFEs",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",