"""
Base class for demo configurations.

Each demo config file in this folder extends _BaseDemoConfig and provides
idempotent load() and remove() methods for setting up / tearing down
a complete demo environment (mandates, users, features, test data, etc.).
"""

import logging
from abc import ABC, abstractmethod
from typing import Dict, Any

logger = logging.getLogger(__name__)


class _BaseDemoConfig(ABC):
    """Abstract base for demo configurations."""

    code: str = ""
    label: str = ""
    description: str = ""

    @abstractmethod
    def load(self, db) -> Dict[str, Any]:
        """Create all demo data (idempotent). Returns summary dict."""
        raise NotImplementedError

    @abstractmethod
    def remove(self, db) -> Dict[str, Any]:
        """Remove all demo data. Returns summary dict."""
        raise NotImplementedError

    def toDict(self) -> Dict[str, Any]:
        return {
            "code": self.code,
            "label": self.label,
            "description": self.description,
        }
