improve and add models

This commit is contained in:
timurgordon
2025-06-12 05:22:17 +03:00
parent c3f6b91aa0
commit 00c4e6a1eb
19 changed files with 1520 additions and 42 deletions

View File

@@ -2,7 +2,6 @@ use rhai::plugin::*;
use rhai::{Engine, EvalAltResult, Position, Module, INT, Dynamic, Array};
use std::sync::Arc;
use std::mem;
use chrono::{DateTime, Utc};
use crate::db::Db;
use super::calendar::{Event, Attendee, Calendar, AttendanceStatus};
@@ -22,16 +21,6 @@ fn id_from_i64_to_u32(id_i64: i64) -> Result<u32, Box<EvalAltResult>> {
)
}
// Helper to convert i64 from Rhai to u64 for timestamps or other large numbers
fn val_from_i64_to_u64(val_i64: i64) -> Result<u64, Box<EvalAltResult>> {
u64::try_from(val_i64).map_err(|_|
Box::new(EvalAltResult::ErrorArithmetic(
format!("Failed to convert value '{}' to u64", val_i64).into(),
Position::NONE
))
)
}
#[export_module]
mod rhai_calendar_module {
// --- Event Functions ---