import { IsUUID, IsNumber, IsPositive, IsDateString, IsString, IsOptional, IsEnum } from 'class-validator';
import { PaymentMethod } from '../entities/fuel-purchase.entity';

export class CreateFuelPurchaseDto {
  @IsUUID()
  vehicleId!: string;

  @IsDateString()
  purchaseDate!: string;

  @IsNumber()
  @IsPositive()
  liters!: number;

  @IsNumber()
  @IsPositive()
  costPerLiter!: number;

  @IsOptional()
  @IsString()
  fuelStation?: string;

  @IsEnum(PaymentMethod)
  @IsOptional()
  paymentMethod?: PaymentMethod;

  @IsOptional()
  @IsNumber()
  odometerReading?: number;

  @IsOptional()
  @IsUUID()
  driverId?: string;

  @IsOptional()
  @IsString()
  receiptNumber?: string;

  @IsOptional()
  @IsString()
  notes?: string;
}
