forked from Shared/esg
initial commit
This commit is contained in:
27
src/inquiry/dto/sayah-request.dto.ts
Normal file
27
src/inquiry/dto/sayah-request.dto.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsIn, IsNotEmpty, IsOptional, IsString, Length, Matches } from 'class-validator';
|
||||
|
||||
export class SayahRequestDto {
|
||||
@ApiProperty({ example: '0', description: '0 for natural person' })
|
||||
@IsString()
|
||||
@IsIn(['0'])
|
||||
accountOwnerType!: string;
|
||||
|
||||
@ApiProperty({ example: '4311402422', description: 'Iranian national code (10 digits)' })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@Length(10, 10)
|
||||
@Matches(/^\d{10}$/, { message: 'nationalId must be exactly 10 digits' })
|
||||
nationalId!: string;
|
||||
|
||||
@ApiPropertyOptional({ nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
legalId?: string | null;
|
||||
|
||||
@ApiProperty({ example: 'IR000000000000000000000000', description: 'Iranian Sheba ID' })
|
||||
@IsString()
|
||||
@Length(26, 26)
|
||||
@Matches(/^IR\d{24}$/, { message: 'shebaId must start with IR and contain 24 digits' })
|
||||
shebaId!: string;
|
||||
}
|
||||
Reference in New Issue
Block a user