diff --git a/rust/crates/web/src/infra/firestore_store.rs b/rust/crates/web/src/infra/firestore_store.rs index 097400d..191ea1a 100644 --- a/rust/crates/web/src/infra/firestore_store.rs +++ b/rust/crates/web/src/infra/firestore_store.rs @@ -49,4 +49,11 @@ impl Store for FirestoreStore { async fn find_all_items(&self) -> Result, use_case::Error> { todo!() } + + async fn find_checks_by_check_list_id( + &self, + check_list_id: String, + ) -> Result, use_case::Error> { + todo!() + } } diff --git a/rust/crates/web/src/infra/store.rs b/rust/crates/web/src/infra/store.rs index fde5e19..362b8a6 100644 --- a/rust/crates/web/src/infra/store.rs +++ b/rust/crates/web/src/infra/store.rs @@ -25,6 +25,17 @@ impl Store for InMemoryStore { async fn find_all_items(&self) -> Result, use_case::Error> { Ok(self.items.clone()) } + async fn find_checks_by_check_list_id( + &self, + check_list_id: String, + ) -> Result, use_case::Error> { + Ok(self + .checks + .iter() + .filter(|check| check.check_list_id == check_list_id) + .cloned() + .collect()) + } } impl InMemoryStore { diff --git a/rust/crates/web/src/use_case.rs b/rust/crates/web/src/use_case.rs index 964b20b..329a419 100644 --- a/rust/crates/web/src/use_case.rs +++ b/rust/crates/web/src/use_case.rs @@ -14,6 +14,10 @@ pub trait Store { async fn find_all_check_lists(&self) -> Result, Error>; async fn find_all_checks(&self) -> Result, Error>; async fn find_all_items(&self) -> Result, Error>; + async fn find_checks_by_check_list_id( + &self, + check_list_id: String, + ) -> Result, Error>; } pub trait HasSchema {