<?php

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

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Models\CurrencyRate;
use App\Models\CurrencyRateLog;

class CreatesRateLog extends AbstractUpdateRecord
{
    /**
     * @param CurrencyRate $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(CurrencyRate $object) {
        $model = new CurrencyRateLog();
        $model->currency_rate_id = $object->id;
        $model->selling = $object->selling;
        $model->created_by = \Auth::user()->id;
        return $this->handler($model);

    }
}