<?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::table('clients', function (Blueprint $table) {
            $table->boolean('email_notifications')->default(true)->after('marketing_emails');
            $table->boolean('sms_notifications')->default(true)->after('email_notifications');
            $table->boolean('invoice_reminders')->default(true)->after('sms_notifications');
            $table->boolean('service_notifications')->default(true)->after('invoice_reminders');
            $table->string('preferred_contact_method', 10)->default('email')->after('service_notifications');
        });
    }

    public function down(): void
    {
        Schema::table('clients', function (Blueprint $table) {
            $table->dropColumn(['email_notifications', 'sms_notifications', 'invoice_reminders', 'service_notifications', 'preferred_contact_method']);
        });
    }
};
