Repository: juspay/hyperswitch
File: crates/router/src/routes/app.rs (Rust)

Code before:
                        .route(web::put().to(refunds::refunds_metadata_update)),
                );
        }

        route
    }
}

#[cfg(feature = "payouts")]
pub struct Payouts;

#[cfg(all(feature = "payouts", feature = "v1"))]
impl Payouts {
    pub fn server(state: AppState) -> Scope {
        let mut route = web::scope("/payouts").app_data(web::Data::new(state));
        route = route.service(web::resource("/create").route(web::post().to(payouts_create)));

        #[cfg(feature = "olap")]
        {
            route = route
                .service(
                    web::resource("/list")
                        .route(web::get().to(payouts_list))
                        .route(web::post().to(payouts_list_by_filter)),
                )
                .service(web::resource("/aggregate").route(web::get().to(get_payouts_aggregates)))
                .service(
                    web::resource("/profile/list")
                        .route(web::get().to(payouts_list_profile))
                        .route(web::post().to(payouts_list_by_filter_profile)),
                )
                .service(
                    web::resource("/filter")
                        .route(web::post().to(payouts_list_available_filters_for_merchant)),
                )
                .service(web::resource("/v2/filter").route(web::get().to(get_payout_filters)))
                .service(
                    web::resource("/profile/filter")
                        .route(web::post().to(payouts_list_available_filters_for_profile)),
                );
        }
        route = route
            .service(
                web::resource("/{payout_id}")
                    .route(web::get().to(payouts_retrieve))
                    .route(web::put().to(payouts_update)),
            )
            .service(web::resource("/{payout_id}/confirm").route(web::post().to(payouts_confirm)))
            .service(web::resource("/{payout_id}/cancel").route(web::post().to(payouts_cancel)))
            .service(web::resource("/{payout_id}/fulfill").route(web::post().to(payouts_fulfill)));
        route

Review comment (suggestion):
I think we also need a `/profile/aggregate` for profile level aggregates, please check the other modules payments, refunds and disputes.

Code after:
                        .route(web::put().to(refunds::refunds_metadata_update)),
                );
        }

        route
    }
}

#[cfg(feature = "payouts")]
pub struct Payouts;

#[cfg(all(feature = "payouts", feature = "v1"))]
impl Payouts {
    pub fn server(state: AppState) -> Scope {
        let mut route = web::scope("/payouts").app_data(web::Data::new(state));
        route = route.service(web::resource("/create").route(web::post().to(payouts_create)));

        #[cfg(feature = "olap")]
        {
            route = route
                .service(
                    web::resource("/list")
                        .route(web::get().to(payouts_list))
                        .route(web::post().to(payouts_list_by_filter)),
                )
                .service(web::resource("/aggregate").route(web::get().to(get_payouts_aggregates)))
                .service(
                    web::resource("/profile/aggregate")
                        .route(web::get().to(get_payouts_aggregates_profile)),
                )
                .service(
                    web::resource("/profile/list")
                        .route(web::get().to(payouts_list_profile))
                        .route(web::post().to(payouts_list_by_filter_profile)),
                )
                .service(
                    web::resource("/filter")
                        .route(web::post().to(payouts_list_available_filters_for_merchant)),
                )
                .service(web::resource("/v2/filter").route(web::get().to(get_payout_filters)))
                .service(
                    web::resource("/profile/filter")
                        .route(web::post().to(payouts_list_available_filters_for_profile)),
                );
        }
        route = route
            .service(
                web::resource("/{payout_id}")
                    .route(web::get().to(payouts_retrieve))
                    .route(web::put().to(payouts_update)),
            )