syntax = "proto3";

package channel_points_custom_reward_redemption;

option go_package = "channel_points_custom_reward_redemption";

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

// ChannelPointsCustomRewardRedemptionCreate is triggered when a custom reward is redeemed on a channel.
message ChannelPointsCustomRewardRedemptionCreate {
  option (eventbus.owner.ldap_group) = "team-communications";
  // The redemption's unique ID.
  string id = 1;
  // The ID of the user who redeemed the reward.
  string user_id = 2;
  // The ID of the channel the reward was redeemed on.
  string broadcaster_user_id = 3;
  // The reward that was redeemed.
  CustomReward reward = 4;
  // The user-supplied input, if any.
  string user_input = 5;
  // The status of the redemption (UNFULFILLED, FULFILLED etc).
  RedemptionStatus status = 6;
  // The time the redemption was redeemed.
  google.protobuf.Timestamp redeemed_at = 7;
}

// CustomReward contains basic information about the reward that was redeemed.
message CustomReward {
  // The reward’s unique ID.
  string id = 1;
  // The ID of the channel the reward belongs to.
  string user_id = 2;
  // A short title used to describe the reward.
  string title = 3;
  // The user-facing prompt that was shown when the user redeemed the reward.
  string prompt = 4;
  // Number of points the reward cost.
  int64 cost = 5;
}

// RedemptionStatus is the different statuses a custom reward redemption can be in.
enum RedemptionStatus {
  REDEMPTION_STATUS_INVALID = 0;
  // The redemption hasn’t had an action taken on it.
  REDEMPTION_STATUS_UNFULFILLED = 1;
  // The redemption has been acted upon and fulfilled.
  REDEMPTION_STATUS_FULFILLED = 2;
  // The redemption has been canceled and the points were refunded.
  REDEMPTION_STATUS_CANCELED = 3;
  // The redemption was reported.
  REDEMPTION_STATUS_REPORTED = 4;
}
