syntax = "proto3";

package worldmonitor.economic.v1;

import "buf/validate/validate.proto";
import "sebuf/http/annotations.proto";

// FredObservation represents a single data point from a FRED economic series.
message FredObservation {
  // Observation date as YYYY-MM-DD string.
  string date = 1;
  // Observation value.
  double value = 2;
}

// FredSeries represents a FRED time series with metadata.
message FredSeries {
  // Series identifier (e.g., "GDP", "UNRATE", "CPIAUCSL").
  string series_id = 1 [
    (buf.validate.field).required = true,
    (buf.validate.field).string.min_len = 1
  ];
  // Series title.
  string title = 2;
  // Unit of measurement.
  string units = 3;
  // Data frequency (e.g., "Monthly", "Quarterly").
  string frequency = 4;
  // Observations in the series.
  repeated FredObservation observations = 5;
}

// WorldBankCountryData represents a World Bank indicator value for a country.
message WorldBankCountryData {
  // ISO 3166-1 alpha-2 country code.
  string country_code = 1 [
    (buf.validate.field).required = true,
    (buf.validate.field).string.min_len = 1
  ];
  // Country name.
  string country_name = 2;
  // World Bank indicator code (e.g., "NY.GDP.MKTP.CD").
  string indicator_code = 3 [
    (buf.validate.field).required = true,
    (buf.validate.field).string.min_len = 1
  ];
  // Indicator name.
  string indicator_name = 4;
  // Data year.
  int32 year = 5;
  // Indicator value.
  double value = 6;
}

// EnergyPrice represents a current energy commodity price from EIA.
message EnergyPrice {
  // Energy commodity identifier.
  string commodity = 1 [
    (buf.validate.field).required = true,
    (buf.validate.field).string.min_len = 1
  ];
  // Human-readable name (e.g., "WTI Crude Oil", "Henry Hub Natural Gas").
  string name = 2;
  // Current price in USD.
  double price = 3;
  // Unit of measurement (e.g., "$/barrel", "$/MMBtu").
  string unit = 4;
  // Percentage change from previous period.
  double change = 5;
  // Price date, as Unix epoch milliseconds.
  int64 price_at = 6 [(sebuf.http.int64_encoding) = INT64_ENCODING_NUMBER];
}
