// =============================================================================
// 🔧 ТИПЫ ДЛЯ BUSINESS HOOKS
// =============================================================================

import type {
  FulfillmentConsumableSupplier,
  FulfillmentConsumableProduct,
  SelectedFulfillmentConsumable,
} from '../types'

// 🏢 ТИПЫ ДЛЯ ХУКА ПОСТАВЩИКОВ
export interface UseSupplierDataReturn {
  suppliers: FulfillmentConsumableSupplier[]
  logisticsPartners: FulfillmentConsumableSupplier[]
  filteredSuppliers: FulfillmentConsumableSupplier[]
  loading: boolean
  error: Error | null
}

// 📦 ТИПЫ ДЛЯ ХУКА ТОВАРОВ
export interface UseProductDataReturn {
  products: FulfillmentConsumableProduct[]
  loading: boolean
  error: Error | null
  refetch: () => void
}

// 📋 ТИПЫ ДЛЯ ХУКА ФОРМЫ
export interface UseSupplyFormReturn {
  // Состояние формы
  selectedSupplier: FulfillmentConsumableSupplier | null
  selectedLogistics: FulfillmentConsumableSupplier | null
  selectedConsumables: SelectedFulfillmentConsumable[]
  searchQuery: string
  productSearchQuery: string
  deliveryDate: string
  notes: string
  
  // Действия формы
  setSelectedSupplier: (supplier: FulfillmentConsumableSupplier | null) => void
  setSelectedLogistics: (logistics: FulfillmentConsumableSupplier | null) => void
  setSelectedConsumables: (consumables: SelectedFulfillmentConsumable[]) => void
  setSearchQuery: (query: string) => void
  setProductSearchQuery: (query: string) => void
  setDeliveryDate: (date: string) => void
  setNotes: (notes: string) => void
  
  // Сброс формы
  resetForm: () => void
}

// 📊 ТИПЫ ДЛЯ ХУКА УПРАВЛЕНИЯ КОЛИЧЕСТВОМ
export interface UseQuantityManagementReturn {
  updateConsumableQuantity: (productId: string, quantity: number) => void
  getSelectedQuantity: (productId: string) => number
  getTotalAmount: () => number
  getTotalItems: () => number
}

// 🚀 ТИПЫ ДЛЯ ХУКА СОЗДАНИЯ ПОСТАВКИ
export interface UseSupplyCreationReturn {
  createSupply: () => Promise<void>
  isCreating: boolean
  error: string | null
}