<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tour_packages', function (Blueprint $table) {
            $table->id();
            $table->text('title');
            $table->text('description')->nullable();
            $table->text('image_url')->nullable();

            $table->foreignId('province_id')->nullable();

            $table->enum('package_type',['private','share'])->default('private');
            $table->enum('tour_size',['xs','s','m','l','xl'])->default('m');
            $table->enum('pickup',['avialable','unavialable'])->default('avialable');

            $table->boolean('is_one_day_trip')->default(1);
            $table->integer('minimun')->default(2);
            $table->integer('maximum')->default(8);

            $table->text('not_suitable_for')->nullable();
            $table->text('cancellation')->nullable();
            $table->text('preparation')->nullable();
            $table->text('booking_condition')->nullable();
            $table->text('what_included')->nullable();
            $table->text('what_not_included')->nullable();

            $table->double('price_per_person')->default(0.00);
            $table->double('discount')->default(0.00);

            $table->foreignId('travel_agency_id')->nullable();

            $table->double('rating')->default(0);
            $table->boolean('status')->default(1);

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

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