<?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('submissions', function (Blueprint $table) {
            $table->id();
            $table->string('submission_code')->unique();
            $table->string('title');
            $table->string('author_name');
            $table->string('author_email');
            $table->string('author_phone')->nullable();
            $table->string('institution');
            $table->string('country')->nullable();
            $table->text('co_authors')->nullable();
            $table->string('sub_theme')->nullable();
            $table->text('abstract')->nullable();
            $table->text('keywords')->nullable();
            $table->string('abstract_file')->nullable();
            $table->string('full_paper_file')->nullable();
            $table->enum('status', ['submitted', 'under_review', 'revision', 'accepted', 'rejected'])->default('submitted');
            $table->enum('type', ['abstract', 'full_paper'])->default('abstract');
            $table->text('reviewer_notes')->nullable();
            $table->string('registration_code')->nullable();
            $table->boolean('is_paid')->default(false);
            $table->timestamps();
        });
    }

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