<?php

namespace App\Classes\Modules\Accounts\Services;


use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\User;
use App\Models\UserEmailVerification;
use Illuminate\Database\Eloquent\Model;

class VerifiesUser extends AbstractUpdateRecord
{

    /**
     * @param User $model
     * @return Model
     * @throws MalformedRequestException
     */
    public function execute(User $model): Model {

        $model->status = ApprovalStatus::APPROVED;

        return $this->handler($model);

    }

}
