Bug: feat(api): Adds support to change reveue_recovery_retry_algorithm_type using UpdateProfileAPI (V2)



Add support to change `reveue_recovery_retry_algorithm_type` through ProfileUpdateAPI
diff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rs
index 22c1868f6ac..e7df178c1ed 100644
--- a/crates/api_models/src/admin.rs
+++ b/crates/api_models/src/admin.rs
@@ -2989,6 +2989,11 @@ pub struct ProfileUpdate {
     /// It is used in payment processing, fraud detection, and regulatory compliance to determine regional rules and routing behavior.
     #[schema(value_type = Option<MerchantCountryCode>, example = "840")]
     pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
+
+    /// Inidcates the state of revenue recovery algorithm type
+    #[schema(value_type = Option<RevenueRecoveryAlgorithmType>, example = "cascading")]
+    pub revenue_recovery_retry_algorithm_type:
+        Option<common_enums::enums::RevenueRecoveryAlgorithmType>,
 }
 
 #[derive(Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
diff --git a/crates/hyperswitch_domain_models/src/business_profile.rs b/crates/hyperswitch_domain_models/src/business_profile.rs
index c5a78c6f39f..0afe3402954 100644
--- a/crates/hyperswitch_domain_models/src/business_profile.rs
+++ b/crates/hyperswitch_domain_models/src/business_profile.rs
@@ -1363,6 +1363,7 @@ pub struct ProfileGeneralUpdate {
     pub external_vault_connector_details: Option<ExternalVaultConnectorDetails>,
     pub merchant_category_code: Option<api_enums::MerchantCategoryCode>,
     pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
+    pub revenue_recovery_retry_algorithm_type: Option<common_enums::RevenueRecoveryAlgorithmType>,
 }
 
 #[cfg(feature = "v2")]
@@ -1443,6 +1444,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
                     external_vault_connector_details,
                     merchant_category_code,
                     merchant_country_code,
+                    revenue_recovery_retry_algorithm_type,
                 } = *update;
                 Self {
                     profile_name,
@@ -1489,7 +1491,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
                     is_clear_pan_retries_enabled: None,
                     is_debit_routing_enabled,
                     merchant_business_country,
-                    revenue_recovery_retry_algorithm_type: None,
+                    revenue_recovery_retry_algorithm_type,
                     revenue_recovery_retry_algorithm_data: None,
                     is_iframe_redirection_enabled,
                     is_external_vault_enabled,
diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs
index c116f266dfe..9068aa2ba0d 100644
--- a/crates/router/src/core/admin.rs
+++ b/crates/router/src/core/admin.rs
@@ -4074,6 +4074,8 @@ impl ProfileUpdateBridge for api::ProfileUpdate {
             }
         };
 
+        let revenue_recovery_retry_algorithm_type = self.revenue_recovery_retry_algorithm_type;
+
         Ok(domain::ProfileUpdate::Update(Box::new(
             domain::ProfileGeneralUpdate {
                 profile_name: self.profile_name,
@@ -4123,6 +4125,7 @@ impl ProfileUpdateBridge for api::ProfileUpdate {
                     .map(ForeignInto::foreign_into),
                 merchant_category_code: self.merchant_category_code,
                 merchant_country_code: self.merchant_country_code,
+                revenue_recovery_retry_algorithm_type,
             },
         )))
     }

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
This Pr provides support to change `revenue_recovery_retry_algorithm_type` under the profile using ProfileUpdate API.

### Additional Changes

- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->


## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Create a Business Profile and hit the following api.
```
curl --location --request PUT '{{base_url}}/v2/profiles/{{profile_id}}' \
--header 'x-merchant-id: {{merchant_id}}' \
--header 'Authorization: {{admin_api_key}}' \
--header 'Content-Type: application/json' \
--header 'api-key: {{admin-api-key}}' \
--data '{
    "revenue_recovery_retry_algorithm_type": "monitoring"
}'
```

And verify the `revenue_recovery_retry_algorithm_type` status of the Business Profile In the DB.

## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
