<?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('submissions', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('member_id')->nullable();
            $table->string('surname');
            $table->string('first_name');
            $table->date('dob');
            $table->string('gender');
            $table->string('mobile');
            $table->string('email')->nullable();
            $table->boolean('disability')->default(false);
            $table->text('disability_details')->nullable();
            $table->text('address')->nullable();
            $table->string('emergency_name');
            $table->string('relationship');
            $table->string('emergency_phone');
            $table->string('membership_type');
            $table->string('package');
            $table->integer('admission_fee')->default(0);
            $table->string('referral_source')->nullable();
            $table->string('profile_pic')->nullable();
            $table->string('signature')->nullable();
            $table->string('staff_signature')->nullable();
            $table->dateTime('approval_date')->nullable();
            $table->dateTime('expiry_date')->nullable();
            $table->dateTime('next_payment_date')->nullable();
            $table->dateTime('induction_date')->nullable();
            $table->string('qr_code_url')->nullable();
            $table->string('status')->default('pending');
            $table->string('application_number')->nullable();
            $table->string('finger_id')->nullable();
            $table->timestamps();
        });
    }

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