from typing import List

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


class LinkOffersToProductUseCase:
    """Links a set of financing offers to a product (replaces existing links)."""

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

    def execute(self, product_id: int, offer_ids: List[int], user_id: int) -> None:
        self.offer_repo.link_offers(product_id, offer_ids, user_id)
