import {
  IsNotEmpty,
  IsOptional,
  IsString,
  IsBoolean,
  IsInt,
  Min,
  MaxLength,
} from 'class-validator';
import { MediaItemDto, MediaListField } from '../../../common/media/media-item.dto';

export class CreateVehicleTypeDto {
  @IsString()
  @IsNotEmpty()
  @MaxLength(100)
  name: string;

  /**
   * Physical seating capacity (legal/safety upper bound).
   * Per stakeholder spec capacity is owned by the vehicle TYPE, not
   * the individual vehicle. Vehicles keep a nullable per-vehicle
   * override for refitted / non-standard cases.
   */
  @IsInt()
  @IsOptional()
  @Min(1)
  seating_capacity?: number;

  /**
   * Operational cap — planning maximum used by quote/booking
   * pax-to-vehicle math (≤ seating_capacity). Often lower than
   * seating because of luggage / comfort policy.
   */
  @IsInt()
  @IsOptional()
  @Min(1)
  operational_cap?: number;

  @IsBoolean()
  @IsOptional()
  is_active?: boolean;

  @MediaListField()
  media?: MediaItemDto[];
}
