<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('travel_meetings', function (Blueprint $table) {
            $table->id();
            $table->foreignId('travel_plan_id')->constrained();
            $table->foreignId('employee_id')->constrained('users');
            $table->date('date');
            $table->time('meeting_schedule_time')->nullable();
            $table->time('meeting_start_time')->nullable();
            $table->time('meeting_end_time')->nullable();
            $table->string('customer_company_name')->nullable();
            $table->string('customer_name')->nullable();
            $table->string('customer_email')->nullable();
            $table->string('customer_phone')->nullable();
            $table->text('purpose')->nullable();
            $table->text('remark')->nullable();
            $table->foreignId('file_id')->nullable()->constrained('uploads');
            $table->unsignedTinyInteger('rating_of_meeting_experience')->nullable();
            $table->foreignId('created_by')->nullable()->constrained('users');
            $table->foreignId('updated_by')->nullable()->constrained('users');

            $table->foreignId('company_id')->nullable()->default(1);
            $table->foreignId('branch_id')->nullable()->default(1);

            $table->timestamps();
        });
    }

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