Files
edr-platform/apps/edr-freight-api/src/modules/warehouses/dto/create-warehouse-zone.dto.ts
2026-06-12 06:58:21 +00:00

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;
}