feat: Improve database handling of model indices #6

Merged
timur merged 8 commits from development_fix_loading_records into main 2025-06-25 16:45:07 +00:00
Showing only changes of commit 20c075ec51 - Show all commits

View File

@ -101,6 +101,16 @@ pub struct Event {
}
impl Event {
/// Converts the event to a JSON string
pub fn to_json(&self) -> Result<String, serde_json::Error> {
serde_json::to_string(self)
}
/// Creates an event from a JSON string
pub fn from_json(json: &str) -> Result<Self, serde_json::Error> {
serde_json::from_str(json)
}
/// Creates a new event with auto-generated ID
pub fn new(title: impl ToString, start_time: DateTime<Utc>, end_time: DateTime<Utc>) -> Self {
Self {