syntax = "proto3";

package worldmonitor.news.v1;

import "sebuf/http/annotations.proto";
import "worldmonitor/news/v1/news_item.proto";

message ListFeedDigestRequest {
  // Digest variant: full, tech, finance, happy, commodity. Unsupported site variants, including energy, currently fall back to full.
  string variant = 1 [(sebuf.http.query) = { name: "variant" }];
  // ISO 639-1 language code (en, fr, ar, etc.)
  string lang = 2 [(sebuf.http.query) = { name: "lang" }];
}

message ListFeedDigestResponse {
  // Per-category buckets — keys match category names from feed config
  map<string, CategoryBucket> categories = 1;
  // Per-feed status — only non-ok states emitted; absent key implies ok.
  // Values: empty (feed returned 0 items), timeout (timed out during fetch),
  // all-undated (every parsed item lacked a usable date), partial-undated
  // (some parsed items lacked a usable date).
  map<string, string> feed_statuses = 2;
  // ISO 8601 timestamp of when this digest was generated
  string generated_at = 3;
}

message CategoryBucket {
  repeated NewsItem items = 1;
}
