<?php

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

return new class extends Migration {
    public function up()
    {
        Schema::create('devices', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('client_id');
            $table->enum('client_type', ['client', 'customer'])->default('customer');
            $table->enum('type', ['laptop','pc','tablet','mac','hdd'])->default('laptop');
            $table->unsignedBigInteger('model_number_id');
            $table->boolean('case')->default(false);
            $table->boolean('psu')->default(false);
            $table->string('visual_inspection', 128)->nullable();
            $table->string('other_items', 128)->nullable();
            $table->unsignedBigInteger('created_by');
            $table->unsignedBigInteger('updated_by')->nullable();
            $table->timestamp('created_at')->useCurrent();
            $table->timestamp('updated_at')->useCurrent();
            $table->timestamp('deleted_at')->nullable();
            $table->boolean('has_antivirus')->nullable();
            $table->enum('antivirus', ['ESET','AVG','Avira','Avast','Kaspersky','Panda','Sophos','other'])->nullable();
            $table->date('antivirus_expiration_date')->nullable();
            $table->boolean('is_secure')->nullable();
            $table->boolean('has_viruses')->nullable();
            $table->integer('num_viruses')->nullable();
            $table->enum('ram_model', ['DDR2','DDR3','DDR4','other'])->nullable();
            $table->integer('ram_speed')->nullable();
            $table->boolean('ram_status')->nullable();
            $table->float('ram_size', 8, 2)->nullable();
            $table->float('recommended_ram_size', 8, 2)->nullable();
            $table->enum('hdd_model', ['SATA','ATA','SSD','Hybrid','mSATA','SCSI'])->nullable();
            $table->float('hdd_size', 8, 2)->nullable();
            $table->boolean('hdd_status')->nullable();
            $table->string('serial_number', 255)->nullable();
        });
    }

    public function down()
    {
        Schema::dropIfExists('devices');
    }
}; 