File

src/database/validation/blog-validation.ts

Index

Properties

Properties

author
Type : string
Decorators :
@ApiProperty()
@IsNotEmpty({message: undefined})
categories
Type : number[]
Decorators :
@ApiProperty({type: undefined})
@IsNotEmpty({message: undefined})
content
Type : string
Decorators :
@ApiProperty()
@IsNotEmpty({message: undefined})
createdAt
Type : Date
datePublication
Type : Date
Decorators :
@ApiProperty()
@IsNotEmpty({message: undefined})
description
Type : string
Decorators :
@ApiProperty()
@IsNotEmpty({message: undefined})
id
Type : number
Decorators :
@ApiProperty()
imageDescription
Type : string
Decorators :
@ApiProperty()
@IsNotEmpty({message: undefined})
imageUrl
Type : string
Decorators :
@ApiProperty()
@IsNotEmpty({message: undefined})
keywords
Type : string
Decorators :
@ApiProperty()
@IsNotEmpty({message: undefined})
mainArticleImage
Type : string
Decorators :
@ApiProperty()
@IsNotEmpty({message: undefined})
readingDuration
Type : string
Decorators :
@ApiProperty()
@IsNotEmpty({message: undefined})
slug
Type : string
Decorators :
@ApiProperty()
@IsUnique({tableName: 'blog', column: 'slug'})
@IsNotEmpty({message: undefined})
status
Type : boolean
Decorators :
@ApiProperty({type: Boolean})
@IsBoolean({message: undefined})
@IsNotEmpty({message: undefined})
title
Type : string
Decorators :
@ApiProperty()
@IsNotEmpty({message: undefined})
import { IsBoolean, IsNotEmpty } from 'class-validator';
import { IsUnique } from 'src/validation/is-unique';
import { MessaeSendResponseIsBoolean, MessaeSendResponseIsNotEmpty } from 'src/validation/validation.exception';
import { ApiProperty } from '@nestjs/swagger/dist';
import { type } from 'os';


export class BlogValidation {
    @ApiProperty()
    id:number;

    @ApiProperty()
    @IsNotEmpty({  message: MessaeSendResponseIsNotEmpty('El titutlo')})
    title:string;
    
    @ApiProperty()
    @IsNotEmpty({  message: MessaeSendResponseIsNotEmpty('La descripcion')})
    description:string;

    @ApiProperty()
    @IsNotEmpty({  message: MessaeSendResponseIsNotEmpty('La fecha de publicacion')})
    datePublication:Date;

    @ApiProperty()
    @IsNotEmpty({  message: MessaeSendResponseIsNotEmpty('La duracion de lectura')})
    readingDuration:string;

    @ApiProperty()
    @IsNotEmpty({  message: MessaeSendResponseIsNotEmpty('El author')})
    author:string;

    @ApiProperty()
    @IsNotEmpty({  message: MessaeSendResponseIsNotEmpty('La imagen del articulo')})
    mainArticleImage:string;

    @ApiProperty()
    @IsNotEmpty({  message: MessaeSendResponseIsNotEmpty('Los keywords')})
    keywords:string;

    @ApiProperty()
    @IsNotEmpty({  message: MessaeSendResponseIsNotEmpty('La imagen')})
    imageUrl:string;

    @ApiProperty()
    @IsNotEmpty({  message: MessaeSendResponseIsNotEmpty('La descripcion imagen')})
    imageDescription:string;

    @ApiProperty({type:[Number]})
    @IsNotEmpty({  message: MessaeSendResponseIsNotEmpty('La categoria')})
    categories:number[];

    @ApiProperty()
    @IsUnique({tableName:'blog',column:'slug'})
    @IsNotEmpty({  message: MessaeSendResponseIsNotEmpty('El slug')})
    slug:string;

    @ApiProperty()
    @IsNotEmpty({  message: MessaeSendResponseIsNotEmpty('El contenido')})
    content:string;

    @ApiProperty({type:Boolean})
    @IsBoolean({message:MessaeSendResponseIsBoolean('El estado')})
    @IsNotEmpty({  message: MessaeSendResponseIsNotEmpty('El estado')})
    status:boolean;
    
    createdAt:Date;

}

results matching ""

    No results matching ""