<?php

namespace App\Database\Seeds;

use CodeIgniter\Database\Seeder;

class BranchSeeder extends Seeder
{
    public function run(): void
    {
        $existing = $this->db->table('branches')->where('code', 'HQ')->get()->getRow();
        if ($existing) {
            return;
        }

        $this->db->table('branches')->insert([
            'name'       => 'Head Office',
            'code'       => 'HQ',
            'status'     => 'active',
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s'),
        ]);
    }
}
