"""选股策略 Repository Protocol。""" from __future__ import annotations from typing import Protocol from app.domain.entities.strategy import SelectionStrategy class StrategyRepository(Protocol): def save(self, definition: SelectionStrategy) -> SelectionStrategy: """新建(name 冲突抛 ValueError)。""" def get(self, strategy_id: str) -> SelectionStrategy | None: ... def get_by_name(self, name: str) -> SelectionStrategy | None: ... def list(self) -> list[SelectionStrategy]: ... def delete(self, strategy_id: str) -> bool: ...