from pydantic import BaseModel


class RechargePackageCreate(BaseModel):
    name: str
    credits: float
    price: float
    bonus_credits: float = 0.0
    description: str | None = None
    package_type: str = "normal"
    is_gift: bool = False
    is_active: bool = True
    sort_order: int = 0


class RechargePackageUpdate(BaseModel):
    name: str | None = None
    credits: float | None = None
    price: float | None = None
    bonus_credits: float | None = None
    description: str | None = None
    package_type: str | None = None
    is_gift: bool | None = None
    is_active: bool | None = None
    sort_order: int | None = None


class RechargePackageOut(BaseModel):
    id: str
    name: str
    credits: float
    price: float
    bonus_credits: float
    total_credits: float
    description: str | None
    package_type: str
    is_gift: bool
    is_active: bool
    sort_order: int

    model_config = {"from_attributes": True}
