<?php

namespace App\Classes\Modules\Orders\Services;

use App\Models\Order;

class ChecksIfOrderNumberExists
{

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

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


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

}