syntax = "proto3";

package subscriber_badge_flair;

option go_package = "subscriber_badge_flair";

import "eventbus/owner.proto";

// SubscriberBadgeFlairCreate triggers when a user uploads a new subscriber badge flair.
message SubscriberBadgeFlairCreate {
  option (eventbus.owner.ldap_group) = "team-subs";
  // user_id refers to the creator who uploaded a new subscriber badge.
  string user_id = 1;
  // flair is the subscriber badge modifier asset that is to be composited over a subscriber badge.
  BadgeAsset flair = 2;
  // tier refers to the subscription tier of badges that this flair will display on.
  Tier tier = 3;
}

// BadgeAsset is the badge related asset uploaded in various sizes.
message BadgeAsset {
  // image_url_1x refers to the url of the 18x18 asset.
  string image_url_1x = 1;
  // image_url_2x refers to the url of the 36x36 asset.
  string image_url_2x = 2;
  // image_url_4x refers to the url of the 72x72 asset.
  string image_url_4x = 3;
}

// Tier the tier value of sub that is attached.
message Tier {
  // the value can be either
  // - an enumerated value (tier 1, 2, 3 subs)
  // - a custom string value (OWL ticket product, legacy ticket products)
  oneof value {
    SubTier numeral = 1;
    string custom = 2;
  }
}

// SubTier is the enumerated values that a sub is normally.
enum SubTier {
  // default case is an invalid sub tier
  SUB_TIER_INVALID = 0;
  // tier 1 subs
  SUB_TIER_1 = 1;
  // tier 2 subs
  SUB_TIER_2 = 2;
  // tier 3 subs
  SUB_TIER_3 = 3;
}
