@cobre-npm/library-portal-core 0.60.0 → 0.62.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
@@ -387,6 +387,17 @@ the geo-flattened, unlabeled rows first and only attaches `label` to what matche
387
387
  never accepts `label` as a filter — unlike the other two `XQuery` types, this is enforced at the type level,
388
388
  not just by convention.
389
389
 
390
+ Usages and validation types are exposed as **types only**, no runtime constant: write the literal and the
391
+ union checks it (autocomplete included, a typo doesn't compile). That replaces the deprecated root's
392
+ `DocumentTypeUsages.Business` / `DocumentTypeValidationTypes.Numeric`:
393
+
394
+ ```ts
395
+ import type { DocumentTypeUsage, DocumentTypeValidationType } from "@cobre-npm/library-portal-core/documentTypes"
396
+
397
+ queryDocumentTypes({ lang, usage: "business" })
398
+ if (record.type === "numeric") { … }
399
+ ```
400
+
390
401
  ### `currencies`
391
402
 
392
403
  ```ts
@@ -677,6 +688,8 @@ import {
677
688
  so whoever reads the catalog fills it in and the column's type keeps one source of truth.
678
689
  - `ExportQuerySort` uses `field`; `ExportQueryFilter` uses `column` — not a typo, the engine's own DTOs
679
690
  name the two differently.
691
+ - `field_date` is optional: the column id that `start_date` /
692
+ `end_date` filter on (`"transaction_date"`, `"movement_date"`, `"created_at"`, …).
680
693
  - `column_aggregations` is a required `boolean` (apply aggregations or don't), not a per-column map — the
681
694
  catalog's `aggregation: "sum"` markers describe what *can* be aggregated, not the request shape.
682
695
  - `language` is deliberately typed `string`, not `Locale`: the engine validates it against
@@ -696,15 +709,18 @@ import {
696
709
  type FinancialInstitutionOption, type FinancialInstitutionQuery,
697
710
  } from "@cobre-npm/library-portal-core/financialInstitutions"
698
711
 
699
- getFinancialInstitutions("en").pr_col_1007 // { code: "pr_col_1007", geo: "col", label: "Bancolombia" }
712
+ getFinancialInstitutions("en").pr_col_1007 // { code: "pr_col_1007", rawCode: "1007", geo: "col", label: "Bancolombia" }
700
713
  queryFinancialInstitutions({ lang: "en", geo: "col" }) // FinancialInstitutionOption[] → every COL institution
701
714
  ```
702
715
 
703
- - **institutions** (i18n): `getFinancialInstitutions(lang)`; each record carries `code`, `geo`
704
- (`"col" | "mex"`) and `label`. One code per financial institution — a bank's code already encodes its
705
- country (`pr_col_*` / `pr_mex_*`), so there is no repeat-by-geo the way `accounts/types` needs one.
716
+ - **institutions** (i18n): `getFinancialInstitutions(lang)`; each record carries `code`, `rawCode`, `geo`
717
+ (`"col" | "mex"`) and `label`. The catalog is **keyed by `code`** (`pr_col_1007`, `pr_mex_40072`): that is
718
+ the `FinancialInstitution` union, the key into the locale files and the value the APIs and logos use.
719
+ `rawCode` is the bare bank code (`"1007"`), unique only within a `geo`; `code` is always
720
+ `pr_<geo>_<rawCode>` (a test enforces it). One entry per financial institution, so there is no
721
+ repeat-by-geo the way `accounts/types` needs one.
706
722
  - `queryFinancialInstitutions({ lang, ... })` returns the same catalog as a **list**, narrowed by
707
- `code`/`geo` — same matching rules as [`queryAccountStatuses`](#accounts): `lang` is required (i18n
723
+ `code`/`rawCode`/`geo` — same matching rules as [`queryAccountStatuses`](#accounts): `lang` is required (i18n
708
724
  domain, no default) and lives inside the query object, and **a key that is present always filters** —
709
725
  `queryFinancialInstitutions({ lang: "en" })` returns everything, `queryFinancialInstitutions({ lang:
710
726
  "en", geo: "col" })` returns only Colombia's institutions.
@@ -6,6 +6,7 @@ export interface ExportQueryConfig {
6
6
  timezone: string;
7
7
  start_date: string;
8
8
  end_date: string;
9
+ field_date?: string;
9
10
  columns: string[];
10
11
  column_aggregations: boolean;
11
12
  query_filters?: ExportQueryFilter[];