<?php

namespace App\Database\Seeds;

use CodeIgniter\Database\Seeder;

class CompanySettingsSeeder extends Seeder
{
    public function run(): void
    {
        $existing = $this->db->table('company_settings')->limit(1)->get()->getRow();
        if ($existing) {
            return;
        }

        $now = date('Y-m-d H:i:s');

        $this->db->table('company_settings')->insert([
            'name'                    => 'My Company',
            'legal_name'              => 'My Company W.L.L.',
            'currency_code'           => 'BHD',
            'currency_symbol'         => 'BD',
            'decimal_places'          => 3,
            'country'                 => 'Bahrain',
            'timezone'                => 'Asia/Bahrain',
            'locale'                  => 'en_BH',
            'date_format'             => 'd/m/Y',
            'fiscal_year_start_month' => 1,
            'created_at'              => $now,
            'updated_at'              => $now,
        ]);
    }
}
