mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 04:15:43 +00:00
fix
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { IsArray, IsNumber, IsOptional, IsUUID, Min, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
|
||||
export class VehicleDistanceInput {
|
||||
@IsUUID()
|
||||
vehicleId!: string;
|
||||
|
||||
@IsNumber()
|
||||
@Min(0)
|
||||
distanceKm!: number;
|
||||
}
|
||||
|
||||
/** Per-vehicle actual distances for a first-mile pickup (multi-truck). */
|
||||
export class SetDistancesDto {
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => VehicleDistanceInput)
|
||||
distances!: VehicleDistanceInput[];
|
||||
|
||||
/** Recomputed remaining payment (total km × rate), from the client. */
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
remainingPayment?: number;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { IsArray, IsOptional, IsString, IsUUID, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
|
||||
export class FirstMileVehicleInput {
|
||||
@IsUUID()
|
||||
vehicleId!: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
containerNumber?: string;
|
||||
}
|
||||
|
||||
/** Replace the full set of vehicles (with their container numbers) on a pickup. */
|
||||
export class SetVehiclesDto {
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => FirstMileVehicleInput)
|
||||
vehicles!: FirstMileVehicleInput[];
|
||||
}
|
||||
Reference in New Issue
Block a user