use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Post {
pub id: String,
pub title: String,
pub content: String,
pub markdown: String,
pub status: PostStatus,
pub slug: Option<String>,
pub content_type: Option<ContentType>,
pub created_at: String,
pub updated_at: String,
pub recommendations: Option<serde_json::Value>,
pub source_metadata: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum PostStatus {
Draft,
Published,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ContentType {
Changelog,
BlogPost,
LinkedinPost,
TwitterPost,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum Sort {
Asc,
Desc,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum LookbackWindow {
CurrentDay,
Yesterday,
Last7Days,
Last14Days,
Last30Days,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DataPoints {
pub commits: bool,
pub pull_requests: bool,
pub releases: bool,
pub linear_data: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SelectedItems {
pub commits: Option<Vec<String>>,
pub pull_requests: Option<Vec<String>>,
pub releases: Option<Vec<String>>,
pub linear_issues: Option<Vec<String>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Repository {
pub owner: String,
pub repo: String,
}