<?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('app_settings', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('config_version')->default(1);
            $table->float('match_threshold')->default(0.40);
            $table->boolean('liveness_enabled')->default(true);
            $table->float('liveness_threshold')->default(0.5);
            $table->unsignedInteger('debounce_minutes')->default(3);
            $table->float('direction_area_ratio')->default(1.25);
            $table->float('min_direction_confidence')->default(0.6);
            $table->unsignedInteger('sync_interval_s')->default(30);
            $table->unsignedInteger('heartbeat_interval_s')->default(60);
            $table->boolean('snapshot_upload')->default(true);
            $table->string('shift_start')->default('09:30');
            $table->string('shift_end')->default('18:00');
            $table->timestamps();
        });
    }

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