<?php

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

/**
 * The exact VAT ID that was verified.
 *
 * A timestamp alone says "some number was checked once" — edit the field and
 * the old confirmation silently vouches for the new value. Storing what was
 * verified makes the check self-enforcing: no writer has to remember to clear
 * a flag.
 */
return new class extends Migration
{
    public function up(): void
    {
        Schema::table('customers', function (Blueprint $table) {
            $table->string('vat_id_verified_value')->nullable()->after('vat_id_verified_at');
        });
    }

    public function down(): void
    {
        Schema::table('customers', function (Blueprint $table) {
            $table->dropColumn('vat_id_verified_value');
        });
    }
};
