<?php

namespace App\Classes\Modules\Companies\Services;

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

class UpdatesCompanyModuleIsCreditTerm extends AbstractUpdateRecord
{

    /**
     * @param CompanyConnection $model
     * @param int $isCreditTerm
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(CompanyConnection $model, int $isCreditTerm)
    {
        $model->is_credit_term = $isCreditTerm;

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