from datetime import datetime
from typing import Optional

from pydantic import BaseModel, ConfigDict, Field


class PedimentoConfigSurchargesBase(BaseModel):
    """Base schema for Pedimento Config Surcharges"""

    pedimento_id: Optional[int] = Field(None, description="Pedimento ID")
    tenant_id: Optional[int] = Field(None, description="Tenant ID")
    surcharge_igi: Optional[bool] = Field(None, description="Surcharge IGI")
    surcharge_dta: Optional[bool] = Field(None, description="Surcharge DTA")
    surcharge_vat: Optional[bool] = Field(None, description="Surcharge VAT")
    surcharge_isan: Optional[bool] = Field(None, description="Surcharge ISAN")
    surcharge_ieps: Optional[bool] = Field(None, description="Surcharge IEPS")
    surcharge_cc: Optional[bool] = Field(None, description="Surcharge CC")


class PedimentoConfigSurchargesCreate(PedimentoConfigSurchargesBase):
    """Schema for creating a new Pedimento Config Surcharges"""

    pass


class PedimentoConfigSurchargesUpdate(BaseModel):
    """Schema for updating a Pedimento Config Surcharges"""

    surcharge_igi: Optional[bool] = None
    surcharge_dta: Optional[bool] = None
    surcharge_vat: Optional[bool] = None
    surcharge_isan: Optional[bool] = None
    surcharge_ieps: Optional[bool] = None
    surcharge_cc: Optional[bool] = None


class PedimentoConfigSurchargesResponse(PedimentoConfigSurchargesBase):
    """Schema for Pedimento Config Surcharges response"""

    id: int
    created_at: datetime

    model_config = ConfigDict(from_attributes=True)
