import { ApiPropertyOptional, PartialType } from '@nestjs/swagger';
import { IsISO8601, IsOptional } from 'class-validator';

import { CreateLastMileDto } from './create-last-mile.dto';

export class UpdateLastMileDto extends PartialType(CreateLastMileDto) {
  /** Truck-detention clock start (vehicle arrived at destination). Overrides the auto-stamp. */
  @ApiPropertyOptional({ description: 'Vehicle arrival time (ISO 8601) — detention clock start.' })
  @IsOptional()
  @IsISO8601()
  arrivedAt?: string;

  /** Truck-detention clock end (cargo cleared / vehicle returned). Overrides the auto-stamp. */
  @ApiPropertyOptional({ description: 'Delivery/return time (ISO 8601) — detention clock end.' })
  @IsOptional()
  @IsISO8601()
  deliveredAt?: string;
}
