use async_trait::async_trait;
use uuid::Uuid;
use business::domain::{{ snake }}::{
errors::{{ pascal }}Error,
model::{{ pascal }},
repository::{{ pascal }}RepositoryTrait,
};
/// A stand-in that stores nothing — replace it with a real adapter (`puerto new --db` generates
/// Postgres repositories).
#[derive(Default)]
pub struct InMemory{{ pascal }}Repository;
impl InMemory{{ pascal }}Repository {
pub fn new() -> Self {
Self
}
}
#[async_trait]
impl {{ pascal }}RepositoryTrait for InMemory{{ pascal }}Repository {
async fn find_by_id(&self, id: Uuid) -> Result<Option<{{ pascal }}>, {{ pascal }}Error> {
tracing::debug!(%id, "find_by_id");
Ok(None)
}
async fn save(&self, entity: &{{ pascal }}) -> Result<(), {{ pascal }}Error> {
tracing::debug!(id = %entity.id, "save");
Ok(())
}
}