from abc import ABC, abstractmethod from typing import List from src.domain.entities.legal_charges import LegalChargesRule class LegalChargesRepositoryInterface(ABC): """Contract for reading and upserting legal-charges rules.""" @abstractmethod def list_all(self) -> List[LegalChargesRule]: """Return all existing legal-charges rules (one per category).""" ... @abstractmethod def upsert_all( self, rules: List[LegalChargesRule], user_id: int, ) -> List[LegalChargesRule]: """Upsert a set of rules. For each rule, if a record already exists for that category_id it is deleted and re-created with the new values (matching Laravel behaviour). Returns the saved rules. """ ...