refactor(graph): refactor the Knowledge Graph to include configs check, while eligibility analysis (#4687)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Amisha Prabhat
2024-05-21 19:44:45 +05:30
committed by GitHub
parent 70612e4c6f
commit a917776bb8
19 changed files with 541 additions and 34 deletions

View File

@ -91,8 +91,12 @@ pub fn seed_knowledge_graph(mcas: JsValue) -> JsResult {
.collect::<Result<_, _>>()
.map_err(|_| "invalid connector name received")
.err_to_js()?;
let mca_graph = kgraph_utils::mca::make_mca_graph(mcas).err_to_js()?;
let pm_filter = kgraph_utils::types::PaymentMethodFilters(HashMap::new());
let config = kgraph_utils::types::CountryCurrencyFilter {
connector_configs: HashMap::new(),
default_configs: Some(pm_filter),
};
let mca_graph = kgraph_utils::mca::make_mca_graph(mcas, &config).err_to_js()?;
let analysis_graph =
hyperswitch_constraint_graph::ConstraintGraph::combine(&mca_graph, &truth::ANALYSIS_GRAPH)
.err_to_js()?;