// forecast_queries.go contains SQL text for hourly forecast reads.
// Layer: adapters/outbound/postgres forecast feature.
package postgres

const (
	queryLatestHourlyForecast = `
SELECT
  event_id,
  location_id,
  location_name,
  issued_at,
  updated_at,
  product,
  latitude,
  longitude,
  elevation_meters
FROM forecasts
WHERE product = 'hourly'
ORDER BY issued_at DESC, event_emitted_at DESC
LIMIT 1`

	queryForecastPeriods = `
SELECT
  period_index,
  start_time,
  end_time,
  name,
  is_day,
  condition_code,
  condition_text,
  provider_raw_description,
  text_description,
  detailed_text,
  icon_url,
  temperature_c,
  temperature_c_min,
  temperature_c_max,
  dewpoint_c,
  relative_humidity_percent,
  wind_direction_degrees,
  wind_speed_kmh,
  wind_gust_kmh,
  barometric_pressure_pa,
  visibility_meters,
  apparent_temperature_c,
  cloud_cover_percent,
  probability_of_precipitation_percent,
  precipitation_amount_mm,
  snowfall_depth_mm,
  uv_index
FROM forecast_periods
WHERE run_event_id = $1
ORDER BY period_index ASC`
)
