mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-04 14:07:18 +08:00 
			
		
		
		
	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:
		@ -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)
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user