parsian inquiries implemented

This commit is contained in:
2026-06-13 12:59:15 +03:30
parent ead2e301e5
commit 0aad5a34d2
19 changed files with 771 additions and 50 deletions

View File

@@ -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;
}