<?php

namespace App\Classes\Modules\Wallets\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\General\Eloquent\AbstractUpdateRelationshipRecord;
use App\Classes\Modules\Wallets\DataTransferObjects\WalletObject;
use App\Models\Wallet;
use App\Models\Company;

class UpdatesWallet extends AbstractUpdateRecord
{
    /**
     * @param WalletObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(Wallet $model, WalletObject  $object) {
        $model->amount = $object->getAmount();
        $model->code = $object->getCode();
        $model->currency_id = $object->getCurrency();


        return $this->handler($model);

    }
}
