<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('catering_packages', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('hotel_id')->nullable()->index();
            $table->unsignedBigInteger('chef_id')->nullable()->index();
            $table->unsignedBigInteger('cuisine_id')->nullable()->index();
            $table->string('name');
            $table->string('slug')->index();
            $table->text('description')->nullable();
            $table->string('category', 30)->nullable();
            $table->string('unit', 20)->default('portion'); // litre|portion|tray|whole|kg|pack
            $table->decimal('price_per_unit', 12, 2)->default(0);
            $table->decimal('min_quantity', 10, 2)->default(1);
            $table->string('image')->nullable();
            $table->unsignedSmallInteger('lead_time_hours')->default(24);
            $table->boolean('available')->default(true);
            $table->boolean('featured')->default(false);
            $table->timestamps();
        });
    }

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