feat: migration api for migrating routing rules to decision_engine (#8233)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Prajjwal Kumar
2025-06-13 14:34:24 +05:30
committed by GitHub
parent ce85b838f4
commit 9045eb5b65
10 changed files with 318 additions and 5 deletions

View File

@ -30,6 +30,7 @@ pub struct RoutingAlgorithmMetadata {
pub algorithm_for: enums::TransactionType,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct RoutingProfileMetadata {
pub profile_id: id_type::ProfileId,
pub algorithm_id: id_type::RoutingId,
@ -40,3 +41,10 @@ pub struct RoutingProfileMetadata {
pub modified_at: time::PrimitiveDateTime,
pub algorithm_for: enums::TransactionType,
}
impl RoutingProfileMetadata {
pub fn metadata_is_advanced_rule_for_payments(&self) -> bool {
matches!(self.kind, enums::RoutingAlgorithmKind::Advanced)
&& matches!(self.algorithm_for, enums::TransactionType::Payment)
}
}