<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('firstName')->nullable();
            $table->string('lastName')->nullable();
            $table->string('email')->unique()->nullable();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password')->nullable();
            $table->string('phone', 20)->nullable();
            $table->rememberToken()->nullable();
            $table->foreignId('current_team_id')->nullable();
            $table->string('profile_photo_path', 2048)->nullable();
            $table->string('sign_dir', 50)->nullable();
            $table->string('branch', 5)->nullable();
            $table->string('access',5)->nullable();
            $table->boolean('hints')->default(true)->nullable();
            $table->boolean('notifications')->default(false)->nullable();
            $table->boolean('clock')->default(1)->nullable();
            $table->boolean('e_status')->default(1);
            $table->string('pass_count', 1)->default(3)->nullable();
            $table->string('session_no',5)->nullable();
            $table->boolean('admin')->default(0)->nullable();
            $table->boolean('dash')->default(0)->nullable();
            $table->boolean('endowment')->default(0)->nullable();
            $table->boolean('reports')->default(true)->nullable();
            $table->boolean('quotation')->default(0)->nullable();
            $table->boolean('finance')->default(0)->nullable();
            $table->boolean('settings')->default(0)->nullable();
            $table->boolean('blocked')->default(0)->nullable();
            $table->string('blocked_reason', 255)->nullable();
            $table->string('blocked_by', 5)->nullable();
            $table->dateTime('blocked_at')->nullable();
            $table->boolean('deleted')->default(0)->nullable();
            $table->string('deleted_by', 5)->nullable();
            $table->softDeletes();
            $table->string('created_by', 5)->nullable();
            $table->string('stamp', 5)->nullable();
            $table->timestamps();
        });
    }

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