mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 11:18:17 +00:00
Join truck_types via vehicles.truck_type_id (normalized legacy vehicle_type only as fallback) so type renames can't unmatch detention rules and FK-less vehicles keep billing.
32 lines
721 B
TypeScript
32 lines
721 B
TypeScript
import { IsArray, IsNumber, IsOptional, IsString, IsUUID, Min, ValidateNested } from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
|
|
export class FirstMileVehicleInput {
|
|
@IsUUID()
|
|
vehicleId!: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
containerNumber?: string;
|
|
|
|
/** Bulk: tonnage this truck hauls. */
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@Min(0)
|
|
tons?: number;
|
|
|
|
/** Bulk: optional item/piece count. */
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@Min(0)
|
|
quantity?: number;
|
|
}
|
|
|
|
/** Replace the full set of vehicles (with their container numbers) on a pickup. */
|
|
export class SetVehiclesDto {
|
|
@IsArray()
|
|
@ValidateNested({ each: true })
|
|
@Type(() => FirstMileVehicleInput)
|
|
vehicles!: FirstMileVehicleInput[];
|
|
}
|