<?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('loans', function (Blueprint $table) {
            $table->integer('fine_overdue')->default(0)->after('status');
            $table->integer('fine_damage')->default(0)->after('fine_overdue');
            $table->string('condition')->nullable()->after('fine_damage');
            $table->text('return_notes')->nullable()->after('condition');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('loans', function (Blueprint $table) {
            $table->dropColumn(['fine_overdue', 'fine_damage', 'condition', 'return_notes']);
        });
    }
};
