from .client import post_request as post_request
from .model import MoneybirdModel as MoneybirdModel
from .payment import Payment as Payment
from dataclasses import dataclass
from typing import Any, Self

@dataclass
class ExternalSalesInvoiceDetailsAttributes:
    id: int | None = ...
    description: str | None = ...
    period: str | None = ...
    price: int | None = ...
    amount: int | None = ...
    tax_rate_id: int | None = ...
    ledger_account_id: str | None = ...
    project_id: str | None = ...
    @classmethod
    def from_dict(cls, data: dict[str, Any]) -> Self: ...
    def __init__(self, id=..., description=..., period=..., price=..., amount=..., tax_rate_id=..., ledger_account_id=..., project_id=...) -> None: ...

@dataclass
class ExternalSalesInvoice(MoneybirdModel):
    contact_id: int | None = ...
    reference: str | None = ...
    date: str | None = ...
    due_date: str | None = ...
    currency: str | None = ...
    prices_are_incl_tax: bool | None = ...
    source: str | None = ...
    source_url: str | None = ...
    details: list[ExternalSalesInvoiceDetailsAttributes] | None = ...
    payments: list[Payment] | None = ...
    def update(self, data: dict[str, Any]) -> None: ...
    def save(self) -> None: ...
    def list_all_by_contact_id(self, contact_id: int, state: str | None = 'all', period: str | None = 'this_year') -> list: ...
    def create_payment(self, payment: Payment) -> None: ...
    def delete_payment(self, payment_id: int) -> None: ...
    def __init__(self, id=..., contact_id=..., reference=..., date=..., due_date=..., currency=..., prices_are_incl_tax=..., source=..., source_url=..., details=..., payments=...) -> None: ...
