syntax = "proto3";

package worldmonitor.trade.v1;

import "sebuf/http/annotations.proto";
import "worldmonitor/trade/v1/trade_data.proto";

// Request for SPS/TBT trade barrier notifications.
message GetTradeBarriersRequest {
  // WTO member codes to filter by. Empty = all.
  // Accepted but currently ignored; no-op until this handler supports the parameter.
  repeated string countries = 1 [(sebuf.http.query) = { name: "countries" }, (sebuf.http.unimplemented) = true];
  // Filter by measure type: "SPS", "TBT", or empty for both.
  // Accepted but currently ignored; no-op until this handler supports the parameter.
  string measure_type = 2 [(sebuf.http.query) = { name: "measure_type" }, (sebuf.http.unimplemented) = true];
  // Max results to return (server caps at 100).
  int32 limit = 3 [(sebuf.http.query) = { name: "limit" }];
}

// Response containing trade barrier notifications.
message GetTradeBarriersResponse {
  // List of SPS/TBT barrier notifications.
  repeated TradeBarrier barriers = 1;
  // ISO 8601 timestamp when data was fetched from WTO.
  string fetched_at = 2;
  // True if upstream fetch failed and results may be stale/empty.
  bool upstream_unavailable = 3;
}
