use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Comment {
pub id: i64,
pub issue_id: String,
pub author: String,
pub text: String,
pub created_at: DateTime<Utc>,
}
impl Comment {
pub fn new(
id: i64,
issue_id: impl Into<String>,
author: impl Into<String>,
text: impl Into<String>,
) -> Self {
Self {
id,
issue_id: issue_id.into(),
author: author.into(),
text: text.into(),
created_at: Utc::now(),
}
}
}