<?php

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

/**
 * Acente sertifikaları (Ayarlar → Sertifikalar):
 * başlık + belge dosyası (PDF / görsel / ofis belgesi).
 * Örn: TÜRSAB belgesi, işletme belgesi, ISO sertifikası...
 */
return new class extends Migration
{
    public function up(): void
    {
        Schema::create('agency_certificates', function (Blueprint $table) {
            $table->id();
            $table->foreignId('agency_id')->constrained('agencies')->cascadeOnDelete();
            $table->string('title');
            $table->string('file_path');
            $table->string('file_name');                       // orijinal dosya adı
            $table->unsignedBigInteger('file_size')->nullable();
            $table->string('mime_type', 100)->nullable();
            $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
            $table->timestamps();
        });
    }

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