<?php

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

return new class extends Migration {
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('financial_sessions', function (Blueprint $table) {
            $table->id();
            $table->string('name')->unique(); // e.g., "2024-25"
            $table->date('start_date');
            $table->date('end_date');
            $table->boolean('is_active')->default(false); // Marks the "Current" session
            $table->enum('status', ['upcoming', 'current', 'closed'])->default('upcoming');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('financial_sessions');
    }
};
