sawera/sawera-boards

Sawera Boards - a team task board for the Dodil Boards Challenge. Boards, lists, cards, roles, activity log, MCP actions and AI extras. FastAPI + DataK3 + appid + Models + MCP.

A remix template · 0 remixes · Remix sawera/sawera-boards

app/boards/application/ports.py

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

from boards.domain.model import Board, Card, Comment


class BoardRepository(Protocol):
    def get(self, board_id: str) -> Optional[Board]: ...
    def boards_for(self, email: str) -> list: ...
    def save_board(self, board: Board) -> None: ...
    def delete_board(self, board_id: str) -> None: ...
    def save_lists(self, board: Board) -> None: ...
    def get_card(self, card_id: str) -> Optional[Card]: ...
    def cards_on(self, board_id: str) -> list: ...
    def save_card(self, card: Card) -> None: ...
    def delete_card(self, card_id: str) -> None: ...
    def save_comment(self, comment: Comment) -> None: ...
    def comments_on(self, card_id: str) -> list: ...
    def comment_counts(self, board_id: str) -> dict: ...
    def log(self, board_id: str, card_id: Optional[str], actor: str, action: str) -> None: ...
    def activity(self, board_id: str, limit: int = 50) -> list: ...
    def counts(self) -> dict: ...
    def get_embeddings(self, board_id: str) -> dict: ...
    def save_embedding(self, card_id: str, text_hash: str, vector) -> None: ...


class Assistant(Protocol):
    def checklist(self, card_title: str) -> list: ...
    def summarize(self, facts: str) -> str: ...
    def embed(self, texts: list) -> list: ...