<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Enums\CaptainStatus; // We will keep this one as it's a static list

class CaptainProfile extends Model
{
    use HasFactory;

    /**
     * The attributes that are mass assignable.
     *
     * @var array<int, string>
     */
    protected $fillable = [
        'user_id',
        'vehicle_type',
        'vehicle_make',
        'vehicle_model',
        'license_number',
        'license_image_path',
        'cnic_image_path',
        'status',
        'current_lat',  // Make sure these are included
        'current_lng'
    ];

    /**
     * The attributes that should be cast.
     *
     * @var array<string, string>
     */
    protected $casts = [
        'status' => CaptainStatus::class,
    ];

    /**
     * Get the user that owns the CaptainProfile.
     */
    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }
}