<?php

use App\Database\Blueprint;
use App\Enums\DbStatusFieldEnum;
use Illuminate\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('suppliers', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('hooreycaId'); // hooreyca azonosito
            $table->string('nameId'); // betu azonosito
            $table->string('orderEmail');
            $table->string('orderEmail2')->nullable();
            $table->string('address');
            $table->string('mailingAddress')->nullable();
            $table->string('phone');
            $table->string('fax')->nullable();
            $table->string('customerServicePhone')->nullable();
            $table->string('note')->nullable(); // megjegyezes
            $table->enum('emailAttachmentType', ['pdf', 'excel', 'none'])->default('pdf');
            $table->string('logoFile')->nullable();
            $table->boolean('canSee')->default(true);
            $table->enum('status', DbStatusFieldEnum::getValues())->default(DbStatusFieldEnum::draft);
            $table->timestamps();
            $table->softDeletes();
            $table->userIdFields();
        });
    }

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