forked from Shared/esg
some error handler + error validation + realEstate bug fixed for hamta end moallem
This commit is contained in:
18
src/inquiry/dto/real-estate-request.dto.ts
Normal file
18
src/inquiry/dto/real-estate-request.dto.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString, Length, Matches } from 'class-validator';
|
||||
|
||||
export class RealEstateRequestDto {
|
||||
@ApiProperty({ example: '5098961130', 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: '1349689554', description: 'Postal code (10 digits)' })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@Length(10, 10)
|
||||
@Matches(/^\d{10}$/, { message: 'postalCode must be exactly 10 digits' })
|
||||
postalCode!: string;
|
||||
}
|
||||
Reference in New Issue
Block a user