<?php

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

return new class extends Migration {
    public function up()
    {
        Schema::create('hr_user_details', function (Blueprint $table) {
            $table->unsignedBigInteger('user_id')->primary();
            $table->string('national_insurance', 15)->nullable();
            $table->string('address', 255)->nullable();
            $table->string('address2', 255)->nullable();
            $table->string('postcode', 255)->nullable();
            $table->unsignedBigInteger('department_id')->nullable();
            $table->float('rate_per_hour', 8, 2)->default(7.00);
            $table->unsignedInteger('annual_leaves')->default(28);
            $table->string('default_start_time', 5)->default('09:00');
            $table->string('default_end_time', 5)->default('17:00');
            $table->timestamps();
        });
    }

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