feat(safety): implement report content API

This commit is contained in:
Paul Makles
2023-02-21 12:38:35 +01:00
parent 49598daf70
commit 056c0380b2
17 changed files with 284 additions and 23 deletions

View File

@@ -0,0 +1,13 @@
use crate::models::Report;
use crate::{AbstractReport, Result};
use super::super::MongoDb;
static COL: &str = "safety_reports";
#[async_trait]
impl AbstractReport for MongoDb {
async fn insert_report(&self, report: &Report) -> Result<()> {
self.insert_one(COL, report).await.map(|_| ())
}
}