<?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('c3_prevention_beneficiaries', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->enum('gender', ['Male', 'Female'])->nullable();
            $table->integer('age')->nullable();
            $table->enum('category_of_participants', [
                'Adult Male', 'Adult Female', 'Adolescent Boy', 'Adolescent Girl',
                'Community Leader', 'Religious Leader'
            ])->nullable();
            $table->boolean('person_with_disability')->default(false);
            $table->string('refugee_displaced_status', 50)->nullable();
            $table->string('state', 100)->nullable();
            $table->string('county', 100)->nullable();
            $table->string('payam', 100)->nullable();
            $table->string('boma', 100)->nullable();

            // Awareness & Communication activities (booleans)
            $table->boolean('prevention_messages')->default(false);
            $table->boolean('referral_pathways')->default(false);
            $table->boolean('conflict_resolution')->default(false);
            $table->boolean('male_engagement')->default(false);
            $table->boolean('positive_masculinity_activity')->default(false);
            $table->boolean('received_iec_materials')->default(false);
            $table->boolean('received_radio_talkshows')->default(false);
            $table->text('other_activities_support')->nullable();

            $table->timestamps();

            $table->index('state');
            $table->index('category_of_participants');
            $table->index('gender');
        });
    }

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