/** Default 30-minute cache for HO nostro / reserve Fineract snapshots (near-realtime audit cadence). */
export const OMNL_HO_LIQUIDITY_CACHE_MS_DEFAULT = 30 * 60 * 1000;

export function hoLiquidityCacheMs(): number {
  const raw = process.env.OMNL_CASH_IN_BANK_CACHE_MS
    || process.env.OMNL_RESERVE_COVERAGE_CACHE_MS
    || process.env.OMNL_OFFICE_GL_CACHE_MS;
  if (raw != null && String(raw).trim() !== '') {
    const parsed = Number(raw);
    if (Number.isFinite(parsed) && parsed > 0) return parsed;
  }
  return OMNL_HO_LIQUIDITY_CACHE_MS_DEFAULT;
}
