export interface RepairTicket {
  id: string
  locationId: string | null
  repairBatchId: string | null
  ticketNumber: string | null
  accountId: string | null
  customerName: string
  customerPhone: string | null
  inventoryUnitId: string | null
  itemDescription: string | null
  serialNumber: string | null
  conditionIn: 'excellent' | 'good' | 'fair' | 'poor' | null
  conditionInNotes: string | null
  problemDescription: string
  technicianNotes: string | null
  status: 'new' | 'in_transit' | 'intake' | 'diagnosing' | 'pending_approval' | 'approved' | 'in_progress' | 'pending_parts' | 'ready' | 'picked_up' | 'delivered' | 'cancelled'
  assignedTechnicianId: string | null
  estimatedCost: string | null
  actualCost: string | null
  intakeDate: string
  promisedDate: string | null
  completedDate: string | null
  legacyId: string | null
  createdAt: string
  updatedAt: string
}

export interface RepairLineItem {
  id: string
  repairTicketId: string
  itemType: 'labor' | 'part' | 'flat_rate' | 'misc' | 'consumable'
  description: string
  productId: string | null
  qty: string
  unitPrice: string
  totalPrice: string
  cost: string | null
  technicianId: string | null
  createdAt: string
}

export interface RepairBatch {
  id: string
  locationId: string | null
  batchNumber: string | null
  accountId: string
  contactName: string | null
  contactPhone: string | null
  contactEmail: string | null
  status: 'intake' | 'in_progress' | 'pending_approval' | 'approved' | 'completed' | 'delivered' | 'cancelled'
  approvalStatus: 'pending' | 'approved' | 'rejected'
  approvedBy: string | null
  approvedAt: string | null
  pickupDate: string | null
  dueDate: string | null
  completedDate: string | null
  deliveredDate: string | null
  itemCount: number
  receivedCount: number
  estimatedTotal: string | null
  actualTotal: string | null
  notes: string | null
  legacyId: string | null
  createdAt: string
  updatedAt: string
}

export interface RepairNote {
  id: string
  repairTicketId: string
  authorId: string
  authorName: string
  content: string
  visibility: 'internal' | 'customer'
  ticketStatus: string | null
  createdAt: string
}

export interface RepairServiceTemplate {
  id: string
  name: string
  itemCategory: string | null
  size: string | null
  description: string | null
  itemType: 'labor' | 'part' | 'flat_rate' | 'misc' | 'consumable'
  defaultPrice: string
  defaultCost: string | null
  sortOrder: number
  isActive: boolean
  createdAt: string
  updatedAt: string
}
