<?php
declare(strict_types=1);

return function (\App\Core\Database $db): void {
    $exists = $db->selectOne(
        "SELECT 1 FROM chart_of_accounts WHERE account_code = ?",
        ['12060102']
    );

    if (!$exists) {
        $db->insert('chart_of_accounts', [
            'account_code'    => '12060102',
            'name_ar'         => 'صندوق الخزنة الفرعية - الأنشطة الرياضية',
            'name_en'         => 'Sub-Treasury Cash - Sports Activities',
            'parent_code'     => '120601',
            'level'           => 5,
            'account_nature'  => 'debit',
            'is_header'       => 0,
            'is_active'       => 1,
            'current_balance' => '0.00',
            'created_at'      => date('Y-m-d H:i:s'),
            'updated_at'      => date('Y-m-d H:i:s'),
        ]);
    }
};
