<?php

declare(strict_types=1);

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('maestro_offer_settings', function (Blueprint $table): void {
            $table->id();
            $table->string('number_prefix', 32)->default('OFF');
            $table->unsignedTinyInteger('number_padding')->default(3);
            $table->string('reset_policy', 24)->default('yearly'); // yearly|never
            $table->unsignedSmallInteger('last_sequence_year')->nullable();
            $table->unsignedInteger('last_sequence')->default(0);
            $table->json('vat_rate_presets')->nullable();
            $table->timestamps();
        });
    }

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