/**
 * The clear day.
 *
 * This is what a box with no weather source configured serves, and it is a
 * supported steady state rather than an error path — the default value of
 * `TERA_WEATHER_SOURCE` is `none`, so this is what the acceptance test sees.
 * It is also what a configured source falls back to when it has never once
 * answered. CONTRACT.md §5.1.
 *
 * The numbers are deliberately unremarkable: a light scatter of cloud, no rain,
 * good visibility. Nothing here pretends to be an observation, which is what
 * `synthetic: true` is on the wire to say.
 */

import type { WeatherBody } from "../../../src/server/wire.ts";

export function clearDay(lat: number, lng: number, now = new Date()): WeatherBody {
  return {
    observedAt: now.toISOString(),
    source: "none",
    synthetic: true,
    location: { lat, lng },
    // Null rather than a plausible-looking number. A renderer reads cloud,
    // precipitation and visibility; inventing 18 °C would only ever be wrong.
    temperatureC: null,
    windKph: null,
    windDirDeg: null,
    cloudCover: 0.08,
    precipitation: 0,
    visibilityKm: 40,
    condition: "clear",
  };
}
