import { ApiProperty } from '@nestjs/swagger'; import { IsEnum, IsNotEmpty, IsString, MaxLength } from 'class-validator'; import { MediaType } from '../enum/medias.enum'; export class InternalMediaDto { @IsNotEmpty() @IsString() @MaxLength(30) @ApiProperty({ type: String, description: 'ObjectID' }) ObjectId: string; @IsNotEmpty() @IsString() @MaxLength(200) @ApiProperty({ type: String, description: 'ObjectType' }) ObjectType: string; @IsNotEmpty() @ApiProperty({ type: String, description: 'Enum either Photo, Video, Document', }) @IsEnum(MediaType) Type: MediaType; @IsNotEmpty() @IsString() @MaxLength(200) @ApiProperty({ type: String, description: 'file name without extension' }) FileName: string; @IsNotEmpty() @IsString() @MaxLength(10) @ApiProperty({ type: String, description: 'extention of file in jpg etc' }) FileExtension: string; @ApiProperty({ type: String, description: 'File stream buffer', format: 'binary', }) FileStream: any; @IsNotEmpty() @IsString() @MaxLength(100) @ApiProperty({ type: String, description: 'title of the media' }) Title: string; @IsNotEmpty() @IsString() @MaxLength(1000) @ApiProperty({ type: String, description: 'Description of the media' }) Description: string; @IsNotEmpty() @IsEnum(['N', 'Y']) @ApiProperty({ type: String, description: 'Option if media needed to be encryped : Y or N', }) IsEncryptedYN: string; }