<?php

namespace App\Classes\Modules\Milestones\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Milestones\DataTransferObjects\MilestoneObject;
use App\Models\Milestone;

class UpdatesMilestone extends AbstractUpdateRecord
{
    /**
     * @param Milestone $model
     * @param MilestoneObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(Milestone $model, MilestoneObject $object)
    {
        $model->name = $object->getName();
        $model->description = $object->getDescription();

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