feat(analytics): refactor and introduce analytics APIs to accommodate OrgLevel, MerchantLevel and ProfileLevel authentication (#5729)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Sampras Lopes <sampras.lopes@juspay.in>
This commit is contained in:
Sandeep Kumar
2024-09-03 15:53:04 +05:30
committed by GitHub
parent 98cfc13f53
commit 8ed942c6cd
63 changed files with 2884 additions and 1531 deletions

View File

@ -10,6 +10,8 @@ pub enum AnalyticsError {
NotImplemented(&'static str),
#[error("Unknown Analytics Error")]
UnknownError,
#[error("Access Forbidden Analytics Error")]
AccessForbiddenError,
}
impl ErrorSwitch<ApiErrorResponse> for AnalyticsError {
@ -27,6 +29,9 @@ impl ErrorSwitch<ApiErrorResponse> for AnalyticsError {
"Something went wrong",
None,
)),
Self::AccessForbiddenError => {
ApiErrorResponse::Unauthorized(ApiError::new("IR", 0, "Access Forbidden", None))
}
}
}
}