<?php

namespace App\Classes\Modules\Companies\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Companies\DataTransferObjects\CompanyObject;
use App\Models\Company;

class UpdatesCompanyDebtor extends AbstractUpdateRecord
{

    /**
     * @param Company $model
     * @param CompanyObject $object
     * @param string $debtor
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(Company $model, string $debtor)
    {
        $model->debtor = $debtor;

        return $this->handler($model);
    }
}
