utils.py

About this file

This file has one function generate_acknowledgment_report() which is a Celery task that generates the acknowledgment report for the user's agency with the specified date range.

Code Issues

  • A general docstring is missing explaining the use of the file.
    The append function used in the for loop for data_from_dates.append() and all_data.append() is appending the same list of variables. The list is long and is adding more lines to the code. It can be defined once and that variable can be called in both the append functions. This will also help in reducing a chance of missing on any variable in the list.

Code Check Report


app/report/utils.py:69:43: E127 continuation line over-indented for visual indent
app/report/utils.py:69:121: E501 line too long (121 > 120 characters)
                        

Documentation drawn from source code


generate_acknowledgment_report(self, current_user_guid: str, date_from: datetime, date_to: datetime):
Celery task that generates the acknowledgment report for the user's agency with the specified date range.

Args:
current_user_guid: GUID of the current user
date_from: Date to filter report from
date_to: Date to filter report to

generate_request_closing_user_report(agency_ein: str, date_from: str, date_to: str, email_to: list):
Generates a report of requests that were closed in a time frame.

Generates a report of requests in a time frame with the following tabs:
1) Total number of opened and closed requests.
2) Total number of closed requests and percentage closed by user.
3) Total number of requests closed by user per day.
4) All of the requests created.
5) All of the requests closed.
6) All of the requests closed and the user who closed it.

Args:
agency_ein: Agency EIN
date_from: Date to filter from
date_to: Date to filter to
email_to: List of recipient emails

generate_monthly_metrics_report(self, agency_ein: str, date_from: str, date_to: str, email_to: list):
Generates a report of monthly metrics about opened and closed requests.

Generates a report of requests in a time frame with the following tabs:
1) Metrics:
- Received for the current month
- Total remaining open for current month
- Closed in the current month that were received in the current month
- Total closed in current month no matter when received
- Total closed since portal started
- Total remaining Open/Pending
- Inquiries for current month
2) All requests that have been opened in the given month.
3) All requests that are still open or pending. Excludes all closed requests.
4) All requests that have been closed in the given month.
5) All requests that have been closed, since the portal started.
6) All requests that have been opened and closed in the same given month.
7) all emails received using the "Contact the Agency" button in the given month.

Args:
agency_ein: Agency EIN
date_from: Date to filter from
date_to: Date to filter to
email_to: List of recipient emails

Source code