pub trait DatabaseInterfaceRefillTrait: Pingable {
// Required methods
fn get_duration_since_last_refill(
&mut self,
) -> Result<u64, SqlInterfaceError>;
fn get_positive_integer_value_from_database(
&mut self,
sql_query_string: &str,
) -> Result<u64, SqlInterfaceError>;
fn check_empty(&mut self) -> Result<u64, SqlInterfaceError>;
fn get_refill_count_of_last_hour(
&mut self,
) -> Result<u64, SqlInterfaceError>;
fn get_refill_count_of_last_24h(&mut self) -> Result<u64, SqlInterfaceError>;
fn get_refill_volume_of_last_24h(
&mut self,
) -> Result<f64, SqlInterfaceError>;
fn get_refill_volume_of_last_hour(
&mut self,
) -> Result<f64, SqlInterfaceError>;
fn insert_refill_event(
&mut self,
timestamp: NaiveDateTime,
duration: f64,
volume: f64,
error_code: i32,
) -> Result<(), SqlInterfaceError>;
}Expand description
Trait for interfacing between refill and SQL database This trait is prerequisite to use mock implementation for testing