<?php

namespace App\Classes\Modules\Currencies\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Models\Currency;

class RateCalculatesCurrency extends AbstractUpdateRecord
{

    public function execute(Currency $conversion_currency, Currency $convertable_currency, $amount) 
    {
        return $convert_amount = ($conversion_currency->selling / $convertable_currency->selling) * $amount;
    }
    
    public function execute_rate(Currency $conversion_currency, Currency $convertable_currency) 
    {
        return $convert_rate = ($conversion_currency->selling / $convertable_currency->selling);
    }
}