<?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::create('department_setup_submissions', function (Blueprint $table) {
            $table->id();
            $table->string('department_name');
            $table->string('department_heads')->nullable();
            $table->string('primary_contact_email')->nullable();
            $table->string('primary_contact_phone')->nullable();
            $table->text('go_live_priority_notes')->nullable();
            $table->string('completed_by')->nullable();
            $table->date('completed_date')->nullable();
            $table->text('additional_notes')->nullable();
            $table->foreignId('submitted_by_user_id')->nullable()->constrained('users')->nullOnDelete();
            $table->json('payload')->nullable();
            $table->timestamps();
        });
    }

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