use crate::AppState;
use super::debug_contracts::LoggingSchemaDebugReport;
use super::debug_service_error::LoggingSchemaDebugReportError;
use super::debug_service_error_mapper::map_logging_client_resolution_error;
use super::debug_service_from_stage_output_assembly::build_debug_service_result_from_stage_output_assembly;
use super::debug_service_resolver::resolve_logging_client_pool;
use super::debug_service_stage_input_assembly::build_debug_service_stage_input_assembly;
use super::debug_service_stage_input_contracts::LoggingSchemaDebugReportServiceStageInput;
use super::debug_service_stage_output_assembly::build_debug_service_stage_output_assembly;
pub(super) async fn load_logging_schema_debug_report(
app_state: &AppState,
) -> Result<LoggingSchemaDebugReport, LoggingSchemaDebugReportError> {
let stage_input: LoggingSchemaDebugReportServiceStageInput =
build_debug_service_stage_input_assembly(
resolve_logging_client_pool(app_state).map_err(map_logging_client_resolution_error)?,
);
let stage = build_debug_service_stage_output_assembly(stage_input);
build_debug_service_result_from_stage_output_assembly(stage).await
}