@fiado/type-kit 3.7.2 → 3.8.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/bin/benefitCenter/dtos/FavoriteDetailResponse.d.ts +40 -0
- package/bin/benefitCenter/dtos/FavoriteDetailResponse.js +27 -0
- package/bin/benefitCenter/dtos/FavoriteItem.d.ts +21 -0
- package/bin/benefitCenter/dtos/FavoriteItem.js +10 -0
- package/bin/benefitCenter/dtos/FavoriteListResponse.d.ts +4 -0
- package/bin/benefitCenter/dtos/FavoriteListResponse.js +6 -0
- package/bin/benefitCenter/dtos/FavoriteReorderRequest.d.ts +13 -0
- package/bin/benefitCenter/dtos/FavoriteReorderRequest.js +42 -0
- package/bin/benefitCenter/dtos/FavoriteUpdateRequest.d.ts +15 -0
- package/bin/benefitCenter/dtos/FavoriteUpdateRequest.js +42 -0
- package/bin/benefitCenter/dtos/FavoriteValidationResult.d.ts +34 -0
- package/bin/benefitCenter/dtos/FavoriteValidationResult.js +25 -0
- package/bin/benefitCenter/enums/FavoriteDisabledReasonEnum.d.ts +15 -0
- package/bin/benefitCenter/enums/FavoriteDisabledReasonEnum.js +19 -0
- package/bin/benefitCenter/index.d.ts +7 -0
- package/bin/benefitCenter/index.js +8 -0
- package/bin/creditBackoffice/dtos/BackofficeCreditDetail.d.ts +4 -4
- package/package.json +1 -1
- package/src/benefitCenter/dtos/FavoriteDetailResponse.ts +43 -0
- package/src/benefitCenter/dtos/FavoriteItem.ts +25 -0
- package/src/benefitCenter/dtos/FavoriteListResponse.ts +5 -0
- package/src/benefitCenter/dtos/FavoriteReorderRequest.ts +32 -0
- package/src/benefitCenter/dtos/FavoriteUpdateRequest.ts +35 -0
- package/src/benefitCenter/dtos/FavoriteValidationResult.ts +37 -0
- package/src/benefitCenter/enums/FavoriteDisabledReasonEnum.ts +15 -0
- package/src/benefitCenter/index.ts +8 -0
- package/src/creditBackoffice/dtos/BackofficeCreditDetail.ts +4 -4
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BenefitSummary } from "./BenefitSummary";
|
|
2
|
+
import { CatalogNode } from "./CatalogNode";
|
|
3
|
+
/**
|
|
4
|
+
* Selección previa del usuario que el frontend usa para pre-llenar el form
|
|
5
|
+
* de pago. La `reference` viaja en claro (es data del propio usuario,
|
|
6
|
+
* autenticado).
|
|
7
|
+
*/
|
|
8
|
+
export declare class FavoriteSelection {
|
|
9
|
+
leafId: string;
|
|
10
|
+
productId: string;
|
|
11
|
+
amount: number | null;
|
|
12
|
+
reference: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Metadata del favorito en sí (para menús contextuales, ordenamiento, etc.).
|
|
16
|
+
*/
|
|
17
|
+
export declare class FavoriteDetailMeta {
|
|
18
|
+
id: string;
|
|
19
|
+
alias: string | null;
|
|
20
|
+
photo: string | null;
|
|
21
|
+
position: number;
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
usageCount: number;
|
|
24
|
+
lastUsedAt: number;
|
|
25
|
+
createdAt: number;
|
|
26
|
+
updatedAt: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Response de `GET /favorites/{id}`. Devuelve el shape del árbol del catálogo
|
|
30
|
+
* (BRANCH padre con los LEAFs hermanos del favorito; el LEAF del favorito
|
|
31
|
+
* trae `leaf` populado inline) más la selección previa y la metadata editable.
|
|
32
|
+
*
|
|
33
|
+
* El frontend reusa `renderCatalog(catalog)` sin caso especial.
|
|
34
|
+
*/
|
|
35
|
+
export declare class FavoriteDetailResponse {
|
|
36
|
+
benefit: BenefitSummary;
|
|
37
|
+
catalog: CatalogNode;
|
|
38
|
+
selection: FavoriteSelection;
|
|
39
|
+
favorite: FavoriteDetailMeta;
|
|
40
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FavoriteDetailResponse = exports.FavoriteDetailMeta = exports.FavoriteSelection = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Selección previa del usuario que el frontend usa para pre-llenar el form
|
|
6
|
+
* de pago. La `reference` viaja en claro (es data del propio usuario,
|
|
7
|
+
* autenticado).
|
|
8
|
+
*/
|
|
9
|
+
class FavoriteSelection {
|
|
10
|
+
}
|
|
11
|
+
exports.FavoriteSelection = FavoriteSelection;
|
|
12
|
+
/**
|
|
13
|
+
* Metadata del favorito en sí (para menús contextuales, ordenamiento, etc.).
|
|
14
|
+
*/
|
|
15
|
+
class FavoriteDetailMeta {
|
|
16
|
+
}
|
|
17
|
+
exports.FavoriteDetailMeta = FavoriteDetailMeta;
|
|
18
|
+
/**
|
|
19
|
+
* Response de `GET /favorites/{id}`. Devuelve el shape del árbol del catálogo
|
|
20
|
+
* (BRANCH padre con los LEAFs hermanos del favorito; el LEAF del favorito
|
|
21
|
+
* trae `leaf` populado inline) más la selección previa y la metadata editable.
|
|
22
|
+
*
|
|
23
|
+
* El frontend reusa `renderCatalog(catalog)` sin caso especial.
|
|
24
|
+
*/
|
|
25
|
+
class FavoriteDetailResponse {
|
|
26
|
+
}
|
|
27
|
+
exports.FavoriteDetailResponse = FavoriteDetailResponse;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FavoriteDisabledReasonEnum } from "../enums/FavoriteDisabledReasonEnum";
|
|
2
|
+
/**
|
|
3
|
+
* Ítem que viaja en `GET /favorites`. Representa un favorito ACTIVO
|
|
4
|
+
* (la lista filtra `disabled=true` por default).
|
|
5
|
+
*/
|
|
6
|
+
export declare class FavoriteItem {
|
|
7
|
+
id: string;
|
|
8
|
+
benefitId: string;
|
|
9
|
+
leafId: string;
|
|
10
|
+
productId: string;
|
|
11
|
+
referenceMasked: string;
|
|
12
|
+
alias: string | null;
|
|
13
|
+
photo: string | null;
|
|
14
|
+
position: number;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
disabledReason: FavoriteDisabledReasonEnum | null;
|
|
17
|
+
lastProductId: string | null;
|
|
18
|
+
lastAmount: number | null;
|
|
19
|
+
usageCount: number;
|
|
20
|
+
lastUsedAt: number;
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FavoriteItem = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Ítem que viaja en `GET /favorites`. Representa un favorito ACTIVO
|
|
6
|
+
* (la lista filtra `disabled=true` por default).
|
|
7
|
+
*/
|
|
8
|
+
class FavoriteItem {
|
|
9
|
+
}
|
|
10
|
+
exports.FavoriteItem = FavoriteItem;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class FavoriteReorderItem {
|
|
2
|
+
id: string;
|
|
3
|
+
position: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Body de `PATCH /favorites/reorder`. El frontend manda la lista completa con
|
|
7
|
+
* las posiciones finales (1, 2, 3, …); el backend confía y persiste.
|
|
8
|
+
*
|
|
9
|
+
* `items: []` es válido: equivale a no-op (drag sin cambios netos) y devuelve 204.
|
|
10
|
+
*/
|
|
11
|
+
export declare class FavoriteReorderRequest {
|
|
12
|
+
items: FavoriteReorderItem[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.FavoriteReorderRequest = exports.FavoriteReorderItem = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
class FavoriteReorderItem {
|
|
16
|
+
}
|
|
17
|
+
exports.FavoriteReorderItem = FavoriteReorderItem;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], FavoriteReorderItem.prototype, "id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsInt)(),
|
|
25
|
+
(0, class_validator_1.Min)(0),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], FavoriteReorderItem.prototype, "position", void 0);
|
|
28
|
+
/**
|
|
29
|
+
* Body de `PATCH /favorites/reorder`. El frontend manda la lista completa con
|
|
30
|
+
* las posiciones finales (1, 2, 3, …); el backend confía y persiste.
|
|
31
|
+
*
|
|
32
|
+
* `items: []` es válido: equivale a no-op (drag sin cambios netos) y devuelve 204.
|
|
33
|
+
*/
|
|
34
|
+
class FavoriteReorderRequest {
|
|
35
|
+
}
|
|
36
|
+
exports.FavoriteReorderRequest = FavoriteReorderRequest;
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsArray)(),
|
|
39
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
40
|
+
(0, class_transformer_1.Type)(() => FavoriteReorderItem),
|
|
41
|
+
__metadata("design:type", Array)
|
|
42
|
+
], FavoriteReorderRequest.prototype, "items", void 0);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body de `PATCH /favorites/{id}`. Solo `alias` y `photo` son editables por
|
|
3
|
+
* el usuario.
|
|
4
|
+
*
|
|
5
|
+
* - `undefined` (campo ausente) → no se toca.
|
|
6
|
+
* - `null` → borra el valor actual.
|
|
7
|
+
* - `string` → setea el nuevo valor (validado).
|
|
8
|
+
*
|
|
9
|
+
* Si AMBOS llegan `undefined`, el manager devuelve `INVALID_PATCH_PAYLOAD`
|
|
10
|
+
* (PATCH vacío no aporta).
|
|
11
|
+
*/
|
|
12
|
+
export declare class FavoriteUpdateRequest {
|
|
13
|
+
alias?: string | null;
|
|
14
|
+
photo?: string | null;
|
|
15
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.FavoriteUpdateRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
/**
|
|
15
|
+
* Body de `PATCH /favorites/{id}`. Solo `alias` y `photo` son editables por
|
|
16
|
+
* el usuario.
|
|
17
|
+
*
|
|
18
|
+
* - `undefined` (campo ausente) → no se toca.
|
|
19
|
+
* - `null` → borra el valor actual.
|
|
20
|
+
* - `string` → setea el nuevo valor (validado).
|
|
21
|
+
*
|
|
22
|
+
* Si AMBOS llegan `undefined`, el manager devuelve `INVALID_PATCH_PAYLOAD`
|
|
23
|
+
* (PATCH vacío no aporta).
|
|
24
|
+
*/
|
|
25
|
+
class FavoriteUpdateRequest {
|
|
26
|
+
}
|
|
27
|
+
exports.FavoriteUpdateRequest = FavoriteUpdateRequest;
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsOptional)(),
|
|
30
|
+
(0, class_validator_1.ValidateIf)((_, value) => value !== null),
|
|
31
|
+
(0, class_validator_1.IsString)(),
|
|
32
|
+
(0, class_validator_1.Length)(1, 60),
|
|
33
|
+
(0, class_validator_1.Matches)(/^[^\u0000-\u001f<>]+$/, { message: "alias contiene caracteres no permitidos" }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], FavoriteUpdateRequest.prototype, "alias", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_validator_1.IsOptional)(),
|
|
38
|
+
(0, class_validator_1.ValidateIf)((_, value) => value !== null),
|
|
39
|
+
(0, class_validator_1.IsUrl)({ protocols: ["https"], require_protocol: true }),
|
|
40
|
+
(0, class_validator_1.MaxLength)(500),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], FavoriteUpdateRequest.prototype, "photo", void 0);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AmountTypeEnum } from "../../servicePayment/enums/AmountTypeEnum";
|
|
2
|
+
import { FavoriteDisabledReasonEnum } from "../enums/FavoriteDisabledReasonEnum";
|
|
3
|
+
/**
|
|
4
|
+
* Información del leaf incluida en el response del validate cuando se pudo
|
|
5
|
+
* resolver. Si el leaf no existe (`reason === LEAF_NOT_FOUND`), no viaja.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FavoriteValidationLeaf {
|
|
8
|
+
name: string;
|
|
9
|
+
logo: string;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Información del producto. `price` es `null` cuando `amountType === VARIABLE`
|
|
14
|
+
* (productos de monto abierto donde el usuario decide cuánto pagar).
|
|
15
|
+
*/
|
|
16
|
+
export declare class FavoriteValidationProduct {
|
|
17
|
+
productId: string;
|
|
18
|
+
productName: string;
|
|
19
|
+
amountType: AmountTypeEnum;
|
|
20
|
+
price: number | null;
|
|
21
|
+
currency: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Resultado del endpoint `POST /favorites/{id}/validate`. Si `valid === false`,
|
|
25
|
+
* el backend ya marcó `disabled: true` con `disabledReason: <reason>` en la
|
|
26
|
+
* misma operación (excepto `USER`, que solo se setea por soft-delete del usuario).
|
|
27
|
+
*/
|
|
28
|
+
export declare class FavoriteValidationResult {
|
|
29
|
+
id: string;
|
|
30
|
+
valid: boolean;
|
|
31
|
+
reason?: FavoriteDisabledReasonEnum;
|
|
32
|
+
leaf?: FavoriteValidationLeaf;
|
|
33
|
+
product?: FavoriteValidationProduct;
|
|
34
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FavoriteValidationResult = exports.FavoriteValidationProduct = exports.FavoriteValidationLeaf = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Información del leaf incluida en el response del validate cuando se pudo
|
|
6
|
+
* resolver. Si el leaf no existe (`reason === LEAF_NOT_FOUND`), no viaja.
|
|
7
|
+
*/
|
|
8
|
+
class FavoriteValidationLeaf {
|
|
9
|
+
}
|
|
10
|
+
exports.FavoriteValidationLeaf = FavoriteValidationLeaf;
|
|
11
|
+
/**
|
|
12
|
+
* Información del producto. `price` es `null` cuando `amountType === VARIABLE`
|
|
13
|
+
* (productos de monto abierto donde el usuario decide cuánto pagar).
|
|
14
|
+
*/
|
|
15
|
+
class FavoriteValidationProduct {
|
|
16
|
+
}
|
|
17
|
+
exports.FavoriteValidationProduct = FavoriteValidationProduct;
|
|
18
|
+
/**
|
|
19
|
+
* Resultado del endpoint `POST /favorites/{id}/validate`. Si `valid === false`,
|
|
20
|
+
* el backend ya marcó `disabled: true` con `disabledReason: <reason>` en la
|
|
21
|
+
* misma operación (excepto `USER`, que solo se setea por soft-delete del usuario).
|
|
22
|
+
*/
|
|
23
|
+
class FavoriteValidationResult {
|
|
24
|
+
}
|
|
25
|
+
exports.FavoriteValidationResult = FavoriteValidationResult;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Razón por la que un favorito quedó deshabilitado (`disabled === true`).
|
|
3
|
+
*
|
|
4
|
+
* - `USER` solo aparece como motivo de deshabilitación (soft delete del usuario);
|
|
5
|
+
* nunca aparece como `reason` en el response del endpoint de validación.
|
|
6
|
+
* - Las otras 4 razones describen por qué el favorito no es usable contra el
|
|
7
|
+
* catálogo actual y SÍ pueden aparecer en el `ValidationResult.reason`.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum FavoriteDisabledReasonEnum {
|
|
10
|
+
USER = "USER",
|
|
11
|
+
LEAF_NOT_FOUND = "LEAF_NOT_FOUND",
|
|
12
|
+
LEAF_DISABLED = "LEAF_DISABLED",
|
|
13
|
+
LEAF_NOT_VISIBLE = "LEAF_NOT_VISIBLE",
|
|
14
|
+
PRODUCT_NOT_FOUND = "PRODUCT_NOT_FOUND"
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FavoriteDisabledReasonEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Razón por la que un favorito quedó deshabilitado (`disabled === true`).
|
|
6
|
+
*
|
|
7
|
+
* - `USER` solo aparece como motivo de deshabilitación (soft delete del usuario);
|
|
8
|
+
* nunca aparece como `reason` en el response del endpoint de validación.
|
|
9
|
+
* - Las otras 4 razones describen por qué el favorito no es usable contra el
|
|
10
|
+
* catálogo actual y SÍ pueden aparecer en el `ValidationResult.reason`.
|
|
11
|
+
*/
|
|
12
|
+
var FavoriteDisabledReasonEnum;
|
|
13
|
+
(function (FavoriteDisabledReasonEnum) {
|
|
14
|
+
FavoriteDisabledReasonEnum["USER"] = "USER";
|
|
15
|
+
FavoriteDisabledReasonEnum["LEAF_NOT_FOUND"] = "LEAF_NOT_FOUND";
|
|
16
|
+
FavoriteDisabledReasonEnum["LEAF_DISABLED"] = "LEAF_DISABLED";
|
|
17
|
+
FavoriteDisabledReasonEnum["LEAF_NOT_VISIBLE"] = "LEAF_NOT_VISIBLE";
|
|
18
|
+
FavoriteDisabledReasonEnum["PRODUCT_NOT_FOUND"] = "PRODUCT_NOT_FOUND";
|
|
19
|
+
})(FavoriteDisabledReasonEnum || (exports.FavoriteDisabledReasonEnum = FavoriteDisabledReasonEnum = {}));
|
|
@@ -7,6 +7,7 @@ export * from "./enums/BannerStatusEnum";
|
|
|
7
7
|
export * from "./enums/BannerLocaleEnum";
|
|
8
8
|
export * from "./enums/BannerScreenEnum";
|
|
9
9
|
export * from "./enums/BannerTemplateVariantEnum";
|
|
10
|
+
export * from "./enums/FavoriteDisabledReasonEnum";
|
|
10
11
|
export * from "./dtos/BenefitItem";
|
|
11
12
|
export * from "./dtos/BenefitListResponse";
|
|
12
13
|
export * from "./dtos/BenefitSummary";
|
|
@@ -39,3 +40,9 @@ export * from "./dtos/BannerUpdateRequest";
|
|
|
39
40
|
export * from "./dtos/BannerTemplateThemeRequest";
|
|
40
41
|
export * from "./dtos/BannerTemplateRequest";
|
|
41
42
|
export * from "./dtos/PublicVerifyReferenceRequest";
|
|
43
|
+
export * from "./dtos/FavoriteItem";
|
|
44
|
+
export * from "./dtos/FavoriteListResponse";
|
|
45
|
+
export * from "./dtos/FavoriteValidationResult";
|
|
46
|
+
export * from "./dtos/FavoriteDetailResponse";
|
|
47
|
+
export * from "./dtos/FavoriteUpdateRequest";
|
|
48
|
+
export * from "./dtos/FavoriteReorderRequest";
|
|
@@ -24,6 +24,7 @@ __exportStar(require("./enums/BannerStatusEnum"), exports);
|
|
|
24
24
|
__exportStar(require("./enums/BannerLocaleEnum"), exports);
|
|
25
25
|
__exportStar(require("./enums/BannerScreenEnum"), exports);
|
|
26
26
|
__exportStar(require("./enums/BannerTemplateVariantEnum"), exports);
|
|
27
|
+
__exportStar(require("./enums/FavoriteDisabledReasonEnum"), exports);
|
|
27
28
|
//DTOs
|
|
28
29
|
__exportStar(require("./dtos/BenefitItem"), exports);
|
|
29
30
|
__exportStar(require("./dtos/BenefitListResponse"), exports);
|
|
@@ -58,3 +59,10 @@ __exportStar(require("./dtos/BannerUpdateRequest"), exports);
|
|
|
58
59
|
__exportStar(require("./dtos/BannerTemplateThemeRequest"), exports);
|
|
59
60
|
__exportStar(require("./dtos/BannerTemplateRequest"), exports);
|
|
60
61
|
__exportStar(require("./dtos/PublicVerifyReferenceRequest"), exports);
|
|
62
|
+
//Favorites (v3.8.1)
|
|
63
|
+
__exportStar(require("./dtos/FavoriteItem"), exports);
|
|
64
|
+
__exportStar(require("./dtos/FavoriteListResponse"), exports);
|
|
65
|
+
__exportStar(require("./dtos/FavoriteValidationResult"), exports);
|
|
66
|
+
__exportStar(require("./dtos/FavoriteDetailResponse"), exports);
|
|
67
|
+
__exportStar(require("./dtos/FavoriteUpdateRequest"), exports);
|
|
68
|
+
__exportStar(require("./dtos/FavoriteReorderRequest"), exports);
|
|
@@ -21,9 +21,9 @@ export declare class BackofficeCreditRow {
|
|
|
21
21
|
total_iva_mxn?: number;
|
|
22
22
|
iva_rate?: number;
|
|
23
23
|
fiado_rate_points?: number;
|
|
24
|
-
|
|
24
|
+
partner_rate_points?: number;
|
|
25
25
|
fiado_interest_mxn?: number;
|
|
26
|
-
|
|
26
|
+
partner_interest_mxn?: number;
|
|
27
27
|
credit_level?: string;
|
|
28
28
|
disbursed_at?: string;
|
|
29
29
|
first_payment_date?: string;
|
|
@@ -51,7 +51,7 @@ export declare class BackofficeCreditPaymentScheduleRow {
|
|
|
51
51
|
iva_mxn?: number;
|
|
52
52
|
total_mxn?: number;
|
|
53
53
|
fiado_interest_mxn?: number;
|
|
54
|
-
|
|
54
|
+
partner_interest_mxn?: number;
|
|
55
55
|
remaining_balance_mxn?: number;
|
|
56
56
|
status?: string;
|
|
57
57
|
paid_amount_mxn?: number;
|
|
@@ -59,7 +59,7 @@ export declare class BackofficeCreditPaymentScheduleRow {
|
|
|
59
59
|
interest_collected_mxn?: number;
|
|
60
60
|
iva_collected_mxn?: number;
|
|
61
61
|
fiado_interest_collected_mxn?: number;
|
|
62
|
-
|
|
62
|
+
partner_interest_collected_mxn?: number;
|
|
63
63
|
anticipated_reduction_mxn?: number;
|
|
64
64
|
collection_attempts?: number;
|
|
65
65
|
last_collection_date?: string;
|
package/package.json
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BenefitSummary } from "./BenefitSummary";
|
|
2
|
+
import { CatalogNode } from "./CatalogNode";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Selección previa del usuario que el frontend usa para pre-llenar el form
|
|
6
|
+
* de pago. La `reference` viaja en claro (es data del propio usuario,
|
|
7
|
+
* autenticado).
|
|
8
|
+
*/
|
|
9
|
+
export class FavoriteSelection {
|
|
10
|
+
leafId: string;
|
|
11
|
+
productId: string;
|
|
12
|
+
amount: number | null;
|
|
13
|
+
reference: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Metadata del favorito en sí (para menús contextuales, ordenamiento, etc.).
|
|
18
|
+
*/
|
|
19
|
+
export class FavoriteDetailMeta {
|
|
20
|
+
id: string;
|
|
21
|
+
alias: string | null;
|
|
22
|
+
photo: string | null;
|
|
23
|
+
position: number;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
usageCount: number;
|
|
26
|
+
lastUsedAt: number;
|
|
27
|
+
createdAt: number;
|
|
28
|
+
updatedAt: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Response de `GET /favorites/{id}`. Devuelve el shape del árbol del catálogo
|
|
33
|
+
* (BRANCH padre con los LEAFs hermanos del favorito; el LEAF del favorito
|
|
34
|
+
* trae `leaf` populado inline) más la selección previa y la metadata editable.
|
|
35
|
+
*
|
|
36
|
+
* El frontend reusa `renderCatalog(catalog)` sin caso especial.
|
|
37
|
+
*/
|
|
38
|
+
export class FavoriteDetailResponse {
|
|
39
|
+
benefit: BenefitSummary;
|
|
40
|
+
catalog: CatalogNode;
|
|
41
|
+
selection: FavoriteSelection;
|
|
42
|
+
favorite: FavoriteDetailMeta;
|
|
43
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FavoriteDisabledReasonEnum } from "../enums/FavoriteDisabledReasonEnum";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Ítem que viaja en `GET /favorites`. Representa un favorito ACTIVO
|
|
5
|
+
* (la lista filtra `disabled=true` por default).
|
|
6
|
+
*/
|
|
7
|
+
export class FavoriteItem {
|
|
8
|
+
id: string;
|
|
9
|
+
benefitId: string;
|
|
10
|
+
|
|
11
|
+
leafId: string;
|
|
12
|
+
productId: string;
|
|
13
|
+
referenceMasked: string; // "555****567" — el campo crudo no se expone en lista
|
|
14
|
+
|
|
15
|
+
alias: string | null;
|
|
16
|
+
photo: string | null;
|
|
17
|
+
position: number; // orden definido por el usuario (drag-and-drop)
|
|
18
|
+
disabled: boolean; // siempre false en GET (filtra disabled=true por default)
|
|
19
|
+
disabledReason: FavoriteDisabledReasonEnum | null;
|
|
20
|
+
|
|
21
|
+
lastProductId: string | null;
|
|
22
|
+
lastAmount: number | null;
|
|
23
|
+
usageCount: number;
|
|
24
|
+
lastUsedAt: number;
|
|
25
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IsArray,
|
|
3
|
+
IsInt,
|
|
4
|
+
IsNotEmpty,
|
|
5
|
+
IsString,
|
|
6
|
+
Min,
|
|
7
|
+
ValidateNested,
|
|
8
|
+
} from "class-validator";
|
|
9
|
+
import { Type } from "class-transformer";
|
|
10
|
+
|
|
11
|
+
export class FavoriteReorderItem {
|
|
12
|
+
@IsString()
|
|
13
|
+
@IsNotEmpty()
|
|
14
|
+
id!: string;
|
|
15
|
+
|
|
16
|
+
@IsInt()
|
|
17
|
+
@Min(0)
|
|
18
|
+
position!: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Body de `PATCH /favorites/reorder`. El frontend manda la lista completa con
|
|
23
|
+
* las posiciones finales (1, 2, 3, …); el backend confía y persiste.
|
|
24
|
+
*
|
|
25
|
+
* `items: []` es válido: equivale a no-op (drag sin cambios netos) y devuelve 204.
|
|
26
|
+
*/
|
|
27
|
+
export class FavoriteReorderRequest {
|
|
28
|
+
@IsArray()
|
|
29
|
+
@ValidateNested({ each: true })
|
|
30
|
+
@Type(() => FavoriteReorderItem)
|
|
31
|
+
items!: FavoriteReorderItem[];
|
|
32
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IsOptional,
|
|
3
|
+
IsString,
|
|
4
|
+
IsUrl,
|
|
5
|
+
Length,
|
|
6
|
+
Matches,
|
|
7
|
+
MaxLength,
|
|
8
|
+
ValidateIf,
|
|
9
|
+
} from "class-validator";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Body de `PATCH /favorites/{id}`. Solo `alias` y `photo` son editables por
|
|
13
|
+
* el usuario.
|
|
14
|
+
*
|
|
15
|
+
* - `undefined` (campo ausente) → no se toca.
|
|
16
|
+
* - `null` → borra el valor actual.
|
|
17
|
+
* - `string` → setea el nuevo valor (validado).
|
|
18
|
+
*
|
|
19
|
+
* Si AMBOS llegan `undefined`, el manager devuelve `INVALID_PATCH_PAYLOAD`
|
|
20
|
+
* (PATCH vacío no aporta).
|
|
21
|
+
*/
|
|
22
|
+
export class FavoriteUpdateRequest {
|
|
23
|
+
@IsOptional()
|
|
24
|
+
@ValidateIf((_, value) => value !== null)
|
|
25
|
+
@IsString()
|
|
26
|
+
@Length(1, 60)
|
|
27
|
+
@Matches(/^[^\u0000-\u001f<>]+$/, { message: "alias contiene caracteres no permitidos" })
|
|
28
|
+
alias?: string | null;
|
|
29
|
+
|
|
30
|
+
@IsOptional()
|
|
31
|
+
@ValidateIf((_, value) => value !== null)
|
|
32
|
+
@IsUrl({ protocols: ["https"], require_protocol: true })
|
|
33
|
+
@MaxLength(500)
|
|
34
|
+
photo?: string | null;
|
|
35
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AmountTypeEnum } from "../../servicePayment/enums/AmountTypeEnum";
|
|
2
|
+
import { FavoriteDisabledReasonEnum } from "../enums/FavoriteDisabledReasonEnum";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Información del leaf incluida en el response del validate cuando se pudo
|
|
6
|
+
* resolver. Si el leaf no existe (`reason === LEAF_NOT_FOUND`), no viaja.
|
|
7
|
+
*/
|
|
8
|
+
export class FavoriteValidationLeaf {
|
|
9
|
+
name: string;
|
|
10
|
+
logo: string;
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Información del producto. `price` es `null` cuando `amountType === VARIABLE`
|
|
16
|
+
* (productos de monto abierto donde el usuario decide cuánto pagar).
|
|
17
|
+
*/
|
|
18
|
+
export class FavoriteValidationProduct {
|
|
19
|
+
productId: string;
|
|
20
|
+
productName: string;
|
|
21
|
+
amountType: AmountTypeEnum;
|
|
22
|
+
price: number | null;
|
|
23
|
+
currency: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Resultado del endpoint `POST /favorites/{id}/validate`. Si `valid === false`,
|
|
28
|
+
* el backend ya marcó `disabled: true` con `disabledReason: <reason>` en la
|
|
29
|
+
* misma operación (excepto `USER`, que solo se setea por soft-delete del usuario).
|
|
30
|
+
*/
|
|
31
|
+
export class FavoriteValidationResult {
|
|
32
|
+
id: string;
|
|
33
|
+
valid: boolean;
|
|
34
|
+
reason?: FavoriteDisabledReasonEnum; // Nunca `USER` — eso es soft delete, no validación.
|
|
35
|
+
leaf?: FavoriteValidationLeaf;
|
|
36
|
+
product?: FavoriteValidationProduct;
|
|
37
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Razón por la que un favorito quedó deshabilitado (`disabled === true`).
|
|
3
|
+
*
|
|
4
|
+
* - `USER` solo aparece como motivo de deshabilitación (soft delete del usuario);
|
|
5
|
+
* nunca aparece como `reason` en el response del endpoint de validación.
|
|
6
|
+
* - Las otras 4 razones describen por qué el favorito no es usable contra el
|
|
7
|
+
* catálogo actual y SÍ pueden aparecer en el `ValidationResult.reason`.
|
|
8
|
+
*/
|
|
9
|
+
export enum FavoriteDisabledReasonEnum {
|
|
10
|
+
USER = "USER",
|
|
11
|
+
LEAF_NOT_FOUND = "LEAF_NOT_FOUND",
|
|
12
|
+
LEAF_DISABLED = "LEAF_DISABLED",
|
|
13
|
+
LEAF_NOT_VISIBLE = "LEAF_NOT_VISIBLE",
|
|
14
|
+
PRODUCT_NOT_FOUND = "PRODUCT_NOT_FOUND",
|
|
15
|
+
}
|
|
@@ -8,6 +8,7 @@ export * from "./enums/BannerStatusEnum";
|
|
|
8
8
|
export * from "./enums/BannerLocaleEnum";
|
|
9
9
|
export * from "./enums/BannerScreenEnum";
|
|
10
10
|
export * from "./enums/BannerTemplateVariantEnum";
|
|
11
|
+
export * from "./enums/FavoriteDisabledReasonEnum";
|
|
11
12
|
|
|
12
13
|
//DTOs
|
|
13
14
|
export * from "./dtos/BenefitItem";
|
|
@@ -43,3 +44,10 @@ export * from "./dtos/BannerUpdateRequest";
|
|
|
43
44
|
export * from "./dtos/BannerTemplateThemeRequest";
|
|
44
45
|
export * from "./dtos/BannerTemplateRequest";
|
|
45
46
|
export * from "./dtos/PublicVerifyReferenceRequest";
|
|
47
|
+
//Favorites (v3.8.1)
|
|
48
|
+
export * from "./dtos/FavoriteItem";
|
|
49
|
+
export * from "./dtos/FavoriteListResponse";
|
|
50
|
+
export * from "./dtos/FavoriteValidationResult";
|
|
51
|
+
export * from "./dtos/FavoriteDetailResponse";
|
|
52
|
+
export * from "./dtos/FavoriteUpdateRequest";
|
|
53
|
+
export * from "./dtos/FavoriteReorderRequest";
|
|
@@ -21,9 +21,9 @@ export class BackofficeCreditRow {
|
|
|
21
21
|
total_iva_mxn?: number;
|
|
22
22
|
iva_rate?: number;
|
|
23
23
|
fiado_rate_points?: number;
|
|
24
|
-
|
|
24
|
+
partner_rate_points?: number;
|
|
25
25
|
fiado_interest_mxn?: number;
|
|
26
|
-
|
|
26
|
+
partner_interest_mxn?: number;
|
|
27
27
|
credit_level?: string;
|
|
28
28
|
disbursed_at?: string;
|
|
29
29
|
first_payment_date?: string;
|
|
@@ -52,7 +52,7 @@ export class BackofficeCreditPaymentScheduleRow {
|
|
|
52
52
|
iva_mxn?: number;
|
|
53
53
|
total_mxn?: number;
|
|
54
54
|
fiado_interest_mxn?: number;
|
|
55
|
-
|
|
55
|
+
partner_interest_mxn?: number;
|
|
56
56
|
remaining_balance_mxn?: number;
|
|
57
57
|
status?: string;
|
|
58
58
|
paid_amount_mxn?: number;
|
|
@@ -60,7 +60,7 @@ export class BackofficeCreditPaymentScheduleRow {
|
|
|
60
60
|
interest_collected_mxn?: number;
|
|
61
61
|
iva_collected_mxn?: number;
|
|
62
62
|
fiado_interest_collected_mxn?: number;
|
|
63
|
-
|
|
63
|
+
partner_interest_collected_mxn?: number;
|
|
64
64
|
anticipated_reduction_mxn?: number;
|
|
65
65
|
collection_attempts?: number;
|
|
66
66
|
last_collection_date?: string;
|