import { Product, ProductListResult, ProductSort } from './product-domain.model';

export type CatalogLayoutMode = 'grid' | 'large-grid' | 'compact-grid' | 'grid-2' | 'grid-3' | 'grid-4' | 'compact' | 'list';
export type CatalogNavigationMode = 'default' | 'left-category-navigation' | 'mega-category-layout' | 'top-category-carousel';

export interface SearchCriteria {
  keyword?: string;
  categoryIDs?: number[];
  subcategoryIDs?: string[];
  minPrice?: number;
  maxPrice?: number;
  availability?: Array<'in-stock' | 'low-stock' | 'out-of-stock'>;
  rating?: number[];
  brand?: string[];
  discountOnly?: boolean;
  newOnly?: boolean;
  color?: string[];
  size?: string[];
  attributes?: Record<string, string[]>;
  sort?: ProductSort | 'discount';
  page?: number;
  pageSize?: number;
}

export type FilterValueType = 'multi-select' | 'range' | 'toggle';

export interface FilterOption {
  id: string;
  label: string;
  value: string;
  count?: number;
}

export interface FilterDefinition {
  id: string;
  label: string;
  type: FilterValueType;
  options?: FilterOption[];
  min?: number;
  max?: number;
  step?: number;
  enabled?: boolean;
}

export interface SortDefinition {
  id: ProductSort | 'discount';
  label: string;
  enabled?: boolean;
}

export interface CatalogView {
  layout: CatalogLayoutMode;
  navigationMode: CatalogNavigationMode;
  showBreadcrumbs: boolean;
  showCategoryBanner: boolean;
  showSubcategoryChips: boolean;
  showRatings: boolean;
  showDiscounts: boolean;
  showAvailability: boolean;
}

export interface SearchResult {
  criteria: SearchCriteria;
  items: Product[];
  total: number;
  page: number;
  pageSize: number;
  summary: string;
}
