use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RedditPost {
    pub id: String,
    pub title: String,
    pub author: String,
    pub subreddit: String,
    pub score: i64,
    pub num_comments: u64,
    pub url: String,
    pub selftext: String,
    pub created_at: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RedditComment {
    pub id: String,
    pub author: String,
    pub body: String,
    pub score: i64,
    pub created_at: String,
    pub depth: u32,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RedditUser {
    pub name: String,
    pub karma: i64,
    pub created_at: String,
    pub is_gold: bool,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RedditThread {
    pub post: RedditPost,
    pub comments: Vec<RedditComment>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RedditListing {
    pub posts: Vec<RedditPost>,
    pub after: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RedditCommentsListing {
    pub comments: Vec<RedditComment>,
    pub after: Option<String>,
}

pub use tail_fin_common::ActionResult;
