pub mod models;

#[cfg(feature = "ssr")]
pub mod ports;

#[cfg(feature = "ssr")]
mod service;

#[cfg(feature = "ssr")]
pub use service::Service;

#[cfg(feature = "ssr")]
pub mod prelude {
    use super::super::super::outbound::dangerous_lettre::DangerousLettre;
    use super::super::super::outbound::postgres::Postgres;

    // This is too damn tightly coupled to pgsql and lettre now
    // But so far, this is the only thing that actually works
    pub type AppService = std::sync::Arc<Service<Postgres, DangerousLettre>>;

    pub use super::models::oauth::*;
    pub use super::models::user::*;
    pub use super::ports::*;
    pub use super::service::*;

    pub use crate::domain::leptos::check_user;

    pub use crate::domain::leptos::flashbag::Alert;
    pub use crate::domain::leptos::flashbag::Flash;
    pub use crate::domain::leptos::flashbag::FlashBag;
    pub use crate::domain::leptos::flashbag::FlashMessage;

    pub use axum_session::SessionAnySession as Session;

    pub use avam_protocol::*;
}

#[cfg(not(feature = "ssr"))]
pub mod prelude {
    pub use super::models::oauth::*;
    pub use super::models::user::*;
    pub use crate::domain::leptos::flashbag::Alert;
    pub use crate::domain::leptos::flashbag::Flash;
}
