<?php

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

/**
 * The named contact at the firm who helps clients complete their application
 * forms. Populates the "who is helping you complete this form" section
 * (help_first_name / help_last_name) of the eSign Part-1 application, replacing
 * the previously hardcoded contact. Phone, email and firm name for that section
 * are sourced from the solicitor's phone-numbers / email-senders subsystems.
 */
return new class extends Migration {
    public function up(): void
    {
        Schema::table('solicitors', function (Blueprint $table) {
            $table->string('help_contact_first_name')->nullable()->after('phone_number');
            $table->string('help_contact_last_name')->nullable()->after('help_contact_first_name');
        });
    }

    public function down(): void
    {
        Schema::table('solicitors', function (Blueprint $table) {
            $table->dropColumn(['help_contact_first_name', 'help_contact_last_name']);
        });
    }
};
