use serde::{Deserialize, Serialize}; use crate::user::User; use super::{IssueComment, IssueCommentRevision, IssueStatus, IssueTag}; #[derive(Hash, Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct IssueTimeline { pub events: Vec, } #[derive(Hash, Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct IssueEvent { /// The id of this event pub id: u64, /// Time at which the event was created pub created: chrono::DateTime, /// User who triggered the event pub triggeror: User, /// Content of the event pub content: IssueEventContent, } // TODO: serialize with flattened internal struct #[derive(Hash, Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub enum IssueEventContent { CommentCreated(IssueComment), CommentRevised(IssueCommentRevision), CommentDeleted(IssueComment), Tagged(IssueTag), Untagged(IssueTag), StatusChanged(IssueStatus), UserAssigned(User), UserUnassigned(User), }