"""Shared typing protocols for ProjectService operations."""

from __future__ import annotations

from typing import Protocol

from noteflow.domain.ports.repositories.identity import (
    ProjectMembershipRepository,
    ProjectRepository,
    WorkspaceRepository,
)


class ProjectCrudRepositoryProvider(Protocol):
    """Protocol for project CRUD repository access."""

    @property
    def supports_projects(self) -> bool: ...

    @property
    def projects(self) -> ProjectRepository: ...

    async def commit(self) -> None: ...


class ProjectMembershipRepositoryProvider(Protocol):
    """Protocol for project membership repository access."""

    @property
    def supports_projects(self) -> bool: ...

    @property
    def project_memberships(self) -> ProjectMembershipRepository: ...

    async def commit(self) -> None: ...


class ProjectActiveRepositoryProvider(Protocol):
    """Protocol for active project resolution repository access."""

    @property
    def supports_projects(self) -> bool: ...

    @property
    def supports_workspaces(self) -> bool: ...

    @property
    def projects(self) -> ProjectRepository: ...

    @property
    def workspaces(self) -> WorkspaceRepository: ...
