<?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_workflows', function (Blueprint $table) {
            $table->id();
            $table->foreignId('employee_id')->constrained('users');
            $table->date('date')->nullable()->comment('Date of report');
            $table->time('start_time')->nullable();
            $table->time('end_time')->nullable();
            $table->unsignedInteger('calls_made')->nullable()->comment('Number of calls made today');
            $table->unsignedInteger('positive_leads')->nullable()->comment('Number of positive leads today');
            $table->string('total_sales')->nullable();
            $table->enum('is_update_pending_and_leads', ['Yes', 'No', 'Other'])->nullable();
            $table->text('pending_and_leads_other_note')->nullable();
            $table->enum('is_worked_on_recovery_today', ['Yes', 'No', 'Other'])->nullable();
            $table->text('recovery_today_other_note')->nullable();
            $table->text('daily_report_summary')->nullable()->comment('Summary of daily work activities');
            $table->text('complaints_questions_comments')->nullable()->comment('Any complaints, questions, or comments');
            $table->foreignId('file_id')->nullable()->constrained('uploads');
            $table->unsignedTinyInteger('how_was_your_day_mark')->nullable()->comment('In Terms of Production, How was your day mark from 1-10');

            $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_workflows');
    }
};
