Spaces:
Sleeping
Sleeping
Viktoria435
Refactor import paths in Book, Visitor, and Worker modules to use relative paths
c995cfc | import { ApiProperty } from '@nestjs/swagger'; | |
| import { | |
| IsString, | |
| IsInt, | |
| MinLength, | |
| MaxLength, | |
| Min, | |
| Max, | |
| IsNotEmpty, | |
| IsEnum, | |
| } from 'class-validator'; | |
| import { BookStatus, Genre } from '../../types/book.types'; | |
| export class Book { | |
| ({ | |
| description: 'Уникальный идентификатор книги', | |
| example: 'b1f3c2e7-9bd1-4f41-82b3-fc4c938f4a1d', | |
| }) | |
| () | |
| id: string; | |
| ({ | |
| description: 'Название книги', | |
| example: 'Pride and Prejudice', | |
| }) | |
| () | |
| ({ message: 'Title is required' }) | |
| (2, { message: 'Title must be at least 2 characters' }) | |
| (100, { message: 'Title must be at most 100 characters' }) | |
| title: string; | |
| ({ | |
| description: 'Автор книги', | |
| example: 'Jane Austen', | |
| }) | |
| () | |
| ({ message: 'Author is required' }) | |
| (2, { message: 'Author must be at least 2 characters' }) | |
| (100, { message: 'Author must be at most 100 characters' }) | |
| author: string; | |
| ({ | |
| description: 'Количество страниц', | |
| example: 279, | |
| }) | |
| ({ message: 'Pages must be an integer' }) | |
| (1, { message: 'Pages must be at least 1' }) | |
| (10000, { message: 'Pages must be at most 10000' }) | |
| pages: number; | |
| ({ | |
| description: 'Год публикации', | |
| example: 1813, | |
| }) | |
| ({ message: 'Year must be an integer' }) | |
| (1000, { message: 'Year must be at least 1000' }) | |
| (new Date().getFullYear(), { | |
| message: `Year cannot be greater than ${new Date().getFullYear()}`, | |
| }) | |
| year: number; | |
| ({ | |
| description: 'Жанр книги', | |
| enum: Genre, | |
| example: Genre.Romance, | |
| }) | |
| (Genre, { message: 'Invalid genre' }) | |
| genre: Genre; | |
| ({ | |
| description: 'Статус книги', | |
| enum: BookStatus, | |
| example: BookStatus.AVAILABLE, | |
| }) | |
| (BookStatus, { message: 'Invalid book status' }) | |
| status: BookStatus; | |
| } | |