mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 09:58:12 +00:00
25 lines
623 B
TypeScript
25 lines
623 B
TypeScript
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 last-mile delivery (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;
|
||
}
|