from abc import abstractmethod
from typing import Protocol

from template_project.application.auth_identity.entity import AuthIdentity, AuthMethod
from template_project.application.user.entity import UserId


class AuthIdentityDataGateway(Protocol):
    @abstractmethod
    async def load_by_method_and_identifier(self, method: AuthMethod, identifier: str) -> AuthIdentity | None:
        raise NotImplementedError

    @abstractmethod
    async def load_all_for_user(self, user_id: UserId) -> list[AuthIdentity]:
        raise NotImplementedError
