"""兼容层：旧素材库仓储接口定义，保留给遗留异步适配器使用。"""

from abc import ABC, abstractmethod

from packages.domain import AssetLibrary, AssetLibraryKind


class AssetLibraryRepository(ABC):
    @abstractmethod
    async def create(self, library: AssetLibrary) -> AssetLibrary:
        pass

    @abstractmethod
    async def find_by_id(self, library_id: str) -> AssetLibrary | None:
        pass

    @abstractmethod
    async def find_by_project(
        self,
        project_id: str,
    ) -> list[AssetLibrary]:
        pass

    @abstractmethod
    async def update(self, library: AssetLibrary) -> AssetLibrary:
        pass

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

    @abstractmethod
    async def increment_asset_count(self, library_id: str, size_delta: int) -> None:
        pass

    @abstractmethod
    async def decrement_asset_count(self, library_id: str, size_delta: int) -> None:
        pass
