This commit is contained in:
2026-02-25 16:58:36 +03:30
parent 5112ff25ae
commit cf7fd04913
14 changed files with 68 additions and 117 deletions
+4 -1
View File
@@ -1,10 +1,13 @@
import { IsNotEmpty, IsString, Length, IsMobilePhone } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
import { normalizePhoneToLocal } from 'src/modules/util/phone.util';
export class VerifyOtpDto {
@Transform(({ value }) => normalizePhoneToLocal(value))
@IsNotEmpty()
@IsString()
@ApiProperty({ example: '09362532122', description: 'Mobile number' })
@ApiProperty({ example: '09362532122', description: 'Mobile number (accepts +98, 0098, 98, 09 formats)' })
@IsMobilePhone('fa-IR')
phone: string;