<?php
// catalog/bancos.php — Lista todos los bancos disponibles
declare(strict_types=1);
require_once dirname(__FILE__) . '/../config.php';
$db   = getDB();
$stmt = $db->query('SELECT idbanco AS id, nombre FROM banco ORDER BY nombre ASC');
$rows = $stmt->fetchAll();
foreach ($rows as &$r) {
    $r['id'] = (int)$r['id'];
}
unset($r);
jsonOk(['bancos' => $rows]);
