from src.core.exceptions import NotFoundException
from src.domain.interfaces.merchant_offer_repository import MerchantOfferRepositoryInterface


class DeleteMerchantOfferUseCase:
    """Soft-deletes a merchant offer by ID."""

    def __init__(self, repo: MerchantOfferRepositoryInterface):
        self.repo = repo

    def execute(self, offer_id: int) -> None:
        deleted = self.repo.delete_by_id(offer_id)
        if not deleted:
            raise NotFoundException(f"Offer {offer_id} not found")
