fix: Use incremental ID

This commit is contained in:
Mahmoud Emad
2025-05-17 13:46:16 +03:00
parent a676854251
commit 57f59da43e
10 changed files with 519 additions and 156 deletions

View File

@@ -142,10 +142,16 @@ impl Calendar {
/// Creates a new calendar with auto-generated ID
///
/// # Arguments
/// * `id` - Optional ID for the calendar (use None for auto-generated ID)
/// * `name` - Name of the calendar
pub fn new(name: impl ToString) -> Self {
pub fn new(id: Option<u32>, name: impl ToString) -> Self {
let mut base_data = BaseModelData::new();
if let Some(id) = id {
base_data.update_id(id);
}
Self {
base_data: BaseModelData::new(),
base_data,
name: name.to_string(),
description: None,
events: Vec::new(),