31 lines
792 B
TypeScript
31 lines
792 B
TypeScript
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'
|
|
import { Type } from 'class-transformer'
|
|
import { ArrayMinSize, IsInt, IsOptional, IsString } from 'class-validator'
|
|
import { CreateInventoryTransferItemDto } from '../../inventory-transfer-items/dto/create-inventory-transfer-item.dto'
|
|
|
|
export class CreateInventoryTransferDto {
|
|
@ApiProperty()
|
|
@IsString()
|
|
code: string
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
description?: string
|
|
|
|
@ApiProperty()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
fromInventoryId: number
|
|
|
|
@ApiProperty()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
toInventoryId: number
|
|
|
|
@ApiProperty({ type: [CreateInventoryTransferItemDto] })
|
|
@Type(() => Array)
|
|
@ArrayMinSize(1)
|
|
items: Array<Omit<CreateInventoryTransferItemDto, 'transferId'>>
|
|
}
|