syntax = "proto3";

package channel_ad_free_benefit;

option go_package = "channel_ad_free_benefit";

import "eventbus/owner.proto";

// ChannelAdFreeBenefitUpdate triggers when the ad free benefit changes for a channel.
message ChannelAdFreeBenefitUpdate {
  option (eventbus.owner.ldap_group) = "team-subs";
  // The broadcaster_user_id represents the user who owns the product this benefit belongs to.
  string broadcaster_user_id = 1;
  // The benefit_state represents the state of the benefit.
  BenefitStateChange benefit_state = 2;
}

// A `BenefitState` is state of the ad free benefit.
enum BenefitState {
  BENEFIT_STATE_INVALID = 0;
  BENEFIT_STATE_ACTIVE = 1;
  BENEFIT_STATE_INACTIVE = 2;
}

// An object representing the benefit state change.
message BenefitStateChange {
  bool updated = 1;
  BenefitState value = 2;
  bool has_old_value = 3;
  BenefitState old_value = 4;
}
