Files
AstralRinth/src/models/teams.rs
2020-09-28 10:48:15 -07:00

32 lines
833 B
Rust

use super::ids::Base62Id;
use serde::{Deserialize, Serialize};
use crate::models::users::UserId;
//TODO Implement Item for teams
/// The ID of a team
#[derive(Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(from = "Base62Id")]
#[serde(into = "Base62Id")]
pub struct TeamId(pub u64);
// TODO: permissions, role names, etc
/// A team of users who control a mod
#[derive(Serialize, Deserialize)]
pub struct Team {
/// The id of the team
pub id: TeamId,
/// A list of the members of the team
pub members: Vec<TeamMember>,
}
/// A member of a team
#[derive(Serialize, Deserialize, Clone)]
pub struct TeamMember {
/// The ID of the user associated with the member
pub user_id: UserId,
/// The name of the user
pub name: String,
///The role of the use in the team
pub role: String,
}