import { ApiProperty } from '@nestjs/swagger'; import { IsString, Matches } from 'class-validator'; import { i18nValidationMessage as i18n } from 'nestjs-i18n'; import { COUNTRY_CODE_REGEX, PASSWORD_REGEX } from '~/auth/constants'; import { IsValidPhoneNumber } from '~/core/decorators/validations'; export class ForgetPasswordRequestDto { @ApiProperty({ example: '+962' }) @Matches(COUNTRY_CODE_REGEX, { message: i18n('validation.Matches', { path: 'general', property: 'auth.countryCode' }), }) countryCode!: string; @ApiProperty({ example: '787259134' }) @IsValidPhoneNumber({ message: i18n('validation.IsValidPhoneNumber', { path: 'general', property: 'auth.phoneNumber' }), }) phoneNumber!: string; @ApiProperty({ example: 'Abcd1234@' }) @Matches(PASSWORD_REGEX, { message: i18n('validation.Matches', { path: 'general', property: 'auth.password' }), }) password!: string; @ApiProperty({ example: 'Abcd1234@' }) @Matches(PASSWORD_REGEX, { message: i18n('validation.Matches', { path: 'general', property: 'auth.confirmPassword' }), }) confirmPassword!: string; @ApiProperty({ example: 'reset-token-32423123' }) @IsString({ message: i18n('validation.IsString', { path: 'general', property: 'auth.resetPasswordToken' }) }) resetPasswordToken!: string; }