use super::debug_contracts::LoggingSchemaDebugReport;
use super::debug_service_loader_from_stage_output_assembly::build_debug_service_loader_result_from_stage_output_assembly;
use super::debug_service_loader_input_contracts::LoggingSchemaDebugReportForClientLoaderInput;
use super::debug_service_loader_stage_input_assembly::build_debug_service_loader_stage_input_assembly;
use super::debug_service_loader_stage_output_assembly::build_debug_service_loader_stage_output_assembly;
use super::debug_snapshot::fetch_logging_schema_snapshot;
use super::debug_snapshot_error::LoggingSchemaSnapshotError;
pub(super) async fn load_logging_schema_debug_report_for_client(
input: LoggingSchemaDebugReportForClientLoaderInput,
) -> Result<LoggingSchemaDebugReport, LoggingSchemaSnapshotError> {
let LoggingSchemaDebugReportForClientLoaderInput {
logging_client_name,
pool,
} = input;
let stage_input = build_debug_service_loader_stage_input_assembly(
logging_client_name,
fetch_logging_schema_snapshot(&pool).await,
);
let stage = build_debug_service_loader_stage_output_assembly(stage_input);
build_debug_service_loader_result_from_stage_output_assembly(stage)
}