/**
 * A healthy `GET /api/health` body, for tests that need protection to be a
 * settled fact rather than the subject under test. Overrides are per condition,
 * so a test names only the one it is about.
 */

import type { Health } from "./types";

export function health(overrides: Partial<Health> = {}): Health {
	return {
		status: "ok",
		protection: { state: "active", until: null },
		upstreams: { state: "ok", available: 2, total: 2 },
		query_history: { state: "recording", dropped_total: 0, last_drop_s: null },
		diagnostics: { state: "recording", active_warnings: 0, active_errors: 0 },
		disk: { state: "ok", free_bytes: 40 * 1024 * 1024 * 1024 },
		...overrides,
	};
}
