<?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('inventario_prendas', function (Blueprint $table) {
            $table->id();

            $table->foreignId('orden_produccion_id')
                ->constrained('orden_produccions')
                ->cascadeOnDelete();

            // Cantidades
            $table->integer('cantidad_terminada');
            $table->integer('cantidad_disponible');

            // Control
            $table->date('fecha_ingreso');

            $table->enum('estado', [
                'lista_despacho',
                'en_bodega'
            ])->default('en_bodega');

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

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