mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 05:18:11 +00:00
35 lines
691 B
TypeScript
35 lines
691 B
TypeScript
import { IsIn, IsNotEmpty, IsString, Matches, MaxLength } from 'class-validator';
|
|
|
|
export const CUSTOMER_TRUCK_TYPES = [
|
|
'Flatbed',
|
|
'Container Chassis',
|
|
'Lowboy',
|
|
'Box Truck',
|
|
'Tipper',
|
|
] as const;
|
|
|
|
export class CustomerTruckAssignmentDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(32)
|
|
truckPlateNumber!: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(120)
|
|
driverName!: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@IsIn(CUSTOMER_TRUCK_TYPES)
|
|
truckType!: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(16)
|
|
@Matches(/^[A-Z]{4}\d{7}$/, {
|
|
message: 'containerNumberToLoad must match ISO container format, e.g. ABCD1234567',
|
|
})
|
|
containerNumberToLoad!: string;
|
|
}
|