feat(warehouses): record container vs bulk freight type

Nullable freight_type on the warehouse, null meaning it takes both.
No backfill: every existing warehouse is unrestricted today and
writing a value would narrow allocation behind the operator's back.
Reuses FREIGHT_TYPES from the booking entity rather than a third copy
of the same two values.
This commit is contained in:
Hagernesh
2026-08-28 15:04:39 +00:00
parent d4373dfbe4
commit ba79b36d90
7 changed files with 81 additions and 3 deletions

View File

@@ -1,7 +1,14 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsEnum, IsNumber, IsOptional, IsString, IsUUID, Matches, MaxLength, Min } from 'class-validator';
import { WAREHOUSE_STATUSES, WAREHOUSE_TYPES, WarehouseStatus, WarehouseType } from '../entities/warehouse.entity';
import {
FREIGHT_TYPES,
FreightType,
WAREHOUSE_STATUSES,
WAREHOUSE_TYPES,
WarehouseStatus,
WarehouseType,
} from '../entities/warehouse.entity';
export class CreateWarehouseDto {
@ApiProperty()
@@ -19,6 +26,11 @@ export class CreateWarehouseDto {
@IsEnum(WAREHOUSE_TYPES)
type!: WarehouseType;
@ApiPropertyOptional({ enum: FREIGHT_TYPES, description: 'Omit for a warehouse that takes both.' })
@IsOptional()
@IsEnum(FREIGHT_TYPES)
freightType?: FreightType;
@ApiPropertyOptional({ format: 'uuid' })
@IsOptional()
@IsUUID()