from __future__ import annotations

from typing import Protocol

from packages.domain import GenerationTask


class GenerationTaskRepository(Protocol):
    def create(self, task: GenerationTask) -> GenerationTask: ...

    def get(self, task_id: str) -> GenerationTask | None: ...

    def list_by_project(self, project_id: str) -> list[GenerationTask]: ...

    def list_by_user(self, user_id: str) -> list[GenerationTask]: ...

    def count_by_user(self, user_id: str) -> int: ...

    def list_recent_by_user(self, user_id: str, limit: int = 5) -> list[GenerationTask]: ...

    def list_by_source_edit_plan(self, plan_id: str) -> list[GenerationTask]: ...

    def update(self, task: GenerationTask) -> GenerationTask: ...
