refactor: Rename business profile to profiles in api, diesel, domain, interface and error types (#5877)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Arun Raj M
2024-09-19 23:30:25 +05:30
committed by GitHub
parent f4fa4cdab4
commit dee91b366a
99 changed files with 2243 additions and 2255 deletions

View File

@ -182,11 +182,11 @@ pub async fn update_merchant_active_algorithm_ref(
}
#[cfg(feature = "v1")]
pub async fn update_business_profile_active_algorithm_ref(
pub async fn update_profile_active_algorithm_ref(
db: &dyn StorageInterface,
key_manager_state: &KeyManagerState,
merchant_key_store: &domain::MerchantKeyStore,
current_business_profile: domain::BusinessProfile,
current_business_profile: domain::Profile,
algorithm_id: routing_types::RoutingAlgorithmRef,
transaction_type: &storage::enums::TransactionType,
) -> RouterResult<()> {
@ -214,12 +214,12 @@ pub async fn update_business_profile_active_algorithm_ref(
storage::enums::TransactionType::Payout => (None, Some(ref_val)),
};
let business_profile_update = domain::BusinessProfileUpdate::RoutingAlgorithmUpdate {
let business_profile_update = domain::ProfileUpdate::RoutingAlgorithmUpdate {
routing_algorithm,
payout_routing_algorithm,
};
db.update_business_profile_by_profile_id(
db.update_profile_by_profile_id(
key_manager_state,
merchant_key_store,
current_business_profile,
@ -241,17 +241,17 @@ pub async fn update_business_profile_active_dynamic_algorithm_ref(
db: &dyn StorageInterface,
key_manager_state: &KeyManagerState,
merchant_key_store: &domain::MerchantKeyStore,
current_business_profile: domain::BusinessProfile,
current_business_profile: domain::Profile,
dynamic_routing_algorithm: routing_types::DynamicRoutingAlgorithmRef,
) -> RouterResult<()> {
let ref_val = dynamic_routing_algorithm
.encode_to_value()
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed to convert dynamic routing ref to value")?;
let business_profile_update = domain::BusinessProfileUpdate::DynamicRoutingAlgorithmUpdate {
let business_profile_update = domain::ProfileUpdate::DynamicRoutingAlgorithmUpdate {
dynamic_routing_algorithm: Some(ref_val),
};
db.update_business_profile_by_profile_id(
db.update_profile_by_profile_id(
key_manager_state,
merchant_key_store,
current_business_profile,