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

from src.domain.entities.merchant import Merchant, MerchantListItem, MerchantLocation


class MerchantRepositoryInterface(ABC):
    """Abstract interface for merchant data access."""

    @abstractmethod
    def get_list(self) -> List[MerchantListItem]: ...

    @abstractmethod
    def get_all(self) -> List[Merchant]: ...

    @abstractmethod
    def get_by_id(self, merchant_id: int) -> Optional[Merchant]: ...

    @abstractmethod
    def list_merchants(self, limit: int = 5, skip: int = 0) -> List[Merchant]:
        """Fetch merchants with pagination."""
        pass

    @abstractmethod
    def count_merchants(self) -> int:
        """Count total non-deleted merchants."""
        pass

    @abstractmethod
    def get_merchant_by_id(self, merchant_id: int) -> Optional[Merchant]:
        """Fetch a specific merchant by ID."""
        pass

    @abstractmethod
    def get_locations_by_merchant(self, merchant_id: int) -> List[MerchantLocation]:
        """Fetch all locations for a specific merchant."""
        pass

    @abstractmethod
    def create_location(self, location: MerchantLocation) -> MerchantLocation:
        """Create a new merchant location."""
        pass

    @abstractmethod
    def get_location_by_id(self, location_id: int) -> Optional[MerchantLocation]:
        """Fetch a specific merchant location by ID."""
        pass

    @abstractmethod
    def update_location(self, location_id: int, location_data: dict) -> Optional[MerchantLocation]:
        """Update an existing merchant location."""
        pass
