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

from src.domain.entities.product import Product


class ProductRepositoryInterface(ABC):
    """Contract for product persistence operations."""

    @abstractmethod
    def get_by_merchant(self, merchant_id: int) -> List[Product]: ...

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

    @abstractmethod
    def create(self, merchant_id: int, data: dict, user_id: int) -> Product: ...

    @abstractmethod
    def update(self, product_id: int, data: dict) -> Optional[Product]: ...

    @abstractmethod
    def delete(self, product_id: int) -> bool: ...
