forked from Shared/esg
parsian inquiries implemented
This commit is contained in:
@@ -1,27 +1,33 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsIn, IsNotEmpty, IsOptional, IsString, Length, Matches } from 'class-validator';
|
||||
|
||||
export class SayahRequestDto {
|
||||
@ApiProperty({ example: '1', description: '1 for natural person (always use "1")' })
|
||||
@ApiPropertyOptional({ example: '1', description: '1 for natural person' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@IsIn(['1'])
|
||||
accountOwnerType!: string;
|
||||
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;
|
||||
@Matches(/^\d{10}$/, { message: 'nationalCode must be exactly 10 digits' })
|
||||
nationalCode!: string;
|
||||
|
||||
@ApiPropertyOptional({ nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
legalId?: string | null;
|
||||
|
||||
@ApiProperty({ example: 'IR800560611828005105117001', description: 'Iranian Sheba ID (26 characters)' })
|
||||
@ApiProperty({
|
||||
example: 'IR800560611828005105117001',
|
||||
description: 'Iranian Sheba ID (26 characters)',
|
||||
})
|
||||
@Transform(({ value }: { value?: string }) => value?.toUpperCase())
|
||||
@IsString()
|
||||
@Length(26, 26)
|
||||
@Matches(/^IR\d{24}$/, { message: 'shebaId must start with IR and contain 24 digits' })
|
||||
shebaId!: string;
|
||||
@Matches(/^IR\d{24}$/, { message: 'sheba must start with IR and contain 24 digits' })
|
||||
sheba!: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user