DROP VIEW IF EXISTS public.estadisticas_costos_ia;

ALTER TABLE ai.estadisticas_costos_ia
    ALTER COLUMN costo_total_usd TYPE numeric(12,6)
    USING costo_total_usd::numeric(12,6);

CREATE OR REPLACE VIEW public.estadisticas_costos_ia AS
SELECT
    id,
    origen,
    identificador_usuario,
    session_id,
    client_id,
    desglose_costos,
    costo_total_usd,
    costo_total_mxn,
    created_at,
    business_id,
    sucursal,
    tracking_key,
    capability_slug,
    runtime_package,
    tracking_scope,
    job_id,
    turn_id,
    login_id,
    actor_user_id,
    request_origin
FROM ai.estadisticas_costos_ia;
