from __future__ import annotations

from typing import Any

from pydantic import BaseModel, ConfigDict, Field


class EasybillBaseModel(BaseModel):
    model_config = ConfigDict(extra="allow", populate_by_name=True)


class Pagination(EasybillBaseModel):
    page: int = 1
    pages: int = 1
    limit: int = 100
    total: int = 0


class WebhookEnvelope(EasybillBaseModel):
    event: str
    delivery_id: str
    payload: dict[str, Any] = Field(default_factory=dict)
    resource_id: int | None = None
    headers: dict[str, str] = Field(default_factory=dict)
