"""标签仓储接口定义。"""

from abc import ABC, abstractmethod

from packages.domain import Tag


class TagRepository(ABC):
    @abstractmethod
    def create(self, tag: Tag) -> Tag:
        pass

    @abstractmethod
    def get(self, tag_id: str) -> Tag | None:
        pass

    @abstractmethod
    def find_by_name(self, user_id: str, name: str) -> Tag | None:
        pass

    @abstractmethod
    def list_by_user(
        self,
        user_id: str,
        skip: int = 0,
        limit: int = 100,
    ) -> list[Tag]:
        pass

    @abstractmethod
    def count_by_user(self, user_id: str) -> int:
        pass

    @abstractmethod
    def delete(self, tag_id: str) -> bool:
        pass
