-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
116 additions
and
201 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
// TODO: Get active ingestions along their progress | ||
// TODO: Get analisis of side-effects and when they will likely occur | ||
|
||
use itertools::Itertools; | ||
|
||
use db::sea_orm::*; | ||
use db::sea_orm::DatabaseConnection; | ||
|
||
pub async fn handle_show_dashboard(database_connection: &DatabaseConnection) { | ||
println!("Dashboard is not implemented yet."); | ||
|
||
// Show average dosage per day of each substance that was ingested | ||
let ingestions = db::ingestion::Entity::find().all(database_connection).await.unwrap(); | ||
|
||
// Group ingestions by substance name | ||
let ingestions_by_substance = ingestions | ||
.into_iter() | ||
.chunk_by(|ingestion| ingestion.substance_name.as_ref().unwrap().clone()).into_iter(); | ||
|
||
println!("Ingestions by substance:"); | ||
} |
Oops, something went wrong.