<?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('bill_counters', function (Blueprint $table) {
            $table->id();
            $table->string('financial_year', 10)->unique()->comment('Format: YY-YY (e.g., 24-25)');
            $table->string('last_bill_number', 50)->nullable()->comment('Last generated bill number');
            $table->timestamps();
            
            $table->index('financial_year');
        });
    }

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