use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use crate::db::core::{SledModel, Storable}; // Import Sled traits from new location // use std::collections::HashMap; // Removed unused import /// User represents a user in the Freezone Manager system #[derive(Debug, Clone, Serialize, Deserialize)] pub struct User { pub id: u32, pub name: String, pub email: String, pub password: String, pub company: String, // here its just a best effort pub role: String, pub created_at: DateTime, pub updated_at: DateTime, } // Removed old Model trait implementation impl User { /// Create a new user with default timestamps pub fn new( id: u32, name: String, email: String, password: String, company: String, role: String, ) -> Self { let now = Utc::now(); Self { id, name, email, password, company, role, created_at: now, updated_at: now, } } } // Implement Storable trait (provides default dump/load) impl Storable for User {} // Implement SledModel trait impl SledModel for User { fn get_id(&self) -> String { self.id.to_string() } fn db_prefix() -> &'static str { "user" } }