use crate::inspect::smp::services::*;

mod gaps;
mod hypotheses;
mod input_fields;
mod model;
mod projection_status;
mod tri_lane;

use gaps::build_near_city_owner_gaps_and_region_statuses;
use hypotheses::build_near_city_projection_hypotheses;
use input_fields::build_near_city_input_fields;
pub(super) use model::NearCityAcquisitionTraceInputs;
use projection_status::build_near_city_projection_status_fields;
use tri_lane::build_near_city_tri_lane_fields;

pub(super) fn build_near_city_acquisition_trace_inputs(
    analysis: &SmpSaveCompanyChairmanAnalysisReport,
) -> NearCityAcquisitionTraceInputs {
    let (
        near_city_acquisition_region_input_fields,
        near_city_acquisition_peer_input_fields,
        near_city_acquisition_company_input_fields,
    ) = build_near_city_input_fields();
    let projection = build_near_city_projection_status_fields();
    let tri_lane = build_near_city_tri_lane_fields(analysis);
    let near_city_acquisition_projection_hypotheses = build_near_city_projection_hypotheses();
    let (near_city_acquisition_remaining_owner_gaps, near_city_acquisition_region_lane_statuses) =
        build_near_city_owner_gaps_and_region_statuses();

    NearCityAcquisitionTraceInputs {
        near_city_acquisition_region_input_fields,
        near_city_acquisition_peer_input_fields,
        near_city_acquisition_company_input_fields,
        near_city_acquisition_shellless_readiness_status: projection
            .near_city_acquisition_shellless_readiness_status,
        near_city_acquisition_runtime_backed_input_families: projection
            .near_city_acquisition_runtime_backed_input_families,
        near_city_acquisition_site_owner_company_projection_status: projection
            .near_city_acquisition_site_owner_company_projection_status,
        near_city_acquisition_site_self_id_projection_status: projection
            .near_city_acquisition_site_self_id_projection_status,
        near_city_acquisition_site_cached_tri_lane_projection_status: projection
            .near_city_acquisition_site_cached_tri_lane_projection_status,
        near_city_acquisition_tri_lane_live_service_status: projection
            .near_city_acquisition_tri_lane_live_service_status,
        near_city_acquisition_candidate_subtype_projection_status: projection
            .near_city_acquisition_candidate_subtype_projection_status,
        near_city_acquisition_backing_record_projection_status: projection
            .near_city_acquisition_backing_record_projection_status,
        near_city_acquisition_nontransport_persisted_source_status: projection
            .near_city_acquisition_nontransport_persisted_source_status,
        near_city_acquisition_nontransport_persisted_source_candidates: projection
            .near_city_acquisition_nontransport_persisted_source_candidates,
        near_city_acquisition_tri_lane_save_shape_family_status: tri_lane
            .near_city_acquisition_tri_lane_save_shape_family_status,
        near_city_acquisition_tri_lane_save_shape_family_candidates: tri_lane
            .near_city_acquisition_tri_lane_save_shape_family_candidates,
        near_city_acquisition_tri_lane_live_owner_families: tri_lane
            .near_city_acquisition_tri_lane_live_owner_families,
        near_city_acquisition_tri_lane_candidate_gate_fields: tri_lane
            .near_city_acquisition_tri_lane_candidate_gate_fields,
        near_city_acquisition_tri_lane_runtime_writer_roles: tri_lane
            .near_city_acquisition_tri_lane_runtime_writer_roles,
        near_city_acquisition_tri_lane_direct_caller_families: tri_lane
            .near_city_acquisition_tri_lane_direct_caller_families,
        near_city_acquisition_tri_lane_formula_input_lanes: tri_lane
            .near_city_acquisition_tri_lane_formula_input_lanes,
        near_city_acquisition_projection_hypotheses,
        near_city_acquisition_remaining_owner_gaps,
        near_city_acquisition_region_lane_statuses,
    }
}
