feat(core): Constraint Graph for Payment Methods List (#5081)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Prajjwal Kumar
2024-07-09 22:45:15 +05:30
committed by GitHub
parent fdac313241
commit 82c6e0e649
17 changed files with 1288 additions and 541 deletions

View File

@ -194,7 +194,7 @@ where
nodes: &[(NodeId, Relation, Strength)],
info: Option<&'static str>,
metadata: Option<M>,
domain: Option<String>,
domain_id: Option<DomainId>,
) -> Result<NodeId, GraphError<V>> {
nodes
.iter()
@ -208,13 +208,7 @@ where
.push(metadata.map(|meta| -> Arc<dyn Metadata> { Arc::new(meta) }));
for (node_id, relation, strength) in nodes {
self.make_edge(
*node_id,
aggregator_id,
*strength,
*relation,
domain.clone(),
)?;
self.make_edge(*node_id, aggregator_id, *strength, *relation, domain_id)?;
}
Ok(aggregator_id)
@ -225,7 +219,7 @@ where
nodes: &[(NodeId, Relation, Strength)],
info: Option<&'static str>,
metadata: Option<M>,
domain: Option<String>,
domain_id: Option<DomainId>,
) -> Result<NodeId, GraphError<V>> {
nodes
.iter()
@ -239,13 +233,7 @@ where
.push(metadata.map(|meta| -> Arc<dyn Metadata> { Arc::new(meta) }));
for (node_id, relation, strength) in nodes {
self.make_edge(
*node_id,
aggregator_id,
*strength,
*relation,
domain.clone(),
)?;
self.make_edge(*node_id, aggregator_id, *strength, *relation, domain_id)?;
}
Ok(aggregator_id)

View File

@ -158,14 +158,6 @@ impl From<String> for DomainIdentifier {
}
}
// impl Deref for DomainIdentifier {
// type Target = &String;
//
// fn deref(&self) -> Self::Target {
// self.0
// }
// }
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct DomainInfo {
pub domain_identifier: DomainIdentifier,