syntax = "proto3";

package prediction_event;

option go_package = "prediction_event";

import "eventbus/owner.proto";
import "google/protobuf/timestamp.proto";

// PredictionEventCreate triggers when a new prediction event is created on a channel.
message PredictionEventCreate {
  option (eventbus.owner.ldap_group) = "team-predictions-prod";
  // The prediction events unique ID.
  string id = 1;
  // The ID of the channel the prediction event belongs to.
  string user_id = 2;
  // The title of the prediction event.
  string title = 3;
  // The outcomes for the prediction event.
  repeated Outcome outcomes = 4;
  // The window in seconds for users to make predictions on the prediction event.
  int64 prediction_window_seconds = 5;
  // The status of the prediction event.
  PredictionEventStatus status = 6;
  // Timestamp of when the prediction event was created.
  google.protobuf.Timestamp created_at = 7;
}

// Outcome contains the information for an outcome of the prediction event.
message Outcome {
  // The outcomes unique ID.
  string id = 1;
  // The color assigned to the outcome.
  OutcomeColor color = 2;
  // The title of the outcome.
  string title = 3;
}

// OutcomeColor is the different colors an outcome can have.
enum OutcomeColor {
  OUTCOME_COLOR_INVALID = 0;
  // Blue
  OUTCOME_COLOR_BLUE = 1;
  // Pink
  OUTCOME_COLOR_PINK = 2;
}

// PredictionEventStatus is the different statuses a prediction event can have.
enum PredictionEventStatus {
  PREDICTION_EVENT_STATUS_INVALID = 0;
  // The prediction event is active and users can make predictions.
  PREDICTION_EVENT_STATUS_ACTIVE = 1;
  // The prediction event has been locked and users can no longer make predictions.
  PREDICTION_EVENT_STATUS_LOCKED = 2;
  // The prediction event has had a winning outcome chosen and the points are being distributed to the users with winning predictions.
  PREDICTION_EVENT_STATUS_RESOLVE_PENDING = 3;
  // The prediction event has had a winning outcome chosen and the points have been distributed to the users with winning predictions.
  PREDICTION_EVENT_STATUS_RESOLVED = 4;
  // The prediction event has been canceled and the points are being refunded to users.
  PREDICTION_EVENT_STATUS_CANCEL_PENDING = 5;
  // The prediction event has been canceled and the points have been refunded to users.
  PREDICTION_EVENT_STATUS_CANCELED = 6;
}
