<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('claim_requests', function (Blueprint $table) {
            $table->id();
            $table->uuid('uuid');
            $table->string('code')->index();
            $table->dateTime('submission_date')->nullable();
            $table->foreignId('member_id');
            $table->string('payment_type');
            $table->string('service_code');
            $table->foreignId('policy_id');
            $table->string('status')->nullable();
            $table->foreignId('claim_id')->nullable()->comment('After Claim is Created');

            $table->timestamps();
            $table->softDeletes();
            $table->unsignedBigInteger('created_by')->nullable()->index();
            $table->unsignedBigInteger('updated_by')->nullable()->index();
            $table->unsignedBigInteger('deleted_by')->nullable()->index();
        });
    }

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