@fiado/type-kit 3.661.0 → 3.663.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 (87) hide show
  1. package/_test_/unit/cognitoBackofficeConnector/dtos/CreatePoolRequest.allowAdminCreateUserOnly.test.ts +37 -0
  2. package/_test_/unit/cognitoBackofficeConnector/dtos/OtpLoginConnectorDtos.test.ts +90 -0
  3. package/_test_/unit/common/InputPatterns.test.ts +9 -0
  4. package/_test_/unit/common/phoneE164Contract.test.ts +29 -0
  5. package/_test_/unit/loanScoring/evaluateSciRequest.test.ts +2 -2
  6. package/_test_/unit/messagesConnector/otpLoginContract.test.ts +47 -0
  7. package/_test_/unit/platformRbac/customerAccountDtos.test.ts +84 -0
  8. package/_test_/unit/platformRbac/customerPortalContract.test.ts +39 -0
  9. package/_test_/unit/platformRbac/enums/__snapshots__/permissionBits.test.ts.snap +2 -1
  10. package/_test_/unit/platformRbac/enums/retailIntegrationPermission.test.ts +3 -4
  11. package/_test_/unit/platformRbac/loginModeChallengeDtos.test.ts +58 -0
  12. package/bin/cognitoBackofficeConnector/dtos/AppClientConfig.d.ts +3 -4
  13. package/bin/cognitoBackofficeConnector/dtos/AppClientConfig.js +7 -4
  14. package/bin/cognitoBackofficeConnector/dtos/CreatePoolClientResponse.d.ts +1 -1
  15. package/bin/cognitoBackofficeConnector/dtos/CreatePoolClientResponse.js +1 -1
  16. package/bin/cognitoBackofficeConnector/dtos/CreatePoolRequest.d.ts +2 -0
  17. package/bin/cognitoBackofficeConnector/dtos/CreatePoolRequest.js +6 -0
  18. package/bin/cognitoBackofficeConnector/dtos/CreatePoolResponse.d.ts +1 -7
  19. package/bin/cognitoBackofficeConnector/dtos/CreatePoolResponse.js +1 -7
  20. package/bin/cognitoBackofficeConnector/dtos/RefreshTokensRequest.d.ts +2 -0
  21. package/bin/cognitoBackofficeConnector/dtos/RefreshTokensRequest.js +13 -0
  22. package/bin/cognitoBackofficeConnector/dtos/RespondToChallengeRequest.d.ts +1 -0
  23. package/bin/cognitoBackofficeConnector/dtos/RespondToChallengeRequest.js +6 -0
  24. package/bin/cognitoBackofficeConnector/dtos/StartOtpLoginRequest.d.ts +8 -0
  25. package/bin/cognitoBackofficeConnector/dtos/StartOtpLoginRequest.js +48 -0
  26. package/bin/cognitoBackofficeConnector/index.d.ts +1 -0
  27. package/bin/cognitoBackofficeConnector/index.js +1 -0
  28. package/bin/common/constants/InputPatterns.d.ts +3 -0
  29. package/bin/common/constants/InputPatterns.js +4 -1
  30. package/bin/loanScoring/dtos/requests/EvaluateSciRequest.d.ts +1 -1
  31. package/bin/loanScoring/dtos/requests/EvaluateSciRequest.js +1 -1
  32. package/bin/messagesConnector/dtos/OtpLoginStateRequest.d.ts +5 -0
  33. package/bin/messagesConnector/dtos/OtpLoginStateRequest.js +30 -0
  34. package/bin/messagesConnector/dtos/OtpLoginStateResponse.d.ts +5 -0
  35. package/bin/messagesConnector/dtos/OtpLoginStateResponse.js +7 -0
  36. package/bin/messagesConnector/index.d.ts +2 -0
  37. package/bin/messagesConnector/index.js +2 -0
  38. package/bin/platformRbac/application/Application.d.ts +3 -0
  39. package/bin/platformRbac/auth/DefineNextChallengeResponse.d.ts +2 -0
  40. package/bin/platformRbac/auth/DefineNextChallengeResponse.js +6 -0
  41. package/bin/platformRbac/auth/PrepareChallengeRequest.d.ts +3 -0
  42. package/bin/platformRbac/auth/PrepareChallengeRequest.js +11 -0
  43. package/bin/platformRbac/dtos/EnsureCustomerAccountRequest.d.ts +8 -0
  44. package/bin/platformRbac/dtos/EnsureCustomerAccountRequest.js +49 -0
  45. package/bin/platformRbac/dtos/EnsureCustomerAccountResponse.d.ts +5 -0
  46. package/bin/platformRbac/dtos/EnsureCustomerAccountResponse.js +2 -0
  47. package/bin/platformRbac/dtos/OtpLoginRequest.d.ts +5 -0
  48. package/bin/platformRbac/dtos/OtpLoginRequest.js +30 -0
  49. package/bin/platformRbac/dtos/UserProfileResponse.d.ts +2 -0
  50. package/bin/platformRbac/enums/LoginModeEnum.d.ts +4 -0
  51. package/bin/platformRbac/enums/LoginModeEnum.js +8 -0
  52. package/bin/platformRbac/enums/Permission.d.ts +2 -1
  53. package/bin/platformRbac/enums/Permission.js +3 -0
  54. package/bin/platformRbac/index.d.ts +4 -0
  55. package/bin/platformRbac/index.js +3 -0
  56. package/bin/retailCustomer/dtos/requests/UpsertCustomerFromKycRequest.js +2 -1
  57. package/bin/retailOrg/dtos/requests/LinkRetailUserWalletRequest.js +2 -1
  58. package/bin/retailOrg/dtos/requests/LookupRetailUserWalletRequest.js +2 -1
  59. package/bin/retailWizard/dtos/requests/StartSessionRequest.js +2 -2
  60. package/package.json +1 -1
  61. package/src/cognitoBackofficeConnector/dtos/AppClientConfig.ts +3 -4
  62. package/src/cognitoBackofficeConnector/dtos/CreatePoolClientResponse.ts +1 -1
  63. package/src/cognitoBackofficeConnector/dtos/CreatePoolRequest.ts +4 -1
  64. package/src/cognitoBackofficeConnector/dtos/CreatePoolResponse.ts +1 -7
  65. package/src/cognitoBackofficeConnector/dtos/RefreshTokensRequest.ts +4 -1
  66. package/src/cognitoBackofficeConnector/dtos/RespondToChallengeRequest.ts +2 -1
  67. package/src/cognitoBackofficeConnector/dtos/StartOtpLoginRequest.ts +11 -0
  68. package/src/cognitoBackofficeConnector/index.ts +1 -0
  69. package/src/common/constants/InputPatterns.ts +4 -0
  70. package/src/loanScoring/dtos/requests/EvaluateSciRequest.ts +3 -3
  71. package/src/messagesConnector/dtos/OtpLoginStateRequest.ts +8 -0
  72. package/src/messagesConnector/dtos/OtpLoginStateResponse.ts +5 -0
  73. package/src/messagesConnector/index.ts +2 -0
  74. package/src/platformRbac/application/Application.ts +3 -0
  75. package/src/platformRbac/auth/DefineNextChallengeResponse.ts +5 -0
  76. package/src/platformRbac/auth/PrepareChallengeRequest.ts +11 -1
  77. package/src/platformRbac/dtos/EnsureCustomerAccountRequest.ts +12 -0
  78. package/src/platformRbac/dtos/EnsureCustomerAccountResponse.ts +5 -0
  79. package/src/platformRbac/dtos/OtpLoginRequest.ts +8 -0
  80. package/src/platformRbac/dtos/UserProfileResponse.ts +2 -0
  81. package/src/platformRbac/enums/LoginModeEnum.ts +4 -0
  82. package/src/platformRbac/enums/Permission.ts +3 -0
  83. package/src/platformRbac/index.ts +4 -0
  84. package/src/retailCustomer/dtos/requests/UpsertCustomerFromKycRequest.ts +3 -2
  85. package/src/retailOrg/dtos/requests/LinkRetailUserWalletRequest.ts +2 -1
  86. package/src/retailOrg/dtos/requests/LookupRetailUserWalletRequest.ts +2 -1
  87. package/src/retailWizard/dtos/requests/StartSessionRequest.ts +2 -2
@@ -1,5 +1,5 @@
1
1
  import { Expose } from 'class-transformer';
2
- import { IsEnum, IsNotEmpty, IsObject, IsString } from 'class-validator';
2
+ import { IsBoolean, IsEnum, IsNotEmpty, IsObject, IsOptional, IsString } from 'class-validator';
3
3
  import { CognitoChallengeType } from '../enums/CognitoChallengeType';
4
4
 
5
5
  export class RespondToChallengeRequest {
@@ -9,4 +9,5 @@ export class RespondToChallengeRequest {
9
9
  @Expose() @IsEnum(CognitoChallengeType) challengeName!: CognitoChallengeType;
10
10
  @Expose() @IsString() @IsNotEmpty() session!: string;
11
11
  @Expose() @IsObject() challengeResponses!: Record<string, string>;
12
+ @Expose() @IsOptional() @IsBoolean() useClientSecret?: boolean;
12
13
  }
@@ -0,0 +1,11 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsBoolean, IsNotEmpty, IsOptional, IsString } from 'class-validator';
3
+
4
+ /** Body de POST /auth/start-otp-login: inicia CUSTOM_AUTH sin SRP ni contraseña. */
5
+ export class StartOtpLoginRequest {
6
+ @Expose() @IsString() @IsNotEmpty() userPoolId!: string;
7
+ @Expose() @IsString() @IsNotEmpty() region!: string;
8
+ @Expose() @IsString() @IsNotEmpty() clientId!: string;
9
+ @Expose() @IsString() @IsNotEmpty() username!: string;
10
+ @Expose() @IsOptional() @IsBoolean() useClientSecret?: boolean;
11
+ }
@@ -23,6 +23,7 @@ export * from './dtos/AuthEventResponse';
23
23
  export * from './dtos/AuthTokensResponse';
24
24
  export * from './dtos/AuthStartLoginRequest';
25
25
  export * from './dtos/AuthStartLoginResponse';
26
+ export * from './dtos/StartOtpLoginRequest';
26
27
  export * from './dtos/InitiateAuthRequest';
27
28
  export * from './dtos/InitiateAuthResponse';
28
29
  export * from './dtos/VerifyPasswordRequest';
@@ -5,6 +5,10 @@ export const PHONE_MX_PATTERN = /^\d{10}$/;
5
5
  export const PHONE_MX_ACCEPTED_PATTERN = /^(?:\+52)?\d{10}$/;
6
6
  export const PHONE_MX_MESSAGE = 'El teléfono debe tener 10 dígitos';
7
7
 
8
+ /** Celular guardado en todo SureKeep: `+52` y 10 dígitos. */
9
+ export const PHONE_E164_PATTERN = /^\+52\d{10}$/;
10
+ export const PHONE_E164_MESSAGE = 'El teléfono debe tener el formato +52 y 10 dígitos';
11
+
8
12
  /** Correo pragmático: algo@dominio.tld, sin espacios. */
9
13
  export const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
10
14
  export const EMAIL_MAX_LENGTH = 254;
@@ -1,6 +1,6 @@
1
1
  import { Type } from 'class-transformer';
2
2
  import { IsBoolean, IsEmail, IsNotEmpty, IsOptional, IsString, Matches, MaxLength, ValidateNested } from 'class-validator';
3
- import { PHONE_MX_PATTERN } from '../../../common/constants/InputPatterns';
3
+ import { PHONE_MX_ACCEPTED_PATTERN } from '../../../common/constants/InputPatterns';
4
4
  import { CREDIT_ID_PATTERN } from '../../../common/constants/CreditIdPattern';
5
5
  import { SciInternalHistoryInput } from './SciInternalHistoryInput';
6
6
 
@@ -49,10 +49,10 @@ export class EvaluateSciRequest {
49
49
  @MaxLength(64)
50
50
  curp!: string;
51
51
 
52
- /** Celular del solicitante: 10 dígitos, sin `+52` (requerido por Modelias). */
52
+ /** Celular del solicitante: 10 dígitos, con o sin `+52`; loan-scoring lo manda a 10 a Modelias. */
53
53
  @IsString()
54
54
  @IsNotEmpty()
55
- @Matches(PHONE_MX_PATTERN, { message: 'cellphone debe tener 10 dígitos' })
55
+ @Matches(PHONE_MX_ACCEPTED_PATTERN, { message: 'cellphone debe tener 10 dígitos, con o sin +52' })
56
56
  cellphone!: string;
57
57
 
58
58
  @IsOptional()
@@ -0,0 +1,8 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ /** Body de POST /messages/otp/login-state. */
5
+ export class OtpLoginStateRequest {
6
+ @Expose() @IsString() @IsNotEmpty() directoryId!: string;
7
+ @Expose() @IsString() @IsNotEmpty() typeOfDirectoryId!: string;
8
+ }
@@ -0,0 +1,5 @@
1
+ /** Respuesta de POST /messages/otp/login-state. `lockedUntil` va en epoch ms. */
2
+ export class OtpLoginStateResponse {
3
+ lastFailureCode!: 'OTP_NOT_FOUND' | 'OTP_EXPIRED' | 'OTP_ALREADY_USED' | null;
4
+ lockedUntil!: number | null;
5
+ }
@@ -10,6 +10,8 @@ export * from './dtos/AgentSendNotificationRequest';
10
10
  export * from './dtos/SendMessageResponse';
11
11
  export * from './dtos/VerifyOtpRequest';
12
12
  export * from './dtos/VerifyOtpResponse';
13
+ export * from './dtos/OtpLoginStateRequest';
14
+ export * from './dtos/OtpLoginStateResponse';
13
15
  export * from './dtos/OtpValidatedResponse';
14
16
  export * from './dtos/NotificationResponse';
15
17
  export * from './dtos/NotificationsPageResponse';
@@ -3,6 +3,7 @@ import { PrincipalIdentifierEnum } from '../enums/PrincipalIdentifierEnum';
3
3
  import { ApplicationStatus } from '../enums/ApplicationStatus';
4
4
  import type { UserFieldDef } from '../dtos/UserFieldDef';
5
5
  import type { TokenValidationMode } from '../enums/TokenValidationMode';
6
+ import type { LoginModeEnum } from '../enums/LoginModeEnum';
6
7
 
7
8
  export interface LevelDef {
8
9
  level: PermissionScope; // LEVEL_1 | LEVEL_2 | LEVEL_3
@@ -55,6 +56,8 @@ export interface ApplicationDefaults {
55
56
  * UsernameAttributes del pool): true ⇒ pool con ['email','phone_number']. Heredado al tenant.
56
57
  */
57
58
  allowSecondary?: boolean;
59
+ /** Modo de login que heredan los tenants de esta aplicación; sin valor entran con contraseña. */
60
+ loginMode?: LoginModeEnum | null;
58
61
  /**
59
62
  * DEC-RBAC-111: política de contraseña que heredan los tenants creados desde esta aplicación.
60
63
  *
@@ -1,5 +1,6 @@
1
1
  import { IsBoolean, IsEnum, IsOptional } from 'class-validator';
2
2
  import { ChallengeNameEnum } from '../enums/ChallengeNameEnum';
3
+ import { LoginModeEnum } from '../enums/LoginModeEnum';
3
4
 
4
5
  export class DefineNextChallengeResponse {
5
6
  @IsOptional()
@@ -11,4 +12,8 @@ export class DefineNextChallengeResponse {
11
12
 
12
13
  @IsBoolean()
13
14
  failAuthentication!: boolean;
15
+
16
+ @IsOptional()
17
+ @IsEnum(LoginModeEnum)
18
+ loginMode?: LoginModeEnum;
14
19
  }
@@ -1,5 +1,6 @@
1
- import { IsEmail, IsEnum, IsOptional, IsString, ValidateIf } from 'class-validator';
1
+ import { IsBoolean, IsEmail, IsEnum, IsOptional, IsString, ValidateIf } from 'class-validator';
2
2
  import { ChallengeNameEnum } from '../enums/ChallengeNameEnum';
3
+ import { LoginModeEnum } from '../enums/LoginModeEnum';
3
4
 
4
5
  export class PrepareChallengeRequest {
5
6
  @IsString()
@@ -23,4 +24,13 @@ export class PrepareChallengeRequest {
23
24
  @IsOptional()
24
25
  @IsString()
25
26
  phone?: string;
27
+
28
+ @IsOptional()
29
+ @IsEnum(LoginModeEnum)
30
+ loginMode?: LoginModeEnum;
31
+
32
+ // Indica que la sesión ya trae un SMS_OTP fallido.
33
+ @IsOptional()
34
+ @IsBoolean()
35
+ isRetry?: boolean;
26
36
  }
@@ -0,0 +1,12 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString, Matches } from 'class-validator';
3
+ import { PHONE_E164_PATTERN } from '../../common/constants/InputPatterns';
4
+
5
+ /** Body de POST /internal/tenants/{tenantId}/customer-accounts. */
6
+ export class EnsureCustomerAccountRequest {
7
+ @Expose() @IsString() @Matches(PHONE_E164_PATTERN) phone!: string;
8
+ @Expose() @IsString() @IsNotEmpty() retailCustomerId!: string;
9
+ @Expose() @IsString() @IsNotEmpty() directoryId!: string;
10
+ @Expose() @IsString() @IsNotEmpty() displayName!: string;
11
+ @Expose() @IsString() @IsNotEmpty() createdBy!: string;
12
+ }
@@ -0,0 +1,5 @@
1
+ /** Respuesta de POST /internal/tenants/{tenantId}/customer-accounts. */
2
+ export interface EnsureCustomerAccountResponse {
3
+ outcome: 'CREATED' | 'EXISTING';
4
+ cognitoSub: string;
5
+ }
@@ -0,0 +1,8 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ /** Body de POST /auth/otp-login. */
5
+ export class OtpLoginRequest {
6
+ @Expose() @IsString() @IsNotEmpty() phone!: string;
7
+ @Expose() @IsString() @IsNotEmpty() tenantId!: string;
8
+ }
@@ -6,4 +6,6 @@ export interface UserProfileResponse {
6
6
  email?: string;
7
7
  phone?: string;
8
8
  status?: string;
9
+ retailCustomerId?: string | null;
10
+ directoryId?: string | null;
9
11
  }
@@ -0,0 +1,4 @@
1
+ /** Modo de login de un tenant. Sin valor, el tenant entra con contraseña. */
2
+ export enum LoginModeEnum {
3
+ OTP_ONLY = 'OTP_ONLY',
4
+ }
@@ -167,6 +167,8 @@ export enum Permission {
167
167
  TENANT_API_USER_MANAGE = 'tenant.api_user.manage',
168
168
  // Activa la integración de un retailer externo (Zentral); scope PLATFORM.
169
169
  PLATFORM_RETAIL_INTEGRATION_ACTIVATE = 'platform.retail_integration.activate',
170
+ // Lectura del portal del cliente.
171
+ CUSTOMER_PORTAL_READ = 'customer.portal.read',
170
172
  }
171
173
 
172
174
  /**
@@ -289,6 +291,7 @@ export const PERMISSION_BIT_ORDER: readonly Permission[] = [
289
291
  Permission.TENANT_INTEGRATION_DIAGNOSTIC,
290
292
  Permission.TENANT_API_USER_MANAGE,
291
293
  Permission.PLATFORM_RETAIL_INTEGRATION_ACTIVATE,
294
+ Permission.CUSTOMER_PORTAL_READ,
292
295
  ] as const;
293
296
 
294
297
  function djb2(input: string): number {
@@ -34,6 +34,7 @@ export type { EffectivePermissionsResponse } from './dtos/EffectivePermissionsRe
34
34
  export * from './enums/MfaMethodEnum';
35
35
  export * from './enums/TokenValidationMode';
36
36
  export * from './enums/ChallengeNameEnum';
37
+ export * from './enums/LoginModeEnum';
37
38
  export * from './auth/DefineNextChallengeRequest';
38
39
  export * from './auth/DefineNextChallengeResponse';
39
40
  export * from './auth/PrepareChallengeRequest';
@@ -130,6 +131,9 @@ export type {
130
131
  // plain (type-only). Consumidos por los endpoints públicos de platform-rbac-business + el gate de perfil.
131
132
  export * from './dtos/SelfRegisterStartRequest';
132
133
  export * from './dtos/SelfRegisterVerifyOtpRequest';
134
+ export * from './dtos/EnsureCustomerAccountRequest';
135
+ export type { EnsureCustomerAccountResponse } from './dtos/EnsureCustomerAccountResponse';
136
+ export * from './dtos/OtpLoginRequest';
133
137
  export * from './dtos/SelfRegisterCompleteRequest';
134
138
 
135
139
  // Endpoints privados de espejo de jerarquía + alta de usuario (SureKeep F1, scope mirror).
@@ -10,7 +10,8 @@ import {
10
10
  Matches,
11
11
  ValidateNested,
12
12
  } from 'class-validator';
13
- import { regexCurp, regexIso8601Date, regexPhoneMx } from '../../../helpers/constans/regex';
13
+ import { PHONE_MX_ACCEPTED_PATTERN } from '../../../common/constants/InputPatterns';
14
+ import { regexCurp, regexIso8601Date } from '../../../helpers/constans/regex';
14
15
  import { RetailAddress } from '../RetailAddress';
15
16
  import { KycMethodEnum } from '../../enums/KycMethodEnum';
16
17
  import { KycModalityEnum } from '../../enums/KycModalityEnum';
@@ -53,7 +54,7 @@ export class UpsertCustomerFromKycRequest {
53
54
  @Expose()
54
55
  @Transform(({ value }) => (typeof value === 'string' ? value.replace(/[\s-]/g, '') : value))
55
56
  @IsString()
56
- @Matches(regexPhoneMx, { message: 'phone debe ser 10 dígitos MX' })
57
+ @Matches(PHONE_MX_ACCEPTED_PATTERN, { message: 'phone debe ser 10 dígitos MX, con o sin +52' })
57
58
  phone!: string;
58
59
 
59
60
  // Normalización en el boundary: el CURP se uppercasea para no evadir la unicidad transaccional
@@ -1,5 +1,6 @@
1
1
  import { Expose } from 'class-transformer';
2
2
  import { IsOptional, IsString, Matches, Validate, ValidateIf } from 'class-validator';
3
+ import { PHONE_MX_ACCEPTED_PATTERN } from '../../../common/constants/InputPatterns';
3
4
  import { IsSingleWalletKeyConstraint } from '../../validators/IsSingleWalletKeyConstraint';
4
5
 
5
6
  /**
@@ -19,6 +20,6 @@ export class LinkRetailUserWalletRequest {
19
20
  @Expose()
20
21
  @IsOptional()
21
22
  @IsString({ message: 'phone debe ser texto' })
22
- @Matches(/^(\+52)?\d{10}$/, { message: 'phone debe tener 10 dígitos, con o sin +52' })
23
+ @Matches(PHONE_MX_ACCEPTED_PATTERN, { message: 'phone debe tener 10 dígitos, con o sin +52' })
23
24
  phone?: string | null;
24
25
  }
@@ -1,5 +1,6 @@
1
1
  import { Expose } from 'class-transformer';
2
2
  import { IsOptional, IsString, Matches, Validate, ValidateIf } from 'class-validator';
3
+ import { PHONE_MX_ACCEPTED_PATTERN } from '../../../common/constants/InputPatterns';
3
4
  import { IsSingleWalletKeyConstraint } from '../../validators/IsSingleWalletKeyConstraint';
4
5
 
5
6
  /**
@@ -19,6 +20,6 @@ export class LookupRetailUserWalletRequest {
19
20
  @Expose()
20
21
  @IsOptional()
21
22
  @IsString({ message: 'phone debe ser texto' })
22
- @Matches(/^(\+52)?\d{10}$/, { message: 'phone debe tener 10 dígitos, con o sin +52' })
23
+ @Matches(PHONE_MX_ACCEPTED_PATTERN, { message: 'phone debe tener 10 dígitos, con o sin +52' })
23
24
  phone?: string | null;
24
25
  }
@@ -1,6 +1,6 @@
1
1
  import { Expose } from 'class-transformer';
2
2
  import { IsBoolean, IsOptional, IsString, Matches } from 'class-validator';
3
- import { regexPhoneMx } from '../../../helpers/constans/regex';
3
+ import { PHONE_MX_ACCEPTED_PATTERN } from '../../../common/constants/InputPatterns';
4
4
 
5
5
  /**
6
6
  * POST /wizard/sessions — arranca (o reanuda) la saga del wizard para un teléfono.
@@ -10,7 +10,7 @@ import { regexPhoneMx } from '../../../helpers/constans/regex';
10
10
  export class StartSessionRequest {
11
11
  @Expose()
12
12
  @IsString()
13
- @Matches(regexPhoneMx, { message: 'phone debe ser un teléfono MX de 10 dígitos' })
13
+ @Matches(PHONE_MX_ACCEPTED_PATTERN, { message: 'phone debe ser un teléfono MX de 10 dígitos, con o sin +52' })
14
14
  phone!: string;
15
15
 
16
16
  /** Prospecto a reanudar (opcional): si viene, la sesión se vincula al prospecto. */