"""交叉评查服务接口。"""

from abc import ABC, abstractmethod

from fastapi_modules.fastapi_leaudit.domian.Dto.crossReviewDto import (
    CrossReviewProposalCreateDTO,
    CrossReviewProposalVoteDTO,
    CrossReviewTaskCreateDTO,
    CrossReviewTaskDocumentQueryDTO,
    CrossReviewTaskQueryDTO,
)
from fastapi_modules.fastapi_leaudit.domian.vo.crossReviewVo import (
    CrossReviewPendingVotesVO,
    CrossReviewPermissionVO,
    CrossReviewProposalCancelVO,
    CrossReviewProposalCreateVO,
    CrossReviewProposalPageVO,
    CrossReviewProposalVoteVO,
    CrossReviewTaskCompleteVO,
    CrossReviewTaskCreateVO,
    CrossReviewTaskDocumentPageVO,
    CrossReviewTaskDocumentUploadVO,
    CrossReviewTaskPageVO,
    CrossReviewTaskProgressVO,
)


class ICrossReviewService(ABC):
    """交叉评查服务接口。"""

    @abstractmethod
    async def CreateTask(self, CurrentUserId: int, Body: CrossReviewTaskCreateDTO) -> CrossReviewTaskCreateVO:
        """创建交叉评查任务。"""
        ...

    @abstractmethod
    async def GetUserTasks(self, CurrentUserId: int, Body: CrossReviewTaskQueryDTO) -> CrossReviewTaskPageVO:
        """查询当前用户参与的交叉评查任务。"""
        ...

    @abstractmethod
    async def GetTaskProgress(self, CurrentUserId: int, TaskId: int) -> CrossReviewTaskProgressVO:
        """查询任务进度。"""
        ...

    @abstractmethod
    async def GetTaskDocuments(
        self,
        CurrentUserId: int,
        TaskId: int,
        Body: CrossReviewTaskDocumentQueryDTO,
    ) -> CrossReviewTaskDocumentPageVO:
        """查询任务文档列表。"""
        ...

    @abstractmethod
    async def CanConfirmTaskDocument(self, CurrentUserId: int, TaskId: int) -> CrossReviewPermissionVO:
        """判断当前用户是否有权确认任务文档完成。"""
        ...

    @abstractmethod
    async def CompleteTaskDocument(self, CurrentUserId: int, TaskId: int, DocumentId: int) -> CrossReviewTaskCompleteVO:
        """确认任务文档完成。"""
        ...

    @abstractmethod
    async def CreateProposal(self, CurrentUserId: int, Body: CrossReviewProposalCreateDTO) -> CrossReviewProposalCreateVO:
        """创建交叉评查提案。"""
        ...

    @abstractmethod
    async def VoteProposal(
        self,
        CurrentUserId: int,
        ProposalId: int,
        Body: CrossReviewProposalVoteDTO,
    ) -> CrossReviewProposalVoteVO:
        """对交叉评查提案投票。"""
        ...

    @abstractmethod
    async def CancelProposal(self, CurrentUserId: int, ProposalId: int) -> CrossReviewProposalCancelVO:
        """撤销交叉评查提案。"""
        ...

    @abstractmethod
    async def GetDocumentProposals(
        self,
        CurrentUserId: int,
        DocumentId: int,
        Page: int,
        PageSize: int,
    ) -> CrossReviewProposalPageVO:
        """获取文档提案列表。"""
        ...

    @abstractmethod
    async def GetDocumentPendingVotes(self, CurrentUserId: int, DocumentId: int) -> CrossReviewPendingVotesVO:
        """获取文档待投票信息。"""
        ...

    @abstractmethod
    async def UploadTaskDocument(
        self,
        CurrentUserId: int,
        TaskId: int,
        FileName: str,
        FileContent: bytes,
        ContentType: str | None,
        TypeId: int | None = None,
        GroupId: int | None = None,
    ) -> CrossReviewTaskDocumentUploadVO:
        """向交叉评查任务补传文档。"""
        ...
