<?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('site_settings', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('tenant_id')->nullable()->unique()->index();
            $table->text('logo')->nullable();
            $table->text('footer_logo')->nullable();
            $table->text('favicon')->nullable();
            $table->string('site_name')->nullable();
            $table->string('tab_title')->nullable();
            $table->text('address')->nullable();
            $table->string('phone', 50)->nullable();
            $table->string('email', 100)->nullable();
            $table->string('facebook')->nullable();
            $table->string('instagram')->nullable();
            $table->string('twitter')->nullable();
            $table->string('youtube')->nullable();
            $table->string('hero_title')->nullable();
            $table->text('hero_subtitle')->nullable();
            $table->text('hero_image')->nullable();
            $table->boolean('free_delivery_enabled')->default(true);
            $table->longText('home_page_json')->nullable();
            $table->longText('categories_json')->nullable();
            $table->longText('delivery_zones_json')->nullable();
            $table->longText('marketing_coupons')->nullable();
            $table->longText('custom_pages_json')->nullable();
            $table->string('messenger_ai_webhook_slug', 100)->nullable();
            $table->text('messenger_ai_openai_key')->nullable();
            $table->text('messenger_ai_fb_token')->nullable();
            $table->string('messenger_ai_fb_verify_token')->nullable();
            $table->text('messenger_ai_description')->nullable();
            $table->boolean('messenger_ai_enabled')->default(true);
            $table->text('fb_ads_access_token')->nullable();
            $table->string('fb_ads_account_id', 100)->nullable();
            $table->string('play_store_link', 500)->nullable();
            $table->string('app_store_link', 500)->nullable();
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('site_settings'); }
};
