<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->enum('vehicle_type', ['van', 'truck', 'trailer'])->nullable()->after('postal_code');
            $table->string('vehicle_plate', 32)->nullable()->after('vehicle_type');
            $table->enum('driver_status', ['online', 'busy', 'offline'])->default('offline')->after('vehicle_plate');
            $table->decimal('rating', 3, 2)->nullable()->after('driver_status');
            $table->timestamp('last_activity')->nullable()->after('rating');
        });
    }

    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn([
                'vehicle_type',
                'vehicle_plate',
                'driver_status',
                'rating',
                'last_activity',
            ]);
        });
    }
};
