forked from Shared/esg
30 lines
978 B
TypeScript
30 lines
978 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsNotEmpty, IsString, Matches } from 'class-validator';
|
|
|
|
export class PolicyByPlateRequestDto {
|
|
@ApiProperty({ example: '4311402422', description: 'Owner national code (10 digits)' })
|
|
@IsString()
|
|
@Matches(/^\d{10}$/, { message: 'nationalCode must be exactly 10 digits' })
|
|
nationalCode!: string;
|
|
|
|
@ApiProperty({ example: '12', description: 'Two digits on the left side of the plate' })
|
|
@IsString()
|
|
@Matches(/^\d{2}$/, { message: 'plk1 must be exactly 2 digits' })
|
|
plk1!: string;
|
|
|
|
@ApiProperty({ example: 'ب', description: 'Middle plate letter' })
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
plk2!: string;
|
|
|
|
@ApiProperty({ example: '345', description: 'Three digits on the right side of the plate' })
|
|
@IsString()
|
|
@Matches(/^\d{3}$/, { message: 'plk3 must be exactly 3 digits' })
|
|
plk3!: string;
|
|
|
|
@ApiProperty({ example: '67', description: 'Plate serial' })
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
plksrl!: string;
|
|
}
|