File

src/shared/dto/file.dto.ts

Index

Properties

Properties

base64String
Type : string
Decorators :
@IsNotEmpty()
@IsString()
fileType
Type : string
Decorators :
@IsNotEmpty()
@IsString()
originalname
Type : string
Decorators :
@ApiProperty({type: 'string'})
@IsString()
@IsNotEmpty()
@MinLength(3)
@MaxLength(300)
import { ApiProperty } from "@nestjs/swagger";
import { Type } from "class-transformer";
import {
  IsString,
  IsNotEmpty,
  MinLength,
  MaxLength,
  IsDefined,
  ValidateNested,
  IsNotEmptyObject,
  IsObject,
} from "class-validator";

export class FileDTO {
  @ApiProperty({ type: "string" })
  @IsString()
  @IsNotEmpty()
  @MinLength(3)
  @MaxLength(300)
  originalname: string;

  @IsNotEmpty()
  @IsString()
  base64String: string;

  @IsNotEmpty()
  @IsString()
  fileType: string;
}

export class IReportDTO {
  @ApiProperty({ type: "string" })
  @IsString()
  @IsNotEmpty()
  @MinLength(3)
  @MaxLength(300)
  data: string;

  @IsDefined()
  @IsNotEmptyObject()
  @IsObject()
  @ValidateNested()
  @Type(() => FileDTO)
  file: FileDTO;
}

results matching ""

    No results matching ""