import type { BilingualField } from '@/components/ui/BilingualInput'

export type Customer = {
  id: string
  firstName: string
  firstNameAr?: string | null
  lastName: string
  lastNameAr?: string | null
  email: string
  phone?: string | null
  driverLicense?: string | null
  dateOfBirth?: string | null
  nationality?: string | null
  address?: Record<string, unknown> | null
  licenseExpiry?: string | null
  licenseIssuedAt?: string | null
  licenseCountry?: string | null
  licenseNumber?: string | null
  licenseCategory?: string | null
  licenseImageUrl?: string | null
}

export type Vehicle = {
  id: string
  make: string
  model: string
  licensePlate: string
  status: string
}

export type AdditionalDriverDraft = {
  id: string
  firstName: BilingualField
  lastName: BilingualField
  email: string
  phone: string
  driverLicense: string
  licenseExpiry: string
  licenseIssuedAt: string
  dateOfBirth: string
  nationality: BilingualField
}

export type ReservationDraft = {
  customer: {
    mode: 'existing' | 'new'
    selectedCustomerId: string | null
    createdCustomerId: string | null
    firstName: BilingualField
    lastName: BilingualField
    email: string
    phone: string
    hydratedFromCustomerId: string | null
  }
  identity: {
    dateOfBirth: string
    nationality: string
    fullAddress: string
    identityDocumentNumber: string
    internationalLicenseNumber: string
  }
  license: {
    number: string
    country: string
    issuedAt: string
    expiry: string
    category: string
    existingImageUrl: string | null
    newImageFile: File | null
  }
  rental: {
    vehicleId: string
    startDate: string
    endDate: string
    pickupLocation: string
    returnLocation: string
  }
  payment: {
    depositAmount: string
    paymentMode: string
    notes: string
  }
  additionalDrivers: AdditionalDriverDraft[]
}

export type WizardStepId = 'customer' | 'identity' | 'license' | 'rental' | 'payment' | 'review'

export type FieldErrors = Record<string, string>

export type CreatedReservation = { id: string }

