from typing import Protocol

from dojocommons.domain.entities.base_entity import BaseEntity


class Repository[T: BaseEntity](Protocol):
    def create(self, entity: T) -> T: ...
    def find_by_id(self, entity_id: str) -> T | None: ...
    def find_all(self, **filters) -> list[T]: ...
    def update(self, entity_id: str, updates: dict) -> T | None: ...
    def delete(self, entity_id: str) -> None: ...
    def exists_by_id(self, entity_id: str) -> bool: ...
    def save_to_parquet(self) -> None: ...
