mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 06:40:57 +00:00
50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { IsEnum, IsNumber, IsOptional, IsString, IsUUID, MaxLength, Min } from 'class-validator';
|
|
|
|
import { WAREHOUSE_ZONE_TYPES, WarehouseZoneType } from '../entities/warehouse-zone.entity';
|
|
|
|
export class CreateWarehouseZoneDto {
|
|
@ApiPropertyOptional({ format: 'uuid', description: 'Optional — taken from the route param when omitted' })
|
|
@IsOptional()
|
|
@IsUUID()
|
|
yardId?: string;
|
|
|
|
@ApiProperty()
|
|
@IsString()
|
|
@MaxLength(160)
|
|
name!: string;
|
|
|
|
@ApiProperty()
|
|
@IsString()
|
|
@MaxLength(40)
|
|
code!: string;
|
|
|
|
@ApiProperty({ enum: WAREHOUSE_ZONE_TYPES })
|
|
@IsEnum(WAREHOUSE_ZONE_TYPES)
|
|
type!: WarehouseZoneType;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@Min(0)
|
|
capacityWeight?: number;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@Min(0)
|
|
capacityContainers?: number;
|
|
|
|
@ApiPropertyOptional({ description: 'Max weight capacity (kg). Defaults to capacityWeight.' })
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@Min(0)
|
|
maxWeight?: number;
|
|
|
|
@ApiPropertyOptional({ description: 'Max volume capacity (m³).' })
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@Min(0)
|
|
maxVolume?: number;
|
|
}
|