Refactor: Remove unused structs, redundant services, and streamline repository models
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
use chrono::Utc;
|
||||
use regex::Regex;
|
||||
|
||||
|
||||
@@ -20,20 +19,6 @@ pub fn create_unique_id(existing_id: Option<&str>) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the current date as an ISO 8601 string.
|
||||
/// Equivalent to TS `System.getCurrentDate()`.
|
||||
pub fn get_current_date() -> String {
|
||||
Utc::now().to_rfc3339()
|
||||
}
|
||||
|
||||
/// Converts an ISO date string to a MySQL-compatible date (YYYY-MM-DD).
|
||||
/// Equivalent to TS `System.dateToMySqlDate()`.
|
||||
pub fn date_to_mysql_date(iso_date_string: &str) -> String {
|
||||
match chrono::DateTime::parse_from_rfc3339(iso_date_string) {
|
||||
Ok(date_object) => date_object.format("%Y-%m-%d").to_string(),
|
||||
Err(_) => iso_date_string.to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Converts HTML content to plain text by stripping tags and decoding entities.
|
||||
/// Equivalent to TS `System.htmlToText()`.
|
||||
|
||||
Reference in New Issue
Block a user