<?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()
    {
        Schema::create('vendors', function (Blueprint $table) {
            $table->uuid('id')->primary(); // Use UUID primary key
            $table->uuid('track_id')->unique();
            $table->string('business_name');
            $table->string('contact_name');
            $table->string('email')->unique();
            $table->string('phone')->nullable();
            $table->string('business_address');
            $table->string('website')->nullable();
            $table->json('vendor_type'); // use JSON to store multiple types like ['service_provider', 'material_seller']
            $table->json('print_services')->nullable();
            $table->text('machine_types')->nullable();
            $table->string('turnaround_time')->nullable();
            $table->json('materials_sold')->nullable();
            $table->string('pricing_file')->nullable();
            $table->string('minimum_order_qty')->nullable();
            $table->string('cac_document')->nullable();
            $table->text('additional_notes')->nullable();
            $table->timestamps();
        });
    }


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