@cobre-npm/library-portal-core 0.26.3 → 0.28.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 (28) hide show
  1. package/README.md +79 -3
  2. package/dist/canonicalTransactions/index.d.ts +3 -0
  3. package/dist/canonicalTransactions/index.d.ts.map +1 -0
  4. package/dist/canonicalTransactions/index.js +19 -0
  5. package/dist/canonicalTransactions/index.js.map +1 -0
  6. package/dist/canonicalTransactions/interfaces/request.interface.d.ts +9 -0
  7. package/dist/canonicalTransactions/interfaces/request.interface.d.ts.map +1 -0
  8. package/dist/canonicalTransactions/interfaces/request.interface.js +3 -0
  9. package/dist/canonicalTransactions/interfaces/request.interface.js.map +1 -0
  10. package/dist/canonicalTransactions/interfaces/response.interface.d.ts +358 -0
  11. package/dist/canonicalTransactions/interfaces/response.interface.d.ts.map +1 -0
  12. package/dist/canonicalTransactions/interfaces/response.interface.js +3 -0
  13. package/dist/canonicalTransactions/interfaces/response.interface.js.map +1 -0
  14. package/dist/currencies/catalog.d.ts +6 -1
  15. package/dist/currencies/catalog.d.ts.map +1 -1
  16. package/dist/currencies/catalog.js +2 -2
  17. package/dist/currencies/catalog.js.map +1 -1
  18. package/dist/currencies/index.d.ts +1 -1
  19. package/dist/currencies/index.d.ts.map +1 -1
  20. package/dist/currencies/utils/currency.utils.d.ts +14 -1
  21. package/dist/currencies/utils/currency.utils.d.ts.map +1 -1
  22. package/dist/currencies/utils/currency.utils.js +14 -1
  23. package/dist/currencies/utils/currency.utils.js.map +1 -1
  24. package/dist/utils/catalog-query.utils.d.ts +24 -0
  25. package/dist/utils/catalog-query.utils.d.ts.map +1 -0
  26. package/dist/utils/catalog-query.utils.js +26 -0
  27. package/dist/utils/catalog-query.utils.js.map +1 -0
  28. package/package.json +5 -1
package/README.md CHANGED
@@ -42,6 +42,7 @@ import { getCountries } from "@cobre-npm/library-portal-core/countries"
42
42
  | `@cobre-npm/library-portal-core/documentTypes` | Document types (definition + per-country applicability) |
43
43
  | `@cobre-npm/library-portal-core/currencies` | Currencies |
44
44
  | `@cobre-npm/library-portal-core/transactions` | Transaction interfaces |
45
+ | `@cobre-npm/library-portal-core/canonicalTransactions` | Canonical transaction/money-movement detail interfaces |
45
46
  | `@cobre-npm/library-portal-core/search` | Search / aggregation interfaces |
46
47
  | `@cobre-npm/library-portal-core/trustedSessions` | Trusted session (OTP elevation window) interfaces |
47
48
  | `@cobre-npm/library-portal-core/lang` | Supported locales (`Locale`, defaults) |
@@ -116,6 +117,15 @@ Every use case comes out of this, without the consumer having to walk internal s
116
117
  > since each record already carries its metadata (`geo`, `type`, etc.), filtering is a trivial `.filter()` on the
117
118
  > consumer side.
118
119
 
120
+ **That is changing, one domain at a time.** Catalogs are growing records that only make sense in one flow
121
+ (`cny`/`eur`, counterparty settlement only) — something the consumer cannot tell from the record alone, so
122
+ "filter it yourself" quietly leaks them into every picker. Domains are gaining a **`queryX()`** that
123
+ returns the list already narrowed, with a safe default.
124
+
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.
128
+
119
129
  ### Two classes of domain
120
130
 
121
131
  | Class | When | Signature | Examples |
@@ -238,15 +248,56 @@ code repeats per country. No single shape covers both cases well.
238
248
  ### `currencies`
239
249
 
240
250
  ```ts
241
- import { getCurrencies, type Currency, type CurrencyType, type CurrencyRecord }
242
- from "@cobre-npm/library-portal-core/currencies"
251
+ import { getCurrencies, queryCurrencies, type Currency, type CurrencyType, type CurrencyRecord,
252
+ type CurrencyScope, type CurrencyQuery } from "@cobre-npm/library-portal-core/currencies"
243
253
 
244
254
  getCurrencies().cop // { code:"cop", label:"COP", isoCode:"COP", geo:"col", flagAsset:"col", minAmount:1, type:"fiat" }
245
- Object.values(getCurrencies()).filter(c => c.type === "fiat") // the consumer filters
255
+ queryCurrencies({ type: "fiat" }) // [ cop, mxn, usd ] → the list a picker needs
246
256
  ```
247
257
 
248
258
  No `lang`: the `label` is fixed (a display code, the same in any language).
249
259
 
260
+ **Which one to use.** `getCurrencies()` is the catalog keyed by code — use it to look a single currency
261
+ up (`getCurrencies()[code]`) or when you genuinely want all of them. `queryCurrencies()` returns a
262
+ **list**, narrowed by the query, and is what a dropdown, table filter or picker should call.
263
+
264
+ #### Query rules
265
+
266
+ ```ts
267
+ queryCurrencies() // cop, mxn, usd, usd_stable, usdt, usdc, copco
268
+ queryCurrencies({ type: "fiat" }) // cop, mxn, usd
269
+ queryCurrencies({ type: ["fiat", "stable"] }) // cop, mxn, usd, usd_stable, copco
270
+ queryCurrencies({ type: "fiat", geo: ["col", "mex"] }) // cop, mxn
271
+ queryCurrencies({ isoCode: "USD" }) // usd, usd_stable, usdt, usdc
272
+ queryCurrencies({ scope: "counterparties" }) // cny, eur
273
+ ```
274
+
275
+ 1. **Any field of the record is queryable**, by equality. **AND across fields, OR within a field**, so
276
+ `{ type: ["fiat","stable"], geo: "col" }` reads as *(fiat or stable) and geo col*. There are no
277
+ operators — for a range or a substring, `.filter()` the result.
278
+ 2. **A key that is present always filters.** What does not filter is the *absence* of the key, so
279
+ `queryCurrencies({})` returns everything while `queryCurrencies({ code: undefined })` returns nothing.
280
+ An optional UI filter therefore has to be spread in conditionally:
281
+
282
+ ```ts
283
+ queryCurrencies({ type: "fiat", ...(country.value ? { geo: country.value } : {}) })
284
+ ```
285
+
286
+ This fails loudly — an empty dropdown — instead of silently returning more rows than intended.
287
+ 3. **`scope` is the one field with a default of its own.** Leave the key out and you get only the
288
+ general-purpose currencies; ask for a scope and you get exactly the ones restricted to it. That is
289
+ what keeps a new picker from inheriting `cny`/`eur`, which exist solely for counterparty settlement.
290
+
291
+ Watch out for two consequences of rule 3:
292
+
293
+ - `queryCurrencies()` and `queryCurrencies({ scope: "counterparties" })` are **disjoint**. For every
294
+ currency a counterparty flow accepts, use `Object.values(getCurrencies())`.
295
+ - `queryCurrencies({ code: "eur" })` returns `[]`, because the scope default drops `eur` before `code`
296
+ is considered. Looking a currency up by code is `getCurrencies().eur`.
297
+
298
+ And two on rule 1: `{ minAmount: 1 }` is equality, not `>=`, which is rarely what you want; and
299
+ `flagAsset`/`label` are presentation details that make poor business criteria.
300
+
250
301
  ### `transactions` / `search` / `trustedSessions`
251
302
 
252
303
  Interfaces only (pure types):
@@ -260,6 +311,31 @@ import type { TrustedSessionStatus } from "@cobre-npm/library-portal-core/truste
260
311
  `TrustedSessionStatus` is the contract of `/trusted-sessions`: the OTP elevation window that lets a
261
312
  caller stop attaching an `otp_token` per request while the window is active.
262
313
 
314
+ ### `canonicalTransactions`
315
+
316
+ Interfaces only (pure types). This is the single source of truth for the canonical money-movement /
317
+ transaction detail — built by `core-portal-bff`'s transaction-canonical BFF, consumed as-is by the
318
+ `portal` MFE (`CanonicalMoneyMovement`), and narrowed with `Pick` by the receipts-generation service:
319
+
320
+ ```ts
321
+ import type {
322
+ ICanonicalTransactionDetail, ICanonicalReceiptRequest,
323
+ ICanonicalParticipant, ICanonicalSummary, ICanonicalAlert, /* ...all sections */
324
+ } from "@cobre-npm/library-portal-core/canonicalTransactions"
325
+ ```
326
+
327
+ - `ICanonicalTransactionDetail` is the full canonical shape (`summary`, `classification`, `participants`,
328
+ `references`, `timeline`, `forex_quote`, `errors`, `allowed_actions`, `approvals`, `balance`,
329
+ `associated_transactions`, `split_information`, `derived`, ...).
330
+ - `ICanonicalReceiptRequest` is the wire contract `core-portal-bff` sends to the receipts-generation
331
+ service (`{ canonical, document_type, resource_id, locale?, timezone? }`).
332
+ - Fields reuse existing catalogs where they represent one (`Currency`, `Country`, `CounterpartyType`,
333
+ `DocumentType`, `MovementStatus`) instead of a loose `string`.
334
+ - This union was assembled by comparing the shape as it existed, slightly diverged, in three
335
+ consumers (`portal`, `core-portal-bff`, `util-portal-receipts`) — see `ICanonicalApprovalEvent`'s
336
+ doc comment for one case that's a superset of two non-overlapping shapes rather than a clean merge,
337
+ and revisit it once the real payload is confirmed.
338
+
263
339
  ---
264
340
 
265
341
  ## i18n / languages
@@ -0,0 +1,3 @@
1
+ export * from "./interfaces/response.interface";
2
+ export * from "./interfaces/request.interface";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/canonicalTransactions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAA;AAC/C,cAAc,gCAAgC,CAAA"}
@@ -0,0 +1,19 @@
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("./interfaces/response.interface"), exports);
18
+ __exportStar(require("./interfaces/request.interface"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/canonicalTransactions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAA+C;AAC/C,iEAA8C"}
@@ -0,0 +1,9 @@
1
+ import type { CanonicalDocumentType, ICanonicalTransactionDetail } from "./response.interface";
2
+ export interface ICanonicalReceiptRequest {
3
+ canonical: ICanonicalTransactionDetail;
4
+ document_type: CanonicalDocumentType;
5
+ resource_id: string;
6
+ locale?: string;
7
+ timezone?: string;
8
+ }
9
+ //# sourceMappingURL=request.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.interface.d.ts","sourceRoot":"","sources":["../../../src/canonicalTransactions/interfaces/request.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAG9F,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,2BAA2B,CAAA;IACtC,aAAa,EAAE,qBAAqB,CAAA;IACpC,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=request.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.interface.js","sourceRoot":"","sources":["../../../src/canonicalTransactions/interfaces/request.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,358 @@
1
+ import type { Country } from "../../countries/base/catalog";
2
+ import type { CounterpartyType } from "../../counterparties/types/catalog";
3
+ import type { Currency } from "../../currencies/catalog";
4
+ import type { DocumentType } from "../../documentTypes/catalog";
5
+ import type { MovementStatus } from "../../movements/status/catalog";
6
+ export type CanonicalDirection = "credit" | "debit";
7
+ export type CanonicalProductType = "payout" | "payin" | "internal_transfer" | "cross_border";
8
+ export type CanonicalNature = "payment" | "collection" | "return" | "fx_conversion";
9
+ export type CanonicalStatusPresentationType = "status-pending" | "info" | "success" | "error" | "neutral" | "warning";
10
+ export type CanonicalAlertType = "danger" | "success" | "warning" | "info";
11
+ export type CanonicalAlertActionType = "open_drawer" | "copy_to_clipboard";
12
+ export type CanonicalApprovalDecision = "approved" | "denied" | "pending_approval";
13
+ export type CanonicalSourceEndpoint = "money_movements" | "transactions";
14
+ export type CanonicalErrorCode = "CAN001";
15
+ export type CanonicalEntityType = "account" | "counterparty";
16
+ export type CanonicalDocumentType = "order" | "receipt";
17
+ export interface ICanonicalAlertAction {
18
+ type: CanonicalAlertActionType;
19
+ target?: string;
20
+ }
21
+ export interface ICanonicalAlert {
22
+ id: string;
23
+ type: CanonicalAlertType;
24
+ title: string;
25
+ description: string;
26
+ priority: number;
27
+ action: ICanonicalAlertAction | null;
28
+ }
29
+ export interface ICanonicalStatus {
30
+ state: MovementStatus;
31
+ code: string | null;
32
+ description: string | null;
33
+ display_label: string;
34
+ }
35
+ export interface ICanonicalSummary {
36
+ amount: number | null;
37
+ currency: Currency | null;
38
+ direction: CanonicalDirection;
39
+ status: ICanonicalStatus;
40
+ created_at: string;
41
+ updated_at: string;
42
+ is_part_of_batch: boolean;
43
+ user_already_voted: boolean;
44
+ split_payment: string | null;
45
+ alerts: ICanonicalAlert[];
46
+ }
47
+ export interface ICanonicalGeo {
48
+ origin_country: Country | null;
49
+ destination_country: Country | null;
50
+ }
51
+ export interface ICanonicalClassification {
52
+ rail: string;
53
+ label: string;
54
+ product_type: CanonicalProductType;
55
+ nature: CanonicalNature;
56
+ category: string | null;
57
+ geo: ICanonicalGeo;
58
+ alerts: ICanonicalAlert[];
59
+ }
60
+ export interface ICanonicalParticipantConnectivity {
61
+ status: string | null;
62
+ description: string | null;
63
+ }
64
+ export interface ICanonicalCounterpartyAddress {
65
+ country: Country | null;
66
+ city: string | null;
67
+ state: string | null;
68
+ street_line1: string | null;
69
+ street_line2: string | null;
70
+ postal_code: string | null;
71
+ }
72
+ export interface ICanonicalBeneficiary {
73
+ account_number: string | null;
74
+ account_type: CounterpartyType | null;
75
+ identification_number: string | null;
76
+ identification_type: DocumentType | null;
77
+ bank_code: string | null;
78
+ bank_name: string | null;
79
+ key_value: string | null;
80
+ wallet_address: string | null;
81
+ chain: string | null;
82
+ token: string | null;
83
+ }
84
+ export interface ICanonicalOrderingInstrument {
85
+ value: string | null;
86
+ error_code: CanonicalErrorCode | null;
87
+ }
88
+ export interface ICanonicalParticipant {
89
+ entity_type: CanonicalEntityType;
90
+ id: string;
91
+ display_name: string | null;
92
+ account_number: string | null;
93
+ account_type: CounterpartyType | null;
94
+ provider_id: string | null;
95
+ provider_name: string | null;
96
+ alias: string | null;
97
+ geo: Country | null;
98
+ currency: Currency | null;
99
+ account_holder_name: string | null;
100
+ account_holder_id_number: string | null;
101
+ account_holder_id_type: string | null;
102
+ obtained_balance: number | null;
103
+ obtained_balance_at: string | null;
104
+ connectivity: ICanonicalParticipantConnectivity | null;
105
+ beneficiary_institution: string | null;
106
+ counterparty_full_name: string | null;
107
+ counterparty_id_number: string | null;
108
+ counterparty_id_type: string | null;
109
+ counterparty_email: string | null;
110
+ counterparty_phone: string | null;
111
+ key_value: string | null;
112
+ key_type: string | null;
113
+ card_number: string | null;
114
+ cobre_tag: string | null;
115
+ counterparty_wallet_address: string | null;
116
+ counterparty_address: ICanonicalCounterpartyAddress | null;
117
+ payment_code: string | null;
118
+ bank_country: Country | null;
119
+ rail: string | null;
120
+ chain: string | null;
121
+ token: string | null;
122
+ beneficiary?: ICanonicalBeneficiary | null;
123
+ payer?: ICanonicalBeneficiary | null;
124
+ ordering_instrument?: ICanonicalOrderingInstrument | null;
125
+ }
126
+ export interface ICanonicalParticipants {
127
+ source: ICanonicalParticipant | null;
128
+ destination: ICanonicalParticipant | null;
129
+ }
130
+ export interface ICanonicalCheckout {
131
+ id: string | null;
132
+ active: boolean | null;
133
+ checkout_item: string | null;
134
+ checkout_url: string | null;
135
+ redirect_url: string | null;
136
+ amount: number | null;
137
+ valid_until: string | null;
138
+ money_movement_intent_limit: number | null;
139
+ money_movement_created: number | null;
140
+ checkout_rails: string[] | null;
141
+ description_to_payee: string | null;
142
+ source_id: string | null;
143
+ destination_id: string | null;
144
+ updated_at: string | null;
145
+ }
146
+ export interface ICanonicalReferences {
147
+ external_id: string | null;
148
+ tracking_key: string | null;
149
+ reference: string | null;
150
+ cep_url: string | null;
151
+ description: string | null;
152
+ mm_approval_id: string | null;
153
+ batch_id: string | null;
154
+ batch_filename: string | null;
155
+ forex_quote_id: string | null;
156
+ creator: string | null;
157
+ checker_approval: boolean;
158
+ key_value: string | null;
159
+ destination_key: string | null;
160
+ virtual_account: string | null;
161
+ payment_valid_until: string | null;
162
+ associated_id: string[] | null;
163
+ r2p_rail: string | null;
164
+ r2p_methods: string[] | null;
165
+ key_config: string | null;
166
+ qr_value: string | null;
167
+ payment_link: string | null;
168
+ redirect_url: string | null;
169
+ ticket_id: string | null;
170
+ financial_institution_code: string | null;
171
+ registration_description: string | null;
172
+ description_to_payer: string | null;
173
+ description_to_payee: string | null;
174
+ description_to_beneficiary_account: string | null;
175
+ pse_bank_code: string | null;
176
+ internal_tracking_key: string | null;
177
+ destination_description: string | null;
178
+ account_reference: string | null;
179
+ alerts: ICanonicalAlert[];
180
+ checkout: ICanonicalCheckout | null;
181
+ }
182
+ export interface ICanonicalTimelineMovement {
183
+ id: string | null;
184
+ type: string;
185
+ type_display: string;
186
+ amount: number;
187
+ direction: CanonicalDirection;
188
+ account_id: string;
189
+ transaction_date: string | null;
190
+ operation_date: string | null;
191
+ created_date: string | null;
192
+ status: MovementStatus;
193
+ status_type: CanonicalStatusPresentationType;
194
+ status_icon: string | null;
195
+ status_label: string;
196
+ status_message: string;
197
+ status_description: string | null;
198
+ previous_balance: number | null;
199
+ current_balance: number | null;
200
+ bank_statement_id: string | null;
201
+ bank_transaction_type: string | null;
202
+ category_code: string | null;
203
+ origin_account_provider_id: string | null;
204
+ account_reference: string | null;
205
+ }
206
+ export interface ICanonicalApprovalEvent {
207
+ id?: string;
208
+ type?: string;
209
+ status?: string;
210
+ status_label?: string;
211
+ occurred_at?: string;
212
+ email?: string;
213
+ decision?: CanonicalApprovalDecision;
214
+ comment?: string;
215
+ decision_at?: string;
216
+ }
217
+ export interface ICanonicalTimeline {
218
+ movements: ICanonicalTimelineMovement[];
219
+ approval_events: ICanonicalApprovalEvent[];
220
+ alerts: ICanonicalAlert[];
221
+ }
222
+ export interface ICanonicalQuoteTier {
223
+ tier: number | null;
224
+ source_amount: number | null;
225
+ destination_amount: number | null;
226
+ spread: number | null;
227
+ fx_rate: number | null;
228
+ valid_until_tier: string | null;
229
+ }
230
+ export interface ICanonicalPenalizationTier {
231
+ source_amount: number | null;
232
+ destination_amount: number | null;
233
+ spread: number | null;
234
+ fx_rate: number | null;
235
+ }
236
+ export interface ICanonicalRollingQuoteDetails {
237
+ quote_tiers: ICanonicalQuoteTier[];
238
+ penalization_tier: ICanonicalPenalizationTier | null;
239
+ }
240
+ export interface ICanonicalFeesBreakdown {
241
+ spread: number;
242
+ }
243
+ export interface ICanonicalForexQuote {
244
+ forex_quote_id: string | null;
245
+ source_currency: Currency | null;
246
+ target_currency: Currency | null;
247
+ fx_rate: number | null;
248
+ inverse_fx_rate: number | null;
249
+ source_amount: number | null;
250
+ destination_amount: number | null;
251
+ valid_until: string | null;
252
+ created_at: string | null;
253
+ tier_applied: string | null;
254
+ fees_breakdown: ICanonicalFeesBreakdown | null;
255
+ off_market: boolean;
256
+ type: "rolling_quote" | "static_quote" | null;
257
+ quota_limit: number | null;
258
+ remaining_quota: number | null;
259
+ rolling_quote_details: ICanonicalRollingQuoteDetails | null;
260
+ alerts: ICanonicalAlert[];
261
+ }
262
+ export interface ICanonicalErrors {
263
+ code: string | null;
264
+ message: string | null;
265
+ category: string;
266
+ bank_rejection_code: string | null;
267
+ bank_transaction_type: string | null;
268
+ }
269
+ export interface ICanonicalAllowedActions {
270
+ can_export_receipt: boolean;
271
+ can_approve: boolean;
272
+ can_decline: boolean;
273
+ can_return: boolean;
274
+ can_view_batch: boolean;
275
+ }
276
+ export interface ICanonicalApprovals {
277
+ mm_approval_id: string | null;
278
+ minimum_approvers: number | null;
279
+ minimum_deniers: number | null;
280
+ approvers_count: number;
281
+ deniers_count: number;
282
+ }
283
+ export interface ICanonicalBalance {
284
+ previous: number | null;
285
+ delta: number;
286
+ final: number | null;
287
+ currency: Currency | null;
288
+ account_id: string | null;
289
+ alerts: ICanonicalAlert[];
290
+ }
291
+ export interface ICanonicalAssociatedTransactionItem {
292
+ id: string | null;
293
+ type: string;
294
+ type_display: string;
295
+ status: Pick<ICanonicalStatus, "state" | "display_label">;
296
+ direction: CanonicalDirection;
297
+ amount: number;
298
+ currency: Currency | null;
299
+ counterparty_name: string | null;
300
+ occurred_at: string | null;
301
+ bank_statement_id: string | null;
302
+ operation_date: string | null;
303
+ bank_transaction_type: string | null;
304
+ bank_rejection_code: string | null;
305
+ }
306
+ export interface ICanonicalAssociatedTransactions {
307
+ items: ICanonicalAssociatedTransactionItem[];
308
+ total_count: number;
309
+ total_amount: number | null;
310
+ alerts: ICanonicalAlert[];
311
+ }
312
+ export interface ICanonicalSplitStatus {
313
+ state: MovementStatus | null;
314
+ code: string | null;
315
+ description: string | null;
316
+ }
317
+ export interface ICanonicalSplitContentItem {
318
+ id: string | null;
319
+ amount: number | null;
320
+ currency: Currency | null;
321
+ status: ICanonicalSplitStatus;
322
+ created_at: string | null;
323
+ }
324
+ export interface ICanonicalSplitInformation {
325
+ split_id: string;
326
+ total_items: number;
327
+ contents: ICanonicalSplitContentItem[];
328
+ }
329
+ export interface ICanonicalDerived {
330
+ source_endpoint: CanonicalSourceEndpoint;
331
+ origin_mm_id: string | null;
332
+ is_reconciliation_adjustment: boolean;
333
+ adjustment_type: string | null;
334
+ adjustment_reason: string | null;
335
+ applied_at: string | null;
336
+ origin_id: string | null;
337
+ origin_display: string | null;
338
+ }
339
+ export interface ICanonicalTransactionDetail {
340
+ id: string;
341
+ canonical_version: string;
342
+ degraded: boolean;
343
+ degraded_sources: string[];
344
+ summary: ICanonicalSummary;
345
+ classification: ICanonicalClassification;
346
+ participants: ICanonicalParticipants;
347
+ references: ICanonicalReferences;
348
+ timeline: ICanonicalTimeline;
349
+ forex_quote: ICanonicalForexQuote | null;
350
+ errors: ICanonicalErrors | null;
351
+ allowed_actions: ICanonicalAllowedActions;
352
+ approvals: ICanonicalApprovals | null;
353
+ balance: ICanonicalBalance | null;
354
+ associated_transactions: ICanonicalAssociatedTransactions | null;
355
+ split_information: ICanonicalSplitInformation | null;
356
+ derived: ICanonicalDerived;
357
+ }
358
+ //# sourceMappingURL=response.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.interface.d.ts","sourceRoot":"","sources":["../../../src/canonicalTransactions/interfaces/response.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,OAAO,CAAA;AACnD,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,OAAO,GAAG,mBAAmB,GAAG,cAAc,CAAA;AAC5F,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,YAAY,GAAG,QAAQ,GAAG,eAAe,CAAA;AACnF,MAAM,MAAM,+BAA+B,GAAG,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;AACrH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAA;AAC1E,MAAM,MAAM,wBAAwB,GAAG,aAAa,GAAG,mBAAmB,CAAA;AAC1E,MAAM,MAAM,yBAAyB,GAAG,UAAU,GAAG,QAAQ,GAAG,kBAAkB,CAAA;AAClF,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG,cAAc,CAAA;AACxE,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAA;AACzC,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,cAAc,CAAA;AAC5D,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,SAAS,CAAA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
+ {"version":3,"file":"response.interface.js","sourceRoot":"","sources":["../../../src/canonicalTransactions/interfaces/response.interface.ts"],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
+ export type CurrencyScope = "counterparties";
1
2
  export declare const CURRENCIES: {
2
3
  readonly cop: {
3
4
  readonly code: "cop";
@@ -70,6 +71,7 @@ export declare const CURRENCIES: {
70
71
  readonly flagAsset: "chn";
71
72
  readonly minAmount: 100;
72
73
  readonly type: "fiat";
74
+ readonly scope: "counterparties";
73
75
  };
74
76
  readonly eur: {
75
77
  readonly code: "eur";
@@ -79,9 +81,12 @@ export declare const CURRENCIES: {
79
81
  readonly flagAsset: "eur";
80
82
  readonly minAmount: 100;
81
83
  readonly type: "fiat";
84
+ readonly scope: "counterparties";
82
85
  };
83
86
  };
84
87
  export type Currency = keyof typeof CURRENCIES;
85
88
  export type CurrencyType = (typeof CURRENCIES)[Currency]["type"];
86
- export type CurrencyRecord = (typeof CURRENCIES)[Currency];
89
+ export type CurrencyRecord = (typeof CURRENCIES)[Currency] & {
90
+ readonly scope?: CurrencyScope;
91
+ };
87
92
  //# sourceMappingURL=catalog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/currencies/catalog.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBrB,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,UAAU,CAAA;AAC9C,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAChE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAA"}
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/currencies/catalog.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAA;AAE5C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBrB,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,UAAU,CAAA;AAC9C,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAMhE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,QAAQ,CAAC,GAAG;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAAE,CAAA"}
@@ -9,7 +9,7 @@ exports.CURRENCIES = {
9
9
  usdt: { code: "usdt", label: "USD (USDT)", isoCode: "USD", geo: "usa", flagAsset: "usdt", minAmount: 1, type: "stablecoin" },
10
10
  usdc: { code: "usdc", label: "USD (USDC)", isoCode: "USD", geo: "usa", flagAsset: "usdc", minAmount: 1, type: "stablecoin" },
11
11
  copco: { code: "copco", label: "COPco", isoCode: "COP", geo: "col", flagAsset: "cop_stable", minAmount: 1, type: "stable" },
12
- cny: { code: "cny", label: "CNY", isoCode: "CNY", geo: "chn", flagAsset: "chn", minAmount: 100, type: "fiat" },
13
- eur: { code: "eur", label: "EUR", isoCode: "EUR", geo: "eur", flagAsset: "eur", minAmount: 100, type: "fiat" },
12
+ cny: { code: "cny", label: "CNY", isoCode: "CNY", geo: "chn", flagAsset: "chn", minAmount: 100, type: "fiat", scope: "counterparties" },
13
+ eur: { code: "eur", label: "EUR", isoCode: "EUR", geo: "eur", flagAsset: "eur", minAmount: 100, type: "fiat", scope: "counterparties" },
14
14
  };
15
15
  //# sourceMappingURL=catalog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/currencies/catalog.ts"],"names":[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BAAgB,EAAE;CAU7K,CAAA"}
@@ -1,3 +1,3 @@
1
- export type { Currency, CurrencyType, CurrencyRecord } from "./catalog";
1
+ export type { Currency, CurrencyType, CurrencyRecord, CurrencyScope } from "./catalog";
2
2
  export * from "./utils/currency.utils";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/currencies/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEvE,cAAc,wBAAwB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/currencies/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAEtF,cAAc,wBAAwB,CAAA"}
@@ -1,3 +1,16 @@
1
- import type { Currency, CurrencyRecord } from "../catalog";
1
+ import type { Currency, CurrencyRecord, CurrencyScope } from "../catalog";
2
+ import type { CatalogQuery } from "../../utils/catalog-query.utils";
2
3
  export declare const getCurrencies: () => Record<Currency, CurrencyRecord>;
4
+ /** Every field of the record is queryable. `scope` is listed apart because it is the one with a default. */
5
+ export type CurrencyQuery = CatalogQuery<Omit<CurrencyRecord, "scope">> & {
6
+ scope?: CurrencyScope | readonly CurrencyScope[];
7
+ };
8
+ /**
9
+ * The catalog as a list, narrowed by the query — see `matchesQuery` for the matching rules.
10
+ *
11
+ * `scope` is the one field with a default: leave the key out and only general-purpose currencies come
12
+ * back, so a picker never inherits the counterparty-only ones by accident. That is also why
13
+ * `{ code: "eur" }` returns nothing — looking a currency up by code is `getCurrencies()[code]`.
14
+ */
15
+ export declare const queryCurrencies: (query?: CurrencyQuery) => CurrencyRecord[];
3
16
  //# sourceMappingURL=currency.utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"currency.utils.d.ts","sourceRoot":"","sources":["../../../src/currencies/utils/currency.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAI1D,eAAO,MAAM,aAAa,QAAO,MAAM,CAAC,QAAQ,EAAE,cAAc,CAAe,CAAA"}
1
+ {"version":3,"file":"currency.utils.d.ts","sourceRoot":"","sources":["../../../src/currencies/utils/currency.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAInE,eAAO,MAAM,aAAa,QAAO,MAAM,CAAC,QAAQ,EAAE,cAAc,CAAe,CAAA;AAE/E,4GAA4G;AAC5G,MAAM,MAAM,aAAa,GACrB,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,GAC3C;IAAE,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,aAAa,EAAE,CAAA;CAAE,CAAA;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,QAAO,aAAkB,KAAG,cAAc,EAIzE,CAAA"}
@@ -1,9 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCurrencies = void 0;
3
+ exports.queryCurrencies = exports.getCurrencies = void 0;
4
4
  const catalog_1 = require("../catalog");
5
+ const catalog_query_utils_1 = require("../../utils/catalog-query.utils");
5
6
  // The currency catalog indexed by code. Label is already inline, so no lang is needed.
6
7
  // Access by code directly, or Object.values for a list.
7
8
  const getCurrencies = () => catalog_1.CURRENCIES;
8
9
  exports.getCurrencies = getCurrencies;
10
+ /**
11
+ * The catalog as a list, narrowed by the query — see `matchesQuery` for the matching rules.
12
+ *
13
+ * `scope` is the one field with a default: leave the key out and only general-purpose currencies come
14
+ * back, so a picker never inherits the counterparty-only ones by accident. That is also why
15
+ * `{ code: "eur" }` returns nothing — looking a currency up by code is `getCurrencies()[code]`.
16
+ */
17
+ const queryCurrencies = (query = {}) => {
18
+ const withScopeDefault = "scope" in query ? query : { ...query, scope: undefined };
19
+ return Object.values(catalog_1.CURRENCIES).filter(currency => (0, catalog_query_utils_1.matchesQuery)(currency, withScopeDefault));
20
+ };
21
+ exports.queryCurrencies = queryCurrencies;
9
22
  //# sourceMappingURL=currency.utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"currency.utils.js","sourceRoot":"","sources":["../../../src/currencies/utils/currency.utils.ts"],"names":[],"mappings":";;;AAAA,wCAAuC;AAGvC,uFAAuF;AACvF,wDAAwD;AACjD,MAAM,aAAa,GAAG,GAAqC,EAAE,CAAC,oBAAU,CAAA;AAAlE,QAAA,aAAa,iBAAqD"}
1
+ {"version":3,"file":"currency.utils.js","sourceRoot":"","sources":["../../../src/currencies/utils/currency.utils.ts"],"names":[],"mappings":";;;AAAA,wCAAuC;AAEvC,yEAA8D;AAG9D,uFAAuF;AACvF,wDAAwD;AACjD,MAAM,aAAa,GAAG,GAAqC,EAAE,CAAC,oBAAU,CAAA;AAAlE,QAAA,aAAa,iBAAqD;AAO/E;;;;;;GAMG;AACI,MAAM,eAAe,GAAG,CAAC,QAAuB,EAAE,EAAoB,EAAE;IAC7E,MAAM,gBAAgB,GAAG,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA;IAElF,OAAO,MAAM,CAAC,MAAM,CAAC,oBAAU,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAA,kCAAY,EAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAA;AAC/F,CAAC,CAAA;AAJY,QAAA,eAAe,mBAI3B"}
@@ -0,0 +1,24 @@
1
+ type ReservedKey = "lang";
2
+ /**
3
+ * The query shape for a catalog record: every field optional, each accepting one value or a list of them.
4
+ * A field typed as an array in the record accepts its item type, so `{ geo: "col" }` works whether `geo`
5
+ * is a `Country` or a `Country[]`.
6
+ */
7
+ export type CatalogQuery<TRecord> = {
8
+ [K in Exclude<keyof TRecord, ReservedKey>]?: TRecord[K] extends readonly (infer TItem)[] ? TItem | readonly TItem[] : TRecord[K] | readonly TRecord[K][];
9
+ };
10
+ /**
11
+ * A single value or a list of them, normalized to a list. `undefined` becomes `[undefined]`, which is what
12
+ * makes a present-but-empty key filter instead of being ignored.
13
+ */
14
+ export declare const asList: <T>(value: T | readonly T[]) => readonly T[];
15
+ /**
16
+ * Whether a record satisfies a query: AND across fields, OR within a field, equality only — no operators.
17
+ *
18
+ * A key that is present always filters; what does not filter is the absence of the key. So `{}` matches
19
+ * everything while `{ code: undefined }` matches nothing, and an optional UI filter has to be spread in
20
+ * conditionally rather than passed as `undefined`.
21
+ */
22
+ export declare const matchesQuery: (record: object, query: object) => boolean;
23
+ export {};
24
+ //# sourceMappingURL=catalog-query.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-query.utils.d.ts","sourceRoot":"","sources":["../../src/utils/catalog-query.utils.ts"],"names":[],"mappings":"AAUA,KAAK,WAAW,GAAG,MAAM,CAAA;AAEzB;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,OAAO,IAAI;KACjC,CAAC,IAAI,OAAO,CAAC,MAAM,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,EACzC,OAAO,CAAC,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,GACvC,KAAK,GAAG,SAAS,KAAK,EAAE,GACxB,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE;CACzC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,EAAE,KAAG,SAAS,CAAC,EACjB,CAAA;AAM7C;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,OAEe,CAAA"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /*
3
+ Domain-agnostic matcher shared by every queryX() in the library. It lives here, and not inside a domain,
4
+ because more catalogs are getting a query API shortly and writing the same matcher four times guarantees
5
+ the semantics drift apart.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.matchesQuery = exports.asList = void 0;
9
+ /**
10
+ * A single value or a list of them, normalized to a list. `undefined` becomes `[undefined]`, which is what
11
+ * makes a present-but-empty key filter instead of being ignored.
12
+ */
13
+ const asList = (value) => Array.isArray(value) ? value : [value];
14
+ exports.asList = asList;
15
+ /* A scalar field matches by equality; an array field matches when it contains any of the wanted values. */
16
+ const matchesField = (actual, wanted) => Array.isArray(actual) ? actual.some(item => wanted.includes(item)) : wanted.includes(actual);
17
+ /**
18
+ * Whether a record satisfies a query: AND across fields, OR within a field, equality only — no operators.
19
+ *
20
+ * A key that is present always filters; what does not filter is the absence of the key. So `{}` matches
21
+ * everything while `{ code: undefined }` matches nothing, and an optional UI filter has to be spread in
22
+ * conditionally rather than passed as `undefined`.
23
+ */
24
+ const matchesQuery = (record, query) => Object.entries(query).every(([field, value]) => matchesField(record[field], (0, exports.asList)(value)));
25
+ exports.matchesQuery = matchesQuery;
26
+ //# sourceMappingURL=catalog-query.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-query.utils.js","sourceRoot":"","sources":["../../src/utils/catalog-query.utils.ts"],"names":[],"mappings":";AAAA;;;;EAIE;;;AAoBF;;;GAGG;AACI,MAAM,MAAM,GAAG,CAAI,KAAuB,EAAgB,EAAE,CACjE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAU,CAAC,CAAA;AADhC,QAAA,MAAM,UAC0B;AAE7C,2GAA2G;AAC3G,MAAM,YAAY,GAAG,CAAC,MAAe,EAAE,MAA0B,EAAW,EAAE,CAC5E,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AAE9F;;;;;;GAMG;AACI,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,KAAa,EAAW,EAAE,CACrE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAC7C,YAAY,CAAE,MAAkC,CAAC,KAAK,CAAC,EAAE,IAAA,cAAM,EAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAF/D,QAAA,YAAY,gBAEmD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cobre-npm/library-portal-core",
3
- "version": "0.26.3",
3
+ "version": "0.28.0",
4
4
  "description": "Shared configurations and resources for Portal MFEs",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -37,6 +37,10 @@
37
37
  "types": "./dist/transactions/index.d.ts",
38
38
  "default": "./dist/transactions/index.js"
39
39
  },
40
+ "./canonicalTransactions": {
41
+ "types": "./dist/canonicalTransactions/index.d.ts",
42
+ "default": "./dist/canonicalTransactions/index.js"
43
+ },
40
44
  "./search": {
41
45
  "types": "./dist/search/index.d.ts",
42
46
  "default": "./dist/search/index.js"