@fiado/type-kit 3.216.0 → 3.217.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/bin/retailWizard/dtos/WizardProduct.d.ts +41 -0
- package/bin/retailWizard/dtos/WizardProduct.js +2 -0
- package/bin/retailWizard/dtos/WizardSession.d.ts +7 -0
- package/bin/retailWizard/index.d.ts +1 -0
- package/bin/retailWizard/index.js +1 -0
- package/package.json +1 -1
- package/src/retailWizard/dtos/WizardProduct.ts +41 -0
- package/src/retailWizard/dtos/WizardSession.ts +7 -0
- package/src/retailWizard/index.ts +1 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ficha COMERCIAL del equipo reservado, congelada en la sesión al momento de reservarlo (S03).
|
|
3
|
+
*
|
|
4
|
+
* **Por qué un snapshot y no una lectura del catálogo en cada `GET`:**
|
|
5
|
+
* 1. Una venta se cotiza al instante en que se reserva. Si el catálogo cambia el precio o retira el
|
|
6
|
+
* modelo mientras el vendedor sigue en el wizard, la venta en curso NO debe cambiar debajo de él
|
|
7
|
+
* — el precio ancla el cobro (`amountCents == cashPrice`) y el contrato ya se le mostró al cliente.
|
|
8
|
+
* 2. El front pollea la sesión cada 3–5 s durante el KYC (D20). Resolver el catálogo en cada lectura
|
|
9
|
+
* convertiría ese poll en un llamado cross-lambda por tick.
|
|
10
|
+
*
|
|
11
|
+
* Lo llena `addProduct`, que YA consulta el catálogo para elegir la unidad física y su precio: los
|
|
12
|
+
* datos salen de la MISMA lectura, sin viajes extra.
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ NO lleva `stock`: es volátil por definición y no describe la unidad ya reservada (que por
|
|
15
|
+
* definición dejó de estar disponible). El stock vive en el catálogo y solo importa en el paso 03.
|
|
16
|
+
*
|
|
17
|
+
* SureKeep Fase 2 — pista Retail.
|
|
18
|
+
*/
|
|
19
|
+
export interface WizardProduct {
|
|
20
|
+
/** SKU del modelo comercial. Espeja `WizardSession.reservedSku`. */
|
|
21
|
+
sku: string;
|
|
22
|
+
/** Unidad física reservada. Espeja `WizardSession.reservedImei`. */
|
|
23
|
+
imei: string;
|
|
24
|
+
/**
|
|
25
|
+
* Precio de contado en centavos, TAL COMO estaba en el catálogo al reservar. Es el ancla del
|
|
26
|
+
* cobro: `registerPayment` exige `amountCents == cashPriceCents`.
|
|
27
|
+
*/
|
|
28
|
+
cashPriceCents: number;
|
|
29
|
+
brand: string;
|
|
30
|
+
model: string;
|
|
31
|
+
capacity: string;
|
|
32
|
+
color: string;
|
|
33
|
+
imageUrl: string | null;
|
|
34
|
+
/** Gama del equipo (`PREMIUM` / `HIGH` / `MID` …). La define el catálogo, no el wizard. */
|
|
35
|
+
tier: string;
|
|
36
|
+
/**
|
|
37
|
+
* Financieras alternativas elegibles para este producto (derivación externa, paso 04).
|
|
38
|
+
* Mismo nombre que en `retail-catalog`: es su dato, no se renombra al cruzar la frontera.
|
|
39
|
+
*/
|
|
40
|
+
eligibleFinanciers: string[];
|
|
41
|
+
}
|
|
@@ -7,6 +7,7 @@ import type { OccupationEnum } from '../enums/OccupationEnum';
|
|
|
7
7
|
import type { WizardConsents } from './WizardConsents';
|
|
8
8
|
import type { WizardLoan } from './WizardLoan';
|
|
9
9
|
import type { WizardPayment } from './WizardPayment';
|
|
10
|
+
import type { WizardProduct } from './WizardProduct';
|
|
10
11
|
import type { WizardWelcome } from './WizardWelcome';
|
|
11
12
|
/** Modalidad de captura del KYC (M1 §213-329). */
|
|
12
13
|
export type KycModality = 'CUSTOMER_LINK' | 'STORE_DEVICE' | 'MANUAL';
|
|
@@ -46,6 +47,12 @@ export interface WizardSession {
|
|
|
46
47
|
accountStatus: AccountStatus | null;
|
|
47
48
|
reservedSku: string | null;
|
|
48
49
|
reservedImei: string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Ficha comercial del equipo reservado (marca, modelo, precio, financieras), congelada al
|
|
52
|
+
* reservar. `reservedSku`/`reservedImei` siguen siendo la fuente de verdad de QUÉ unidad está
|
|
53
|
+
* tomada; esto es lo que hace falta para PINTARLA sin volver al catálogo. Null antes del S03.
|
|
54
|
+
*/
|
|
55
|
+
product: WizardProduct | null;
|
|
49
56
|
reservationExpiresAt: string | null;
|
|
50
57
|
paymentMethod: PaymentMethodEnum | null;
|
|
51
58
|
externalProvider: ExternalProviderEnum | null;
|
|
@@ -14,6 +14,7 @@ export * from './enums/OccupationEnum';
|
|
|
14
14
|
export * from './enums/BeneficiaryRelationEnum';
|
|
15
15
|
export * from './dtos/WizardConsents';
|
|
16
16
|
export * from './dtos/WizardPayment';
|
|
17
|
+
export * from './dtos/WizardProduct';
|
|
17
18
|
export * from './dtos/WizardWelcome';
|
|
18
19
|
export * from './dtos/SalePaymentDetail';
|
|
19
20
|
export * from './dtos/ProspectNewCustomer';
|
|
@@ -32,6 +32,7 @@ __exportStar(require("./enums/BeneficiaryRelationEnum"), exports);
|
|
|
32
32
|
// DTOs anidados
|
|
33
33
|
__exportStar(require("./dtos/WizardConsents"), exports);
|
|
34
34
|
__exportStar(require("./dtos/WizardPayment"), exports);
|
|
35
|
+
__exportStar(require("./dtos/WizardProduct"), exports);
|
|
35
36
|
__exportStar(require("./dtos/WizardWelcome"), exports);
|
|
36
37
|
__exportStar(require("./dtos/SalePaymentDetail"), exports);
|
|
37
38
|
__exportStar(require("./dtos/ProspectNewCustomer"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ficha COMERCIAL del equipo reservado, congelada en la sesión al momento de reservarlo (S03).
|
|
3
|
+
*
|
|
4
|
+
* **Por qué un snapshot y no una lectura del catálogo en cada `GET`:**
|
|
5
|
+
* 1. Una venta se cotiza al instante en que se reserva. Si el catálogo cambia el precio o retira el
|
|
6
|
+
* modelo mientras el vendedor sigue en el wizard, la venta en curso NO debe cambiar debajo de él
|
|
7
|
+
* — el precio ancla el cobro (`amountCents == cashPrice`) y el contrato ya se le mostró al cliente.
|
|
8
|
+
* 2. El front pollea la sesión cada 3–5 s durante el KYC (D20). Resolver el catálogo en cada lectura
|
|
9
|
+
* convertiría ese poll en un llamado cross-lambda por tick.
|
|
10
|
+
*
|
|
11
|
+
* Lo llena `addProduct`, que YA consulta el catálogo para elegir la unidad física y su precio: los
|
|
12
|
+
* datos salen de la MISMA lectura, sin viajes extra.
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ NO lleva `stock`: es volátil por definición y no describe la unidad ya reservada (que por
|
|
15
|
+
* definición dejó de estar disponible). El stock vive en el catálogo y solo importa en el paso 03.
|
|
16
|
+
*
|
|
17
|
+
* SureKeep Fase 2 — pista Retail.
|
|
18
|
+
*/
|
|
19
|
+
export interface WizardProduct {
|
|
20
|
+
/** SKU del modelo comercial. Espeja `WizardSession.reservedSku`. */
|
|
21
|
+
sku: string;
|
|
22
|
+
/** Unidad física reservada. Espeja `WizardSession.reservedImei`. */
|
|
23
|
+
imei: string;
|
|
24
|
+
/**
|
|
25
|
+
* Precio de contado en centavos, TAL COMO estaba en el catálogo al reservar. Es el ancla del
|
|
26
|
+
* cobro: `registerPayment` exige `amountCents == cashPriceCents`.
|
|
27
|
+
*/
|
|
28
|
+
cashPriceCents: number;
|
|
29
|
+
brand: string;
|
|
30
|
+
model: string;
|
|
31
|
+
capacity: string;
|
|
32
|
+
color: string;
|
|
33
|
+
imageUrl: string | null;
|
|
34
|
+
/** Gama del equipo (`PREMIUM` / `HIGH` / `MID` …). La define el catálogo, no el wizard. */
|
|
35
|
+
tier: string;
|
|
36
|
+
/**
|
|
37
|
+
* Financieras alternativas elegibles para este producto (derivación externa, paso 04).
|
|
38
|
+
* Mismo nombre que en `retail-catalog`: es su dato, no se renombra al cruzar la frontera.
|
|
39
|
+
*/
|
|
40
|
+
eligibleFinanciers: string[];
|
|
41
|
+
}
|
|
@@ -7,6 +7,7 @@ import type { OccupationEnum } from '../enums/OccupationEnum';
|
|
|
7
7
|
import type { WizardConsents } from './WizardConsents';
|
|
8
8
|
import type { WizardLoan } from './WizardLoan';
|
|
9
9
|
import type { WizardPayment } from './WizardPayment';
|
|
10
|
+
import type { WizardProduct } from './WizardProduct';
|
|
10
11
|
import type { WizardWelcome } from './WizardWelcome';
|
|
11
12
|
|
|
12
13
|
/** Modalidad de captura del KYC (M1 §213-329). */
|
|
@@ -49,6 +50,12 @@ export interface WizardSession {
|
|
|
49
50
|
accountStatus: AccountStatus | null;
|
|
50
51
|
reservedSku: string | null;
|
|
51
52
|
reservedImei: string | null;
|
|
53
|
+
/**
|
|
54
|
+
* Ficha comercial del equipo reservado (marca, modelo, precio, financieras), congelada al
|
|
55
|
+
* reservar. `reservedSku`/`reservedImei` siguen siendo la fuente de verdad de QUÉ unidad está
|
|
56
|
+
* tomada; esto es lo que hace falta para PINTARLA sin volver al catálogo. Null antes del S03.
|
|
57
|
+
*/
|
|
58
|
+
product: WizardProduct | null;
|
|
52
59
|
reservationExpiresAt: string | null;
|
|
53
60
|
paymentMethod: PaymentMethodEnum | null;
|
|
54
61
|
externalProvider: ExternalProviderEnum | null;
|
|
@@ -17,6 +17,7 @@ export * from './enums/BeneficiaryRelationEnum';
|
|
|
17
17
|
// DTOs anidados
|
|
18
18
|
export * from './dtos/WizardConsents';
|
|
19
19
|
export * from './dtos/WizardPayment';
|
|
20
|
+
export * from './dtos/WizardProduct';
|
|
20
21
|
export * from './dtos/WizardWelcome';
|
|
21
22
|
export * from './dtos/SalePaymentDetail';
|
|
22
23
|
export * from './dtos/ProspectNewCustomer';
|