<?php

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

class CreateDailyMeetingReportsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('daily_meeting_reports', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('client_id')->nullable()->unsigned();
            $table->foreign('client_id')->references('id')->on('clients');
            $table->string('contact_person')->nullable();
            $table->datetime('from')->nullable();
            $table->datetime('to')->nullable();
            $table->string('purpose_of_visit')->nullable();
            $table->string('feedback')->nullable();
            $table->bigInteger('outcome_id')->nullable()->unsigned();
            $table->foreign('outcome_id')->references('id')->on('outcome');
            $table->string('reason')->nullable();
            $table->bigInteger('communication_mode_id')->nullable()->unsigned();
            $table->foreign('communication_mode_id')->references('id')->on('communication_mode');
            $table->enum('status', ['pending', 'active', 'follow_up','converted','positive','negative','other'])->nullable();
            $table->timestamps();
        });
    }

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