@fiado/type-kit 3.182.0 → 3.184.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 (68) hide show
  1. package/_test_/unit/benefitCenter/benefitFlowString.test.ts +22 -0
  2. package/_test_/unit/benefitCenter/flowDtos.test.ts +27 -0
  3. package/_test_/unit/retailOrg/dtos/RetailUser.test.ts +30 -0
  4. package/_test_/unit/retailOrg/dtos/Retailer.test.ts +1 -1
  5. package/_test_/unit/retailOrg/dtos/Store.test.ts +2 -2
  6. package/_test_/unit/retailOrg/dtos/requests/retailUserRequests.test.ts +34 -0
  7. package/_test_/unit/retailOrg/dtos/requests/retailerRequests.test.ts +9 -9
  8. package/_test_/unit/retailOrg/dtos/requests/storeRequests.test.ts +2 -2
  9. package/_test_/unit/retailOrg/dtos/responses/RetailerHierarchyResponse.test.ts +1 -1
  10. package/_test_/unit/retailOrg/dtos/validation/validationDtos.test.ts +2 -2
  11. package/_test_/unit/retailOrg/enums/CollectorSeniorityEnum.test.ts +12 -0
  12. package/_test_/unit/retailOrg/enums/RetailerTypeEnum.test.ts +5 -5
  13. package/bin/benefitCenter/dtos/BenefitCreateRequest.d.ts +1 -2
  14. package/bin/benefitCenter/dtos/BenefitCreateRequest.js +2 -2
  15. package/bin/benefitCenter/dtos/BenefitItem.d.ts +1 -2
  16. package/bin/benefitCenter/dtos/BenefitSummary.d.ts +1 -2
  17. package/bin/benefitCenter/dtos/BenefitUpdateRequest.d.ts +1 -2
  18. package/bin/benefitCenter/dtos/BenefitUpdateRequest.js +2 -2
  19. package/bin/benefitCenter/dtos/FavoriteItem.d.ts +1 -2
  20. package/bin/benefitCenter/dtos/FlowDtos.d.ts +36 -0
  21. package/bin/benefitCenter/dtos/FlowDtos.js +109 -0
  22. package/bin/benefitCenter/enums/FlowStatusEnum.d.ts +4 -0
  23. package/bin/benefitCenter/enums/FlowStatusEnum.js +8 -0
  24. package/bin/benefitCenter/enums/FlowTypeEnum.d.ts +6 -0
  25. package/bin/benefitCenter/enums/FlowTypeEnum.js +10 -0
  26. package/bin/benefitCenter/index.d.ts +3 -1
  27. package/bin/benefitCenter/index.js +4 -1
  28. package/bin/retailOrg/dtos/RetailUser.d.ts +7 -0
  29. package/bin/retailOrg/dtos/RetailUser.js +20 -0
  30. package/bin/retailOrg/dtos/Store.d.ts +6 -2
  31. package/bin/retailOrg/dtos/Store.js +1 -1
  32. package/bin/retailOrg/dtos/requests/CreateRetailUserRequest.d.ts +7 -0
  33. package/bin/retailOrg/dtos/requests/CreateRetailUserRequest.js +20 -0
  34. package/bin/retailOrg/dtos/requests/CreateStoreRequest.d.ts +6 -2
  35. package/bin/retailOrg/dtos/requests/CreateStoreRequest.js +1 -1
  36. package/bin/retailOrg/dtos/requests/CreateSubdistributorRequest.d.ts +3 -3
  37. package/bin/retailOrg/dtos/requests/CreateSubdistributorRequest.js +3 -3
  38. package/bin/retailOrg/dtos/requests/UpdateRetailUserRequest.d.ts +7 -0
  39. package/bin/retailOrg/dtos/requests/UpdateRetailUserRequest.js +20 -0
  40. package/bin/retailOrg/dtos/requests/UpdateStoreRequest.d.ts +2 -1
  41. package/bin/retailOrg/dtos/requests/UpdateStoreRequest.js +1 -1
  42. package/bin/retailOrg/enums/CollectorSeniorityEnum.d.ts +12 -0
  43. package/bin/retailOrg/enums/CollectorSeniorityEnum.js +16 -0
  44. package/bin/retailOrg/enums/RetailerTypeEnum.d.ts +6 -6
  45. package/bin/retailOrg/enums/RetailerTypeEnum.js +6 -6
  46. package/bin/retailOrg/index.d.ts +1 -0
  47. package/bin/retailOrg/index.js +1 -0
  48. package/package.json +1 -1
  49. package/src/benefitCenter/dtos/BenefitCreateRequest.ts +3 -3
  50. package/src/benefitCenter/dtos/BenefitItem.ts +1 -3
  51. package/src/benefitCenter/dtos/BenefitSummary.ts +1 -3
  52. package/src/benefitCenter/dtos/BenefitUpdateRequest.ts +2 -2
  53. package/src/benefitCenter/dtos/FavoriteItem.ts +1 -2
  54. package/src/benefitCenter/dtos/FlowDtos.ts +73 -0
  55. package/src/benefitCenter/enums/FlowStatusEnum.ts +4 -0
  56. package/src/benefitCenter/enums/FlowTypeEnum.ts +6 -0
  57. package/src/benefitCenter/index.ts +4 -1
  58. package/src/retailOrg/dtos/RetailUser.ts +21 -1
  59. package/src/retailOrg/dtos/Store.ts +6 -2
  60. package/src/retailOrg/dtos/requests/CreateRetailUserRequest.ts +21 -1
  61. package/src/retailOrg/dtos/requests/CreateStoreRequest.ts +6 -2
  62. package/src/retailOrg/dtos/requests/CreateSubdistributorRequest.ts +4 -4
  63. package/src/retailOrg/dtos/requests/UpdateRetailUserRequest.ts +21 -1
  64. package/src/retailOrg/dtos/requests/UpdateStoreRequest.ts +2 -1
  65. package/src/retailOrg/enums/CollectorSeniorityEnum.ts +12 -0
  66. package/src/retailOrg/enums/RetailerTypeEnum.ts +6 -6
  67. package/src/retailOrg/index.ts +1 -0
  68. package/src/benefitCenter/enums/BenefitFlowEnum.ts +0 -11
@@ -1,3 +1,4 @@
1
+ import { CollectorSeniorityEnum } from '../enums/CollectorSeniorityEnum';
1
2
  import { EmploymentTypeEnum } from '../enums/EmploymentTypeEnum';
2
3
  import { RetailUserStatusEnum } from '../enums/RetailUserStatusEnum';
3
4
  /**
@@ -13,6 +14,12 @@ export declare class RetailUser {
13
14
  zoneId: string | null;
14
15
  employmentType: EmploymentTypeEnum;
15
16
  commissionTier: string;
17
+ /** Teléfono de contacto del usuario retail; opcional. */
18
+ phone?: string;
19
+ /** Seniority del cobrador; solo aplica a usuarios retail con rol de cobrador. */
20
+ collectorSeniority?: CollectorSeniorityEnum;
21
+ /** Tiendas que cubre el cobrador (zona de cobranza); opcional. */
22
+ coverageStoreIds?: string[];
16
23
  status: RetailUserStatusEnum;
17
24
  createdAt: string;
18
25
  updatedAt: string;
@@ -13,6 +13,7 @@ exports.RetailUser = void 0;
13
13
  const class_transformer_1 = require("class-transformer");
14
14
  const class_validator_1 = require("class-validator");
15
15
  const regex_1 = require("../../helpers/constans/regex");
16
+ const CollectorSeniorityEnum_1 = require("../enums/CollectorSeniorityEnum");
16
17
  const EmploymentTypeEnum_1 = require("../enums/EmploymentTypeEnum");
17
18
  const RetailUserStatusEnum_1 = require("../enums/RetailUserStatusEnum");
18
19
  /**
@@ -58,6 +59,25 @@ __decorate([
58
59
  (0, class_validator_1.IsString)(),
59
60
  __metadata("design:type", String)
60
61
  ], RetailUser.prototype, "commissionTier", void 0);
62
+ __decorate([
63
+ (0, class_transformer_1.Expose)(),
64
+ (0, class_validator_1.IsOptional)(),
65
+ (0, class_validator_1.IsString)(),
66
+ __metadata("design:type", String)
67
+ ], RetailUser.prototype, "phone", void 0);
68
+ __decorate([
69
+ (0, class_transformer_1.Expose)(),
70
+ (0, class_validator_1.IsOptional)(),
71
+ (0, class_validator_1.IsEnum)(CollectorSeniorityEnum_1.CollectorSeniorityEnum),
72
+ __metadata("design:type", String)
73
+ ], RetailUser.prototype, "collectorSeniority", void 0);
74
+ __decorate([
75
+ (0, class_transformer_1.Expose)(),
76
+ (0, class_validator_1.IsOptional)(),
77
+ (0, class_validator_1.IsArray)(),
78
+ (0, class_validator_1.IsString)({ each: true }),
79
+ __metadata("design:type", Array)
80
+ ], RetailUser.prototype, "coverageStoreIds", void 0);
61
81
  __decorate([
62
82
  (0, class_transformer_1.Expose)(),
63
83
  (0, class_validator_1.IsEnum)(RetailUserStatusEnum_1.RetailUserStatusEnum),
@@ -22,8 +22,12 @@ export declare class Store {
22
22
  managerRetailUserId: string | null;
23
23
  /** Horario operativo (texto libre); `null` si no está definido. */
24
24
  schedule: string | null;
25
- /** Venta diaria promedio en centavos; `null` si no está registrada. */
26
- dailyAvgSalesCents: number | null;
25
+ /**
26
+ * Conteo promedio de transacciones de cobro por día (NO es un monto de dinero).
27
+ * `null` si no está registrado. El factor 2× que amplifica este conteo es global
28
+ * y vive en loan-config, no acá.
29
+ */
30
+ dailyAvgCollectionsCount: number | null;
27
31
  status: StoreStatusEnum;
28
32
  createdAt: string;
29
33
  updatedAt: string;
@@ -87,7 +87,7 @@ __decorate([
87
87
  (0, class_validator_1.IsOptional)(),
88
88
  (0, class_validator_1.IsNumber)(),
89
89
  __metadata("design:type", Number)
90
- ], Store.prototype, "dailyAvgSalesCents", void 0);
90
+ ], Store.prototype, "dailyAvgCollectionsCount", void 0);
91
91
  __decorate([
92
92
  (0, class_transformer_1.Expose)(),
93
93
  (0, class_validator_1.IsEnum)(StoreStatusEnum_1.StoreStatusEnum),
@@ -1,3 +1,4 @@
1
+ import { CollectorSeniorityEnum } from '../../enums/CollectorSeniorityEnum';
1
2
  import { EmploymentTypeEnum } from '../../enums/EmploymentTypeEnum';
2
3
  /**
3
4
  * Body de POST /retailers/:retailerId/users — alta de usuario retail (el `retailerId` sale del path;
@@ -10,4 +11,10 @@ export declare class CreateRetailUserRequest {
10
11
  commissionTier: string;
11
12
  /** Zona de operación del usuario; `null` si no está acotado a una zona. */
12
13
  zoneId: string | null;
14
+ /** Teléfono de contacto del usuario retail; opcional. */
15
+ phone?: string;
16
+ /** Seniority del cobrador; solo aplica a usuarios retail con rol de cobrador. */
17
+ collectorSeniority?: CollectorSeniorityEnum;
18
+ /** Tiendas que cubre el cobrador (zona de cobranza); opcional. */
19
+ coverageStoreIds?: string[];
13
20
  }
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CreateRetailUserRequest = void 0;
13
13
  const class_transformer_1 = require("class-transformer");
14
14
  const class_validator_1 = require("class-validator");
15
+ const CollectorSeniorityEnum_1 = require("../../enums/CollectorSeniorityEnum");
15
16
  const EmploymentTypeEnum_1 = require("../../enums/EmploymentTypeEnum");
16
17
  /**
17
18
  * Body de POST /retailers/:retailerId/users — alta de usuario retail (el `retailerId` sale del path;
@@ -46,3 +47,22 @@ __decorate([
46
47
  (0, class_validator_1.IsString)(),
47
48
  __metadata("design:type", String)
48
49
  ], CreateRetailUserRequest.prototype, "zoneId", void 0);
50
+ __decorate([
51
+ (0, class_transformer_1.Expose)(),
52
+ (0, class_validator_1.IsOptional)(),
53
+ (0, class_validator_1.IsString)(),
54
+ __metadata("design:type", String)
55
+ ], CreateRetailUserRequest.prototype, "phone", void 0);
56
+ __decorate([
57
+ (0, class_transformer_1.Expose)(),
58
+ (0, class_validator_1.IsOptional)(),
59
+ (0, class_validator_1.IsEnum)(CollectorSeniorityEnum_1.CollectorSeniorityEnum),
60
+ __metadata("design:type", String)
61
+ ], CreateRetailUserRequest.prototype, "collectorSeniority", void 0);
62
+ __decorate([
63
+ (0, class_transformer_1.Expose)(),
64
+ (0, class_validator_1.IsOptional)(),
65
+ (0, class_validator_1.IsArray)(),
66
+ (0, class_validator_1.IsString)({ each: true }),
67
+ __metadata("design:type", Array)
68
+ ], CreateRetailUserRequest.prototype, "coverageStoreIds", void 0);
@@ -17,6 +17,10 @@ export declare class CreateStoreRequest {
17
17
  managerRetailUserId: string | null;
18
18
  /** Horario operativo (texto libre); `null` si no está definido. */
19
19
  schedule: string | null;
20
- /** Venta diaria promedio en centavos; `null` si no está registrada. */
21
- dailyAvgSalesCents: number | null;
20
+ /**
21
+ * Conteo promedio de transacciones de cobro por día (NO es un monto de dinero).
22
+ * `null` si no está registrado. El factor 2× que amplifica este conteo es global
23
+ * y vive en loan-config, no acá.
24
+ */
25
+ dailyAvgCollectionsCount: number | null;
22
26
  }
@@ -74,4 +74,4 @@ __decorate([
74
74
  (0, class_validator_1.IsOptional)(),
75
75
  (0, class_validator_1.IsNumber)(),
76
76
  __metadata("design:type", Number)
77
- ], CreateStoreRequest.prototype, "dailyAvgSalesCents", void 0);
77
+ ], CreateStoreRequest.prototype, "dailyAvgCollectionsCount", void 0);
@@ -4,11 +4,11 @@ import { RetailAddressInput } from './RetailAddressInput';
4
4
  * Body de POST /retailers/:retailerId/subdistributors — alta de un retailer hijo colgando de
5
5
  * `:retailerId` (el `parentId` sale del path param, NO del body).
6
6
  *
7
- * `type` se restringe a SUBDISTRIBUIDOR | FRANQUICIA con `@IsIn`: un nodo hijo no puede ser una
8
- * CADENA raíz (esa se crea con `CreateRetailerRequest`).
7
+ * `type` se restringe a SUBDISTRIBUTOR | FRANCHISE con `@IsIn`: un nodo hijo no puede ser una
8
+ * CHAIN raíz (esa se crea con `CreateRetailerRequest`).
9
9
  */
10
10
  export declare class CreateSubdistributorRequest {
11
- type: RetailerTypeEnum.SUBDISTRIBUIDOR | RetailerTypeEnum.FRANQUICIA;
11
+ type: RetailerTypeEnum.SUBDISTRIBUTOR | RetailerTypeEnum.FRANCHISE;
12
12
  name: string;
13
13
  legalName: string;
14
14
  /** RFC mexicano — 12 (persona moral / empresa) o 13 (persona física). */
@@ -18,15 +18,15 @@ const RetailAddressInput_1 = require("./RetailAddressInput");
18
18
  * Body de POST /retailers/:retailerId/subdistributors — alta de un retailer hijo colgando de
19
19
  * `:retailerId` (el `parentId` sale del path param, NO del body).
20
20
  *
21
- * `type` se restringe a SUBDISTRIBUIDOR | FRANQUICIA con `@IsIn`: un nodo hijo no puede ser una
22
- * CADENA raíz (esa se crea con `CreateRetailerRequest`).
21
+ * `type` se restringe a SUBDISTRIBUTOR | FRANCHISE con `@IsIn`: un nodo hijo no puede ser una
22
+ * CHAIN raíz (esa se crea con `CreateRetailerRequest`).
23
23
  */
24
24
  class CreateSubdistributorRequest {
25
25
  }
26
26
  exports.CreateSubdistributorRequest = CreateSubdistributorRequest;
27
27
  __decorate([
28
28
  (0, class_transformer_1.Expose)(),
29
- (0, class_validator_1.IsIn)([RetailerTypeEnum_1.RetailerTypeEnum.SUBDISTRIBUIDOR, RetailerTypeEnum_1.RetailerTypeEnum.FRANQUICIA]),
29
+ (0, class_validator_1.IsIn)([RetailerTypeEnum_1.RetailerTypeEnum.SUBDISTRIBUTOR, RetailerTypeEnum_1.RetailerTypeEnum.FRANCHISE]),
30
30
  __metadata("design:type", String)
31
31
  ], CreateSubdistributorRequest.prototype, "type", void 0);
32
32
  __decorate([
@@ -1,3 +1,4 @@
1
+ import { CollectorSeniorityEnum } from '../../enums/CollectorSeniorityEnum';
1
2
  import { EmploymentTypeEnum } from '../../enums/EmploymentTypeEnum';
2
3
  /**
3
4
  * Body de PUT /users/:retailUserId — edición de usuario retail (campos editables opcionales).
@@ -8,4 +9,10 @@ export declare class UpdateRetailUserRequest {
8
9
  employmentType?: EmploymentTypeEnum;
9
10
  commissionTier?: string;
10
11
  zoneId?: string | null;
12
+ /** Teléfono de contacto del usuario retail; opcional. */
13
+ phone?: string;
14
+ /** Seniority del cobrador; solo aplica a usuarios retail con rol de cobrador. */
15
+ collectorSeniority?: CollectorSeniorityEnum;
16
+ /** Tiendas que cubre el cobrador (zona de cobranza); opcional. */
17
+ coverageStoreIds?: string[];
11
18
  }
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.UpdateRetailUserRequest = void 0;
13
13
  const class_transformer_1 = require("class-transformer");
14
14
  const class_validator_1 = require("class-validator");
15
+ const CollectorSeniorityEnum_1 = require("../../enums/CollectorSeniorityEnum");
15
16
  const EmploymentTypeEnum_1 = require("../../enums/EmploymentTypeEnum");
16
17
  /**
17
18
  * Body de PUT /users/:retailUserId — edición de usuario retail (campos editables opcionales).
@@ -39,3 +40,22 @@ __decorate([
39
40
  (0, class_validator_1.IsString)(),
40
41
  __metadata("design:type", String)
41
42
  ], UpdateRetailUserRequest.prototype, "zoneId", void 0);
43
+ __decorate([
44
+ (0, class_transformer_1.Expose)(),
45
+ (0, class_validator_1.IsOptional)(),
46
+ (0, class_validator_1.IsString)(),
47
+ __metadata("design:type", String)
48
+ ], UpdateRetailUserRequest.prototype, "phone", void 0);
49
+ __decorate([
50
+ (0, class_transformer_1.Expose)(),
51
+ (0, class_validator_1.IsOptional)(),
52
+ (0, class_validator_1.IsEnum)(CollectorSeniorityEnum_1.CollectorSeniorityEnum),
53
+ __metadata("design:type", String)
54
+ ], UpdateRetailUserRequest.prototype, "collectorSeniority", void 0);
55
+ __decorate([
56
+ (0, class_transformer_1.Expose)(),
57
+ (0, class_validator_1.IsOptional)(),
58
+ (0, class_validator_1.IsArray)(),
59
+ (0, class_validator_1.IsString)({ each: true }),
60
+ __metadata("design:type", Array)
61
+ ], UpdateRetailUserRequest.prototype, "coverageStoreIds", void 0);
@@ -14,5 +14,6 @@ export declare class UpdateStoreRequest {
14
14
  phone?: string;
15
15
  managerRetailUserId?: string | null;
16
16
  schedule?: string | null;
17
- dailyAvgSalesCents?: number | null;
17
+ /** Conteo promedio de transacciones de cobro por día (NO es un monto de dinero). */
18
+ dailyAvgCollectionsCount?: number | null;
18
19
  }
@@ -78,4 +78,4 @@ __decorate([
78
78
  (0, class_validator_1.IsOptional)(),
79
79
  (0, class_validator_1.IsNumber)(),
80
80
  __metadata("design:type", Number)
81
- ], UpdateStoreRequest.prototype, "dailyAvgSalesCents", void 0);
81
+ ], UpdateStoreRequest.prototype, "dailyAvgCollectionsCount", void 0);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Antigüedad / seniority de un cobrador retail en SureKeep.
3
+ * Solo aplica a usuarios retail que cumplen rol de cobrador.
4
+ * @enum {string}
5
+ *
6
+ * @property {string} JUNIOR - Cobrador de menor antigüedad / experiencia.
7
+ * @property {string} SENIOR - Cobrador de mayor antigüedad / experiencia.
8
+ */
9
+ export declare enum CollectorSeniorityEnum {
10
+ JUNIOR = "JUNIOR",
11
+ SENIOR = "SENIOR"
12
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CollectorSeniorityEnum = void 0;
4
+ /**
5
+ * Antigüedad / seniority de un cobrador retail en SureKeep.
6
+ * Solo aplica a usuarios retail que cumplen rol de cobrador.
7
+ * @enum {string}
8
+ *
9
+ * @property {string} JUNIOR - Cobrador de menor antigüedad / experiencia.
10
+ * @property {string} SENIOR - Cobrador de mayor antigüedad / experiencia.
11
+ */
12
+ var CollectorSeniorityEnum;
13
+ (function (CollectorSeniorityEnum) {
14
+ CollectorSeniorityEnum["JUNIOR"] = "JUNIOR";
15
+ CollectorSeniorityEnum["SENIOR"] = "SENIOR";
16
+ })(CollectorSeniorityEnum || (exports.CollectorSeniorityEnum = CollectorSeniorityEnum = {}));
@@ -2,12 +2,12 @@
2
2
  * Tipo de retailer en la organización comercial de SureKeep.
3
3
  * @enum {string}
4
4
  *
5
- * @property {string} CADENA - Cadena comercial con múltiples tiendas propias.
6
- * @property {string} SUBDISTRIBUIDOR - Subdistribuidor que opera bajo un distribuidor mayor.
7
- * @property {string} FRANQUICIA - Franquicia operada por un tercero bajo la marca.
5
+ * @property {string} CHAIN - Cadena comercial con múltiples tiendas propias.
6
+ * @property {string} SUBDISTRIBUTOR - Subdistribuidor que opera bajo un distribuidor mayor.
7
+ * @property {string} FRANCHISE - Franquicia operada por un tercero bajo la marca.
8
8
  */
9
9
  export declare enum RetailerTypeEnum {
10
- CADENA = "CADENA",
11
- SUBDISTRIBUIDOR = "SUBDISTRIBUIDOR",
12
- FRANQUICIA = "FRANQUICIA"
10
+ CHAIN = "CHAIN",
11
+ SUBDISTRIBUTOR = "SUBDISTRIBUTOR",
12
+ FRANCHISE = "FRANCHISE"
13
13
  }
@@ -5,13 +5,13 @@ exports.RetailerTypeEnum = void 0;
5
5
  * Tipo de retailer en la organización comercial de SureKeep.
6
6
  * @enum {string}
7
7
  *
8
- * @property {string} CADENA - Cadena comercial con múltiples tiendas propias.
9
- * @property {string} SUBDISTRIBUIDOR - Subdistribuidor que opera bajo un distribuidor mayor.
10
- * @property {string} FRANQUICIA - Franquicia operada por un tercero bajo la marca.
8
+ * @property {string} CHAIN - Cadena comercial con múltiples tiendas propias.
9
+ * @property {string} SUBDISTRIBUTOR - Subdistribuidor que opera bajo un distribuidor mayor.
10
+ * @property {string} FRANCHISE - Franquicia operada por un tercero bajo la marca.
11
11
  */
12
12
  var RetailerTypeEnum;
13
13
  (function (RetailerTypeEnum) {
14
- RetailerTypeEnum["CADENA"] = "CADENA";
15
- RetailerTypeEnum["SUBDISTRIBUIDOR"] = "SUBDISTRIBUIDOR";
16
- RetailerTypeEnum["FRANQUICIA"] = "FRANQUICIA";
14
+ RetailerTypeEnum["CHAIN"] = "CHAIN";
15
+ RetailerTypeEnum["SUBDISTRIBUTOR"] = "SUBDISTRIBUTOR";
16
+ RetailerTypeEnum["FRANCHISE"] = "FRANCHISE";
17
17
  })(RetailerTypeEnum || (exports.RetailerTypeEnum = RetailerTypeEnum = {}));
@@ -4,6 +4,7 @@ export * from './enums/ZoneStatusEnum';
4
4
  export * from './enums/StoreStatusEnum';
5
5
  export * from './enums/RetailUserStatusEnum';
6
6
  export * from './enums/EmploymentTypeEnum';
7
+ export * from './enums/CollectorSeniorityEnum';
7
8
  export * from './dtos/GeoLocation';
8
9
  export * from './dtos/Retailer';
9
10
  export * from './dtos/Zone';
@@ -20,6 +20,7 @@ __exportStar(require("./enums/ZoneStatusEnum"), exports);
20
20
  __exportStar(require("./enums/StoreStatusEnum"), exports);
21
21
  __exportStar(require("./enums/RetailUserStatusEnum"), exports);
22
22
  __exportStar(require("./enums/EmploymentTypeEnum"), exports);
23
+ __exportStar(require("./enums/CollectorSeniorityEnum"), exports);
23
24
  // Entity DTOs
24
25
  __exportStar(require("./dtos/GeoLocation"), exports);
25
26
  __exportStar(require("./dtos/Retailer"), 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.184.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,6 +1,7 @@
1
1
  import { Expose } from 'class-transformer';
2
- import { IsEnum, IsOptional, IsString, Matches } from 'class-validator';
2
+ import { IsArray, IsEnum, IsOptional, IsString, Matches } from 'class-validator';
3
3
  import { regexIso8601 } from '../../helpers/constans/regex';
4
+ import { CollectorSeniorityEnum } from '../enums/CollectorSeniorityEnum';
4
5
  import { EmploymentTypeEnum } from '../enums/EmploymentTypeEnum';
5
6
  import { RetailUserStatusEnum } from '../enums/RetailUserStatusEnum';
6
7
 
@@ -39,6 +40,25 @@ export class RetailUser {
39
40
  @IsString()
40
41
  commissionTier!: string;
41
42
 
43
+ /** Teléfono de contacto del usuario retail; opcional. */
44
+ @Expose()
45
+ @IsOptional()
46
+ @IsString()
47
+ phone?: string;
48
+
49
+ /** Seniority del cobrador; solo aplica a usuarios retail con rol de cobrador. */
50
+ @Expose()
51
+ @IsOptional()
52
+ @IsEnum(CollectorSeniorityEnum)
53
+ collectorSeniority?: CollectorSeniorityEnum;
54
+
55
+ /** Tiendas que cubre el cobrador (zona de cobranza); opcional. */
56
+ @Expose()
57
+ @IsOptional()
58
+ @IsArray()
59
+ @IsString({ each: true })
60
+ coverageStoreIds?: string[];
61
+
42
62
  @Expose()
43
63
  @IsEnum(RetailUserStatusEnum)
44
64
  status!: RetailUserStatusEnum;
@@ -75,11 +75,15 @@ export class Store {
75
75
  @IsString()
76
76
  schedule!: string | null;
77
77
 
78
- /** Venta diaria promedio en centavos; `null` si no está registrada. */
78
+ /**
79
+ * Conteo promedio de transacciones de cobro por día (NO es un monto de dinero).
80
+ * `null` si no está registrado. El factor 2× que amplifica este conteo es global
81
+ * y vive en loan-config, no acá.
82
+ */
79
83
  @Expose()
80
84
  @IsOptional()
81
85
  @IsNumber()
82
- dailyAvgSalesCents!: number | null;
86
+ dailyAvgCollectionsCount!: number | null;
83
87
 
84
88
  @Expose()
85
89
  @IsEnum(StoreStatusEnum)
@@ -1,5 +1,6 @@
1
1
  import { Expose } from 'class-transformer';
2
- import { IsEnum, IsOptional, IsString } from 'class-validator';
2
+ import { IsArray, IsEnum, IsOptional, IsString } from 'class-validator';
3
+ import { CollectorSeniorityEnum } from '../../enums/CollectorSeniorityEnum';
3
4
  import { EmploymentTypeEnum } from '../../enums/EmploymentTypeEnum';
4
5
 
5
6
  /**
@@ -28,4 +29,23 @@ export class CreateRetailUserRequest {
28
29
  @IsOptional()
29
30
  @IsString()
30
31
  zoneId!: string | null;
32
+
33
+ /** Teléfono de contacto del usuario retail; opcional. */
34
+ @Expose()
35
+ @IsOptional()
36
+ @IsString()
37
+ phone?: string;
38
+
39
+ /** Seniority del cobrador; solo aplica a usuarios retail con rol de cobrador. */
40
+ @Expose()
41
+ @IsOptional()
42
+ @IsEnum(CollectorSeniorityEnum)
43
+ collectorSeniority?: CollectorSeniorityEnum;
44
+
45
+ /** Tiendas que cubre el cobrador (zona de cobranza); opcional. */
46
+ @Expose()
47
+ @IsOptional()
48
+ @IsArray()
49
+ @IsString({ each: true })
50
+ coverageStoreIds?: string[];
31
51
  }
@@ -59,9 +59,13 @@ export class CreateStoreRequest {
59
59
  @IsString()
60
60
  schedule!: string | null;
61
61
 
62
- /** Venta diaria promedio en centavos; `null` si no está registrada. */
62
+ /**
63
+ * Conteo promedio de transacciones de cobro por día (NO es un monto de dinero).
64
+ * `null` si no está registrado. El factor 2× que amplifica este conteo es global
65
+ * y vive en loan-config, no acá.
66
+ */
63
67
  @Expose()
64
68
  @IsOptional()
65
69
  @IsNumber()
66
- dailyAvgSalesCents!: number | null;
70
+ dailyAvgCollectionsCount!: number | null;
67
71
  }