syntax = "proto3";

package worldmonitor.economic.v1;

import "sebuf/http/annotations.proto";

// BlsObservation is a single BLS data point.
message BlsObservation {
  // Year of the observation.
  string year = 1;
  // Period code (e.g. "M01" for January, "A01" for annual).
  string period = 2;
  // Human-readable period name.
  string period_name = 3;
  // Observed value.
  string value = 4;
}

// BlsSeries is a BLS time series with metadata and observations.
message BlsSeries {
  // BLS series ID (e.g. "CES0500000001").
  string series_id = 1;
  // Human-readable series title.
  string title = 2;
  // Unit of measure.
  string units = 3;
  // Observations ordered by date ascending.
  repeated BlsObservation observations = 4;
}

// GetBlsSeriesRequest specifies which BLS series to retrieve.
message GetBlsSeriesRequest {
  // BLS series ID (e.g. "CES0500000001", "CIU1010000000000A").
  string series_id = 1 [(sebuf.http.query) = { name: "series_id" }];
  // Maximum number of observations to return. Defaults to 60.
  int32 limit = 2 [(sebuf.http.query) = { name: "limit" }];
}

// GetBlsSeriesResponse contains the requested BLS series data.
message GetBlsSeriesResponse {
  // The BLS time series, absent if not yet seeded or unavailable.
  BlsSeries series = 1;
}
