// =============================================================================
// 📦 ТИПЫ ДЛЯ УПРАВЛЕНИЯ ТОВАРНЫМИ ПОСТАВКАМИ ФУЛФИЛМЕНТА V2
// =============================================================================

export interface FulfillmentGoodsSupply {
  id: string
  status: SellerSupplyOrderStatus
  createdAt: string
  updatedAt: string
  
  // Участники
  sellerId: string
  seller: {
    id: string
    name: string
    inn: string
  }
  
  fulfillmentCenterId: string
  fulfillmentCenter: {
    id: string
    name: string
    inn: string
  }
  
  supplierId: string
  supplier: {
    id: string
    name: string
    inn: string
  }
  
  logisticsPartnerId?: string
  logisticsPartner?: {
    id: string
    name: string
    inn: string
  }
  
  // Даты
  requestedDeliveryDate: string
  estimatedDeliveryDate?: string
  shippedAt?: string
  deliveredAt?: string
  supplierApprovedAt?: string
  
  // Получение
  receivedById?: string
  receivedBy?: {
    id: string
    managerName: string
    phone: string
  }
  
  // Детали
  notes?: string
  supplierNotes?: string
  receiptNotes?: string
  totalCostWithDelivery: number
  packagesCount?: number
  estimatedVolume?: number
  trackingNumber?: string
  
  // Рецептура
  recipeItems: GoodsSupplyRecipeItem[]
}

export interface GoodsSupplyRecipeItem {
  id: string
  productId: string
  quantity: number
  recipeType: RecipeType
  product: {
    id: string
    name: string
    article: string
    price: number
    mainImage?: string
  }
}

export type SellerSupplyOrderStatus = 
  | 'PENDING'
  | 'SUPPLIER_APPROVED'
  | 'CONFIRMED'
  | 'LOGISTICS_CONFIRMED'
  | 'SHIPPED'
  | 'IN_TRANSIT'
  | 'DELIVERED'
  | 'CANCELLED'

export type RecipeType =
  | 'MAIN_PRODUCT'
  | 'COMPONENT'
  | 'PACKAGING'
  | 'ACCESSORY'

export interface Employee {
  id: string
  managerName: string
  phone: string
}

export interface LogisticsPartner {
  id: string
  name: string
  fullName?: string
  inn?: string
}

export interface FulfillmentGoodsTabType {
  key: string
  label: string
  status: SellerSupplyOrderStatus[]
  count: number
}