syntax = "proto3";

package devvit.dev_portal.developer_account;

import "google/protobuf/timestamp.proto";

option go_package = "github.snooguts.net/reddit/reddit-devplatform-monorepo/go-common/generated/protos/types/devvit/dev_portal/developer_account";

message DeveloperAccountRegisterUserRequest {
  // Thing ID (T2 ID with prefix. eg, t2_123abc.)
  string user_id = 1;
  // Username
  string user_name = 2;
  bool does_consent_to_email = 3;
}

message GetUserAccountInfoResponse {
  // The version of the developer terms & conditions accepted by the user upon Developer Account creation (ie, 2)
  int32 accepted_terms_version = 1;
  // The current version of the developer terms & conditions
  int32 current_terms_version = 2;
  bool has_verified_email = 3;
  // User selected preferences for email communication from the Developer Platform
  bool does_consent_to_email = 4;
  // Thing ID (T2 ID with prefix. eg, t2_123abc.), optional because user could be logged out
  optional string user_id = 5;
}

message DeveloperAccountInfo {
  // UUID of the Developer Account, assigned in database
  string id = 1;
  // Thing I (T2 ID with prefix. eg, t2_123abc.), optional because user could be logged out
  string user_id = 2;
  // User's reddit username (eg, "spez")
  string user_name = 3;

  google.protobuf.Timestamp created_at = 4;
  // The version of the developer terms & conditions accepted by the user upon Developer Account creation (ie, 2)
  int32 accepted_terms_version = 5;
  // Timestamp of when the user accepted the current developer terms & conditions
  google.protobuf.Timestamp accepted_terms_version_at = 6;
  // Whether the user has verified the email address associated with their Reddit Account
  bool has_verified_email = 7;
  // User selected preferences for email communication from the Developer Platform
  bool does_consent_to_email = 8;
}
