use rocket::serde::Serialize; #[derive(Serialize, Copy, Clone)] pub enum ReviewState { Draft, Open, Dropped, Closed, } #[derive(Serialize)] pub struct User { pub id: u64, pub username: String, pub name: String, pub active: bool, } #[derive(Serialize)] pub struct Review { pub id: u64, pub title: String, pub description: String, pub owner: User, pub reviewers: Vec, pub watchers: Vec, pub state: ReviewState, pub progress: f32, } #[derive(Serialize)] pub struct ReviewEntry { pub id: u64, pub title: String, pub owner: User, pub state: ReviewState, pub progress: f32, } #[derive(Serialize)] pub struct Reviews { pub offset: u32, pub limit: u32, pub total_count: u32, pub more: bool, pub reviews: Vec, } #[derive(Serialize)] pub struct Project { pub id: u64, pub title: String, pub description: String, pub members: Vec, } #[derive(Serialize)] pub struct ProjectEntry { pub id: u64, pub title: String, } #[derive(Serialize)] pub struct Projects { pub offset: u32, pub limit: u32, pub total_count: u32, pub more: bool, pub projects: Vec, } #[derive(Serialize)] pub struct StatusResponse { pub ok: bool, #[serde(skip_serializing_if = "Option::is_none")] pub error: Option, }