25 lines
786 B
TypeScript
25 lines
786 B
TypeScript
import { IsString, IsNotEmpty, IsNumber, IsBoolean, IsOptional } from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
|
|
export class CreateStockStatusDto {
|
|
@ApiProperty({ description: 'ID товара' })
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
productId: string;
|
|
|
|
@ApiProperty({ description: 'Текущее количество на складе', required: false })
|
|
@IsNumber()
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
quantity?: number;
|
|
|
|
@ApiProperty({ description: 'Признак наличия товара', required: false })
|
|
@IsBoolean()
|
|
@IsOptional()
|
|
inStock?: boolean;
|
|
|
|
@ApiProperty({ description: 'Дата последнего обновления', required: false })
|
|
@IsOptional()
|
|
updatedAt?: Date;
|
|
} |