syntax = "proto3";

package worldmonitor.natural.v1;

import "sebuf/http/annotations.proto";

message NaturalEvent {
  string id = 1;
  string title = 2;
  string description = 3;
  string category = 4;
  string category_title = 5;
  double lat = 6;
  double lon = 7;
  int64 date = 8 [(sebuf.http.int64_encoding) = INT64_ENCODING_NUMBER];
  double magnitude = 9;
  string magnitude_unit = 10;
  string source_url = 11;
  string source_name = 12;
  bool closed = 13;

  // Optional tropical cyclone fields (populated for severeStorms from GDACS TC / NHC)
  optional string storm_id = 14;
  optional string storm_name = 15;
  optional string basin = 16;
  optional int32 storm_category = 17;
  optional string classification = 18;
  optional int32 wind_kt = 19;
  optional int32 pressure_mb = 20;
  optional int32 movement_dir = 21;
  optional int32 movement_speed_kt = 22;
  repeated ForecastPoint forecast_track = 23;
  repeated CoordRing cone_polygon = 24;
  repeated PastTrackPoint past_track = 25;
}

message ForecastPoint {
  double lat = 1;
  double lon = 2;
  int32 hour = 3;
  int32 wind_kt = 4;
  int32 category = 5;
}

message PastTrackPoint {
  double lat = 1;
  double lon = 2;
  int32 wind_kt = 3;
  int64 timestamp = 4 [(sebuf.http.int64_encoding) = INT64_ENCODING_NUMBER];
}

message Coordinate {
  double lon = 1;
  double lat = 2;
}

message CoordRing {
  repeated Coordinate points = 1;
}

message ListNaturalEventsRequest {
  int32 days = 1 [(sebuf.http.query) = { name: "days" }];
}

message ListNaturalEventsResponse {
  repeated NaturalEvent events = 1;
}
