import uuid
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from datetime import date


@dataclass
class BudgetComponent(ABC):
    name: str
    id: str = field(default_factory=lambda: str(uuid.uuid4()))
    created_at: str = field(default_factory=lambda: date.today().isoformat())

    @abstractmethod
    def get_balance(self) -> dict[str, float]: ...

    @abstractmethod
    def to_dict(self) -> dict[str, object]: ...
