@fiado/type-kit 3.493.0 → 3.494.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.
@@ -0,0 +1,75 @@
1
+ import type {
2
+ RemittanceMonthlySection,
3
+ RemittanceOrphanRow,
4
+ RemittancePoolBalanceSection,
5
+ RemittanceSnapshotSection,
6
+ RemittanceUnitellerSnapshot,
7
+ } from "../../../src/remittance/dtos/RemittanceUnitellerSnapshot";
8
+
9
+ // Interfaces TypeScript puros sin class-validator — el valor del test es:
10
+ // (a) compile-time check de que la shape es la esperada (si cambia, falla build)
11
+ // (b) fixture canonico que docs el shape para consumers (fiado-dashboard).
12
+ // Si el consolidator server-side produce algo que no matchea esto, falla el type-check en el dashboard.
13
+
14
+ describe("RemittanceUnitellerSnapshot shape", () => {
15
+ const emptySection: RemittanceSnapshotSection = {
16
+ ok: 0, soloFiado: 0, soloUniteller: 0,
17
+ diffMonto: 0, diffFx: 0, diffCost: 0, diffRate: 0,
18
+ totalMontoUsd: 0,
19
+ };
20
+
21
+ const poolBalance: RemittancePoolBalanceSection = {
22
+ balanceUsd: 125428.75,
23
+ reportedBalanceUsd: 125430.5,
24
+ diffUsd: -1.75,
25
+ asOf: "2026-10-02",
26
+ staleness: "FRESH",
27
+ };
28
+
29
+ const orphan: RemittanceOrphanRow = {
30
+ txIdentifier: "5649809531",
31
+ statementDate: "2026-10-02",
32
+ reportType: "TX_DETAILS",
33
+ amountUsd: 500,
34
+ processingFee: 3,
35
+ };
36
+
37
+ const monthlySection: RemittanceMonthlySection = {
38
+ envios: emptySection,
39
+ cancels: emptySection,
40
+ itemsUrl: "https://admin-dashboard.fiado.online/conciliacion/pago-confiado/uniteller?mes=2026-10",
41
+ };
42
+
43
+ const snapshot: RemittanceUnitellerSnapshot = {
44
+ calculatedAt: "2026-10-02T19:00:00.000Z",
45
+ envios: emptySection,
46
+ cancels: emptySection,
47
+ poolBalance,
48
+ orphans: [orphan],
49
+ byMonth: { "2026-10": monthlySection },
50
+ };
51
+
52
+ it("estructura canonica con todos los campos required", () => {
53
+ expect(snapshot.calculatedAt).toMatch(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/);
54
+ expect(snapshot.envios).toBe(emptySection);
55
+ expect(snapshot.cancels).toBe(emptySection);
56
+ expect(snapshot.poolBalance).toBe(poolBalance);
57
+ expect(snapshot.orphans).toHaveLength(1);
58
+ expect(snapshot.byMonth["2026-10"]).toBe(monthlySection);
59
+ });
60
+
61
+ it("itemsUrl es opcional en RemittanceMonthlySection", () => {
62
+ const withoutUrl: RemittanceMonthlySection = { envios: emptySection, cancels: emptySection };
63
+ expect(withoutUrl.itemsUrl).toBeUndefined();
64
+ });
65
+
66
+ it("staleness acepta los 3 valores del union", () => {
67
+ const states: Array<RemittancePoolBalanceSection["staleness"]> = ["FRESH", "STALE", "MISSING"];
68
+ expect(states).toEqual(["FRESH", "STALE", "MISSING"]);
69
+ });
70
+
71
+ it("reportType acepta los 3 valores del union", () => {
72
+ const types: Array<RemittanceOrphanRow["reportType"]> = ["TX_DETAILS", "CANCEL_TX", "VOID_TX"];
73
+ expect(types).toEqual(["TX_DETAILS", "CANCEL_TX", "VOID_TX"]);
74
+ });
75
+ });
@@ -1,6 +1,7 @@
1
1
  import { CollectionResultStatus } from '../../../collection/enums/CollectionResultStatus';
2
2
  import { MechanismType } from '../../../collection/enums/MechanismType';
3
3
  import { CurrencyId } from '../../../currency/enums/CurrencyId';
4
+ import { LoanChargeKindEnum } from '../../enums/LoanChargeKindEnum';
4
5
  /** Un pago del historial de un crédito, tal como lo asentó el motor de cobro en `LoanPayment_GT`. */
5
6
  export interface LoanPaymentListItem {
6
7
  paymentId: string;
@@ -24,6 +25,10 @@ export interface LoanPaymentListItem {
24
25
  appliedInterestCents?: number;
25
26
  /** IVA del interés que abonó este pago. Ausente en pagos anteriores al desglose (I1). */
26
27
  appliedIvaCents?: number;
28
+ /** Qué cobró el pago: cuota, abono a capital, adelanto, liquidación o recuperación. Ausente en pagos viejos. */
29
+ chargeKind?: LoanChargeKindEnum;
30
+ /** Saldo de capital del crédito después de este pago. Ausente en pagos viejos. */
31
+ creditPrincipalBalanceAfterCents?: number;
27
32
  }
28
33
  /** Página del historial. El fin lo marca la AUSENCIA de `nextToken`, nunca una página corta. */
29
34
  export interface LoanPaymentListResponse {
@@ -0,0 +1,37 @@
1
+ export interface RemittanceSnapshotSection {
2
+ ok: number;
3
+ soloFiado: number;
4
+ soloUniteller: number;
5
+ diffMonto: number;
6
+ diffFx: number;
7
+ diffCost: number;
8
+ diffRate: number;
9
+ totalMontoUsd: number;
10
+ }
11
+ export interface RemittancePoolBalanceSection {
12
+ balanceUsd: number;
13
+ reportedBalanceUsd: number;
14
+ diffUsd: number;
15
+ asOf: string;
16
+ staleness: "FRESH" | "STALE" | "MISSING";
17
+ }
18
+ export interface RemittanceOrphanRow {
19
+ txIdentifier: string;
20
+ statementDate: string;
21
+ reportType: "TX_DETAILS" | "CANCEL_TX" | "VOID_TX";
22
+ amountUsd: number;
23
+ processingFee: number;
24
+ }
25
+ export interface RemittanceMonthlySection {
26
+ envios: RemittanceSnapshotSection;
27
+ cancels: RemittanceSnapshotSection;
28
+ itemsUrl?: string;
29
+ }
30
+ export interface RemittanceUnitellerSnapshot {
31
+ calculatedAt: string;
32
+ envios: RemittanceSnapshotSection;
33
+ cancels: RemittanceSnapshotSection;
34
+ poolBalance: RemittancePoolBalanceSection;
35
+ orphans: RemittanceOrphanRow[];
36
+ byMonth: Record<string, RemittanceMonthlySection>;
37
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -53,3 +53,4 @@ export * from "./RemittanceFavoriteItem";
53
53
  export * from "./RemittanceFavoriteListResponse";
54
54
  export * from "./RemittanceBackofficeCancelCloseRequest";
55
55
  export * from "./RemittanceBackofficeCancelCloseResponse";
56
+ export * from "./RemittanceUnitellerSnapshot";
@@ -69,3 +69,4 @@ __exportStar(require("./RemittanceFavoriteItem"), exports);
69
69
  __exportStar(require("./RemittanceFavoriteListResponse"), exports);
70
70
  __exportStar(require("./RemittanceBackofficeCancelCloseRequest"), exports);
71
71
  __exportStar(require("./RemittanceBackofficeCancelCloseResponse"), exports);
72
+ __exportStar(require("./RemittanceUnitellerSnapshot"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.493.0",
3
+ "version": "3.494.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -1,6 +1,7 @@
1
1
  import { CollectionResultStatus } from '../../../collection/enums/CollectionResultStatus';
2
2
  import { MechanismType } from '../../../collection/enums/MechanismType';
3
3
  import { CurrencyId } from '../../../currency/enums/CurrencyId';
4
+ import { LoanChargeKindEnum } from '../../enums/LoanChargeKindEnum';
4
5
 
5
6
  /** Un pago del historial de un crédito, tal como lo asentó el motor de cobro en `LoanPayment_GT`. */
6
7
  export interface LoanPaymentListItem {
@@ -25,6 +26,10 @@ export interface LoanPaymentListItem {
25
26
  appliedInterestCents?: number;
26
27
  /** IVA del interés que abonó este pago. Ausente en pagos anteriores al desglose (I1). */
27
28
  appliedIvaCents?: number;
29
+ /** Qué cobró el pago: cuota, abono a capital, adelanto, liquidación o recuperación. Ausente en pagos viejos. */
30
+ chargeKind?: LoanChargeKindEnum;
31
+ /** Saldo de capital del crédito después de este pago. Ausente en pagos viejos. */
32
+ creditPrincipalBalanceAfterCents?: number;
28
33
  }
29
34
 
30
35
  /** Página del historial. El fin lo marca la AUSENCIA de `nextToken`, nunca una página corta. */
@@ -0,0 +1,41 @@
1
+ export interface RemittanceSnapshotSection {
2
+ ok: number;
3
+ soloFiado: number;
4
+ soloUniteller: number;
5
+ diffMonto: number;
6
+ diffFx: number;
7
+ diffCost: number;
8
+ diffRate: number;
9
+ totalMontoUsd: number;
10
+ }
11
+
12
+ export interface RemittancePoolBalanceSection {
13
+ balanceUsd: number;
14
+ reportedBalanceUsd: number;
15
+ diffUsd: number;
16
+ asOf: string; // YYYY-MM-DD | "N/A"
17
+ staleness: "FRESH" | "STALE" | "MISSING";
18
+ }
19
+
20
+ export interface RemittanceOrphanRow {
21
+ txIdentifier: string;
22
+ statementDate: string; // YYYY-MM-DD
23
+ reportType: "TX_DETAILS" | "CANCEL_TX" | "VOID_TX";
24
+ amountUsd: number;
25
+ processingFee: number;
26
+ }
27
+
28
+ export interface RemittanceMonthlySection {
29
+ envios: RemittanceSnapshotSection;
30
+ cancels: RemittanceSnapshotSection;
31
+ itemsUrl?: string; // opcional — link a la vista de detalle
32
+ }
33
+
34
+ export interface RemittanceUnitellerSnapshot {
35
+ calculatedAt: string; // ISO UTC
36
+ envios: RemittanceSnapshotSection;
37
+ cancels: RemittanceSnapshotSection;
38
+ poolBalance: RemittancePoolBalanceSection;
39
+ orphans: RemittanceOrphanRow[];
40
+ byMonth: Record<string, RemittanceMonthlySection>; // key = "YYYY-MM"
41
+ }
@@ -53,3 +53,4 @@ export * from "./RemittanceFavoriteItem";
53
53
  export * from "./RemittanceFavoriteListResponse";
54
54
  export * from "./RemittanceBackofficeCancelCloseRequest";
55
55
  export * from "./RemittanceBackofficeCancelCloseResponse";
56
+ export * from "./RemittanceUnitellerSnapshot";