<?php

namespace App\Classes\Modules\Companies\Services;

use App\Models\Company;

class ChecksIfCompanyAccountNumberExists
{

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

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

    public function execute(int $accountNumber): bool {
        return $this->repository->where('reference', $accountNumber)->exists();
    }

}