export type UnitCondition = 'new' | 'excellent' | 'good' | 'fair' | 'poor'
export type UnitStatus =
  | 'available'
  | 'sold'
  | 'rented'
  | 'on_trial'
  | 'in_repair'
  | 'layaway'
  | 'lost'
  | 'retired'

export interface Category {
  id: string
  name: string
  parentId: string | null
  sortOrder: number
  isActive: boolean
  createdAt: string
  updatedAt: string
}

export interface Supplier {
  id: string
  name: string
  contactName: string | null
  email: string | null
  phone: string | null
  website: string | null
  accountNumber: string | null
  paymentTerms: string | null
  createdAt: string
  updatedAt: string
}

export interface Product {
  id: string
  name: string
  sku: string | null
  upc: string | null
  brand: string | null
  model: string | null
  description: string | null
  categoryId: string | null
  isSerialized: boolean
  isRental: boolean
  isDualUseRepair: boolean
  isConsumable: boolean
  price: string | null
  minPrice: string | null
  rentalRateMonthly: string | null
  qtyOnHand: number
  qtyReorderPoint: number | null
  isActive: boolean
  createdAt: string
  updatedAt: string
}

export interface InventoryUnit {
  id: string
  productId: string
  serialNumber: string | null
  condition: UnitCondition
  status: UnitStatus
  purchaseDate: string | null
  purchaseCost: string | null
  notes: string | null
  createdAt: string
}

export interface ProductSupplier {
  id: string
  productId: string
  supplierId: string
  supplierSku: string | null
  isPreferred: boolean
  createdAt: string
  supplierName: string
  supplierContactName: string | null
  supplierEmail: string | null
  supplierPhone: string | null
  supplierAccountNumber: string | null
  supplierPaymentTerms: string | null
}

export interface StockReceipt {
  id: string
  productId: string
  supplierId: string | null
  inventoryUnitId: string | null
  qty: number
  costPerUnit: string
  totalCost: string
  receivedDate: string
  invoiceNumber: string | null
  notes: string | null
  createdAt: string
  supplierName: string | null
}

export interface PriceHistory {
  id: string
  productId: string
  previousPrice: string | null
  newPrice: string
  previousMinPrice: string | null
  newMinPrice: string | null
  createdAt: string
  changedBy: string | null
}
