syntax = "proto3";

package slash.store;

option go_package = "gen/store";

message UserSetting {
  int32 user_id = 1;

  UserSettingKey key = 2;

  oneof value {
    GeneralSetting general = 3;
    AccessTokensSetting access_tokens = 4;
  }

  message GeneralSetting {
    string locale = 1;
    string color_theme = 2;
  }

  message AccessTokensSetting {
    message AccessToken {
      // The access token is a JWT token, including expiration time, issuer, etc.
      string access_token = 1;
      // A description for the access token.
      string description = 2;
    }
    repeated AccessToken access_tokens = 1; // Nested repeated field
  }
}

enum UserSettingKey {
  USER_SETTING_KEY_UNSPECIFIED = 0;
  // User general settings.
  USER_SETTING_GENERAL = 1;
  // User access tokens.
  USER_SETTING_ACCESS_TOKENS = 2;
}
