syntax = "proto3";

package worldmonitor.forecast.v1;

import "sebuf/http/annotations.proto";
import "worldmonitor/forecast/v1/forecast.proto";

message GetForecastsRequest {
  // Forecast domain to retrieve, such as geopolitics, markets, or climate.
  string domain = 1 [(sebuf.http.query) = { name: "domain" }];
  // Optional geographic or thematic region filter for forecasts.
  string region = 2 [(sebuf.http.query) = { name: "region" }];
}

message GetForecastsResponse {
  repeated Forecast forecasts = 1;
  int64 generated_at = 2 [(sebuf.http.int64_encoding) = INT64_ENCODING_NUMBER];
  // True when the forecast backend could not read the canonical cache.
  // Distinguishes an outage from a healthy empty forecast set.
  bool degraded = 3;
  // True when forecasts are served from a stale fallback. Currently false for
  // this endpoint because get-forecasts does not have a stale fallback cache.
  bool stale = 4;
  // Stable machine-readable reason when degraded=true, empty otherwise.
  // Value: "forecast_backend_unavailable" on Redis/backend read failures.
  string error = 5;
}
