JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Basic Issue data structures

Emilia - ⁨1⁩ year ago

parent: tbd commit: ⁨509aa4e

⁨giterated-models/src/issue/events.rs⁩ - ⁨1019⁩ bytes
Raw
1 use serde::{Deserialize, Serialize};
2
3 use crate::user::User;
4
5 use super::{IssueComment, IssueCommentRevision, IssueStatus, IssueTag};
6
7 #[derive(Hash, Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
8 pub struct IssueTimeline {
9 pub events: Vec<IssueEvent>,
10 }
11
12 #[derive(Hash, Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
13 pub struct IssueEvent {
14 /// The id of this event
15 pub id: u64,
16 /// Time at which the event was created
17 pub created: chrono::DateTime<chrono::Utc>,
18 /// User who triggered the event
19 pub triggeror: User,
20 /// Content of the event
21 pub content: IssueEventContent,
22 }
23
24 // TODO: serialize with flattened internal struct
25 #[derive(Hash, Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
26 pub enum IssueEventContent {
27 CommentCreated(IssueComment),
28 CommentRevised(IssueCommentRevision),
29 CommentDeleted(IssueComment),
30
31 Tagged(IssueTag),
32 Untagged(IssueTag),
33
34 StatusChanged(IssueStatus),
35
36 UserAssigned(User),
37 UserUnassigned(User),
38 }
39