"""Abstract storage API for preprocess sets."""

from __future__ import annotations

from abc import ABC, abstractmethod
from pathlib import Path

from python_app.models.dataset_model import ComboKey, SweepCollection


class StoreApi(ABC):
    """Storage contract used by workflows and GUI code."""

    @abstractmethod
    def save_set(self, kind: str, radar_key: str, set_name: str, collection: SweepCollection) -> None:
        """Persist a named set."""
        raise NotImplementedError

    @abstractmethod
    def load_set(self, kind: str, radar_key: str, set_name: str) -> SweepCollection:
        """Load a named set."""
        raise NotImplementedError

    @abstractmethod
    def list_sets(self, kind: str, radar_key: str) -> list[str]:
        """List set names for kind/radar key."""
        raise NotImplementedError

    @abstractmethod
    def has_combo_coverage(self, kind: str, radar_key: str, set_name: str, combos: list[ComboKey]) -> bool:
        """Check whether stored set covers requested switch combinations."""
        raise NotImplementedError

    @abstractmethod
    def export_set_bundle(self, kind: str, radar_key: str, set_name: str, output_path: Path) -> Path:
        """Export set into binary bundle file for C++ preprocessing."""
        raise NotImplementedError
