mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 19:28:17 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user