Skip to content

Commit

Permalink
Supporting multiple expenditure thresholds on eligibility page (#4405)
Browse files Browse the repository at this point in the history
* Supporting multiple expenditure thresholds for step 1

* Comments

* Lint

* Lint

* Making start dates inclusive

* Unit tests

* Tweaking error message

* Removing unused DOLLAR_THRESHOLD

* Lint

* Lint

* Including the message in settings.py

* Updating unit test

* Lint
  • Loading branch information
phildominguez-gsa authored Dec 9, 2024
1 parent adbac51 commit 569ef19
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
17 changes: 16 additions & 1 deletion backend/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@

# APP-level constants
CENSUS_DATA_SOURCE = "CENSUS"
DOLLAR_THRESHOLD = 750000
SUMMARY_REPORT_DOWNLOAD_LIMIT = 1000
DEFAULT_MAX_ROWS = (
10000 # A version of this constant also exists in schemas.scrpits.render.py
Expand Down Expand Up @@ -583,6 +582,22 @@
# https://docs.djangoproject.com/en/dev/ref/settings/#session-save-every-request
SESSION_SAVE_EVERY_REQUEST = True

# Minimum expenditure thresholds
DOLLAR_THRESHOLDS = [
{
"start": None,
"end": datetime(2024, 10, 1),
"minimum": 750000,
"message": "$750,000 or more with a Fiscal Year starting BEFORE October 01, 2024",
},
{
"start": datetime(2024, 10, 1),
"end": None,
"minimum": 1000000,
"message": "$1,000,000 or more with a Fiscal Year starting ON or AFTER October 01, 2024",
},
]

# Times for the maintenance banner to display.
# Requires a 'start' and an 'end'.
# 'template_name' is optional, and defines what will display if maintenance mode is enabled during this timeframe. If no name is given, the 503 error page is used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,13 @@
</fieldset>
<fieldset class="usa-fieldset question">
<legend class="usa-legend">
Did this entity spend $750,000 or more in federal awards during its audit period in accordance with
Uniform
Guidance?
Did this entity spend an amount of federal awards meeting one of the following criteria during its audit period, in accordance with Uniform Guidance?
<abbr title="required" class="usa-hint usa-hint--required">*</abbr>
<ul>
{% for dollar_threshold in dollar_thresholds %}
<li>{{ dollar_threshold }}</li>
{% endfor %}
</ul>
</legend>
<div class="usa-radio">
<input class="usa-radio__input"
Expand All @@ -118,9 +121,7 @@
aria-required="true"
required/>
<label class="usa-radio__label" for="spend-no">No</label>
<span class="usa-error-message">You only need to submit a report for an entity that spent $750,000
or more in federal awards during its audit period (fiscal period beginning dates on or after
12/26/2014).</span>
<span class="usa-error-message">You do not meet the requirements for submitting a single audit report.</span>
</div>
</fieldset>
<fieldset class="usa-fieldset question">
Expand Down
7 changes: 7 additions & 0 deletions backend/report_submission/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ def test_step_one_eligibility_submission_pass(self):
self.assertEqual(get_response.status_code, 200)
self.assertTemplateUsed(get_response, "report_submission/step-base.html")
self.assertTemplateUsed(get_response, "report_submission/step-1.html")
self.assertEqual(
get_response.context["dollar_thresholds"],
[
"$750,000 or more with a Fiscal Year starting BEFORE October 01, 2024",
"$1,000,000 or more with a Fiscal Year starting ON or AFTER October 01, 2024",
],
)

response = self.client.post(url, data=self.step1_data)
self.assertEqual(response.status_code, 302)
Expand Down
13 changes: 8 additions & 5 deletions backend/report_submission/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from audit.utils import Util
from audit.models.models import ExcelFile
from audit.fixtures.excel import FORM_SECTIONS
from config.settings import STATIC_SITE_URL, STATE_ABBREVS
from config.settings import STATIC_SITE_URL, STATE_ABBREVS, DOLLAR_THRESHOLDS

from report_submission.forms import AuditeeInfoForm, GeneralInformationForm

Expand All @@ -35,11 +35,14 @@ def get(self, request):
# Step 1
class EligibilityFormView(LoginRequiredMixin, View):
def get(self, request):
args = {}
args["step"] = 1
return render(request, "report_submission/step-1.html", args)
args = {
"step": 1,
"dollar_thresholds": [
dict_item["message"] for dict_item in DOLLAR_THRESHOLDS
],
}

# render eligibility form
return render(request, "report_submission/step-1.html", args)

# gather/save step 1 info, redirect to step 2
def post(self, post_request):
Expand Down

0 comments on commit 569ef19

Please sign in to comment.