import { IsString, IsNumber, IsNotEmpty, IsOptional } from "class-validator"
import { ApiProperty } from "@nestjs/swagger"

export class CreateFleetManagementDto {
  car_code: string

  @ApiProperty({
    description: "ID of the vehicle manufacturer",
    example: 1,
  })
  @IsNumber()
  @IsNotEmpty()
  vehicle_manufacture_id: number

  @ApiProperty({
    description: "ID of the vehicle type",
    example: 1,
  })
  @IsNumber()
  @IsNotEmpty()
  vehicle_type_id: number

  @ApiProperty({
    description: "ID of the vehicle model",
    example: 1,
  })
  @IsNumber()
  @IsNotEmpty()
  vehicle_model_id: number

  @ApiProperty({
    description: "passenger capacity of the vehicle",
  })
  @IsString()
  @IsOptional()
  passenger_capacity: string

  @ApiProperty({
    description: "Year of the vehicle",
    example: "2024",
  })
  @IsString()
  @IsNotEmpty()
  year: string

  @ApiProperty({
    description: "Color of the vehicle",
    example: "Red",
  })
  @IsString()
  @IsNotEmpty()
  color: string

  @ApiProperty({
    description: "Vehicle registration number",
    example: "ABC123",
  })
  @IsString()
  @IsNotEmpty()
  registration_number: string

  @ApiProperty({
    description: "Registration start date of the vehicle",
    example: "2024-01-01",
  })
  @IsString()
  @IsNotEmpty()
  registration_start_date: string

  @ApiProperty({
    description: "Registration expiry date of the vehicle",
    example: "2025-01-01",
  })
  @IsString()
  @IsNotEmpty()
  registration_expiry_date: string

  @ApiProperty({
    description: "State of the vehicle",
    example: 1,
  })
  @IsNumber()
  @IsNotEmpty()
  state_id: number

  @ApiProperty({
    description: "Vehicle Identification Number (VIN)",
    example: "1HGCM82633A123456",
  })
  @IsString()
  @IsNotEmpty()
  vin_number: string

  @ApiProperty({
    description: "Odometer reading",
    example: 5000,
  })
  @IsNumber()
  @IsOptional()
  odo_reader: number

  @ApiProperty({
    description: "Unit of measurement for odometer",
    example: "km",
  })
  @IsString()
  @IsOptional()
  unit: string

  @ApiProperty({
    description: "Current status of the vehicle",
    example: "2",
  })
  @IsNumber()
  @IsOptional()
  vehicle_status_id: number

  @ApiProperty({
    description: "ID of the assigned driver",
    example: 1,
    required: false,
  })
  @IsNumber()
  @IsOptional()
  assigned_driver?: number

  @ApiProperty({
    description: "ID of the assigned dispatcher",
    example: 1,
    required: false,
  })
  @IsNumber()
  @IsOptional()
  assigned_dispatcher_id?: number

  @ApiProperty({
    description: "description of the vehicle",
    example: "This is a description of the vehicle",
    required: false,
  })
  @IsString()
  @IsOptional()
  vehicle_description?: string

  @ApiProperty({
    description: "Ownership of the vehicle",
    example: "Owned",
    required: false,
  })
  @IsString()
  @IsOptional()
  vehicle_ownership: string

  @ApiProperty({
    description: "Owner information of the vehicle",
    example: "John Doe",
    required: false,
  })
  @IsString()
  @IsOptional()
  owner_information: string

  @ApiProperty({
    description: "ID of the vehicle location",
    example: 1,
    required: false,
  })
  @IsNumber()
  @IsOptional()
  vehicle_location_id: number

  @ApiProperty({
    description: "ID of the vehicle location",
    example: 1,
    required: false,
  })
  @IsNumber()
  @IsOptional()
  vehicle_city_location_id: number

  @ApiProperty({
    description: "Registration document of the vehicle",
    example: "registration_document.pdf",
    required: false,
  })
  @IsString()
  @IsOptional()
  registration_document: string
}
