<?php

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

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

class CreatesRates extends AbstractUpdateRelationshipRecord
{


    /**
     * @param Currency $currency
     * @param array $rates
     * @return mixed
     */
    public function execute(Currency $currency, array $rates)
    {
        return $currency->update($rates)->save();
    }
}