puerto 0.19.0

Puerto — Rust full-stack DDD framework CLI. Scaffolds Clean Architecture projects with auto-wired DI, SQLx support, and zero manual wiring. Formerly puerto-framework.
use async_trait::async_trait;
use business::domain::{{ snake }}::{
    model::{{ "{" }}{{ pascal }}, {{ pascal }}Id},
    repository::{{ pascal }}RepositoryTrait,
};
use puerto_core::RepositoryError;

/// 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: {{ pascal }}Id) -> Result<Option<{{ pascal }}>, RepositoryError> {
        tracing::debug!(%id, "find_by_id");
        Ok(None)
    }

    async fn save(&self, entity: &{{ pascal }}) -> Result<(), RepositoryError> {
        tracing::debug!(id = %entity.id, "save");
        Ok(())
    }
}