from abc import ABC, abstractmethod
from typing import Optional, Any

from models.config import SystemConfig


class ConfigurationManagerBase(ABC):
    @abstractmethod
    async def load_config(self, path: str) -> SystemConfig:
        pass

    @abstractmethod
    async def save_config(self, config: SystemConfig, path: str) -> bool:
        pass

    @abstractmethod
    def get_config(self) -> SystemConfig:
        pass

    @abstractmethod
    def get_value(self, key: str, default: Any = None) -> Any:
        pass

    @abstractmethod
    async def update_value(self, key: str, value: Any) -> bool:
        pass

    @abstractmethod
    async def validate_config(self, config: SystemConfig) -> list[str]:
        pass

    @abstractmethod
    async def reload_config(self) -> bool:
        pass

