This commit is contained in:
2025-11-11 10:35:58 +03:30
parent e34b93aa83
commit 5dd7a6588e
5 changed files with 15 additions and 10 deletions
+10 -5
View File
@@ -1,13 +1,18 @@
import { IsNotEmpty, IsString, Matches } from 'class-validator';
import { IsNotEmpty, IsString, IsMobilePhone } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
export class RequestOtpDto {
@IsNotEmpty()
@IsString()
@ApiProperty({ example: '09362532122', description: 'Mobile number' })
@Matches(/^09\d{9}$/, {
message: 'Mobile number must be a valid Iranian phone number (e.g., 09123456789)',
})
// @IsMobilePhone('fa-IR')
// @Matches(/^09\d{9}$/, {
// message: 'Mobile number must be a valid Iranian phone number (e.g., 09123456789)',
// })
@IsMobilePhone('fa-IR')
phone: string;
@IsNotEmpty()
@IsString()
@ApiProperty({ example: '', description: 'Restuarant slug' })
slug: string;
}