syntax = "proto3";

package worldmonitor.trade.v1;

import "sebuf/http/annotations.proto";
import "worldmonitor/trade/v1/get_trade_restrictions.proto";
import "worldmonitor/trade/v1/get_tariff_trends.proto";
import "worldmonitor/trade/v1/get_trade_flows.proto";
import "worldmonitor/trade/v1/get_trade_barriers.proto";
import "worldmonitor/trade/v1/get_customs_revenue.proto";
import "worldmonitor/trade/v1/list_comtrade_flows.proto";

// Trade policy intelligence from WTO and US Treasury data sources.
service TradeService {
  option (sebuf.http.service_config) = {base_path: "/api/trade/v1"};

  // Get quantitative restrictions and export controls.
  rpc GetTradeRestrictions(GetTradeRestrictionsRequest) returns (GetTradeRestrictionsResponse) {
    option (sebuf.http.config) = {path: "/get-trade-restrictions", method: HTTP_METHOD_GET};
  }

  // Get tariff rate timeseries for a country pair.
  rpc GetTariffTrends(GetTariffTrendsRequest) returns (GetTariffTrendsResponse) {
    option (sebuf.http.config) = {path: "/get-tariff-trends", method: HTTP_METHOD_GET};
  }

  // Get bilateral merchandise trade flows.
  rpc GetTradeFlows(GetTradeFlowsRequest) returns (GetTradeFlowsResponse) {
    option (sebuf.http.config) = {path: "/get-trade-flows", method: HTTP_METHOD_GET};
  }

  // Get SPS/TBT barrier notifications.
  rpc GetTradeBarriers(GetTradeBarriersRequest) returns (GetTradeBarriersResponse) {
    option (sebuf.http.config) = {path: "/get-trade-barriers", method: HTTP_METHOD_GET};
  }

  // Get US customs duties revenue (Treasury MTS data, seeded by Railway).
  rpc GetCustomsRevenue(GetCustomsRevenueRequest) returns (GetCustomsRevenueResponse) {
    option (sebuf.http.config) = {path: "/get-customs-revenue", method: HTTP_METHOD_GET};
  }

  // List UN Comtrade strategic commodity flows with anomaly detection.
  rpc ListComtradeFlows(ListComtradeFlowsRequest) returns (ListComtradeFlowsResponse) {
    option (sebuf.http.config) = {path: "/list-comtrade-flows", method: HTTP_METHOD_GET};
  }
}
