<?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('job_applications', function (Blueprint $table) {
            $table->enum('cv_scan_status', ['pending', 'clean', 'infected', 'failed', 'skipped'])
                ->default('pending')
                ->after('cv_original_name');
            $table->json('cv_scan_result')->nullable()->after('cv_scan_status');
            $table->timestamp('cv_scanned_at')->nullable()->after('cv_scan_result');
        });
    }

    public function down(): void
    {
        Schema::table('job_applications', function (Blueprint $table) {
            $table->dropColumn(['cv_scan_status', 'cv_scan_result', 'cv_scanned_at']);
        });
    }
};