syntax = "proto3";

package cheer;

option go_package = "cheer";

import "eventbus/authorization.proto";
import "eventbus/owner.proto";

// CheerCreate triggers when a user successfully cheers bits at a broadcaster.
message CheerCreate {
  option (eventbus.owner.ldap_group) = "team-payday";
  // The unique bits transaction associated with this cheer
  string bits_transaction_id = 1;
  // The recipient of the bits, as a unique user identifier (not display name)
  string to_user_id = 2;
  // The details of the user sending the bits can come in 1 of 2 forms:
  // - An identified user, in which case some additional information is provided
  // - An anonymous user, in which case no additional information is available
  oneof from {
    User user = 3;
    AnonymousUser anonymous_user = 4;
  }
  // The chat message that accompanied this cheer
  string public_message = 5;
  // The number of bits cheered to the broadcaster
  sint64 bits = 6;
}

// User information, when cheer is not made anonymously.
// Contains additional public information to contextualize the cheer transaction.
message User {
  // The spender of the bits, as a unique user identifier (not display name)
  string id = 1;
}

// AnonymousUser contains a restricted field for the anonymous cheerer.
message AnonymousUser {
  // The spender of the bits, as a unique user identifier (not display name)
  eventbus.authorization.String id = 1 [(eventbus.authorization.data_classification) = "restricted"];
}
