<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('appointments', function (Blueprint $table) {
            // Repuestos estimados (texto simple por ahora)
            $table->text('parts_needed')->nullable()->after('problem_description');
            
            // Costo (Presupuesto)
            $table->decimal('estimated_cost', 10, 2)->nullable()->after('parts_needed');
            
            // Teléfono de contacto rápido (por si es distinto al del cliente registrado)
            $table->string('contact_phone')->nullable()->after('client_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('appointments', function (Blueprint $table) {
            $table->dropColumn(['parts_needed', 'estimated_cost', 'contact_phone']);
        });
    }
};
