<?php

namespace App\Classes\Modules\Currencies\Services\Rates;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Currencies\DataTransferObjects\RateObject;
use App\Models\CurrencyRate;

class UpdatesRate extends AbstractUpdateRecord
{

    /**
     * @param CurrencyRate $model
     * @param RateObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(CurrencyRate $model, RateObject $object)
    {
        $model->selling = $object->getSelling();

        return $this->handler($model);
    }
}