<?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('guest_policy_settings', function (Blueprint $table) {
            $table->id();
            $table->boolean('guest_downloads_enabled')->default(true);
            $table->boolean('guest_sharing_enabled')->default(true);
            $table->string('guest_upload_visibility')->default('review');
            $table->unsignedInteger('per_device_upload_limit')->default(50);
            $table->unsignedInteger('join_token_failure_limit')->default(10);
            $table->unsignedInteger('join_token_failure_decay_minutes')->default(5);
            $table->unsignedInteger('join_token_access_limit')->default(120);
            $table->unsignedInteger('join_token_access_decay_minutes')->default(1);
            $table->unsignedInteger('join_token_download_limit')->default(60);
            $table->unsignedInteger('join_token_download_decay_minutes')->default(1);
            $table->unsignedInteger('share_link_ttl_hours')->default(48);
            $table->unsignedInteger('guest_notification_ttl_hours')->nullable();
            $table->timestamps();
        });
    }

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