@fiado/type-kit 3.182.0 → 3.183.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.
Files changed (36) hide show
  1. package/_test_/unit/benefitCenter/benefitFlowString.test.ts +22 -0
  2. package/_test_/unit/benefitCenter/flowDtos.test.ts +27 -0
  3. package/bin/benefitCenter/dtos/BenefitCreateRequest.d.ts +1 -2
  4. package/bin/benefitCenter/dtos/BenefitCreateRequest.js +2 -2
  5. package/bin/benefitCenter/dtos/BenefitItem.d.ts +1 -2
  6. package/bin/benefitCenter/dtos/BenefitSummary.d.ts +1 -2
  7. package/bin/benefitCenter/dtos/BenefitUpdateRequest.d.ts +1 -2
  8. package/bin/benefitCenter/dtos/BenefitUpdateRequest.js +2 -2
  9. package/bin/benefitCenter/dtos/FavoriteItem.d.ts +1 -2
  10. package/bin/benefitCenter/dtos/FlowDtos.d.ts +36 -0
  11. package/bin/benefitCenter/dtos/FlowDtos.js +109 -0
  12. package/bin/benefitCenter/enums/FlowStatusEnum.d.ts +4 -0
  13. package/bin/benefitCenter/enums/FlowStatusEnum.js +8 -0
  14. package/bin/benefitCenter/enums/FlowTypeEnum.d.ts +6 -0
  15. package/bin/benefitCenter/enums/FlowTypeEnum.js +10 -0
  16. package/bin/benefitCenter/index.d.ts +3 -1
  17. package/bin/benefitCenter/index.js +4 -1
  18. package/package.json +1 -1
  19. package/src/benefitCenter/dtos/BenefitCreateRequest.ts +3 -3
  20. package/src/benefitCenter/dtos/BenefitItem.ts +1 -3
  21. package/src/benefitCenter/dtos/BenefitSummary.ts +1 -3
  22. package/src/benefitCenter/dtos/BenefitUpdateRequest.ts +2 -2
  23. package/src/benefitCenter/dtos/FavoriteItem.ts +1 -2
  24. package/src/benefitCenter/dtos/FlowDtos.ts +73 -0
  25. package/src/benefitCenter/enums/FlowStatusEnum.ts +4 -0
  26. package/src/benefitCenter/enums/FlowTypeEnum.ts +6 -0
  27. package/src/benefitCenter/index.ts +4 -1
  28. package/bin/benefitCenter/enums/BenefitFlowEnum.d.ts +0 -11
  29. package/bin/benefitCenter/enums/BenefitFlowEnum.js +0 -15
  30. package/bin/places/dtos/CashInFeeDto.d.ts +0 -17
  31. package/bin/places/dtos/CashInFeeDto.js +0 -12
  32. package/bin/platformRbac/dtos/ResendOtpRequest.d.ts +0 -22
  33. package/bin/platformRbac/dtos/ResendOtpRequest.js +0 -36
  34. package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.d.ts +0 -11
  35. package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.js +0 -36
  36. package/src/benefitCenter/enums/BenefitFlowEnum.ts +0 -11
@@ -0,0 +1,22 @@
1
+ import "reflect-metadata";
2
+ import { plainToInstance } from "class-transformer";
3
+ import { validateSync } from "class-validator";
4
+ import { BenefitCreateRequest } from "../../../src/benefitCenter/dtos/BenefitCreateRequest";
5
+
6
+ describe("BenefitCreateRequest.flow como referencia string", () => {
7
+ it("acepta cualquier reference string no vacía (incluso fuera del enum legacy)", () => {
8
+ const dto = plainToInstance(BenefitCreateRequest, {
9
+ name: "X", status: "ACTIVE", sortOrder: 1, flow: "CUSTOM_FLOW_XYZ",
10
+ });
11
+ const errors = validateSync(dto).filter(e => e.property === "flow");
12
+ expect(errors).toHaveLength(0);
13
+ });
14
+
15
+ it("rechaza flow vacío", () => {
16
+ const dto = plainToInstance(BenefitCreateRequest, {
17
+ name: "X", status: "ACTIVE", sortOrder: 1, flow: "",
18
+ });
19
+ const errors = validateSync(dto).filter(e => e.property === "flow");
20
+ expect(errors.length).toBeGreaterThan(0);
21
+ });
22
+ });
@@ -0,0 +1,27 @@
1
+ import "reflect-metadata";
2
+ import { plainToInstance } from "class-transformer";
3
+ import { validateSync } from "class-validator";
4
+ import { FlowCreateRequest } from "../../../src/benefitCenter/dtos/FlowDtos";
5
+ import { FlowTypeEnum } from "../../../src/benefitCenter/enums/FlowTypeEnum";
6
+ import { FlowStatusEnum } from "../../../src/benefitCenter/enums/FlowStatusEnum";
7
+
8
+ describe("FlowCreateRequest", () => {
9
+ it("acepta un payload válido", () => {
10
+ const dto = plainToInstance(FlowCreateRequest, {
11
+ name: "Recargas",
12
+ reference: "TOPUPS",
13
+ type: FlowTypeEnum.INTERNAL,
14
+ status: FlowStatusEnum.ACTIVE,
15
+ sortOrder: 1,
16
+ supportedProps: [{ name: "leafId", required: false }],
17
+ });
18
+ expect(validateSync(dto)).toHaveLength(0);
19
+ });
20
+
21
+ it("rechaza reference vacía y type inválido", () => {
22
+ const dto = plainToInstance(FlowCreateRequest, {
23
+ name: "X", reference: "", type: "NOPE", status: FlowStatusEnum.ACTIVE, sortOrder: 0,
24
+ });
25
+ expect(validateSync(dto).length).toBeGreaterThan(0);
26
+ });
27
+ });
@@ -1,4 +1,3 @@
1
- import { BenefitFlowEnum } from "../enums/BenefitFlowEnum";
2
1
  import { BenefitModuleConfigRequest } from "./BenefitModuleConfigRequest";
3
2
  /** Mirror enum-like de BenefitCatalogStatus en el type-kit (para validación). */
4
3
  export declare enum BenefitCatalogStatusEnum {
@@ -13,7 +12,7 @@ export declare class BenefitCreateRequest {
13
12
  status: BenefitCatalogStatusEnum;
14
13
  sortOrder: number;
15
14
  icon?: string;
16
- flow: BenefitFlowEnum;
15
+ flow: string;
17
16
  translationKey?: string;
18
17
  moduleConfig: BenefitModuleConfigRequest;
19
18
  /**
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.BenefitCreateRequest = exports.BenefitCatalogStatusEnum = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const class_transformer_1 = require("class-transformer");
15
- const BenefitFlowEnum_1 = require("../enums/BenefitFlowEnum");
16
15
  const BenefitModuleConfigRequest_1 = require("./BenefitModuleConfigRequest");
17
16
  /** Mirror enum-like de BenefitCatalogStatus en el type-kit (para validación). */
18
17
  var BenefitCatalogStatusEnum;
@@ -54,7 +53,8 @@ __decorate([
54
53
  __metadata("design:type", String)
55
54
  ], BenefitCreateRequest.prototype, "icon", void 0);
56
55
  __decorate([
57
- (0, class_validator_1.IsEnum)(BenefitFlowEnum_1.BenefitFlowEnum),
56
+ (0, class_validator_1.IsString)(),
57
+ (0, class_validator_1.IsNotEmpty)(),
58
58
  __metadata("design:type", String)
59
59
  ], BenefitCreateRequest.prototype, "flow", void 0);
60
60
  __decorate([
@@ -1,10 +1,9 @@
1
- import { BenefitFlowEnum } from "../enums/BenefitFlowEnum";
2
1
  export declare class BenefitItem {
3
2
  id: string;
4
3
  name: string;
5
4
  description: string;
6
5
  icon: string;
7
- flow: BenefitFlowEnum;
6
+ flow: string;
8
7
  translationKey: string;
9
8
  sortOrder: number;
10
9
  }
@@ -1,7 +1,6 @@
1
- import { BenefitFlowEnum } from "../enums/BenefitFlowEnum";
2
1
  export declare class BenefitSummary {
3
2
  id: string;
4
3
  name: string;
5
- flow: BenefitFlowEnum;
4
+ flow: string;
6
5
  version: string;
7
6
  }
@@ -1,4 +1,3 @@
1
- import { BenefitFlowEnum } from "../enums/BenefitFlowEnum";
2
1
  import { BenefitCatalogStatusEnum } from "./BenefitCreateRequest";
3
2
  import { BenefitModuleConfigRequest } from "./BenefitModuleConfigRequest";
4
3
  export declare class BenefitUpdateRequest {
@@ -7,7 +6,7 @@ export declare class BenefitUpdateRequest {
7
6
  status?: BenefitCatalogStatusEnum;
8
7
  sortOrder?: number;
9
8
  icon?: string;
10
- flow?: BenefitFlowEnum;
9
+ flow?: string;
11
10
  translationKey?: string;
12
11
  moduleConfig?: BenefitModuleConfigRequest;
13
12
  /**
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.BenefitUpdateRequest = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const class_transformer_1 = require("class-transformer");
15
- const BenefitFlowEnum_1 = require("../enums/BenefitFlowEnum");
16
15
  const BenefitCreateRequest_1 = require("./BenefitCreateRequest");
17
16
  const BenefitModuleConfigRequest_1 = require("./BenefitModuleConfigRequest");
18
17
  class BenefitUpdateRequest {
@@ -46,7 +45,8 @@ __decorate([
46
45
  ], BenefitUpdateRequest.prototype, "icon", void 0);
47
46
  __decorate([
48
47
  (0, class_validator_1.IsOptional)(),
49
- (0, class_validator_1.IsEnum)(BenefitFlowEnum_1.BenefitFlowEnum),
48
+ (0, class_validator_1.IsString)(),
49
+ (0, class_validator_1.IsNotEmpty)(),
50
50
  __metadata("design:type", String)
51
51
  ], BenefitUpdateRequest.prototype, "flow", void 0);
52
52
  __decorate([
@@ -1,5 +1,4 @@
1
1
  import { FavoriteDisabledReasonEnum } from "../enums/FavoriteDisabledReasonEnum";
2
- import { BenefitFlowEnum } from "../enums/BenefitFlowEnum";
3
2
  /**
4
3
  * Ítem que viaja en `GET /favorites`. Representa un favorito ACTIVO
5
4
  * (la lista filtra `disabled=true` por default).
@@ -19,7 +18,7 @@ export declare class FavoriteItem {
19
18
  lastAmount: number | null;
20
19
  usageCount: number;
21
20
  lastUsedAt: number;
22
- flow?: BenefitFlowEnum;
21
+ flow?: string;
23
22
  destinationCountryISO?: string;
24
23
  beneficiaryFirstName?: string;
25
24
  beneficiaryLastName?: string;
@@ -0,0 +1,36 @@
1
+ import { FlowTypeEnum } from "../enums/FlowTypeEnum";
2
+ import { FlowStatusEnum } from "../enums/FlowStatusEnum";
3
+ export declare class FlowSupportedProp {
4
+ name: string;
5
+ required: boolean;
6
+ }
7
+ export interface FlowResponse {
8
+ id: string;
9
+ name: string;
10
+ reference: string;
11
+ type: FlowTypeEnum;
12
+ description?: string;
13
+ supportedProps: FlowSupportedProp[];
14
+ status: FlowStatusEnum;
15
+ sortOrder: number;
16
+ createdAt?: number;
17
+ updatedAt?: number;
18
+ }
19
+ export declare class FlowCreateRequest {
20
+ name: string;
21
+ reference: string;
22
+ type: FlowTypeEnum;
23
+ description?: string;
24
+ supportedProps?: FlowSupportedProp[];
25
+ status: FlowStatusEnum;
26
+ sortOrder: number;
27
+ }
28
+ export declare class FlowUpdateRequest {
29
+ name?: string;
30
+ reference?: string;
31
+ type?: FlowTypeEnum;
32
+ description?: string;
33
+ supportedProps?: FlowSupportedProp[];
34
+ status?: FlowStatusEnum;
35
+ sortOrder?: number;
36
+ }
@@ -0,0 +1,109 @@
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.FlowUpdateRequest = exports.FlowCreateRequest = exports.FlowSupportedProp = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const FlowTypeEnum_1 = require("../enums/FlowTypeEnum");
16
+ const FlowStatusEnum_1 = require("../enums/FlowStatusEnum");
17
+ class FlowSupportedProp {
18
+ }
19
+ exports.FlowSupportedProp = FlowSupportedProp;
20
+ __decorate([
21
+ (0, class_validator_1.IsString)(),
22
+ (0, class_validator_1.IsNotEmpty)(),
23
+ __metadata("design:type", String)
24
+ ], FlowSupportedProp.prototype, "name", void 0);
25
+ __decorate([
26
+ (0, class_validator_1.IsBoolean)(),
27
+ __metadata("design:type", Boolean)
28
+ ], FlowSupportedProp.prototype, "required", void 0);
29
+ class FlowCreateRequest {
30
+ }
31
+ exports.FlowCreateRequest = FlowCreateRequest;
32
+ __decorate([
33
+ (0, class_validator_1.IsString)(),
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ __metadata("design:type", String)
36
+ ], FlowCreateRequest.prototype, "name", void 0);
37
+ __decorate([
38
+ (0, class_validator_1.IsString)(),
39
+ (0, class_validator_1.IsNotEmpty)(),
40
+ __metadata("design:type", String)
41
+ ], FlowCreateRequest.prototype, "reference", void 0);
42
+ __decorate([
43
+ (0, class_validator_1.IsEnum)(FlowTypeEnum_1.FlowTypeEnum),
44
+ __metadata("design:type", String)
45
+ ], FlowCreateRequest.prototype, "type", void 0);
46
+ __decorate([
47
+ (0, class_validator_1.IsOptional)(),
48
+ (0, class_validator_1.IsString)(),
49
+ __metadata("design:type", String)
50
+ ], FlowCreateRequest.prototype, "description", void 0);
51
+ __decorate([
52
+ (0, class_validator_1.IsOptional)(),
53
+ (0, class_validator_1.IsArray)(),
54
+ (0, class_validator_1.ValidateNested)({ each: true }),
55
+ (0, class_transformer_1.Type)(() => FlowSupportedProp),
56
+ __metadata("design:type", Array)
57
+ ], FlowCreateRequest.prototype, "supportedProps", void 0);
58
+ __decorate([
59
+ (0, class_validator_1.IsEnum)(FlowStatusEnum_1.FlowStatusEnum),
60
+ __metadata("design:type", String)
61
+ ], FlowCreateRequest.prototype, "status", void 0);
62
+ __decorate([
63
+ (0, class_validator_1.IsInt)(),
64
+ (0, class_validator_1.Min)(0),
65
+ __metadata("design:type", Number)
66
+ ], FlowCreateRequest.prototype, "sortOrder", void 0);
67
+ class FlowUpdateRequest {
68
+ }
69
+ exports.FlowUpdateRequest = FlowUpdateRequest;
70
+ __decorate([
71
+ (0, class_validator_1.IsOptional)(),
72
+ (0, class_validator_1.IsString)(),
73
+ (0, class_validator_1.IsNotEmpty)(),
74
+ __metadata("design:type", String)
75
+ ], FlowUpdateRequest.prototype, "name", void 0);
76
+ __decorate([
77
+ (0, class_validator_1.IsOptional)(),
78
+ (0, class_validator_1.IsString)(),
79
+ (0, class_validator_1.IsNotEmpty)(),
80
+ __metadata("design:type", String)
81
+ ], FlowUpdateRequest.prototype, "reference", void 0);
82
+ __decorate([
83
+ (0, class_validator_1.IsOptional)(),
84
+ (0, class_validator_1.IsEnum)(FlowTypeEnum_1.FlowTypeEnum),
85
+ __metadata("design:type", String)
86
+ ], FlowUpdateRequest.prototype, "type", void 0);
87
+ __decorate([
88
+ (0, class_validator_1.IsOptional)(),
89
+ (0, class_validator_1.IsString)(),
90
+ __metadata("design:type", String)
91
+ ], FlowUpdateRequest.prototype, "description", void 0);
92
+ __decorate([
93
+ (0, class_validator_1.IsOptional)(),
94
+ (0, class_validator_1.IsArray)(),
95
+ (0, class_validator_1.ValidateNested)({ each: true }),
96
+ (0, class_transformer_1.Type)(() => FlowSupportedProp),
97
+ __metadata("design:type", Array)
98
+ ], FlowUpdateRequest.prototype, "supportedProps", void 0);
99
+ __decorate([
100
+ (0, class_validator_1.IsOptional)(),
101
+ (0, class_validator_1.IsEnum)(FlowStatusEnum_1.FlowStatusEnum),
102
+ __metadata("design:type", String)
103
+ ], FlowUpdateRequest.prototype, "status", void 0);
104
+ __decorate([
105
+ (0, class_validator_1.IsOptional)(),
106
+ (0, class_validator_1.IsInt)(),
107
+ (0, class_validator_1.Min)(0),
108
+ __metadata("design:type", Number)
109
+ ], FlowUpdateRequest.prototype, "sortOrder", void 0);
@@ -0,0 +1,4 @@
1
+ export declare enum FlowStatusEnum {
2
+ ACTIVE = "ACTIVE",
3
+ INACTIVE = "INACTIVE"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlowStatusEnum = void 0;
4
+ var FlowStatusEnum;
5
+ (function (FlowStatusEnum) {
6
+ FlowStatusEnum["ACTIVE"] = "ACTIVE";
7
+ FlowStatusEnum["INACTIVE"] = "INACTIVE";
8
+ })(FlowStatusEnum || (exports.FlowStatusEnum = FlowStatusEnum = {}));
@@ -0,0 +1,6 @@
1
+ export declare enum FlowTypeEnum {
2
+ /** Flujo del centro de beneficios — referenciable desde Beneficio y Banner. */
3
+ INTERNAL = "INTERNAL",
4
+ /** Flujo de otra funcionalidad de la app — solo referenciable desde Banner. */
5
+ EXTERNAL = "EXTERNAL"
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlowTypeEnum = void 0;
4
+ var FlowTypeEnum;
5
+ (function (FlowTypeEnum) {
6
+ /** Flujo del centro de beneficios — referenciable desde Beneficio y Banner. */
7
+ FlowTypeEnum["INTERNAL"] = "INTERNAL";
8
+ /** Flujo de otra funcionalidad de la app — solo referenciable desde Banner. */
9
+ FlowTypeEnum["EXTERNAL"] = "EXTERNAL";
10
+ })(FlowTypeEnum || (exports.FlowTypeEnum = FlowTypeEnum = {}));
@@ -1,4 +1,3 @@
1
- export * from "./enums/BenefitFlowEnum";
2
1
  export * from "./enums/CatalogNodeTypeEnum";
3
2
  export * from "./enums/InputFieldTypeEnum";
4
3
  export * from "./enums/BannerContentTypeEnum";
@@ -12,6 +11,9 @@ export * from "./enums/BenefitPaymentStatusEnum";
12
11
  export * from "./enums/BenefitPaymentErrorCodeEnum";
13
12
  export * from "./enums/BannerAssetKindEnum";
14
13
  export * from "./enums/LeafAssetKindEnum";
14
+ export * from "./enums/FlowTypeEnum";
15
+ export * from "./enums/FlowStatusEnum";
16
+ export * from "./dtos/FlowDtos";
15
17
  export * from "./dtos/BenefitItem";
16
18
  export * from "./dtos/BenefitListResponse";
17
19
  export * from "./dtos/BenefitSummary";
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  //Enums
18
- __exportStar(require("./enums/BenefitFlowEnum"), exports);
19
18
  __exportStar(require("./enums/CatalogNodeTypeEnum"), exports);
20
19
  __exportStar(require("./enums/InputFieldTypeEnum"), exports);
21
20
  __exportStar(require("./enums/BannerContentTypeEnum"), exports);
@@ -29,6 +28,10 @@ __exportStar(require("./enums/BenefitPaymentStatusEnum"), exports);
29
28
  __exportStar(require("./enums/BenefitPaymentErrorCodeEnum"), exports);
30
29
  __exportStar(require("./enums/BannerAssetKindEnum"), exports);
31
30
  __exportStar(require("./enums/LeafAssetKindEnum"), exports);
31
+ // Flows dinámicos
32
+ __exportStar(require("./enums/FlowTypeEnum"), exports);
33
+ __exportStar(require("./enums/FlowStatusEnum"), exports);
34
+ __exportStar(require("./dtos/FlowDtos"), exports);
32
35
  //DTOs
33
36
  __exportStar(require("./dtos/BenefitItem"), exports);
34
37
  __exportStar(require("./dtos/BenefitListResponse"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.182.0",
3
+ "version": "3.183.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -10,7 +10,6 @@ import {
10
10
  ValidateNested,
11
11
  } from "class-validator";
12
12
  import { Type } from "class-transformer";
13
- import { BenefitFlowEnum } from "../enums/BenefitFlowEnum";
14
13
  import { BenefitModuleConfigRequest } from "./BenefitModuleConfigRequest";
15
14
 
16
15
  /** Mirror enum-like de BenefitCatalogStatus en el type-kit (para validación). */
@@ -44,8 +43,9 @@ export class BenefitCreateRequest {
44
43
  @IsString()
45
44
  icon?: string;
46
45
 
47
- @IsEnum(BenefitFlowEnum)
48
- flow!: BenefitFlowEnum;
46
+ @IsString()
47
+ @IsNotEmpty()
48
+ flow!: string;
49
49
 
50
50
  @IsOptional()
51
51
  @IsString()
@@ -1,11 +1,9 @@
1
- import { BenefitFlowEnum } from "../enums/BenefitFlowEnum";
2
-
3
1
  export class BenefitItem {
4
2
  id: string;
5
3
  name: string;
6
4
  description: string;
7
5
  icon: string;
8
- flow: BenefitFlowEnum;
6
+ flow: string;
9
7
  translationKey: string;
10
8
  sortOrder: number;
11
9
  }
@@ -1,8 +1,6 @@
1
- import { BenefitFlowEnum } from "../enums/BenefitFlowEnum";
2
-
3
1
  export class BenefitSummary {
4
2
  id: string;
5
3
  name: string;
6
- flow: BenefitFlowEnum;
4
+ flow: string;
7
5
  version: string;
8
6
  }
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  IsEnum,
3
3
  IsInt,
4
+ IsNotEmpty,
4
5
  IsObject,
5
6
  IsOptional,
6
7
  IsString,
@@ -9,7 +10,6 @@ import {
9
10
  ValidateNested,
10
11
  } from "class-validator";
11
12
  import { Type } from "class-transformer";
12
- import { BenefitFlowEnum } from "../enums/BenefitFlowEnum";
13
13
  import {
14
14
  BenefitCatalogStatusEnum,
15
15
  } from "./BenefitCreateRequest";
@@ -21,7 +21,7 @@ export class BenefitUpdateRequest {
21
21
  @IsOptional() @IsEnum(BenefitCatalogStatusEnum) status?: BenefitCatalogStatusEnum;
22
22
  @IsOptional() @IsInt() @Min(0) sortOrder?: number;
23
23
  @IsOptional() @IsString() icon?: string;
24
- @IsOptional() @IsEnum(BenefitFlowEnum) flow?: BenefitFlowEnum;
24
+ @IsOptional() @IsString() @IsNotEmpty() flow?: string;
25
25
  @IsOptional() @IsString() translationKey?: string;
26
26
 
27
27
  @IsOptional()
@@ -1,5 +1,4 @@
1
1
  import { FavoriteDisabledReasonEnum } from "../enums/FavoriteDisabledReasonEnum";
2
- import { BenefitFlowEnum } from "../enums/BenefitFlowEnum";
3
2
 
4
3
  /**
5
4
  * Ítem que viaja en `GET /favorites`. Representa un favorito ACTIVO
@@ -26,7 +25,7 @@ export class FavoriteItem {
26
25
 
27
26
  // Enriquecimiento de favoritos de remesa (#2) — opcionales, solo poblados para flow REMITTANCE.
28
27
  // Denormalizados al crear el beneficiario; el listado sigue siendo read barato (sin llamar al connector).
29
- flow?: BenefitFlowEnum; // el front distingue la card sin decodificar el leafId
28
+ flow?: string; // el front distingue la card sin decodificar el leafId
30
29
  destinationCountryISO?: string; // ISO país destino (para la bandera)
31
30
  beneficiaryFirstName?: string;
32
31
  beneficiaryLastName?: string;
@@ -0,0 +1,73 @@
1
+ import {
2
+ IsArray, IsBoolean, IsEnum, IsInt, IsNotEmpty, IsOptional, IsString, Min, ValidateNested,
3
+ } from "class-validator";
4
+ import { Type } from "class-transformer";
5
+ import { FlowTypeEnum } from "../enums/FlowTypeEnum";
6
+ import { FlowStatusEnum } from "../enums/FlowStatusEnum";
7
+
8
+ export class FlowSupportedProp {
9
+ @IsString() @IsNotEmpty()
10
+ name!: string;
11
+
12
+ @IsBoolean()
13
+ required!: boolean;
14
+ }
15
+
16
+ export interface FlowResponse {
17
+ id: string;
18
+ name: string;
19
+ reference: string;
20
+ type: FlowTypeEnum;
21
+ description?: string;
22
+ supportedProps: FlowSupportedProp[];
23
+ status: FlowStatusEnum;
24
+ sortOrder: number;
25
+ createdAt?: number;
26
+ updatedAt?: number;
27
+ }
28
+
29
+ export class FlowCreateRequest {
30
+ @IsString() @IsNotEmpty()
31
+ name!: string;
32
+
33
+ @IsString() @IsNotEmpty()
34
+ reference!: string;
35
+
36
+ @IsEnum(FlowTypeEnum)
37
+ type!: FlowTypeEnum;
38
+
39
+ @IsOptional() @IsString()
40
+ description?: string;
41
+
42
+ @IsOptional() @IsArray() @ValidateNested({ each: true }) @Type(() => FlowSupportedProp)
43
+ supportedProps?: FlowSupportedProp[];
44
+
45
+ @IsEnum(FlowStatusEnum)
46
+ status!: FlowStatusEnum;
47
+
48
+ @IsInt() @Min(0)
49
+ sortOrder!: number;
50
+ }
51
+
52
+ export class FlowUpdateRequest {
53
+ @IsOptional() @IsString() @IsNotEmpty()
54
+ name?: string;
55
+
56
+ @IsOptional() @IsString() @IsNotEmpty()
57
+ reference?: string;
58
+
59
+ @IsOptional() @IsEnum(FlowTypeEnum)
60
+ type?: FlowTypeEnum;
61
+
62
+ @IsOptional() @IsString()
63
+ description?: string;
64
+
65
+ @IsOptional() @IsArray() @ValidateNested({ each: true }) @Type(() => FlowSupportedProp)
66
+ supportedProps?: FlowSupportedProp[];
67
+
68
+ @IsOptional() @IsEnum(FlowStatusEnum)
69
+ status?: FlowStatusEnum;
70
+
71
+ @IsOptional() @IsInt() @Min(0)
72
+ sortOrder?: number;
73
+ }
@@ -0,0 +1,4 @@
1
+ export enum FlowStatusEnum {
2
+ ACTIVE = "ACTIVE",
3
+ INACTIVE = "INACTIVE",
4
+ }
@@ -0,0 +1,6 @@
1
+ export enum FlowTypeEnum {
2
+ /** Flujo del centro de beneficios — referenciable desde Beneficio y Banner. */
3
+ INTERNAL = "INTERNAL",
4
+ /** Flujo de otra funcionalidad de la app — solo referenciable desde Banner. */
5
+ EXTERNAL = "EXTERNAL",
6
+ }
@@ -1,5 +1,4 @@
1
1
  //Enums
2
- export * from "./enums/BenefitFlowEnum";
3
2
  export * from "./enums/CatalogNodeTypeEnum";
4
3
  export * from "./enums/InputFieldTypeEnum";
5
4
  export * from "./enums/BannerContentTypeEnum";
@@ -13,6 +12,10 @@ export * from "./enums/BenefitPaymentStatusEnum";
13
12
  export * from "./enums/BenefitPaymentErrorCodeEnum";
14
13
  export * from "./enums/BannerAssetKindEnum";
15
14
  export * from "./enums/LeafAssetKindEnum";
15
+ // Flows dinámicos
16
+ export * from "./enums/FlowTypeEnum";
17
+ export * from "./enums/FlowStatusEnum";
18
+ export * from "./dtos/FlowDtos";
16
19
 
17
20
  //DTOs
18
21
  export * from "./dtos/BenefitItem";
@@ -1,11 +0,0 @@
1
- export declare enum BenefitFlowEnum {
2
- TOPUPS = "TOPUPS",
3
- BILL_PAYMENT = "BILL_PAYMENT",
4
- CREDIT = "CREDIT",
5
- INSURANCE = "INSURANCE",
6
- DONATION = "DONATION",
7
- PHARMACY = "PHARMACY",
8
- REMITTANCE = "REMITTANCE",
9
- /** Fondeo de wallet PCF con efectivo via provider externo (Equality/Passport, OpenPay, …) — spec 13. */
10
- WALLET_FUNDING = "WALLET_FUNDING"
11
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BenefitFlowEnum = void 0;
4
- var BenefitFlowEnum;
5
- (function (BenefitFlowEnum) {
6
- BenefitFlowEnum["TOPUPS"] = "TOPUPS";
7
- BenefitFlowEnum["BILL_PAYMENT"] = "BILL_PAYMENT";
8
- BenefitFlowEnum["CREDIT"] = "CREDIT";
9
- BenefitFlowEnum["INSURANCE"] = "INSURANCE";
10
- BenefitFlowEnum["DONATION"] = "DONATION";
11
- BenefitFlowEnum["PHARMACY"] = "PHARMACY";
12
- BenefitFlowEnum["REMITTANCE"] = "REMITTANCE";
13
- /** Fondeo de wallet PCF con efectivo via provider externo (Equality/Passport, OpenPay, …) — spec 13. */
14
- BenefitFlowEnum["WALLET_FUNDING"] = "WALLET_FUNDING";
15
- })(BenefitFlowEnum || (exports.BenefitFlowEnum = BenefitFlowEnum = {}));
@@ -1,17 +0,0 @@
1
- import { CurrencyId } from '../../currency/enums/CurrencyId';
2
- /**
3
- * Comisión que cobra un punto de cash-in (lo que el lambda MUESTRA, no cobra).
4
- * - GreenDot (US): representativo por cadena → `fixed` + `cap` (cada tienda cobra hasta el tope).
5
- * - Passport (MX): por red → `fixed` + `percentage`.
6
- * Response DTO — sin decoradores de validación.
7
- */
8
- export declare class CashInFeeDto {
9
- /** Comisión fija, en la moneda del país. */
10
- fixed?: number;
11
- /** Porcentaje del monto depositado (0–100). */
12
- percentage?: number;
13
- /** Tope máximo de comisión (GreenDot: el asociado cobra hasta este cap). */
14
- cap?: number;
15
- /** Moneda del fee: USD (GreenDot) | MXN (Passport). */
16
- currency: CurrencyId;
17
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CashInFeeDto = void 0;
4
- /**
5
- * Comisión que cobra un punto de cash-in (lo que el lambda MUESTRA, no cobra).
6
- * - GreenDot (US): representativo por cadena → `fixed` + `cap` (cada tienda cobra hasta el tope).
7
- * - Passport (MX): por red → `fixed` + `percentage`.
8
- * Response DTO — sin decoradores de validación.
9
- */
10
- class CashInFeeDto {
11
- }
12
- exports.CashInFeeDto = CashInFeeDto;
@@ -1,22 +0,0 @@
1
- import { MfaMethodEnum } from '../enums/MfaMethodEnum';
2
- /**
3
- * Body del POST /auth/resend-otp (público, anónimo). DEC-RBAC-054.
4
- * Reenvía el OTP del login re-disparando el challenge real CUSTOM_AUTH (EMAIL_OTP) para la
5
- * identidad SIN password. `tenantId` obligatorio (DEC-064 — el picker ya lo resolvió, NO "solo email").
6
- * El email se normaliza lowercase server-side. Postura anti-enumeración: respuesta 200 genérica
7
- * siempre, sin filtrar existencia (ver AuthLoginManager.resendChallengeOtp).
8
- */
9
- export declare class ResendOtpRequest {
10
- email: string;
11
- tenantId: string;
12
- }
13
- /**
14
- * Respuesta del resend-otp. `session`/`mfaMethod` frescos del nuevo challenge CUSTOM_AUTH.
15
- * Plain sin validators (no validamos lo que mandamos al cliente — fiado-validation-and-dtos § 7).
16
- * Ambos opcionales: en los caminos de rechazo silencioso (anti-enumeración) o ramas sin CUSTOM_AUTH
17
- * el server responde 200 genérico sin session ni método.
18
- */
19
- export interface ResendOtpResponse {
20
- session?: string;
21
- mfaMethod?: MfaMethodEnum;
22
- }
@@ -1,36 +0,0 @@
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.ResendOtpRequest = void 0;
13
- const class_transformer_1 = require("class-transformer");
14
- const class_validator_1 = require("class-validator");
15
- /**
16
- * Body del POST /auth/resend-otp (público, anónimo). DEC-RBAC-054.
17
- * Reenvía el OTP del login re-disparando el challenge real CUSTOM_AUTH (EMAIL_OTP) para la
18
- * identidad SIN password. `tenantId` obligatorio (DEC-064 — el picker ya lo resolvió, NO "solo email").
19
- * El email se normaliza lowercase server-side. Postura anti-enumeración: respuesta 200 genérica
20
- * siempre, sin filtrar existencia (ver AuthLoginManager.resendChallengeOtp).
21
- */
22
- class ResendOtpRequest {
23
- }
24
- exports.ResendOtpRequest = ResendOtpRequest;
25
- __decorate([
26
- (0, class_transformer_1.Expose)(),
27
- (0, class_validator_1.IsEmail)(),
28
- (0, class_validator_1.IsNotEmpty)(),
29
- __metadata("design:type", String)
30
- ], ResendOtpRequest.prototype, "email", void 0);
31
- __decorate([
32
- (0, class_transformer_1.Expose)(),
33
- (0, class_validator_1.IsString)(),
34
- (0, class_validator_1.IsNotEmpty)(),
35
- __metadata("design:type", String)
36
- ], ResendOtpRequest.prototype, "tenantId", void 0);
@@ -1,11 +0,0 @@
1
- /**
2
- * Body del POST /self-register/resend-otp (público, anónimo). DEC-RBAC-054.
3
- * Re-envía el OTP del autoregistro (mecanismo messages-business, NO Cognito) tras validar un
4
- * `pending` existente. Misma postura anti-enumeración del start. El email se normaliza lowercase
5
- * server-side. DTO propio por endpoint (NO reusa SelfRegisterStartRequest, que exige roleId/scope/
6
- * scopeRef, ni SelfRegisterVerifyOtpRequest, que exige otp).
7
- */
8
- export declare class ResendSelfRegisterOtpRequest {
9
- tenantId: string;
10
- email: string;
11
- }
@@ -1,36 +0,0 @@
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.ResendSelfRegisterOtpRequest = void 0;
13
- const class_transformer_1 = require("class-transformer");
14
- const class_validator_1 = require("class-validator");
15
- /**
16
- * Body del POST /self-register/resend-otp (público, anónimo). DEC-RBAC-054.
17
- * Re-envía el OTP del autoregistro (mecanismo messages-business, NO Cognito) tras validar un
18
- * `pending` existente. Misma postura anti-enumeración del start. El email se normaliza lowercase
19
- * server-side. DTO propio por endpoint (NO reusa SelfRegisterStartRequest, que exige roleId/scope/
20
- * scopeRef, ni SelfRegisterVerifyOtpRequest, que exige otp).
21
- */
22
- class ResendSelfRegisterOtpRequest {
23
- }
24
- exports.ResendSelfRegisterOtpRequest = ResendSelfRegisterOtpRequest;
25
- __decorate([
26
- (0, class_transformer_1.Expose)(),
27
- (0, class_validator_1.IsString)(),
28
- (0, class_validator_1.IsNotEmpty)(),
29
- __metadata("design:type", String)
30
- ], ResendSelfRegisterOtpRequest.prototype, "tenantId", void 0);
31
- __decorate([
32
- (0, class_transformer_1.Expose)(),
33
- (0, class_validator_1.IsEmail)(),
34
- (0, class_validator_1.IsNotEmpty)(),
35
- __metadata("design:type", String)
36
- ], ResendSelfRegisterOtpRequest.prototype, "email", void 0);
@@ -1,11 +0,0 @@
1
- export enum BenefitFlowEnum {
2
- TOPUPS = "TOPUPS",
3
- BILL_PAYMENT = "BILL_PAYMENT",
4
- CREDIT = "CREDIT",
5
- INSURANCE = "INSURANCE",
6
- DONATION = "DONATION",
7
- PHARMACY = "PHARMACY",
8
- REMITTANCE = "REMITTANCE",
9
- /** Fondeo de wallet PCF con efectivo via provider externo (Equality/Passport, OpenPay, …) — spec 13. */
10
- WALLET_FUNDING = "WALLET_FUNDING",
11
- }