<?php

namespace BYDAuto\Models;

use Carbon\Carbon;
use BYDAuto\Observers\TestdriveObserver;
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
use Illuminate\Database\Eloquent\Model;

/**
 * 销售线索.
 *
 * @property int $id
 * @property Carbon $date_created
 * @property Carbon $date_updated
 */
#[ObservedBy([TestdriveObserver::class])]
class Testdrive extends Model
{
    public const STATUS_UNKNOWN = 'unknown';

    public const STATUS_DRAFT = 'draft';

    public const STATUS_PUBLISHED = 'published';

    public const STATUS_ARCHIVED = 'archived';

    public const CREATED_AT = 'date_created';

    public const UPDATED_AT = 'date_updated';

    protected $table = 'bydauto_testdrive';

    protected $fillable = ['status', 'name', 'mobile', 'platform', 'source', 'meta', 'rawdata', 'request_id'];

    protected $casts = ['meta' => 'json', 'rawdata' => 'json'];
}
