Skip to main content

radicle_feed/models/
entry.rs

1use diesel::prelude::Insertable;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Insertable, Serialize, Deserialize, Clone)]
5#[serde(rename_all = "camelCase")]
6#[diesel(table_name = crate::schema::activity_feed_timeline)]
7pub struct TimelineEntry {
8    pub repo: String,
9    pub node: String,
10    pub cob_id: String,
11    pub typename: String,
12    pub last_operation_id: Option<String>,
13    pub operations: Vec<String>,
14}
15
16#[derive(Debug, Serialize, Insertable, Deserialize, Clone)]
17#[serde(rename_all = "camelCase")]
18#[diesel(table_name = crate::schema::activity_feed_operations)]
19pub struct OperationEntry {
20    pub rid: String,
21    pub repo_alias: Option<String>,
22    pub cob_title: String,
23    pub cob_status: String,
24    pub operation_id: String,
25    pub author: String,
26    pub author_alias: Option<String>,
27    pub actions: Vec<serde_json::Value>,
28    pub created_at: i32,
29    pub typename: String,
30}
31
32#[derive(Serialize, Deserialize, Clone)]
33#[serde(rename_all = "camelCase")]
34pub struct Stat {
35    pub typename: String,
36    pub count: i32,
37}