syntax = "proto3";

package user_recover;

option go_package = "user_recover";

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

// SourceType is the source type of the account recovery.
enum SourceType {
  // default to invalid
  SOURCE_TYPE_INVALID = 0;
  // if source type is unknown
  SOURCE_TYPE_OTHER = 1;
  // if request came from a SIRT mass account run
  SOURCE_TYPE_BULK = 2;
  // if request came from admin panel
  SOURCE_TYPE_MANUAL = 3;
}

// UserRecoverCreate triggers when a account goes though the recovery process either in bulk during a SIRT or though admin panel.
message UserRecoverCreate {
  // At time of ownership implementation, this event has no publisher and so the owner is set to the EventBus team for now
  option (eventbus.owner.ldap_group) = "team-identity";
  // user id that was recovered
  string user_id = 1;
  // ldap of the staff who initiated the account-recovery , required
  string ldap_runner = 2;
  // What is the type/source of recovery being preformed, required
  // “manual”, “bulk”, “other”
  SourceType source_type = 3;
  // detail of the source, shows in admin panel audits, for example "SIRT-257" or "customer requested recovery"
  string source_detail = 4;
  // optional, when did the account become compromised
  google.protobuf.Timestamp compromised_at = 5;
}
