<?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('app_settings', function (Blueprint $table) {
            $table->id();
            $table->string('app_name')->default('Taxi App');
            $table->string('app_email')->nullable();
            $table->text('app_description')->nullable();
            $table->text('app_about')->nullable();
            $table->string('app_icon')->nullable();
            $table->string('app_logo')->nullable();

            // Subscription settings
            $table->enum('driver_subscription_type', ['percentage', 'monthly'])->default('percentage');
            $table->decimal('driver_subscription_value', 5, 2)->default(10.00); // 10% or monthly amount
            $table->boolean('driver_subscription_enabled')->default(true);

            $table->enum('restaurant_subscription_type', ['percentage', 'monthly'])->default('percentage');
            $table->decimal('restaurant_subscription_value', 5, 2)->default(15.00); // 15% or monthly amount
            $table->boolean('restaurant_subscription_enabled')->default(true);

            $table->enum('gas_subscription_type', ['percentage', 'monthly'])->default('percentage');
            $table->decimal('gas_subscription_value', 5, 2)->default(12.00); // 12% or monthly amount
            $table->boolean('gas_subscription_enabled')->default(true);

            $table->timestamps();
        });
    }

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