mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 21:07:58 +08:00
feat(analytics): added filter api for dispute analytics (#3724)
This commit is contained in:
committed by
GitHub
parent
49c71d093e
commit
6aeb44091b
@ -88,6 +88,10 @@ pub mod routes {
|
||||
web::resource("metrics/api_events")
|
||||
.route(web::post().to(get_api_events_metrics)),
|
||||
)
|
||||
.service(
|
||||
web::resource("filters/disputes")
|
||||
.route(web::post().to(get_dispute_filters)),
|
||||
)
|
||||
}
|
||||
route
|
||||
}
|
||||
@ -582,4 +586,30 @@ pub mod routes {
|
||||
))
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn get_dispute_filters(
|
||||
state: web::Data<AppState>,
|
||||
req: actix_web::HttpRequest,
|
||||
json_payload: web::Json<api_models::analytics::GetDisputeFilterRequest>,
|
||||
) -> impl Responder {
|
||||
let flow = AnalyticsFlow::GetDisputeFilters;
|
||||
Box::pin(api::server_wrap(
|
||||
flow,
|
||||
state,
|
||||
&req,
|
||||
json_payload.into_inner(),
|
||||
|state, auth: AuthenticationData, req| async move {
|
||||
analytics::disputes::get_filters(
|
||||
&state.pool,
|
||||
req,
|
||||
&auth.merchant_account.merchant_id,
|
||||
)
|
||||
.await
|
||||
.map(ApplicationResponse::Json)
|
||||
},
|
||||
&auth::JWTAuth(Permission::Analytics),
|
||||
api_locking::LockAction::NotApplicable,
|
||||
))
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user