<?php

namespace App\Classes\Modules\Schedules\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Models\Schedule;

class UpdatesSchedule extends AbstractUpdateRecord
{

    /**
     * @param Schedule $model
     * @param ScheduleObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(Schedule $model, ScheduleObject $object) {

        $model->etd = $object->getETD();
        $model->eta = $object->getETA();
        $model->status = $object->getStatus();

        return $this->handler($model);

    }
}
