Overview
Calculate and return various metrics for a church's contributions.
This function computes key metrics related to contributions for a specific church, including: - Total completed contributions. - Total and percentage change for recurring monthly contributions. - Total and percentage change for recurring weekly contributions. - Average contribution amount.
The metrics are calculated by filtering and aggregating data from the church's contributions and related transactions.
:param request: The HTTP request object containing user and church information. :return: JSON response with the calculated metrics.
Generate detailed contribution reports based on the specified action.
Actions include: - category-types: Contribution percentage per type for a given year. - sources: Contribution percentage per source for a given year. - last-year: Monthly contribution breakdown by type for the past 12 months. - past-years: Contribution breakdown by year and month for the church's existence.
:param request: The HTTP request object containing user and church information. :param route_action: The specific report action to generate. :return: JSON response with the report data.
^(category-types|sources|last-year|past-years)$