Added modules for books & series.
This commit is contained in:
35
backend/nestjs-seshat-api/src/books/dto/create-book.dto.ts
Normal file
35
backend/nestjs-seshat-api/src/books/dto/create-book.dto.ts
Normal file
@ -0,0 +1,35 @@
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsDate, IsNotEmpty, IsNumber, IsOptional, IsPositive, IsString, MaxLength } from 'class-validator';
|
||||
|
||||
export class CreateBookDto {
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
providerSeriesId: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
providerBookId: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@MaxLength(128)
|
||||
title: string;
|
||||
|
||||
@IsString()
|
||||
@MaxLength(512)
|
||||
desc: string;
|
||||
|
||||
@IsNumber()
|
||||
@IsOptional()
|
||||
@IsPositive()
|
||||
volume: number | null;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
provider: string;
|
||||
|
||||
@IsDate()
|
||||
@IsNotEmpty()
|
||||
@Transform(({ value }) => new Date(value))
|
||||
publishedAt: Date
|
||||
}
|
Reference in New Issue
Block a user