<?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 UpdatesWalletBalance extends AbstractUpdateRecord
{
    /**
     * @param Wallet $model
     * @param $amount
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(Wallet $model, $amount) {

        $model->amount = $model->amount + $amount;
        return $this->handler($model);

    }
}
