@fiado/type-kit 3.321.0 → 3.321.1
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/_test_/unit/retailCustomer/welcomeBonusRequests.test.ts +71 -0
- package/bin/benefitCenter/enums/BenefitFlowEnum.d.ts +11 -0
- package/bin/benefitCenter/enums/BenefitFlowEnum.js +15 -0
- package/bin/common/decorators/Trim.d.ts +5 -0
- package/bin/common/decorators/Trim.js +10 -0
- package/bin/common/index.d.ts +1 -0
- package/bin/common/index.js +2 -0
- package/bin/loanCredit/dtos/requests/UpdateActivationChecklistRequest.d.ts +11 -0
- package/bin/loanCredit/dtos/requests/UpdateActivationChecklistRequest.js +46 -0
- package/bin/loanCredit/enums/ClientLevelEnum.d.ts +11 -0
- package/bin/loanCredit/enums/ClientLevelEnum.js +15 -0
- package/bin/networkConnector/dtos/CreateProfileRequest.d.ts +1 -4
- package/bin/networkConnector/dtos/CreateProfileRequest.js +1 -1
- package/bin/networkConnector/dtos/ProfileResponse.d.ts +0 -3
- package/bin/networkConnector/dtos/UpdateProfileRequest.d.ts +1 -0
- package/bin/networkConnector/dtos/UpdateProfileRequest.js +6 -0
- package/bin/retailCustomer/dtos/requests/WelcomeAccreditationRequest.d.ts +1 -3
- package/bin/retailCustomer/dtos/requests/WelcomeAccreditationRequest.js +11 -14
- package/bin/retailCustomer/dtos/requests/WelcomeAccreditationResultRequest.d.ts +8 -0
- package/bin/retailCustomer/dtos/requests/WelcomeAccreditationResultRequest.js +29 -6
- package/bin/retailCustomer/dtos/responses/WelcomeBonusResponse.d.ts +4 -0
- package/bin/retailWizard/dtos/WizardBlocked.d.ts +7 -2
- package/bin/retailWizard/dtos/WizardSession.d.ts +5 -6
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.d.ts +6 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.js +31 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.d.ts +7 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.js +6 -0
- package/bin/walletFunding/dtos/CancelFundingRequest.d.ts +11 -0
- package/bin/walletFunding/dtos/CancelFundingRequest.js +33 -0
- package/bin/walletFunding/dtos/CancelFundingResponse.d.ts +14 -0
- package/bin/walletFunding/dtos/CancelFundingResponse.js +12 -0
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.d.ts +3 -0
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.js +21 -0
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.d.ts +7 -0
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.js +6 -0
- package/bin/walletFunding/dtos/GetWalletFundingLimitResponse.d.ts +57 -11
- package/bin/walletFunding/dtos/GetWalletFundingLimitResponse.js +22 -11
- package/package.json +1 -1
- package/src/common/decorators/Trim.ts +8 -0
- package/src/common/index.ts +3 -0
- package/src/networkConnector/dtos/CreateProfileRequest.ts +2 -5
- package/src/networkConnector/dtos/ProfileResponse.ts +0 -3
- package/src/networkConnector/dtos/UpdateProfileRequest.ts +1 -2
- package/src/retailCustomer/dtos/requests/WelcomeAccreditationRequest.ts +12 -17
- package/src/retailCustomer/dtos/requests/WelcomeAccreditationResultRequest.ts +32 -9
- package/src/retailCustomer/dtos/responses/WelcomeBonusResponse.ts +4 -0
- package/src/retailWizard/dtos/WizardBlocked.ts +7 -2
- package/src/retailWizard/dtos/WizardSession.ts +5 -6
- package/src/walletFunding/dtos/GetWalletFundingLimitResponse.ts +60 -11
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CancelFundingRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
/**
|
|
15
|
+
* Request del cancel via Centro de Beneficios (spec 13 v2.0).
|
|
16
|
+
* `reference` viaja en el path, `directoryId` se resuelve del JWT.
|
|
17
|
+
* `providerModuleName` permite al marketplace rutear al publisher correcto
|
|
18
|
+
* sin tener que persistir el mapping (el wallet-app sabe el moduleName
|
|
19
|
+
* porque vino en la respuesta del authorize).
|
|
20
|
+
*/
|
|
21
|
+
class CancelFundingRequest {
|
|
22
|
+
}
|
|
23
|
+
exports.CancelFundingRequest = CancelFundingRequest;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.MaxLength)(64),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], CancelFundingRequest.prototype, "idempotencyKey", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, class_validator_1.MaxLength)(128),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], CancelFundingRequest.prototype, "providerModuleName", void 0);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BenefitPaymentStatusEnum } from "../../benefitCenter/enums/BenefitPaymentStatusEnum";
|
|
2
|
+
import { WalletFundingErrorCodeEnum } from "../enums/WalletFundingErrorCodeEnum";
|
|
3
|
+
/**
|
|
4
|
+
* Response del cancel via Centro de Beneficios (spec 13 v2.0).
|
|
5
|
+
* `status` reusa `BenefitPaymentStatusEnum` (APPROVED = cancel aceptado;
|
|
6
|
+
* REJECTED = no se pudo) para consistencia con `CancelFundingReferenceResponse`
|
|
7
|
+
* (marketplace ↔ connector). Idempotente: re-cancelar devuelve APPROVED.
|
|
8
|
+
*/
|
|
9
|
+
export declare class CancelFundingResponse {
|
|
10
|
+
reference: string;
|
|
11
|
+
status: BenefitPaymentStatusEnum;
|
|
12
|
+
errorCode?: WalletFundingErrorCodeEnum;
|
|
13
|
+
message?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CancelFundingResponse = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Response del cancel via Centro de Beneficios (spec 13 v2.0).
|
|
6
|
+
* `status` reusa `BenefitPaymentStatusEnum` (APPROVED = cancel aceptado;
|
|
7
|
+
* REJECTED = no se pudo) para consistencia con `CancelFundingReferenceResponse`
|
|
8
|
+
* (marketplace ↔ connector). Idempotente: re-cancelar devuelve APPROVED.
|
|
9
|
+
*/
|
|
10
|
+
class CancelFundingResponse {
|
|
11
|
+
}
|
|
12
|
+
exports.CancelFundingResponse = CancelFundingResponse;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CancelWalletFundingRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class CancelWalletFundingRequest {
|
|
15
|
+
}
|
|
16
|
+
exports.CancelWalletFundingRequest = CancelWalletFundingRequest;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
(0, class_validator_1.MaxLength)(64),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], CancelWalletFundingRequest.prototype, "idempotencyKey", void 0);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BenefitPaymentStatusEnum } from "../../benefitCenter/enums/BenefitPaymentStatusEnum";
|
|
2
|
+
import { WalletFundingErrorCodeEnum } from "../enums/WalletFundingErrorCodeEnum";
|
|
3
|
+
export declare class CancelWalletFundingResponse {
|
|
4
|
+
status: BenefitPaymentStatusEnum;
|
|
5
|
+
errorCode?: WalletFundingErrorCodeEnum;
|
|
6
|
+
reference?: string;
|
|
7
|
+
}
|
|
@@ -1,22 +1,68 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Response del endpoint
|
|
2
|
+
* Response del endpoint de limites de wallet funding.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Lo consume el wallet-app para decirle al usuario cuanto puede fondear ANTES
|
|
5
|
+
* de que vaya a la tienda. Hay dos topes distintos que lo pueden frenar, y el
|
|
6
|
+
* usuario tiene derecho a saber cual — asi que cada uno viaja en su propia
|
|
7
|
+
* propiedad en vez de colapsarlos en un solo numero:
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* `remainingAmount` tambien viene undefined; el front muestra "Sin limite".
|
|
12
|
-
* - `monthlyLimit` definido → hay cap. `remainingAmount = max(0, monthlyLimit
|
|
13
|
-
* − monthlyConsumed)`. Si el usuario ya copo el cap, `remainingAmount = 0`.
|
|
9
|
+
* 1. TOPE DEL NIVEL DE CUENTA (`monthly*`) — regulatorio (CFPE / Contrato
|
|
10
|
+
* EDM). Cubre TODAS las entradas del usuario: P2P, SPEI, Pomelo y tambien
|
|
11
|
+
* el cash-in. Es el TECHO: nada puede pasarlo.
|
|
14
12
|
*
|
|
15
|
-
*
|
|
13
|
+
* 2. TOPE DE CASH IN (`cashIn*`) — decision de negocio Fiado, por cliente y
|
|
14
|
+
* por mes calendario. Dice cuanto de ese techo puede venir por efectivo en
|
|
15
|
+
* tienda. NO lo reemplaza: es un sub-limite dentro de el.
|
|
16
|
+
*
|
|
17
|
+
* El cap AGREGADO de exposicion FSA no se reporta aca: es global, no un limite
|
|
18
|
+
* personal del usuario. Si el servicio esta suspendido se comunica por otra via.
|
|
19
|
+
*
|
|
20
|
+
* `availableToFund` es la respuesta a "cuanto puedo depositar ahora": el MENOR
|
|
21
|
+
* de los dos, ya descontando lo pendiente. Es el unico numero que el front
|
|
22
|
+
* necesita para habilitar o bloquear; los demas sirven para explicar POR QUE,
|
|
23
|
+
* que es lo que evita el ticket de soporte.
|
|
24
|
+
*
|
|
25
|
+
* Compatibilidad: los cuatro campos originales conservan su semantica exacta.
|
|
26
|
+
* Los nuevos son opcionales — un caller viejo sigue funcionando igual.
|
|
16
27
|
*/
|
|
17
28
|
export declare class GetWalletFundingLimitResponse {
|
|
29
|
+
/**
|
|
30
|
+
* Tope mensual de ENTRADAS del nivel de cuenta, en MXN.
|
|
31
|
+
* `undefined` = nivel ilimitado (`maxMonthlyIncomingAmount = 0` en UDIs);
|
|
32
|
+
* el front muestra "Sin limite".
|
|
33
|
+
*/
|
|
18
34
|
monthlyLimit?: number;
|
|
35
|
+
/** Entradas ya recibidas este mes por CUALQUIER via, no solo cash-in. */
|
|
19
36
|
monthlyConsumed?: number;
|
|
37
|
+
/** `max(0, monthlyLimit − monthlyConsumed)`. `undefined` si no hay tope. */
|
|
20
38
|
remainingAmount?: number;
|
|
39
|
+
/** Tope mensual de cash-in por cliente, en MXN. */
|
|
40
|
+
cashInMonthlyLimit?: number;
|
|
41
|
+
/** Cash-in ya ACREDITADO al cliente este mes. */
|
|
42
|
+
cashInMonthlyConsumed?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Cash-in AUTORIZADO pero todavia no acreditado (pagos en verificacion).
|
|
45
|
+
*
|
|
46
|
+
* Cuenta contra el disponible aunque aun no toque el saldo: el cliente ya
|
|
47
|
+
* entrego ese efectivo en la caja y el dinero esta comprometido. Sin esto,
|
|
48
|
+
* en la ventana entre autorizar y acreditar el usuario veria un disponible
|
|
49
|
+
* inflado y podria pasarse del tope.
|
|
50
|
+
*/
|
|
51
|
+
cashInMonthlyPending?: number;
|
|
52
|
+
/** `max(0, cashInMonthlyLimit − consumido − pendiente)`. */
|
|
53
|
+
cashInRemainingAmount?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Cuanto puede fondear el usuario AHORA por cash-in: el menor entre
|
|
56
|
+
* `remainingAmount` y `cashInRemainingAmount`.
|
|
57
|
+
*
|
|
58
|
+
* Es el numero que el front debe usar para habilitar o bloquear el flujo.
|
|
59
|
+
*/
|
|
60
|
+
availableToFund?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Que tope esta limitando: `ACCOUNT_LEVEL` (el regulatorio del nivel) o
|
|
63
|
+
* `CASH_IN` (el de negocio). Permite explicarle al usuario por que no puede
|
|
64
|
+
* depositar mas, en vez de mostrarle un cero sin razon.
|
|
65
|
+
*/
|
|
66
|
+
limitedBy?: "ACCOUNT_LEVEL" | "CASH_IN";
|
|
21
67
|
currency: string;
|
|
22
68
|
}
|
|
@@ -2,20 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetWalletFundingLimitResponse = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* Response del endpoint
|
|
5
|
+
* Response del endpoint de limites de wallet funding.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Lo consume el wallet-app para decirle al usuario cuanto puede fondear ANTES
|
|
8
|
+
* de que vaya a la tienda. Hay dos topes distintos que lo pueden frenar, y el
|
|
9
|
+
* usuario tiene derecho a saber cual — asi que cada uno viaja en su propia
|
|
10
|
+
* propiedad en vez de colapsarlos en un solo numero:
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* `remainingAmount` tambien viene undefined; el front muestra "Sin limite".
|
|
15
|
-
* - `monthlyLimit` definido → hay cap. `remainingAmount = max(0, monthlyLimit
|
|
16
|
-
* − monthlyConsumed)`. Si el usuario ya copo el cap, `remainingAmount = 0`.
|
|
12
|
+
* 1. TOPE DEL NIVEL DE CUENTA (`monthly*`) — regulatorio (CFPE / Contrato
|
|
13
|
+
* EDM). Cubre TODAS las entradas del usuario: P2P, SPEI, Pomelo y tambien
|
|
14
|
+
* el cash-in. Es el TECHO: nada puede pasarlo.
|
|
17
15
|
*
|
|
18
|
-
*
|
|
16
|
+
* 2. TOPE DE CASH IN (`cashIn*`) — decision de negocio Fiado, por cliente y
|
|
17
|
+
* por mes calendario. Dice cuanto de ese techo puede venir por efectivo en
|
|
18
|
+
* tienda. NO lo reemplaza: es un sub-limite dentro de el.
|
|
19
|
+
*
|
|
20
|
+
* El cap AGREGADO de exposicion FSA no se reporta aca: es global, no un limite
|
|
21
|
+
* personal del usuario. Si el servicio esta suspendido se comunica por otra via.
|
|
22
|
+
*
|
|
23
|
+
* `availableToFund` es la respuesta a "cuanto puedo depositar ahora": el MENOR
|
|
24
|
+
* de los dos, ya descontando lo pendiente. Es el unico numero que el front
|
|
25
|
+
* necesita para habilitar o bloquear; los demas sirven para explicar POR QUE,
|
|
26
|
+
* que es lo que evita el ticket de soporte.
|
|
27
|
+
*
|
|
28
|
+
* Compatibilidad: los cuatro campos originales conservan su semantica exacta.
|
|
29
|
+
* Los nuevos son opcionales — un caller viejo sigue funcionando igual.
|
|
19
30
|
*/
|
|
20
31
|
class GetWalletFundingLimitResponse {
|
|
21
32
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Transform } from 'class-transformer';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Recorta los espacios del borde de un string; deja pasar cualquier otro tipo sin tocarlo.
|
|
5
|
+
* Se aplica antes de los validadores, así que `' '` llega como `''` y `@IsNotEmpty` lo rechaza.
|
|
6
|
+
*/
|
|
7
|
+
export const Trim = (): PropertyDecorator =>
|
|
8
|
+
Transform(({ value }) => (typeof value === 'string' ? value.trim() : value));
|
package/src/common/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsString, IsOptional,
|
|
2
|
+
import { IsString, IsOptional, IsObject, MaxLength, MinLength } from 'class-validator';
|
|
3
3
|
|
|
4
4
|
export class CreateProfileRequest {
|
|
5
5
|
@Expose() @IsString() @MinLength(1) @MaxLength(100) firstName!: string;
|
|
@@ -8,10 +8,7 @@ export class CreateProfileRequest {
|
|
|
8
8
|
@Expose() @IsOptional() @IsString() @MaxLength(200) company?: string;
|
|
9
9
|
@Expose() @IsString() @MinLength(2) @MaxLength(100) slug!: string;
|
|
10
10
|
@Expose() @IsString() directoryId!: string;
|
|
11
|
-
|
|
12
|
-
* (IOnboardingBusinessApi.getByPhoneNumber) al crear el perfil. Inmutable tras la creacion
|
|
13
|
-
* (UpdateProfileRequest ya no acepta este campo). */
|
|
14
|
-
@Expose() @IsString() @IsNotEmpty() phone!: string;
|
|
11
|
+
@Expose() @IsOptional() @IsString() phone?: string;
|
|
15
12
|
@Expose() @IsOptional() @IsString() email?: string;
|
|
16
13
|
@Expose() @IsOptional() @IsString() @MaxLength(500) bio?: string;
|
|
17
14
|
@Expose() @IsOptional() @IsObject() socialLinks?: Record<string, string>;
|
|
@@ -13,9 +13,6 @@ export interface ProfileResponse {
|
|
|
13
13
|
logoUrl?: string;
|
|
14
14
|
bio?: string;
|
|
15
15
|
socialLinks?: Record<string, string>;
|
|
16
|
-
/** Codigo de referido del promotor (myReferralCode de Onboarding), resuelto por telefono al
|
|
17
|
-
* crear el perfil. null si el telefono no tiene codigo asociado en Onboarding. */
|
|
18
|
-
referralCode?: string | null;
|
|
19
16
|
status: ProfileStatusEnum;
|
|
20
17
|
directoryId: string;
|
|
21
18
|
createdAt: number;
|
|
@@ -8,8 +8,7 @@ export class UpdateProfileRequest {
|
|
|
8
8
|
@Expose() @IsOptional() @IsString() @MaxLength(200) title?: string;
|
|
9
9
|
@Expose() @IsOptional() @IsString() @MaxLength(200) company?: string;
|
|
10
10
|
@Expose() @IsOptional() @IsString() @MinLength(2) @MaxLength(100) slug?: string;
|
|
11
|
-
|
|
12
|
-
// creo la cuenta, usado para resolver el codigo de referido). No se acepta en Update.
|
|
11
|
+
@Expose() @IsOptional() @IsString() phone?: string;
|
|
13
12
|
@Expose() @IsOptional() @IsString() email?: string;
|
|
14
13
|
@Expose() @IsOptional() @IsString() @MaxLength(500) bio?: string;
|
|
15
14
|
@Expose() @IsOptional() @IsObject() socialLinks?: Record<string, string>;
|
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
import { Expose
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
2
|
import { IsEnum, IsInt, IsNotEmpty, IsOptional, IsPositive, IsString } from 'class-validator';
|
|
3
|
+
import { Trim } from '../../../common/decorators/Trim';
|
|
3
4
|
import { WelcomeBonusAmountSourceEnum } from '../../enums/WelcomeBonusAmountSourceEnum';
|
|
4
5
|
|
|
5
|
-
/** Recorta los strings del borde: un valor con espacios ensucia claves y cortes de conciliación. */
|
|
6
|
-
const trim = (): PropertyDecorator =>
|
|
7
|
-
Transform(({ value }) => (typeof value === 'string' ? value.trim() : value));
|
|
8
|
-
|
|
9
6
|
/**
|
|
10
7
|
* Datos de la venta que acompañan la reserva del bono de bienvenida (D33):
|
|
11
8
|
* `POST /private/customers/:id/welcome-accreditation`. SureKeep Fase 2 — pista Retail.
|
|
12
9
|
*
|
|
13
|
-
*
|
|
14
|
-
* durante la ventana el wizard viejo sigue llamando sin body: el asiento nace incompleto y se acredita
|
|
15
|
-
* igual. Exigirlos convertiría esa ventana en un 400 que deja al cliente sin bono.
|
|
10
|
+
* Todos los campos son opcionales: un caller que no los manda abre el asiento igual, incompleto.
|
|
16
11
|
*/
|
|
17
12
|
export class WelcomeAccreditationRequest {
|
|
18
13
|
/** Tienda donde se dio el bono — es la partición del asiento. */
|
|
19
14
|
@Expose()
|
|
20
15
|
@IsOptional()
|
|
21
|
-
@
|
|
16
|
+
@Trim()
|
|
22
17
|
@IsString()
|
|
23
18
|
@IsNotEmpty()
|
|
24
19
|
storeId?: string;
|
|
25
20
|
|
|
26
21
|
@Expose()
|
|
27
22
|
@IsOptional()
|
|
28
|
-
@
|
|
23
|
+
@Trim()
|
|
29
24
|
@IsString()
|
|
30
25
|
@IsNotEmpty()
|
|
31
26
|
retailerId?: string;
|
|
@@ -33,14 +28,14 @@ export class WelcomeAccreditationRequest {
|
|
|
33
28
|
/** Vendedor que cerró la venta. */
|
|
34
29
|
@Expose()
|
|
35
30
|
@IsOptional()
|
|
36
|
-
@
|
|
31
|
+
@Trim()
|
|
37
32
|
@IsString()
|
|
38
33
|
@IsNotEmpty()
|
|
39
34
|
sellerRetailUserId?: string;
|
|
40
35
|
|
|
41
36
|
@Expose()
|
|
42
37
|
@IsOptional()
|
|
43
|
-
@
|
|
38
|
+
@Trim()
|
|
44
39
|
@IsString()
|
|
45
40
|
@IsNotEmpty()
|
|
46
41
|
saleId?: string;
|
|
@@ -48,14 +43,14 @@ export class WelcomeAccreditationRequest {
|
|
|
48
43
|
/** Folio de la venta, tal como lo ve el vendedor en el ticket. */
|
|
49
44
|
@Expose()
|
|
50
45
|
@IsOptional()
|
|
51
|
-
@
|
|
46
|
+
@Trim()
|
|
52
47
|
@IsString()
|
|
53
48
|
@IsNotEmpty()
|
|
54
49
|
folio?: string;
|
|
55
50
|
|
|
56
51
|
@Expose()
|
|
57
52
|
@IsOptional()
|
|
58
|
-
@
|
|
53
|
+
@Trim()
|
|
59
54
|
@IsString()
|
|
60
55
|
@IsNotEmpty()
|
|
61
56
|
wizardSessionId?: string;
|
|
@@ -69,7 +64,7 @@ export class WelcomeAccreditationRequest {
|
|
|
69
64
|
/** ISO-4217. Ausente ⇒ el server asienta `MXN`. */
|
|
70
65
|
@Expose()
|
|
71
66
|
@IsOptional()
|
|
72
|
-
@
|
|
67
|
+
@Trim()
|
|
73
68
|
@IsString()
|
|
74
69
|
@IsNotEmpty()
|
|
75
70
|
currency?: string;
|
|
@@ -82,14 +77,14 @@ export class WelcomeAccreditationRequest {
|
|
|
82
77
|
/** Clave con la que el caller acredita en el processor — ata el asiento al movimiento de plata. */
|
|
83
78
|
@Expose()
|
|
84
79
|
@IsOptional()
|
|
85
|
-
@
|
|
80
|
+
@Trim()
|
|
86
81
|
@IsString()
|
|
87
82
|
@IsNotEmpty()
|
|
88
83
|
idempotencyKey?: string;
|
|
89
84
|
|
|
90
85
|
@Expose()
|
|
91
86
|
@IsOptional()
|
|
92
|
-
@
|
|
87
|
+
@Trim()
|
|
93
88
|
@IsString()
|
|
94
89
|
@IsNotEmpty()
|
|
95
90
|
providerName?: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Expose
|
|
2
|
-
import { IsIn, IsNotEmpty, IsOptional, IsString, ValidateIf } from 'class-validator';
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsIn, IsNotEmpty, IsOptional, IsString, MaxLength, ValidateIf } from 'class-validator';
|
|
3
|
+
import { Trim } from '../../../common/decorators/Trim';
|
|
3
4
|
import { WelcomeBonusStatusEnum } from '../../enums/WelcomeBonusStatusEnum';
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
const
|
|
7
|
-
Transform(({ value }) => (typeof value === 'string' ? value.trim() : value));
|
|
6
|
+
/** Tope de los textos libres que el caller escribe en el asiento. */
|
|
7
|
+
const FREE_TEXT_MAX_LENGTH = 256;
|
|
8
8
|
|
|
9
9
|
/** Resultados que el caller puede asentar. `PENDING` lo escribe el server al reservar, no el caller. */
|
|
10
10
|
const RESULT_STATUSES = [
|
|
@@ -26,11 +26,14 @@ const STATUSES_REQUIRING_REASON: WelcomeBonusStatusEnum[] = [
|
|
|
26
26
|
* `FAILED` libera el candado `welcomeAccredited` para que la venta se reintente. `UNVERIFIED` lo deja
|
|
27
27
|
* tomado: el `walletFundingCredit` del processor no deduplica, así que liberar tras un timeout podría
|
|
28
28
|
* acreditar plata real dos veces.
|
|
29
|
+
*
|
|
30
|
+
* Un asiento `UNVERIFIED` se cierra después con `ACCREDITED` o `FAILED` mandando además `reconciledBy`
|
|
31
|
+
* y `reconciliationReason` — ese par es lo que marca el cierre como reconciliación.
|
|
29
32
|
*/
|
|
30
33
|
export class WelcomeAccreditationResultRequest {
|
|
31
34
|
/** Referencia opaca del asiento, tal como la devolvió la reserva. */
|
|
32
35
|
@Expose()
|
|
33
|
-
@
|
|
36
|
+
@Trim()
|
|
34
37
|
@IsString()
|
|
35
38
|
@IsNotEmpty()
|
|
36
39
|
bonusKey!: string;
|
|
@@ -41,22 +44,42 @@ export class WelcomeAccreditationResultRequest {
|
|
|
41
44
|
|
|
42
45
|
@Expose()
|
|
43
46
|
@ValidateIf((o: WelcomeAccreditationResultRequest) => o.status === WelcomeBonusStatusEnum.ACCREDITED)
|
|
44
|
-
@
|
|
47
|
+
@Trim()
|
|
45
48
|
@IsString()
|
|
46
49
|
@IsNotEmpty({ message: 'processorTransactionId es obligatorio cuando status es ACCREDITED' })
|
|
47
50
|
processorTransactionId?: string;
|
|
48
51
|
|
|
52
|
+
/** Motivo legible del fallo — un resumen, NO el payload crudo del processor (el libro va sin PII). */
|
|
49
53
|
@Expose()
|
|
50
54
|
@ValidateIf((o: WelcomeAccreditationResultRequest) => STATUSES_REQUIRING_REASON.includes(o.status))
|
|
51
|
-
@
|
|
55
|
+
@Trim()
|
|
52
56
|
@IsString()
|
|
53
57
|
@IsNotEmpty({ message: 'failReason es obligatorio cuando status es FAILED o UNVERIFIED' })
|
|
58
|
+
@MaxLength(FREE_TEXT_MAX_LENGTH)
|
|
54
59
|
failReason?: string;
|
|
55
60
|
|
|
56
61
|
@Expose()
|
|
57
62
|
@IsOptional()
|
|
58
|
-
@
|
|
63
|
+
@Trim()
|
|
59
64
|
@IsString()
|
|
60
65
|
@IsNotEmpty()
|
|
61
66
|
providerName?: string;
|
|
67
|
+
|
|
68
|
+
/** Quién cierra a mano un asiento `UNVERIFIED`. Va junto con `reconciliationReason`. */
|
|
69
|
+
@Expose()
|
|
70
|
+
@ValidateIf((o: WelcomeAccreditationResultRequest) => o.reconciliationReason !== undefined)
|
|
71
|
+
@Trim()
|
|
72
|
+
@IsString()
|
|
73
|
+
@IsNotEmpty({ message: 'reconciledBy es obligatorio en un cierre de reconciliación' })
|
|
74
|
+
@MaxLength(FREE_TEXT_MAX_LENGTH)
|
|
75
|
+
reconciledBy?: string;
|
|
76
|
+
|
|
77
|
+
/** Por qué se cerró a mano — un resumen, NO el payload crudo del processor. */
|
|
78
|
+
@Expose()
|
|
79
|
+
@ValidateIf((o: WelcomeAccreditationResultRequest) => o.reconciledBy !== undefined)
|
|
80
|
+
@Trim()
|
|
81
|
+
@IsString()
|
|
82
|
+
@IsNotEmpty({ message: 'reconciliationReason es obligatorio en un cierre de reconciliación' })
|
|
83
|
+
@MaxLength(FREE_TEXT_MAX_LENGTH)
|
|
84
|
+
reconciliationReason?: string;
|
|
62
85
|
}
|
|
@@ -32,6 +32,10 @@ export interface WelcomeBonusResponse {
|
|
|
32
32
|
failReason: string | null;
|
|
33
33
|
requestedAt: string;
|
|
34
34
|
resolvedAt: string | null;
|
|
35
|
+
/** Instante del cierre de reconciliación. No nulo = el asiento se cerró a mano, no por el flujo. */
|
|
36
|
+
reconciledAt: string | null;
|
|
37
|
+
reconciledBy: string | null;
|
|
38
|
+
reconciliationReason: string | null;
|
|
35
39
|
processorTransactionId: string | null;
|
|
36
40
|
idempotencyKey: string | null;
|
|
37
41
|
providerName: string | null;
|
|
@@ -24,10 +24,15 @@ export interface WizardBlocked {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* Lo
|
|
28
|
-
* fuera `code` y `detail`, que son de soporte y admin.
|
|
27
|
+
* Lo del bloqueo que puede viajar al navegador del vendedor: qué pantalla toca, la etiqueta y el
|
|
28
|
+
* «hace N días». Deja fuera `code` y `detail`, que son de soporte y admin.
|
|
29
29
|
*/
|
|
30
30
|
export interface WizardBlockedSummary {
|
|
31
|
+
/**
|
|
32
|
+
* Cuál de las dos pantallas del paso 02 toca: la espera, o «no se pudo abrir». Opcional: la ficha
|
|
33
|
+
* de Prospectos no lo manda, y un consumidor que no lo conoce sigue leyendo `category`.
|
|
34
|
+
*/
|
|
35
|
+
reason?: BlockedReasonEnum;
|
|
31
36
|
category: BlockedCategoryEnum | null;
|
|
32
37
|
/** ISO 8601, copiado tal cual de `WizardBlocked.since`. */
|
|
33
38
|
since: string;
|
|
@@ -4,7 +4,7 @@ import type { FiadoPhoneStatusEnum } from '../enums/FiadoPhoneStatusEnum';
|
|
|
4
4
|
import type { PaymentMethodEnum } from '../enums/PaymentMethodEnum';
|
|
5
5
|
import type { ExternalProviderEnum } from '../enums/ExternalProviderEnum';
|
|
6
6
|
import type { OccupationEnum } from '../enums/OccupationEnum';
|
|
7
|
-
import type {
|
|
7
|
+
import type { WizardBlockedSummary } from './WizardBlocked';
|
|
8
8
|
import type { WizardConsents } from './WizardConsents';
|
|
9
9
|
import type { WizardLoan } from './WizardLoan';
|
|
10
10
|
import type { WizardPayment } from './WizardPayment';
|
|
@@ -98,12 +98,11 @@ export interface WizardSession {
|
|
|
98
98
|
accountOpened: boolean;
|
|
99
99
|
accountStatus: AccountStatus | null;
|
|
100
100
|
/**
|
|
101
|
-
* La venta está detenida esperando la cuenta.
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* Opcional por lo mismo que `resumeOtpRequired`. Ausente o `null` = la venta va bien.
|
|
101
|
+
* La venta está detenida esperando la cuenta. Resumen y no el bloqueo entero: el motivo crudo del
|
|
102
|
+
* emisor puede nombrar una coincidencia en listas de PLD, y avisarlo es delito — se sirve por su
|
|
103
|
+
* propio endpoint con permiso. Ausente o `null` = la venta va bien.
|
|
105
104
|
*/
|
|
106
|
-
blocked?:
|
|
105
|
+
blocked?: WizardBlockedSummary | null;
|
|
107
106
|
reservedSku: string | null;
|
|
108
107
|
reservedImei: string | null;
|
|
109
108
|
/**
|
|
@@ -1,22 +1,71 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Response del endpoint
|
|
2
|
+
* Response del endpoint de limites de wallet funding.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Lo consume el wallet-app para decirle al usuario cuanto puede fondear ANTES
|
|
5
|
+
* de que vaya a la tienda. Hay dos topes distintos que lo pueden frenar, y el
|
|
6
|
+
* usuario tiene derecho a saber cual — asi que cada uno viaja en su propia
|
|
7
|
+
* propiedad en vez de colapsarlos en un solo numero:
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* `remainingAmount` tambien viene undefined; el front muestra "Sin limite".
|
|
12
|
-
* - `monthlyLimit` definido → hay cap. `remainingAmount = max(0, monthlyLimit
|
|
13
|
-
* − monthlyConsumed)`. Si el usuario ya copo el cap, `remainingAmount = 0`.
|
|
9
|
+
* 1. TOPE DEL NIVEL DE CUENTA (`monthly*`) — regulatorio (CFPE / Contrato
|
|
10
|
+
* EDM). Cubre TODAS las entradas del usuario: P2P, SPEI, Pomelo y tambien
|
|
11
|
+
* el cash-in. Es el TECHO: nada puede pasarlo.
|
|
14
12
|
*
|
|
15
|
-
*
|
|
13
|
+
* 2. TOPE DE CASH IN (`cashIn*`) — decision de negocio Fiado, por cliente y
|
|
14
|
+
* por mes calendario. Dice cuanto de ese techo puede venir por efectivo en
|
|
15
|
+
* tienda. NO lo reemplaza: es un sub-limite dentro de el.
|
|
16
|
+
*
|
|
17
|
+
* El cap AGREGADO de exposicion FSA no se reporta aca: es global, no un limite
|
|
18
|
+
* personal del usuario. Si el servicio esta suspendido se comunica por otra via.
|
|
19
|
+
*
|
|
20
|
+
* `availableToFund` es la respuesta a "cuanto puedo depositar ahora": el MENOR
|
|
21
|
+
* de los dos, ya descontando lo pendiente. Es el unico numero que el front
|
|
22
|
+
* necesita para habilitar o bloquear; los demas sirven para explicar POR QUE,
|
|
23
|
+
* que es lo que evita el ticket de soporte.
|
|
24
|
+
*
|
|
25
|
+
* Compatibilidad: los cuatro campos originales conservan su semantica exacta.
|
|
26
|
+
* Los nuevos son opcionales — un caller viejo sigue funcionando igual.
|
|
16
27
|
*/
|
|
17
28
|
export class GetWalletFundingLimitResponse {
|
|
29
|
+
/**
|
|
30
|
+
* Tope mensual de ENTRADAS del nivel de cuenta, en MXN.
|
|
31
|
+
* `undefined` = nivel ilimitado (`maxMonthlyIncomingAmount = 0` en UDIs);
|
|
32
|
+
* el front muestra "Sin limite".
|
|
33
|
+
*/
|
|
18
34
|
monthlyLimit?: number;
|
|
35
|
+
/** Entradas ya recibidas este mes por CUALQUIER via, no solo cash-in. */
|
|
19
36
|
monthlyConsumed?: number;
|
|
37
|
+
/** `max(0, monthlyLimit − monthlyConsumed)`. `undefined` si no hay tope. */
|
|
20
38
|
remainingAmount?: number;
|
|
39
|
+
|
|
40
|
+
/** Tope mensual de cash-in por cliente, en MXN. */
|
|
41
|
+
cashInMonthlyLimit?: number;
|
|
42
|
+
/** Cash-in ya ACREDITADO al cliente este mes. */
|
|
43
|
+
cashInMonthlyConsumed?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Cash-in AUTORIZADO pero todavia no acreditado (pagos en verificacion).
|
|
46
|
+
*
|
|
47
|
+
* Cuenta contra el disponible aunque aun no toque el saldo: el cliente ya
|
|
48
|
+
* entrego ese efectivo en la caja y el dinero esta comprometido. Sin esto,
|
|
49
|
+
* en la ventana entre autorizar y acreditar el usuario veria un disponible
|
|
50
|
+
* inflado y podria pasarse del tope.
|
|
51
|
+
*/
|
|
52
|
+
cashInMonthlyPending?: number;
|
|
53
|
+
/** `max(0, cashInMonthlyLimit − consumido − pendiente)`. */
|
|
54
|
+
cashInRemainingAmount?: number;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Cuanto puede fondear el usuario AHORA por cash-in: el menor entre
|
|
58
|
+
* `remainingAmount` y `cashInRemainingAmount`.
|
|
59
|
+
*
|
|
60
|
+
* Es el numero que el front debe usar para habilitar o bloquear el flujo.
|
|
61
|
+
*/
|
|
62
|
+
availableToFund?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Que tope esta limitando: `ACCOUNT_LEVEL` (el regulatorio del nivel) o
|
|
65
|
+
* `CASH_IN` (el de negocio). Permite explicarle al usuario por que no puede
|
|
66
|
+
* depositar mas, en vez de mostrarle un cero sin razon.
|
|
67
|
+
*/
|
|
68
|
+
limitedBy?: "ACCOUNT_LEVEL" | "CASH_IN";
|
|
69
|
+
|
|
21
70
|
currency!: string;
|
|
22
71
|
}
|