<?php

namespace BYDAuto\Observers;

use BYDAuto\Jobs\TestdrivePushJob;
use BYDAuto\Models\Testdrive;

class TestdriveObserver
{
    public function creating(Testdrive $model)
    {
        if ($model->status === null) {
            $model->status = Testdrive::STATUS_DRAFT;
        }
    }

    public function created(Testdrive $model)
    {
        // if ($model->status === Testdrive::STATUS_DRAFT) {
        //     TestdrivePushJob::dispatch($model);
        // } else {
        //     info('===== TestdriveObserver::created not a draft', ['id' => $model->id, 'status' => $model->status]);
        // }
    }
}
