from __future__ import annotations

from typing import Protocol

from ynab_unlinked.models import Transaction, TransactionWithYnabData

from .migrations import Versioned
from .models.shared import EntityConfig


class Config(Versioned, Protocol):
    @staticmethod
    def exists() -> bool: ...
    def save(self): ...
    @staticmethod
    def load() -> Config: ...
    def update_and_save(self, last_transaction: Transaction, entity_name: str): ...
    def add_payee_rules(self, transactions: list[TransactionWithYnabData]): ...
    def payee_from_fules(self, payee: str) -> str | None: ...
    def entity(self, name: str) -> EntityConfig | None: ...
    def set_entity_account(self, name: str, account_id: str): ...
