@fiado/type-kit 3.552.0 → 3.554.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.
- package/_test_/unit/common/InputPatternValidators.test.ts +64 -0
- package/_test_/unit/common/InputPatterns.test.ts +104 -0
- package/_test_/unit/retailCatalog/backofficeRequests.test.ts +1 -1
- package/_test_/unit/retailOrg/dtos/requests/inputPatternRequests.test.ts +93 -0
- package/_test_/unit/retailWizard/accessorySaleRequests.test.ts +4 -3
- package/_test_/unit/retailWizard/fixtures/saleWithoutCustomer.strict.ts +3 -0
- package/_test_/unit/retailWizard/saleWithoutCustomer.test.ts +32 -0
- package/bin/common/constants/InputPatterns.d.ts +25 -0
- package/bin/common/constants/InputPatterns.js +28 -0
- package/bin/common/decorators/UpperCase.d.ts +2 -0
- package/bin/common/decorators/UpperCase.js +7 -0
- package/bin/common/helpers/imeiChecksum.d.ts +2 -0
- package/bin/common/helpers/imeiChecksum.js +20 -0
- package/bin/common/index.d.ts +8 -0
- package/bin/common/index.js +10 -0
- package/bin/common/validators/IsMxPhone.d.ts +3 -0
- package/bin/common/validators/IsMxPhone.js +8 -0
- package/bin/common/validators/IsMxZipCode.d.ts +3 -0
- package/bin/common/validators/IsMxZipCode.js +8 -0
- package/bin/common/validators/IsRfc.d.ts +3 -0
- package/bin/common/validators/IsRfc.js +8 -0
- package/bin/common/validators/IsSku.d.ts +3 -0
- package/bin/common/validators/IsSku.js +8 -0
- package/bin/common/validators/matchesInputPattern.d.ts +3 -0
- package/bin/common/validators/matchesInputPattern.js +16 -0
- package/bin/helpers/constans/regex.js +2 -1
- package/bin/loanCredit/dtos/LoanContractDetails.js +2 -2
- package/bin/loanCredit/dtos/LoanDeviceEnrollItem.js +4 -4
- package/bin/retailCatalog/constants/SkuPattern.d.ts +2 -2
- package/bin/retailCatalog/constants/SkuPattern.js +5 -3
- package/bin/retailCatalog/dtos/ProductComponent.js +1 -1
- package/bin/retailCatalog/dtos/requests/BackofficeCreateKitRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/BackofficeCreateProductRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/BackofficeCreateServiceRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/BackofficeCreateTransferRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/BackofficeRegisterEntryRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/CreateProductRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/ReturnPieceCondition.js +1 -1
- package/bin/retailCatalog/dtos/requests/SyncInventoryRequest.js +1 -1
- package/bin/retailIntegration/constants/retailIntegrationLimits.d.ts +1 -1
- package/bin/retailIntegration/constants/retailIntegrationLimits.js +2 -2
- package/bin/retailOrg/dtos/requests/CreateRetailUserRequest.js +2 -1
- package/bin/retailOrg/dtos/requests/CreateRetailerRequest.d.ts +1 -1
- package/bin/retailOrg/dtos/requests/CreateRetailerRequest.js +6 -2
- package/bin/retailOrg/dtos/requests/CreateStoreRequest.js +2 -1
- package/bin/retailOrg/dtos/requests/CreateSubdistributorRequest.d.ts +1 -1
- package/bin/retailOrg/dtos/requests/CreateSubdistributorRequest.js +6 -2
- package/bin/retailOrg/dtos/requests/ProvisionRetailUserRequest.js +2 -1
- package/bin/retailOrg/dtos/requests/RetailAddressInput.d.ts +1 -1
- package/bin/retailOrg/dtos/requests/RetailAddressInput.js +2 -2
- package/bin/retailOrg/dtos/requests/UpdateRetailUserRequest.js +2 -1
- package/bin/retailOrg/dtos/requests/UpdateRetailerRequest.js +2 -1
- package/bin/retailOrg/dtos/requests/UpdateStoreRequest.js +2 -1
- package/bin/retailWizard/dtos/Sale.d.ts +2 -1
- package/bin/retailWizard/dtos/requests/CreateAccessorySaleRequest.d.ts +1 -2
- package/bin/retailWizard/dtos/requests/CreateAccessorySaleRequest.js +1 -7
- package/package.json +1 -1
- package/src/common/constants/InputPatterns.ts +32 -0
- package/src/common/decorators/UpperCase.ts +5 -0
- package/src/common/helpers/imeiChecksum.ts +16 -0
- package/src/common/index.ts +12 -0
- package/src/common/validators/IsMxPhone.ts +7 -0
- package/src/common/validators/IsMxZipCode.ts +7 -0
- package/src/common/validators/IsRfc.ts +7 -0
- package/src/common/validators/IsSku.ts +7 -0
- package/src/common/validators/matchesInputPattern.ts +24 -0
- package/src/helpers/constans/regex.ts +2 -1
- package/src/loanCredit/dtos/LoanContractDetails.ts +1 -1
- package/src/loanCredit/dtos/LoanDeviceEnrollItem.ts +3 -3
- package/src/retailCatalog/constants/SkuPattern.ts +2 -2
- package/src/retailCatalog/dtos/ProductComponent.ts +2 -2
- package/src/retailCatalog/dtos/requests/BackofficeCreateKitRequest.ts +2 -2
- package/src/retailCatalog/dtos/requests/BackofficeCreateProductRequest.ts +2 -2
- package/src/retailCatalog/dtos/requests/BackofficeCreateServiceRequest.ts +2 -2
- package/src/retailCatalog/dtos/requests/BackofficeCreateTransferRequest.ts +2 -2
- package/src/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.ts +2 -2
- package/src/retailCatalog/dtos/requests/BackofficeRegisterEntryRequest.ts +2 -2
- package/src/retailCatalog/dtos/requests/CreateProductRequest.ts +2 -2
- package/src/retailCatalog/dtos/requests/ReturnPieceCondition.ts +2 -2
- package/src/retailCatalog/dtos/requests/SyncInventoryRequest.ts +2 -2
- package/src/retailIntegration/constants/retailIntegrationLimits.ts +2 -2
- package/src/retailOrg/dtos/requests/CreateRetailUserRequest.ts +2 -1
- package/src/retailOrg/dtos/requests/CreateRetailerRequest.ts +8 -4
- package/src/retailOrg/dtos/requests/CreateStoreRequest.ts +2 -1
- package/src/retailOrg/dtos/requests/CreateSubdistributorRequest.ts +8 -4
- package/src/retailOrg/dtos/requests/ProvisionRetailUserRequest.ts +2 -1
- package/src/retailOrg/dtos/requests/RetailAddressInput.ts +3 -3
- package/src/retailOrg/dtos/requests/UpdateRetailUserRequest.ts +2 -1
- package/src/retailOrg/dtos/requests/UpdateRetailerRequest.ts +2 -1
- package/src/retailOrg/dtos/requests/UpdateStoreRequest.ts +2 -1
- package/src/retailWizard/dtos/Sale.ts +2 -1
- package/src/retailWizard/dtos/requests/CreateAccessorySaleRequest.ts +1 -6
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Type } from 'class-transformer';
|
|
2
2
|
import { ArrayMinSize, IsArray, IsBoolean, IsOptional, IsString, Length, Matches, ValidateNested } from 'class-validator';
|
|
3
|
-
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
3
|
+
import { SKU_MESSAGE, SKU_PATTERN } from '../../constants/SkuPattern';
|
|
4
4
|
import { ProductComponent } from '../ProductComponent';
|
|
5
5
|
|
|
6
6
|
/** Body de POST /backoffice/catalog/kits (backofficeCreateKit); category BUNDLE y origen BACKOFFICE los fija el servidor. */
|
|
7
7
|
export class BackofficeCreateKitRequest {
|
|
8
|
-
@Matches(SKU_PATTERN, { message:
|
|
8
|
+
@Matches(SKU_PATTERN, { message: SKU_MESSAGE })
|
|
9
9
|
@Length(1, 64)
|
|
10
10
|
@IsString()
|
|
11
11
|
sku!: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IsArray, IsBoolean, IsEnum, IsIn, IsInt, IsISO8601, IsObject, IsOptional, IsString, Length, Matches, Max, Min, Validate, ValidateIf } from 'class-validator';
|
|
2
|
-
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
2
|
+
import { SKU_MESSAGE, SKU_PATTERN } from '../../constants/SkuPattern';
|
|
3
3
|
import { NON_BUNDLE_CATEGORIES } from '../../constants/NonBundleCategories';
|
|
4
4
|
import { ProductCategoryEnum } from '../../enums/ProductCategoryEnum';
|
|
5
5
|
import { AccessorySubcategoryEnum } from '../../enums/AccessorySubcategoryEnum';
|
|
@@ -11,7 +11,7 @@ import { IsMdmCoherentConstraint } from '../../validators/IsMdmCoherentConstrain
|
|
|
11
11
|
|
|
12
12
|
/** Body de POST /backoffice/catalog/products (backofficeCreateProduct); itemType PRODUCT y origen BACKOFFICE los fija el servidor. */
|
|
13
13
|
export class BackofficeCreateProductRequest {
|
|
14
|
-
@Matches(SKU_PATTERN, { message:
|
|
14
|
+
@Matches(SKU_PATTERN, { message: SKU_MESSAGE })
|
|
15
15
|
@Length(1, 64)
|
|
16
16
|
@IsString()
|
|
17
17
|
sku!: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IsBoolean, IsOptional, IsString, Length, Matches } from 'class-validator';
|
|
2
|
-
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
2
|
+
import { SKU_MESSAGE, SKU_PATTERN } from '../../constants/SkuPattern';
|
|
3
3
|
|
|
4
4
|
/** Body de POST /backoffice/catalog/services (backofficeCreateService); itemType SERVICE y trackingMode QUANTITY los fija el servidor. */
|
|
5
5
|
export class BackofficeCreateServiceRequest {
|
|
6
|
-
@Matches(SKU_PATTERN, { message:
|
|
6
|
+
@Matches(SKU_PATTERN, { message: SKU_MESSAGE })
|
|
7
7
|
@Length(1, 64)
|
|
8
8
|
@IsString()
|
|
9
9
|
sku!: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ArrayMinSize, ArrayUnique, IsArray, IsInt, IsOptional, IsString, Length, Matches, Min } from 'class-validator';
|
|
2
|
-
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
2
|
+
import { SKU_MESSAGE, SKU_PATTERN } from '../../constants/SkuPattern';
|
|
3
3
|
|
|
4
4
|
/** Body de POST /backoffice/inventory/transfers (backofficeCreateTransfer); origen = destino lo rechaza el dominio. */
|
|
5
5
|
export class BackofficeCreateTransferRequest {
|
|
@@ -11,7 +11,7 @@ export class BackofficeCreateTransferRequest {
|
|
|
11
11
|
@IsString()
|
|
12
12
|
toStoreId!: string;
|
|
13
13
|
|
|
14
|
-
@Matches(SKU_PATTERN, { message:
|
|
14
|
+
@Matches(SKU_PATTERN, { message: SKU_MESSAGE })
|
|
15
15
|
@Length(1, 64)
|
|
16
16
|
@IsString()
|
|
17
17
|
sku!: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ArrayMinSize, ArrayUnique, IsArray, IsIn, IsInt, IsOptional, IsString, Length, Matches, Min } from 'class-validator';
|
|
2
2
|
import { ADJUSTMENT_REASONS } from '../../constants/AdjustmentReasons';
|
|
3
|
-
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
3
|
+
import { SKU_MESSAGE, SKU_PATTERN } from '../../constants/SkuPattern';
|
|
4
4
|
import { InventoryMovementReasonEnum } from '../../enums/InventoryMovementReasonEnum';
|
|
5
5
|
|
|
6
6
|
/** Body de POST /backoffice/inventory/adjustments (backofficeRegisterAdjustment); resta del disponible con motivo. */
|
|
@@ -10,7 +10,7 @@ export class BackofficeRegisterAdjustmentRequest {
|
|
|
10
10
|
@IsString()
|
|
11
11
|
storeId!: string;
|
|
12
12
|
|
|
13
|
-
@Matches(SKU_PATTERN, { message:
|
|
13
|
+
@Matches(SKU_PATTERN, { message: SKU_MESSAGE })
|
|
14
14
|
@Length(1, 64)
|
|
15
15
|
@IsString()
|
|
16
16
|
sku!: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ArrayMinSize, ArrayUnique, IsArray, IsEnum, IsInt, IsOptional, IsString, Length, Matches, Min } from 'class-validator';
|
|
2
|
-
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
2
|
+
import { SKU_MESSAGE, SKU_PATTERN } from '../../constants/SkuPattern';
|
|
3
3
|
import { InventoryMovementReasonEnum } from '../../enums/InventoryMovementReasonEnum';
|
|
4
4
|
|
|
5
5
|
/** Body de POST /backoffice/inventory/entries (backofficeRegisterEntry); suma al saldo de la tienda con un MOV# ENTRY. */
|
|
@@ -9,7 +9,7 @@ export class BackofficeRegisterEntryRequest {
|
|
|
9
9
|
@IsString()
|
|
10
10
|
storeId!: string;
|
|
11
11
|
|
|
12
|
-
@Matches(SKU_PATTERN, { message:
|
|
12
|
+
@Matches(SKU_PATTERN, { message: SKU_MESSAGE })
|
|
13
13
|
@Length(1, 64)
|
|
14
14
|
@IsString()
|
|
15
15
|
sku!: string;
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
Min,
|
|
12
12
|
Validate,
|
|
13
13
|
} from 'class-validator';
|
|
14
|
-
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
14
|
+
import { SKU_MESSAGE, SKU_PATTERN } from '../../constants/SkuPattern';
|
|
15
15
|
import { MdmLockModeEnum } from '../../enums/MdmLockModeEnum';
|
|
16
16
|
import { MdmProviderEnum } from '../../enums/MdmProviderEnum';
|
|
17
17
|
import { ProductTierEnum } from '../../enums/ProductTierEnum';
|
|
@@ -22,7 +22,7 @@ import { IsMdmCoherentConstraint } from '../../validators/IsMdmCoherentConstrain
|
|
|
22
22
|
* @deprecated Modelo viejo por IMEI; usar BackofficeCreateProductRequest. Se conserva porque otras ramas lo importan.
|
|
23
23
|
*/
|
|
24
24
|
export class CreateProductRequest {
|
|
25
|
-
@Matches(SKU_PATTERN, { message:
|
|
25
|
+
@Matches(SKU_PATTERN, { message: SKU_MESSAGE })
|
|
26
26
|
@Length(1, 64)
|
|
27
27
|
@IsString()
|
|
28
28
|
sku!: string;
|
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
Validate,
|
|
11
11
|
ValidateIf,
|
|
12
12
|
} from 'class-validator';
|
|
13
|
-
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
13
|
+
import { SKU_MESSAGE, SKU_PATTERN } from '../../constants/SkuPattern';
|
|
14
14
|
import { ReturnConditionEnum } from '../../enums/ReturnConditionEnum';
|
|
15
15
|
import { IsPieceRefConstraint } from '../../validators/IsPieceRefConstraint';
|
|
16
16
|
|
|
17
17
|
/** Condición de una pieza devuelta; ausente = GOOD. Un accesorio por cantidad se declara con sku + qty. */
|
|
18
18
|
export class ReturnPieceCondition {
|
|
19
19
|
@Expose()
|
|
20
|
-
@Matches(SKU_PATTERN, { message:
|
|
20
|
+
@Matches(SKU_PATTERN, { message: SKU_MESSAGE })
|
|
21
21
|
@Length(1, 64)
|
|
22
22
|
@IsString()
|
|
23
23
|
sku!: string;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
Min,
|
|
13
13
|
ValidateNested,
|
|
14
14
|
} from 'class-validator';
|
|
15
|
-
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
15
|
+
import { SKU_MESSAGE, SKU_PATTERN } from '../../constants/SkuPattern';
|
|
16
16
|
import { MdmLockModeEnum } from '../../enums/MdmLockModeEnum';
|
|
17
17
|
import { MdmProviderEnum } from '../../enums/MdmProviderEnum';
|
|
18
18
|
import { ProductCategoryEnum } from '../../enums/ProductCategoryEnum';
|
|
@@ -38,7 +38,7 @@ export class SyncPrice {
|
|
|
38
38
|
|
|
39
39
|
/** Producto tal como llega de Zentral. */
|
|
40
40
|
export class SyncProduct {
|
|
41
|
-
@Matches(SKU_PATTERN, { message:
|
|
41
|
+
@Matches(SKU_PATTERN, { message: SKU_MESSAGE })
|
|
42
42
|
@Length(1, 64)
|
|
43
43
|
@IsString()
|
|
44
44
|
sku!: string;
|
|
@@ -21,8 +21,8 @@ export const RETAIL_STORE_CODE_MAX_LENGTH = 10;
|
|
|
21
21
|
export const RETAIL_ZIP_CODE_MIN_LENGTH = 4;
|
|
22
22
|
export const RETAIL_ZIP_CODE_MAX_LENGTH = 10;
|
|
23
23
|
|
|
24
|
-
/** SKU del catálogo del retailer. */
|
|
25
|
-
export const RETAIL_SKU_PATTERN = /^[A-Za-z0-9-]
|
|
24
|
+
/** SKU del catálogo del retailer: el charset de `SKU_PATTERN` con tope de 64. */
|
|
25
|
+
export const RETAIL_SKU_PATTERN = /^(?=.{1,64}$)[A-Za-z0-9-]+(?: +[A-Za-z0-9-]+)*$/;
|
|
26
26
|
|
|
27
27
|
/** Decimal del contrato: string con dos decimales, nunca negativo. */
|
|
28
28
|
export const RETAIL_DECIMAL_PATTERN = /^\d+\.\d{2}$/;
|
|
@@ -2,6 +2,7 @@ import { Expose } from 'class-transformer';
|
|
|
2
2
|
import { IsArray, IsEnum, IsOptional, IsString } from 'class-validator';
|
|
3
3
|
import { CollectorSeniorityEnum } from '../../enums/CollectorSeniorityEnum';
|
|
4
4
|
import { EmploymentTypeEnum } from '../../enums/EmploymentTypeEnum';
|
|
5
|
+
import { IsMxPhone } from '../../../common/validators/IsMxPhone';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Body de POST /retailers/:retailerId/users — alta de usuario retail (el `retailerId` sale del path;
|
|
@@ -42,7 +43,7 @@ export class CreateRetailUserRequest {
|
|
|
42
43
|
/** Teléfono de contacto del usuario retail; opcional. */
|
|
43
44
|
@Expose()
|
|
44
45
|
@IsOptional()
|
|
45
|
-
@
|
|
46
|
+
@IsMxPhone()
|
|
46
47
|
phone?: string;
|
|
47
48
|
|
|
48
49
|
/** Seniority del cobrador; solo aplica a usuarios retail con rol de cobrador. */
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Expose, Type } from 'class-transformer';
|
|
2
|
-
import { IsDefined, IsEmail, IsEnum, IsString,
|
|
2
|
+
import { IsDefined, IsEmail, IsEnum, IsString, ValidateNested } from 'class-validator';
|
|
3
3
|
import { RetailerTypeEnum } from '../../enums/RetailerTypeEnum';
|
|
4
4
|
import { RetailAddressInput } from './RetailAddressInput';
|
|
5
|
+
import { IsMxPhone } from '../../../common/validators/IsMxPhone';
|
|
6
|
+
import { IsRfc } from '../../../common/validators/IsRfc';
|
|
7
|
+
import { UpperCase } from '../../../common/decorators/UpperCase';
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* Body de POST /retailers — alta de un retailer raíz (SureKeep Fase 1 — pista Retail).
|
|
@@ -21,10 +24,11 @@ export class CreateRetailerRequest {
|
|
|
21
24
|
@IsString()
|
|
22
25
|
legalName!: string;
|
|
23
26
|
|
|
24
|
-
/** RFC
|
|
27
|
+
/** RFC — 12 (persona moral) o 13 (persona física); se pasa a mayúsculas antes de validar. */
|
|
25
28
|
@Expose()
|
|
26
29
|
@IsString()
|
|
27
|
-
@
|
|
30
|
+
@UpperCase()
|
|
31
|
+
@IsRfc()
|
|
28
32
|
rfc!: string;
|
|
29
33
|
|
|
30
34
|
@Expose()
|
|
@@ -32,7 +36,7 @@ export class CreateRetailerRequest {
|
|
|
32
36
|
contactEmail!: string;
|
|
33
37
|
|
|
34
38
|
@Expose()
|
|
35
|
-
@
|
|
39
|
+
@IsMxPhone()
|
|
36
40
|
contactPhone!: string;
|
|
37
41
|
|
|
38
42
|
@Expose()
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from 'class-validator';
|
|
10
10
|
import { GeoLocation } from '../GeoLocation';
|
|
11
11
|
import { RetailAddressInput } from './RetailAddressInput';
|
|
12
|
+
import { IsMxPhone } from '../../../common/validators/IsMxPhone';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Body de POST /retailers/:retailerId/stores — alta de tienda física (el `retailerId` sale del path).
|
|
@@ -44,7 +45,7 @@ export class CreateStoreRequest {
|
|
|
44
45
|
location!: GeoLocation;
|
|
45
46
|
|
|
46
47
|
@Expose()
|
|
47
|
-
@
|
|
48
|
+
@IsMxPhone()
|
|
48
49
|
phone!: string;
|
|
49
50
|
|
|
50
51
|
/** Usuario retail responsable; `null` si no hay gerente asignado. */
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Expose, Type } from 'class-transformer';
|
|
2
|
-
import { IsDefined, IsEmail, IsIn, IsString,
|
|
2
|
+
import { IsDefined, IsEmail, IsIn, IsString, ValidateNested } from 'class-validator';
|
|
3
3
|
import { RetailerTypeEnum } from '../../enums/RetailerTypeEnum';
|
|
4
4
|
import { RetailAddressInput } from './RetailAddressInput';
|
|
5
|
+
import { IsMxPhone } from '../../../common/validators/IsMxPhone';
|
|
6
|
+
import { IsRfc } from '../../../common/validators/IsRfc';
|
|
7
|
+
import { UpperCase } from '../../../common/decorators/UpperCase';
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* Body de POST /retailers/:retailerId/subdistributors — alta de un retailer hijo colgando de
|
|
@@ -23,10 +26,11 @@ export class CreateSubdistributorRequest {
|
|
|
23
26
|
@IsString()
|
|
24
27
|
legalName!: string;
|
|
25
28
|
|
|
26
|
-
/** RFC
|
|
29
|
+
/** RFC — 12 (persona moral) o 13 (persona física); se pasa a mayúsculas antes de validar. */
|
|
27
30
|
@Expose()
|
|
28
31
|
@IsString()
|
|
29
|
-
@
|
|
32
|
+
@UpperCase()
|
|
33
|
+
@IsRfc()
|
|
30
34
|
rfc!: string;
|
|
31
35
|
|
|
32
36
|
@Expose()
|
|
@@ -34,7 +38,7 @@ export class CreateSubdistributorRequest {
|
|
|
34
38
|
contactEmail!: string;
|
|
35
39
|
|
|
36
40
|
@Expose()
|
|
37
|
-
@
|
|
41
|
+
@IsMxPhone()
|
|
38
42
|
contactPhone!: string;
|
|
39
43
|
|
|
40
44
|
@Expose()
|
|
@@ -3,6 +3,7 @@ import { IsArray, IsEmail, IsEnum, IsOptional, IsString } from 'class-validator'
|
|
|
3
3
|
import { CollectorSeniorityEnum } from '../../enums/CollectorSeniorityEnum';
|
|
4
4
|
import { EmploymentTypeEnum } from '../../enums/EmploymentTypeEnum';
|
|
5
5
|
import { PermissionScope } from '../../../platformRbac/enums/PermissionScope';
|
|
6
|
+
import { IsMxPhone } from '../../../common/validators/IsMxPhone';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Body de POST /retailers/:retailerId/users/provision — alta de usuario retail ORQUESTADA (SureKeep F1,
|
|
@@ -64,7 +65,7 @@ export class ProvisionRetailUserRequest {
|
|
|
64
65
|
/** Teléfono de contacto del usuario retail; opcional. */
|
|
65
66
|
@Expose()
|
|
66
67
|
@IsOptional()
|
|
67
|
-
@
|
|
68
|
+
@IsMxPhone()
|
|
68
69
|
phone?: string;
|
|
69
70
|
|
|
70
71
|
/** Seniority del cobrador; solo aplica a usuarios retail con rol de cobrador. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
2
|
import { IsOptional, IsString, Length } from 'class-validator';
|
|
3
|
+
import { IsMxZipCode } from '../../../common/validators/IsMxZipCode';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Dirección comercial de entrada (input validado) para los requests de creación/edición del dominio
|
|
@@ -53,10 +54,9 @@ export class RetailAddressInput {
|
|
|
53
54
|
@Length(1, 150)
|
|
54
55
|
state!: string;
|
|
55
56
|
|
|
56
|
-
/** Código postal (espejo de `LocationAddress.zipCode`). */
|
|
57
|
+
/** Código postal MX de 5 dígitos (espejo de `LocationAddress.zipCode`). */
|
|
57
58
|
@Expose()
|
|
58
|
-
@
|
|
59
|
-
@Length(4, 10)
|
|
59
|
+
@IsMxZipCode()
|
|
60
60
|
zipCode!: string;
|
|
61
61
|
|
|
62
62
|
/** País ISO. OPCIONAL — sin slot en `LocationAddress` (TD-SKF1-007). */
|
|
@@ -2,6 +2,7 @@ import { Expose } from 'class-transformer';
|
|
|
2
2
|
import { IsArray, IsEnum, IsOptional, IsString } from 'class-validator';
|
|
3
3
|
import { CollectorSeniorityEnum } from '../../enums/CollectorSeniorityEnum';
|
|
4
4
|
import { EmploymentTypeEnum } from '../../enums/EmploymentTypeEnum';
|
|
5
|
+
import { IsMxPhone } from '../../../common/validators/IsMxPhone';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Body de PUT /users/:retailUserId — edición de usuario retail (campos editables opcionales).
|
|
@@ -33,7 +34,7 @@ export class UpdateRetailUserRequest {
|
|
|
33
34
|
/** Teléfono de contacto del usuario retail; opcional. */
|
|
34
35
|
@Expose()
|
|
35
36
|
@IsOptional()
|
|
36
|
-
@
|
|
37
|
+
@IsMxPhone()
|
|
37
38
|
phone?: string;
|
|
38
39
|
|
|
39
40
|
/** Seniority del cobrador; solo aplica a usuarios retail con rol de cobrador. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Expose, Type } from 'class-transformer';
|
|
2
2
|
import { IsEmail, IsOptional, IsString, ValidateNested } from 'class-validator';
|
|
3
3
|
import { RetailAddressInput } from './RetailAddressInput';
|
|
4
|
+
import { IsMxPhone } from '../../../common/validators/IsMxPhone';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Body de PUT /retailers/:retailerId — edición de campos comerciales del retailer.
|
|
@@ -25,7 +26,7 @@ export class UpdateRetailerRequest {
|
|
|
25
26
|
|
|
26
27
|
@Expose()
|
|
27
28
|
@IsOptional()
|
|
28
|
-
@
|
|
29
|
+
@IsMxPhone()
|
|
29
30
|
contactPhone?: string;
|
|
30
31
|
|
|
31
32
|
@Expose()
|
|
@@ -2,6 +2,7 @@ import { Expose, Type } from 'class-transformer';
|
|
|
2
2
|
import { IsNumber, IsOptional, IsString, Length, ValidateNested } from 'class-validator';
|
|
3
3
|
import { GeoLocation } from '../GeoLocation';
|
|
4
4
|
import { RetailAddressInput } from './RetailAddressInput';
|
|
5
|
+
import { IsMxPhone } from '../../../common/validators/IsMxPhone';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Body de PUT /stores/:storeId — edición de tienda (campos editables opcionales). El status se
|
|
@@ -39,7 +40,7 @@ export class UpdateStoreRequest {
|
|
|
39
40
|
|
|
40
41
|
@Expose()
|
|
41
42
|
@IsOptional()
|
|
42
|
-
@
|
|
43
|
+
@IsMxPhone()
|
|
43
44
|
phone?: string;
|
|
44
45
|
|
|
45
46
|
@Expose()
|
|
@@ -19,7 +19,8 @@ export interface Sale {
|
|
|
19
19
|
retailerId: string;
|
|
20
20
|
storeId: string;
|
|
21
21
|
sellerRetailUserId: string;
|
|
22
|
-
|
|
22
|
+
/** `null` en la venta de mostrador sin cliente. */
|
|
23
|
+
retailCustomerId: string | null;
|
|
23
24
|
/** Sesión del wizard que cerró la venta; ausente en la venta de mostrador. */
|
|
24
25
|
wizardSessionId?: string;
|
|
25
26
|
/** Canal de la venta; ausente = `WIZARD` (ventas anteriores al campo). */
|
|
@@ -18,15 +18,10 @@ import { SalePaymentDetail } from '../SalePaymentDetail';
|
|
|
18
18
|
import { AccessorySaleLine } from '../AccessorySaleLine';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* POST /wizard/accessory-sales — cierra la venta de mostrador
|
|
21
|
+
* POST /wizard/accessory-sales — cierra la venta de mostrador, sin cliente.
|
|
22
22
|
* `amountCents` es lo cobrado en caja y debe igualar la suma del catálogo.
|
|
23
23
|
*/
|
|
24
24
|
export class CreateAccessorySaleRequest {
|
|
25
|
-
@Expose()
|
|
26
|
-
@IsString()
|
|
27
|
-
@MinLength(1)
|
|
28
|
-
otpChallengeId!: string;
|
|
29
|
-
|
|
30
25
|
@Expose()
|
|
31
26
|
@IsArray()
|
|
32
27
|
@ArrayMinSize(1)
|