<?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('receivings', function (Blueprint $table) {
            $table->id();
            $table->date('receiving_date');
            $table->string('supplier')->nullable();
            $table->enum('type', ['feed', 'vaccine']); // matches UI selection
            $table->enum('mode', ['manual', 'mos', 'qr']); // how it was received
            $table->string('external_reference')->nullable(); // QR / MOS ref
            $table->text('remarks')->nullable();
            $table->foreignId('user_id');
            $table->softDeletes();
            $table->timestamps();
        });
    }

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