<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Carbon\Carbon;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        $now = Carbon::now();

        // Menyisipkan akun BTKL Aktual ke tabel accounts
        DB::table('accounts')->insert([
            'code'       => '5001',
            'name'       => 'Biaya Upah Harian Pabrik (BTKL Aktual)',
            'group'      => 'expense',
            'category'   => 'HPP',
            'is_active'  => 1,
            'created_at' => $now,
            'updated_at' => $now,
        ]);
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        DB::table('accounts')->where('code', '5001')->delete();
    }
};