from datetime import datetime
from typing import Optional, List, Dict
from pydantic import BaseModel, Field


class MatchInputSchema(BaseModel):
    """Schema for wine match input data"""
    price: Optional[float] = None
    sku: str = ""
    tax_status: str = ""
    url: str = ""
    description: str = ""
    history_text: str = ""
    original_history_text: str = ""
    keyword_text: str = ""
    original_keyword_text: str = ""
    vintage: str = ""
    size: str = ""
    bottle_size_id: Optional[str] = None


class MatchOutputSchema(BaseModel):
    """Schema for wine match output data"""
    wine_id: str = ""
    wine_db_id: str = ""
    wine_name: str = ""
    match: str = ""
    errors: str = ""
    bottle_size: str = ""
    vintage: str = ""
    price: Optional[float] = None
    tax_status: str = ""
    url: str = ""
    description: str = ""
    keyword_string: str = ""
    history_string: str = ""
    sku: str = ""


class MatchResultSchema(BaseModel):
    """Schema for match result summary"""
    code: str
    match_date: datetime
    is_keyword: bool
    status: str
    message: str = ""
    date_start: datetime
    date_end: datetime
    raw_size: int = 0
    history_count: int = 0
    keyword_count: int = 0
    ambiguous_count: int = 0
    unknown_count: int = 0
    execution_time_seconds: float = 0.0
