import { ApiProperty } from '@nestjs/swagger';
import { IsDateString } from 'class-validator';

import { PreviewRescheduleDto } from './preview-reschedule.dto';

/**
 * Body for the maintenance-reschedule endpoint. This must be a real class (not
 * the previous `PreviewRescheduleDto & { newDepartureDate: string }`
 * intersection): an intersection type carries no class-validator metadata, so
 * Nest's ValidationPipe silently skipped validation of the whole payload.
 */
export class MaintenanceRescheduleDto extends PreviewRescheduleDto {
  @ApiProperty({ example: '2026-06-22T08:00:00.000Z' })
  @IsDateString()
  newDepartureDate!: string;
}
