import { IsUUID, IsString, IsDateString, IsOptional, IsEnum } from 'class-validator';
import { ComplianceType, ComplianceStatus } from '../entities/compliance-record.entity';

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

  @IsEnum(ComplianceType)
  type!: ComplianceType;

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

  @IsOptional()
  @IsDateString()
  issuedDate?: string;

  @IsDateString()
  expiryDate!: string;

  @IsOptional()
  @IsEnum(ComplianceStatus)
  status?: ComplianceStatus;

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

export class UpdateComplianceRecordDto {
  @IsOptional()
  @IsEnum(ComplianceType)
  type?: ComplianceType;

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

  @IsOptional()
  @IsDateString()
  issuedDate?: string;

  @IsOptional()
  @IsDateString()
  expiryDate?: string;

  @IsOptional()
  @IsEnum(ComplianceStatus)
  status?: ComplianceStatus;

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