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

@ -353,7 +353,7 @@ async fn incoming_webhooks_core<W: types::OutgoingWebhookType>(
.store
.find_business_profile_by_profile_id(key_manager_state, &key_store, profile_id)
.await
.to_not_found_response(errors::ApiErrorResponse::BusinessProfileNotFound {
.to_not_found_response(errors::ApiErrorResponse::ProfileNotFound {
id: profile_id.get_string_repr().to_owned(),
})?;
@ -498,7 +498,7 @@ async fn payments_incoming_webhook_flow(
state: SessionState,
req_state: ReqState,
merchant_account: domain::MerchantAccount,
business_profile: domain::BusinessProfile,
business_profile: domain::Profile,
key_store: domain::MerchantKeyStore,
webhook_details: api::IncomingWebhookDetails,
source_verified: bool,
@ -636,7 +636,7 @@ async fn payments_incoming_webhook_flow(
async fn payouts_incoming_webhook_flow(
state: SessionState,
merchant_account: domain::MerchantAccount,
business_profile: domain::BusinessProfile,
business_profile: domain::Profile,
key_store: domain::MerchantKeyStore,
webhook_details: api::IncomingWebhookDetails,
event_type: webhooks::IncomingWebhookEvent,
@ -770,7 +770,7 @@ async fn payouts_incoming_webhook_flow(
async fn refunds_incoming_webhook_flow(
state: SessionState,
merchant_account: domain::MerchantAccount,
business_profile: domain::BusinessProfile,
business_profile: domain::Profile,
key_store: domain::MerchantKeyStore,
webhook_details: api::IncomingWebhookDetails,
connector_name: &str,
@ -914,7 +914,7 @@ async fn get_or_update_dispute_object(
organization_id: &common_utils::id_type::OrganizationId,
payment_attempt: &hyperswitch_domain_models::payments::payment_attempt::PaymentAttempt,
event_type: webhooks::IncomingWebhookEvent,
business_profile: &domain::BusinessProfile,
business_profile: &domain::Profile,
connector_name: &str,
) -> CustomResult<diesel_models::dispute::Dispute, errors::ApiErrorResponse> {
let db = &*state.store;
@ -995,7 +995,7 @@ async fn external_authentication_incoming_webhook_flow(
request_details: &IncomingWebhookRequestDetails<'_>,
connector: &ConnectorEnum,
object_ref_id: api::ObjectReferenceId,
business_profile: domain::BusinessProfile,
business_profile: domain::Profile,
merchant_connector_account: domain::MerchantConnectorAccount,
) -> CustomResult<WebhookResponseTracker, errors::ApiErrorResponse> {
if source_verified {
@ -1161,7 +1161,7 @@ async fn external_authentication_incoming_webhook_flow(
async fn mandates_incoming_webhook_flow(
state: SessionState,
merchant_account: domain::MerchantAccount,
business_profile: domain::BusinessProfile,
business_profile: domain::Profile,
key_store: domain::MerchantKeyStore,
webhook_details: api::IncomingWebhookDetails,
source_verified: bool,
@ -1254,7 +1254,7 @@ async fn frm_incoming_webhook_flow(
source_verified: bool,
event_type: webhooks::IncomingWebhookEvent,
object_ref_id: api::ObjectReferenceId,
business_profile: domain::BusinessProfile,
business_profile: domain::Profile,
) -> CustomResult<WebhookResponseTracker, errors::ApiErrorResponse> {
if source_verified {
let payment_attempt =
@ -1360,7 +1360,7 @@ async fn frm_incoming_webhook_flow(
async fn disputes_incoming_webhook_flow(
state: SessionState,
merchant_account: domain::MerchantAccount,
business_profile: domain::BusinessProfile,
business_profile: domain::Profile,
key_store: domain::MerchantKeyStore,
webhook_details: api::IncomingWebhookDetails,
source_verified: bool,
@ -1433,7 +1433,7 @@ async fn bank_transfer_webhook_flow(
state: SessionState,
req_state: ReqState,
merchant_account: domain::MerchantAccount,
business_profile: domain::BusinessProfile,
business_profile: domain::Profile,
key_store: domain::MerchantKeyStore,
webhook_details: api::IncomingWebhookDetails,
source_verified: bool,
@ -1695,6 +1695,7 @@ async fn fetch_optional_mca_and_connector(
.attach_printable(
"error while fetching merchant_connector_account from connector_id",
)?;
#[cfg(feature = "v2")]
let mca: domain::MerchantConnectorAccount = {
let _ = merchant_account;