export interface Product {
  ID: string
  OrganizationID: string
  CategoryID: string
  SKU: string
  Name: string
  Description: string | null
  Price: number
  Cost: number
  BusinessType: string
  ImageURL: string
  PrinterType: string
  UnitID: string | null
  HasIngredients: boolean
  Metadata: Record<string, any>
  IsActive: boolean
  CreatedAt: string // ISO date string
  UpdatedAt: string // ISO date string
}

export interface Ingredient {
  id: string
  organization_id: string
  outlet_id: string | null
  name: string
  unit_id: string
  cost: number
  stock: number
  is_semi_finished: boolean
  is_active: boolean
  metadata: Record<string, any>
  created_at: string
  updated_at: string
  unit: IngredientUnit
}

export interface ProductRecipe {
  id: string
  organization_id: string
  outlet_id: string | null
  product_id: string
  variant_id: string | null
  ingredient_id: string
  quantity: number
  created_at: string
  updated_at: string
  product: Product
  ingredient: Ingredient
}

export interface ProductRecipeRequest {
  product_id: string
  variant_id: string | null
  ingredient_id: string
  quantity: number
  outlet_id: string | null
}

export interface IngredientUnit {
  id: string
  organization_id: string
  outlet_id: string
  name: string
  abbreviation: string
  is_active: boolean
  created_at: string
  updated_at: string
}

export interface IngredientUnitConverterRequest {
  ingredient_id: string
  from_unit_id: string
  to_unit_id: string
  conversion_factor: number
}

export interface UnitConversion {
  id: string
  organization_id: string
  ingredient_id: string
  from_unit_id: string
  to_unit_id: string
  conversion_factor: number
  is_active: boolean
  created_at: string
  updated_at: string
  created_by: string
  updated_by: string
  from_unit: UnitConversionFrom
  to_unit: UnitConversionTo
}

export interface UnitConversionFrom {
  id: string
  name: string
}

export interface UnitConversionTo {
  id: string
  name: string
}
