<?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::table('service_assets', function (Blueprint $table) {
            // Daftar aksesori yang dibawa saat penyerahan (JSON array of strings)
            $table->text('accessories')->nullable()->after('sig_entry');
            // Catatan kondisi fisik perangkat saat masuk (goresan, penyok, dll.)
            $table->text('physical_condition')->nullable()->after('accessories');
            // Password / PIN opsional (plaintext, hanya untuk keperluan servis)
            $table->string('device_password', 100)->nullable()->after('physical_condition');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('service_assets', function (Blueprint $table) {
            $table->dropColumn(['accessories', 'physical_condition', 'device_password']);
        });
    }
};
