UNPKG

pl4y-data-library

Version:

This library contains the dtos, enums, schemas, and other data objects needed in the pl4y ecosystem.

23 lines (16 loc) 529 B
import { IsEnum, IsNotEmpty, IsNumber, IsOptional, IsString } from "class-validator"; import { StockLocation } from "../../../enums/stock-location.enum"; export class StockTransferDto { @IsOptional() id?: string; @IsString() @IsNotEmpty() productId: string; @IsEnum(StockLocation, { message: "Invalid stock location" }) from: StockLocation; @IsEnum(StockLocation, { message: "Invalid stock location" }) to: StockLocation; @IsNumber() quantity: number; transferredAt: Date; }