<?php

namespace App\Classes\Modules\Wallets\Services;


use App\Models\Wallet;

class ChecksIfWalletCodeExists
{

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


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

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

}