<?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
    {
        // Form 2 - Stage 2 details
        Schema::create('application_stage2', function (Blueprint $table) {
            $table->id();
            $table->foreignId('application_id')->constrained('applications')->cascadeOnDelete();
            $table->text('basic_skills'); // Kemampuan dasar
            $table->text('facilities'); // Fasilitas: HP, Laptop, dll
            $table->text('additional_info')->nullable();
            $table->timestamps();
        });

        // Form 3 - Stage 3 details
        Schema::create('application_stage3', function (Blueprint $table) {
            $table->id();
            $table->foreignId('application_id')->constrained('applications')->cascadeOnDelete();
            $table->string('preferred_working_hours'); // Jam kerja yang diinginkan
            $table->decimal('expected_salary', 12, 0); // Gaji yang ditawarkan
            $table->text('availability')->nullable();
            $table->text('notes')->nullable();
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('application_stage3');
        Schema::dropIfExists('application_stage2');
    }
};
