merchant-eye/pulse-board

PulseBoard: The Trello Replacement on Dodil

A remix template · 0 remixes · Remix merchant-eye/pulse-board

app/boards/application/ports.py

"""What the use cases need from the outside world. infrastructure/ provides it; tests fake it."""
from typing import List, Optional, Protocol

from boards.domain.model import Board, Card


class BoardRepository(Protocol):
    def get(self, board_id: str) -> Optional[Board]: ...
    def boards_for(self, email: str) -> List[Board]: ...
    def save_board(self, board: Board) -> None: ...
    def delete_board(self, board_id: str) -> None: ...
    def get_card(self, card_id: str) -> Optional[Card]: ...
    def cards_on(self, board_id: str) -> List[Card]: ...
    def save_card(self, card: Card) -> None: ...
    def delete_card(self, card_id: str) -> None: ...
    def log(self, board_id: str, card_id: Optional[str], actor: str, action: str) -> None: ...
    def activity_for_card(self, card_id: str) -> List[dict]: ...
    def activity_for_board(self, board_id: str, limit: int = 50) -> List[dict]: ...


class Assistant(Protocol):
    def checklist(self, card_title: str) -> List[str]: ...
    def summary(self, board_title: str, cards_summary: str) -> str: ...
    def find_similar(self, target_title: str, candidate_titles: List[dict]) -> List[dict]: ...