<?php

namespace App\Classes\Modules\Vouchers\Services;

use App\Models\VoucherCampaign;

class CheckIfVoucherCampaignExists
{

    /** @var VoucherCampaign */
    private $repository;


    /**
     * CheckIfVoucherCampaignExists constructor.
     * @param VoucherCampaign $repository
     */
    public function __construct(VoucherCampaign $repository)
    {
        $this->repository = $repository;
    }

    public function execute(string $campaignId): bool {
        return $this->repository->where('campaign_id', $campaignId)->exists();
    }

}
