forked from Shared/esg
initial commit
This commit is contained in:
17
src/inquiry/dto/shahkar-request.dto.ts
Normal file
17
src/inquiry/dto/shahkar-request.dto.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString, Length, Matches } from 'class-validator';
|
||||
|
||||
export class ShahkarRequestDto {
|
||||
@ApiProperty({ example: '4311402422', description: 'Iranian national code (10 digits)' })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@Length(10, 10)
|
||||
@Matches(/^\d{10}$/, { message: 'nationalCode must be exactly 10 digits' })
|
||||
nationalCode!: string;
|
||||
|
||||
@ApiProperty({ example: '09226187419', description: 'Iranian mobile number' })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@Matches(/^09\d{9}$/, { message: 'mobileNo must be an Iranian mobile number' })
|
||||
mobileNo!: string;
|
||||
}
|
||||
Reference in New Issue
Block a user