<?php

namespace App\Classes\Modules\Orders\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\Order;

class CancelsOrder extends AbstractUpdateRecord
{

    /**
     * @param Order $model
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(Order $model)
    {
        $model->status = ApprovalStatus::SUSPENDED;

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