puerto 0.19.1

Puerto — Rust full-stack DDD framework CLI. Scaffolds Clean Architecture projects with auto-wired DI, SQLx support, and zero manual wiring. Formerly puerto-framework.
//! Yours: `puerto new --auth local` writes this file once.

use async_trait::async_trait;

use crate::domain::user::errors::UserError;

/// `token`: the session the caller signed this request with.
pub struct LogoutParams {
    pub token: String,
}

/// Revokes a session: its token is refused from then on.
#[async_trait]
pub trait LogoutUseCaseTrait: Send + Sync {
    async fn execute(&self, params: LogoutParams) -> Result<(), UserError>;
}

#[cfg(any(test, feature = "test-utils"))]
pub mod mocks {
    use mockall::mock;

    use super::*;

    mock! {
        pub LogoutUseCase {}

        #[async_trait]
        impl LogoutUseCaseTrait for LogoutUseCase {
            async fn execute(&self, params: LogoutParams) -> Result<(), UserError>;
        }
    }
}