use async_trait::async_trait;
use puerto_core::RepositoryError;
use super::model::{{ "{" }}{{ pascal }}, {{ pascal }}Id};
#[async_trait]
pub trait {{ pascal }}RepositoryTrait: Send + Sync {
async fn find_by_id(&self, id: {{ pascal }}Id) -> Result<Option<{{ pascal }}>, RepositoryError>;
async fn save(&self, entity: &{{ pascal }}) -> Result<(), RepositoryError>;
}
#[cfg(any(test, feature = "test-utils"))]
pub mod mocks {
use mockall::mock;
use super::*;
mock! {
pub {{ pascal }}Repository {}
#[async_trait]
impl {{ pascal }}RepositoryTrait for {{ pascal }}Repository {
async fn find_by_id(&self, id: {{ pascal }}Id) -> Result<Option<{{ pascal }}>, RepositoryError>;
async fn save(&self, entity: &{{ pascal }}) -> Result<(), RepositoryError>;
}
}
}