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

class WinsaaiGenerationRequest(BaseModel):
    invoice_ids: List[int] = Field(..., description="List of invoice IDs to process")
    is_temporal: bool = Field(True, description="Whether to generate as temporal (SCAII) or definitive")

class ErrorValidacion(BaseModel):
    partida: Optional[int] = None
    linea: int
    descripcion: str
    soluciones: Optional[str] = None
    identificador: Optional[str] = None

class WinsaaiResponse(BaseModel):
    task_id: str
    status: str = "PENDING"
    message: str = "WINSAAI generation task started"
    validation_errors: List[ErrorValidacion] = []
