<?php

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

/**
 * Per-solicitor Fintrixor eSign credentials. One Fintrixor account per solicitor
 * (true multitenant). The API key is stored encrypted (model 'encrypted' cast).
 */
return new class extends Migration {
    public function up(): void
    {
        Schema::table('solicitors', function (Blueprint $table) {
            $table->text('esign_api_key')->nullable();      // encrypted via model cast
            $table->string('esign_base_url')->nullable();   // optional per-solicitor base URL override
        });
    }

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