@fiado/type-kit 3.52.0 → 3.54.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.
@@ -12,15 +12,15 @@
12
12
  */
13
13
  export declare class AuthorizeBenefitsMarketplaceTransactionRequest {
14
14
  /**
15
- * Reusa entradas existentes en `ProductCatalog_GT` del procesador
16
- * (`MEX_TOPUP`, `MEX_SERVICE_PAYMENT`, …). No se agregan entradas nuevas
17
- * en Fase 2 (ver doc §10).
15
+ * Id del producto del marketplace en `ProductCatalog_GT` del procesador
16
+ * (`MEX_TOPUP`, `MEX_SERVICE_PAYMENT`, `INTERNATIONAL_REMITTANCE`, …).
18
17
  *
19
- * El factory dinámico `TransactionProcessorFactory.getMarketplaceInstance`
20
- * deriva el token del binding desde aquí (`MEX_<X>`
21
- * `BenefitsMarketplace<X>TransactionService`). La regex impone el contrato
22
- * y permite que el factory falle con 400 en lugar de 500 si llega algo
23
- * fuera de la convención.
18
+ * El marketplace es multi-país y multi-servicio, así que el prefijo `MEX_`
19
+ * NO es obligatorio (era una convención inicial sesgada a México). La regex
20
+ * solo exige UPPER_SNAKE para que el factory dinámico
21
+ * `TransactionProcessorFactory.getMarketplaceInstance` derive el token
22
+ * (`<X>` `BenefitsMarketplace<X>TransactionService`, quitando `MEX_` si
23
+ * está) y falle con 400 en lugar de 500 ante valores fuera de convención.
24
24
  */
25
25
  productCatalogId: string;
26
26
  /**
@@ -30,8 +30,8 @@ __decorate([
30
30
  (0, class_validator_1.IsString)(),
31
31
  (0, class_validator_1.IsNotEmpty)(),
32
32
  (0, class_validator_1.MaxLength)(64),
33
- (0, class_validator_1.Matches)(/^MEX_[A-Z][A-Z_]*$/, {
34
- message: "productCatalogId debe seguir el formato MEX_<UPPER_SNAKE>",
33
+ (0, class_validator_1.Matches)(/^[A-Z][A-Z0-9_]*$/, {
34
+ message: "productCatalogId debe ser UPPER_SNAKE (ej. INTERNATIONAL_REMITTANCE, MEX_TOPUP)",
35
35
  }),
36
36
  __metadata("design:type", String)
37
37
  ], AuthorizeBenefitsMarketplaceTransactionRequest.prototype, "productCatalogId", void 0);
@@ -9,6 +9,8 @@
9
9
  * `requiresReferenceVerification` SÍ es editable: es un toggle a nivel
10
10
  * servicio que el backend traduce a `verificateReference` en TODOS los
11
11
  * productos del servicio (el derivado se recalcula solo en el siguiente read).
12
+ *
13
+ * `currency` y `countryId` también son editables a nivel servicio (F5).
12
14
  */
13
15
  export declare class BackofficeLeafUpdateRequest {
14
16
  serviceName?: string;
@@ -19,4 +21,6 @@ export declare class BackofficeLeafUpdateRequest {
19
21
  serviceOrder?: number;
20
22
  subcategoryOrder?: number;
21
23
  requiresReferenceVerification?: boolean;
24
+ currency?: string;
25
+ countryId?: string;
22
26
  }
@@ -22,6 +22,8 @@ const class_validator_1 = require("class-validator");
22
22
  * `requiresReferenceVerification` SÍ es editable: es un toggle a nivel
23
23
  * servicio que el backend traduce a `verificateReference` en TODOS los
24
24
  * productos del servicio (el derivado se recalcula solo en el siguiente read).
25
+ *
26
+ * `currency` y `countryId` también son editables a nivel servicio (F5).
25
27
  */
26
28
  class BackofficeLeafUpdateRequest {
27
29
  }
@@ -72,3 +74,15 @@ __decorate([
72
74
  (0, class_validator_1.IsBoolean)(),
73
75
  __metadata("design:type", Boolean)
74
76
  ], BackofficeLeafUpdateRequest.prototype, "requiresReferenceVerification", void 0);
77
+ __decorate([
78
+ (0, class_validator_1.IsOptional)(),
79
+ (0, class_validator_1.IsString)(),
80
+ (0, class_validator_1.MaxLength)(10),
81
+ __metadata("design:type", String)
82
+ ], BackofficeLeafUpdateRequest.prototype, "currency", void 0);
83
+ __decorate([
84
+ (0, class_validator_1.IsOptional)(),
85
+ (0, class_validator_1.IsString)(),
86
+ (0, class_validator_1.MaxLength)(10),
87
+ __metadata("design:type", String)
88
+ ], BackofficeLeafUpdateRequest.prototype, "countryId", void 0);
@@ -0,0 +1,28 @@
1
+ import { AmountTypeEnum } from "../../servicePayment/enums/AmountTypeEnum";
2
+ import { ReferenceTypeEnum } from "../enums/ReferenceTypeEnum";
3
+ /**
4
+ * Patch parcial in-place de un producto existente (F2/F3). Se traduce a forma
5
+ * nativa en el conector (que re-deriva tipoFront de amountType).
6
+ */
7
+ export declare class BackofficeProductUpdateRequest {
8
+ productName?: string;
9
+ /** Precio del producto (0 para monto VARIABLE). */
10
+ price?: number;
11
+ /** Comisión. */
12
+ fee?: number;
13
+ amountType?: AmountTypeEnum;
14
+ /** Tipo de referencia (→ tipoReferencia nativo; define el input de la app). */
15
+ referenceType?: ReferenceTypeEnum;
16
+ /** Si la referencia lleva dígito verificador (→ hasDigitoVerificador). */
17
+ hasCheckDigit?: boolean;
18
+ /** Si la referencia se verifica antes de pagar (→ verificateReference). */
19
+ verifyReference?: boolean;
20
+ /** Texto de ayuda (→ legend). */
21
+ helpText?: string;
22
+ /** Imagen de ayuda / dónde escanear (→ refSrc). */
23
+ helpImage?: string;
24
+ /** Logo del producto (→ logoSrc). */
25
+ logo?: string;
26
+ /** Habilitado. */
27
+ enabled?: boolean;
28
+ }
@@ -0,0 +1,82 @@
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.BackofficeProductUpdateRequest = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const AmountTypeEnum_1 = require("../../servicePayment/enums/AmountTypeEnum");
15
+ const ReferenceTypeEnum_1 = require("../enums/ReferenceTypeEnum");
16
+ /**
17
+ * Patch parcial in-place de un producto existente (F2/F3). Se traduce a forma
18
+ * nativa en el conector (que re-deriva tipoFront de amountType).
19
+ */
20
+ class BackofficeProductUpdateRequest {
21
+ }
22
+ exports.BackofficeProductUpdateRequest = BackofficeProductUpdateRequest;
23
+ __decorate([
24
+ (0, class_validator_1.IsOptional)(),
25
+ (0, class_validator_1.IsString)(),
26
+ (0, class_validator_1.MaxLength)(200),
27
+ __metadata("design:type", String)
28
+ ], BackofficeProductUpdateRequest.prototype, "productName", void 0);
29
+ __decorate([
30
+ (0, class_validator_1.IsOptional)(),
31
+ (0, class_validator_1.IsNumber)(),
32
+ (0, class_validator_1.Min)(0),
33
+ __metadata("design:type", Number)
34
+ ], BackofficeProductUpdateRequest.prototype, "price", void 0);
35
+ __decorate([
36
+ (0, class_validator_1.IsOptional)(),
37
+ (0, class_validator_1.IsNumber)(),
38
+ (0, class_validator_1.Min)(0),
39
+ __metadata("design:type", Number)
40
+ ], BackofficeProductUpdateRequest.prototype, "fee", void 0);
41
+ __decorate([
42
+ (0, class_validator_1.IsOptional)(),
43
+ (0, class_validator_1.IsEnum)(AmountTypeEnum_1.AmountTypeEnum),
44
+ __metadata("design:type", String)
45
+ ], BackofficeProductUpdateRequest.prototype, "amountType", void 0);
46
+ __decorate([
47
+ (0, class_validator_1.IsOptional)(),
48
+ (0, class_validator_1.IsEnum)(ReferenceTypeEnum_1.ReferenceTypeEnum),
49
+ __metadata("design:type", String)
50
+ ], BackofficeProductUpdateRequest.prototype, "referenceType", void 0);
51
+ __decorate([
52
+ (0, class_validator_1.IsOptional)(),
53
+ (0, class_validator_1.IsBoolean)(),
54
+ __metadata("design:type", Boolean)
55
+ ], BackofficeProductUpdateRequest.prototype, "hasCheckDigit", void 0);
56
+ __decorate([
57
+ (0, class_validator_1.IsOptional)(),
58
+ (0, class_validator_1.IsBoolean)(),
59
+ __metadata("design:type", Boolean)
60
+ ], BackofficeProductUpdateRequest.prototype, "verifyReference", void 0);
61
+ __decorate([
62
+ (0, class_validator_1.IsOptional)(),
63
+ (0, class_validator_1.IsString)(),
64
+ __metadata("design:type", String)
65
+ ], BackofficeProductUpdateRequest.prototype, "helpText", void 0);
66
+ __decorate([
67
+ (0, class_validator_1.IsOptional)(),
68
+ (0, class_validator_1.IsString)(),
69
+ (0, class_validator_1.MaxLength)(500),
70
+ __metadata("design:type", String)
71
+ ], BackofficeProductUpdateRequest.prototype, "helpImage", void 0);
72
+ __decorate([
73
+ (0, class_validator_1.IsOptional)(),
74
+ (0, class_validator_1.IsString)(),
75
+ (0, class_validator_1.MaxLength)(500),
76
+ __metadata("design:type", String)
77
+ ], BackofficeProductUpdateRequest.prototype, "logo", void 0);
78
+ __decorate([
79
+ (0, class_validator_1.IsOptional)(),
80
+ (0, class_validator_1.IsBoolean)(),
81
+ __metadata("design:type", Boolean)
82
+ ], BackofficeProductUpdateRequest.prototype, "enabled", void 0);
@@ -75,3 +75,4 @@ export * from "./dtos/BackofficeLeafCreateRequest";
75
75
  export * from "./dtos/BannerUploadUrlRequest";
76
76
  export * from "./dtos/BannerUploadUrlResponse";
77
77
  export * from "./dtos/VerifyEquivalentInfo";
78
+ export * from "./dtos/BackofficeProductUpdateRequest";
@@ -103,3 +103,5 @@ __exportStar(require("./dtos/BannerUploadUrlRequest"), exports);
103
103
  __exportStar(require("./dtos/BannerUploadUrlResponse"), exports);
104
104
  //Backoffice verify toggle + equivalente STP (Fase 1)
105
105
  __exportStar(require("./dtos/VerifyEquivalentInfo"), exports);
106
+ //Backoffice product editor (F2/F3): patch parcial in-place de un producto
107
+ __exportStar(require("./dtos/BackofficeProductUpdateRequest"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.52.0",
3
+ "version": "3.54.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -26,21 +26,21 @@ import {
26
26
  */
27
27
  export class AuthorizeBenefitsMarketplaceTransactionRequest {
28
28
  /**
29
- * Reusa entradas existentes en `ProductCatalog_GT` del procesador
30
- * (`MEX_TOPUP`, `MEX_SERVICE_PAYMENT`, …). No se agregan entradas nuevas
31
- * en Fase 2 (ver doc §10).
29
+ * Id del producto del marketplace en `ProductCatalog_GT` del procesador
30
+ * (`MEX_TOPUP`, `MEX_SERVICE_PAYMENT`, `INTERNATIONAL_REMITTANCE`, …).
32
31
  *
33
- * El factory dinámico `TransactionProcessorFactory.getMarketplaceInstance`
34
- * deriva el token del binding desde aquí (`MEX_<X>`
35
- * `BenefitsMarketplace<X>TransactionService`). La regex impone el contrato
36
- * y permite que el factory falle con 400 en lugar de 500 si llega algo
37
- * fuera de la convención.
32
+ * El marketplace es multi-país y multi-servicio, así que el prefijo `MEX_`
33
+ * NO es obligatorio (era una convención inicial sesgada a México). La regex
34
+ * solo exige UPPER_SNAKE para que el factory dinámico
35
+ * `TransactionProcessorFactory.getMarketplaceInstance` derive el token
36
+ * (`<X>` `BenefitsMarketplace<X>TransactionService`, quitando `MEX_` si
37
+ * está) y falle con 400 en lugar de 500 ante valores fuera de convención.
38
38
  */
39
39
  @IsString()
40
40
  @IsNotEmpty()
41
41
  @MaxLength(64)
42
- @Matches(/^MEX_[A-Z][A-Z_]*$/, {
43
- message: "productCatalogId debe seguir el formato MEX_<UPPER_SNAKE>",
42
+ @Matches(/^[A-Z][A-Z0-9_]*$/, {
43
+ message: "productCatalogId debe ser UPPER_SNAKE (ej. INTERNATIONAL_REMITTANCE, MEX_TOPUP)",
44
44
  })
45
45
  productCatalogId!: string;
46
46
 
@@ -11,6 +11,8 @@ import { IsBoolean, IsNumber, IsOptional, IsString, Matches, MaxLength } from "c
11
11
  * `requiresReferenceVerification` SÍ es editable: es un toggle a nivel
12
12
  * servicio que el backend traduce a `verificateReference` en TODOS los
13
13
  * productos del servicio (el derivado se recalcula solo en el siguiente read).
14
+ *
15
+ * `currency` y `countryId` también son editables a nivel servicio (F5).
14
16
  */
15
17
  export class BackofficeLeafUpdateRequest {
16
18
  @IsOptional() @IsString() @MaxLength(200) serviceName?: string;
@@ -32,4 +34,8 @@ export class BackofficeLeafUpdateRequest {
32
34
  @IsOptional() @IsNumber() subcategoryOrder?: number;
33
35
 
34
36
  @IsOptional() @IsBoolean() requiresReferenceVerification?: boolean;
37
+
38
+ @IsOptional() @IsString() @MaxLength(10) currency?: string;
39
+
40
+ @IsOptional() @IsString() @MaxLength(10) countryId?: string;
35
41
  }
@@ -0,0 +1,75 @@
1
+ import {
2
+ IsBoolean,
3
+ IsEnum,
4
+ IsNumber,
5
+ IsOptional,
6
+ IsString,
7
+ Min,
8
+ MaxLength,
9
+ } from "class-validator";
10
+ import { AmountTypeEnum } from "../../servicePayment/enums/AmountTypeEnum";
11
+ import { ReferenceTypeEnum } from "../enums/ReferenceTypeEnum";
12
+
13
+ /**
14
+ * Patch parcial in-place de un producto existente (F2/F3). Se traduce a forma
15
+ * nativa en el conector (que re-deriva tipoFront de amountType).
16
+ */
17
+ export class BackofficeProductUpdateRequest {
18
+ @IsOptional()
19
+ @IsString()
20
+ @MaxLength(200)
21
+ productName?: string;
22
+
23
+ /** Precio del producto (0 para monto VARIABLE). */
24
+ @IsOptional()
25
+ @IsNumber()
26
+ @Min(0)
27
+ price?: number;
28
+
29
+ /** Comisión. */
30
+ @IsOptional()
31
+ @IsNumber()
32
+ @Min(0)
33
+ fee?: number;
34
+
35
+ @IsOptional()
36
+ @IsEnum(AmountTypeEnum)
37
+ amountType?: AmountTypeEnum;
38
+
39
+ /** Tipo de referencia (→ tipoReferencia nativo; define el input de la app). */
40
+ @IsOptional()
41
+ @IsEnum(ReferenceTypeEnum)
42
+ referenceType?: ReferenceTypeEnum;
43
+
44
+ /** Si la referencia lleva dígito verificador (→ hasDigitoVerificador). */
45
+ @IsOptional()
46
+ @IsBoolean()
47
+ hasCheckDigit?: boolean;
48
+
49
+ /** Si la referencia se verifica antes de pagar (→ verificateReference). */
50
+ @IsOptional()
51
+ @IsBoolean()
52
+ verifyReference?: boolean;
53
+
54
+ /** Texto de ayuda (→ legend). */
55
+ @IsOptional()
56
+ @IsString()
57
+ helpText?: string;
58
+
59
+ /** Imagen de ayuda / dónde escanear (→ refSrc). */
60
+ @IsOptional()
61
+ @IsString()
62
+ @MaxLength(500)
63
+ helpImage?: string;
64
+
65
+ /** Logo del producto (→ logoSrc). */
66
+ @IsOptional()
67
+ @IsString()
68
+ @MaxLength(500)
69
+ logo?: string;
70
+
71
+ /** Habilitado. */
72
+ @IsOptional()
73
+ @IsBoolean()
74
+ enabled?: boolean;
75
+ }
@@ -88,3 +88,5 @@ export * from "./dtos/BannerUploadUrlRequest";
88
88
  export * from "./dtos/BannerUploadUrlResponse";
89
89
  //Backoffice verify toggle + equivalente STP (Fase 1)
90
90
  export * from "./dtos/VerifyEquivalentInfo";
91
+ //Backoffice product editor (F2/F3): patch parcial in-place de un producto
92
+ export * from "./dtos/BackofficeProductUpdateRequest";