mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 19:42:27 +08:00
feat(router): Add Smart Routing to route payments efficiently (#2665)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: shashank_attarde <shashank.attarde@juspay.in> Co-authored-by: Aprabhat19 <amishaprabhat@gmail.com> Co-authored-by: Amisha Prabhat <55580080+Aprabhat19@users.noreply.github.com>
This commit is contained in:
37
crates/euclid/src/frontend/vir.rs
Normal file
37
crates/euclid/src/frontend/vir.rs
Normal file
@ -0,0 +1,37 @@
|
||||
//! Valued Intermediate Representation
|
||||
use crate::types::{EuclidValue, Metadata};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum ValuedComparisonLogic {
|
||||
NegativeConjunction,
|
||||
PositiveDisjunction,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ValuedComparison {
|
||||
pub values: Vec<EuclidValue>,
|
||||
pub logic: ValuedComparisonLogic,
|
||||
pub metadata: Metadata,
|
||||
}
|
||||
|
||||
pub type ValuedIfCondition = Vec<ValuedComparison>;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ValuedIfStatement {
|
||||
pub condition: ValuedIfCondition,
|
||||
pub nested: Option<Vec<ValuedIfStatement>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ValuedRule<O> {
|
||||
pub name: String,
|
||||
pub connector_selection: O,
|
||||
pub statements: Vec<ValuedIfStatement>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ValuedProgram<O> {
|
||||
pub default_selection: O,
|
||||
pub rules: Vec<ValuedRule<O>>,
|
||||
pub metadata: Metadata,
|
||||
}
|
||||
Reference in New Issue
Block a user