
use rocket::serde::{Deserialize, Serialize};

// #[derive(Deserialize, Serialize)]
// #[serde(crate = "rocket::serde")]
// #[derive(Debug)]
// pub struct SensorData { 
//     pub id: Option<u32>,
//     pub name: String,
//     pub value: f32,
//     pub unit: String,
// }

#[derive(Deserialize, Serialize)]
#[serde(crate = "rocket::serde")]
#[derive(Debug)]
pub struct SensorData { 
    pub id: Option<u32>,
    pub city_codename_cords_sector_cell: String, // CERCELL::[S1:C1] 
    pub sensor_name_and_model: String,
    pub value: f32,
    pub unit: String,
    pub timestamp: u32 
}

// #[derive(Debug)]
pub fn get_sensor_data() -> SensorData {
    SensorData {
        id: Some(1),
        city_codename_cords_sector_cell: String::from("CERCELL:[40.7128,-74.0060]::S1:C1"),
        sensor_name_and_model:  String::from("Humidity:[DHT22]"),
        value: 20.7,
        unit: String::from("RH"),
        timestamp: 17000002
    }
}


