<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('cup_sizes', function (Blueprint $table) {
            $table->id();
            $table->string('name'); // e.g., "Single Scoop", "Double Scoop", "Triple Scoop", "6 Scoop Cup"
            $table->string('code')->unique(); // e.g., "SINGLE", "DOUBLE", "TRIPLE", "SIX"
            $table->integer('scoop_count'); // Number of scoops (for reference)
            $table->decimal('weight_grams', 8, 2); // Total weight in grams
            $table->decimal('price', 8, 2)->nullable(); // Base price for this cup size
            $table->text('description')->nullable();
            $table->boolean('is_active')->default(true);
            $table->integer('display_order')->default(0);
            $table->timestamps();
        });
    }

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