-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1799 from GSA-TTS/main
- Loading branch information
Showing
73 changed files
with
1,802 additions
and
399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
def audit_findings(sac_dict): | ||
""" | ||
Checks that the number of audit findings in the Federal Awards and Audit Findings | ||
sections are consistent. | ||
""" | ||
all_sections = sac_dict["sf_sac_sections"] | ||
awards_outer = all_sections.get("federal_awards", {}) | ||
awards = awards_outer.get("federal_awards", []) if awards_outer else [] | ||
finds_outer = all_sections.get("findings_text", {}) | ||
findings = finds_outer.get("findings_text_entries", []) if finds_outer else [] | ||
# If both empty, that's consistent: | ||
if not awards and not findings: | ||
return [] | ||
if awards: | ||
# How to determine if findings is required? Loop through the awards? | ||
num_expected = sum(_.get("number_of_audit_findings", 0) for _ in findings) | ||
# For now, just check for non-zero | ||
if num_expected and not awards: | ||
return [ | ||
{ | ||
"error": "There are findings listed in Federal Awards " | ||
" but none in Findings Text" | ||
} | ||
] | ||
|
||
if False > 1: | ||
return [{"error": "error message"}] | ||
return [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
backend/audit/fixtures/json/federal-awards--test0001test--simple-pass.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"FederalAwards": { | ||
"auditee_uei": "TEST0001TEST", | ||
"total_amount_expended": 12345, | ||
"federal_awards": [ | ||
{ | ||
"program": { | ||
"federal_agency_prefix": "42", | ||
"three_digit_extension": "RD", | ||
"additional_award_identification": 1234, | ||
"program_name": "FLOWER DREAMING", | ||
"is_major": "N", | ||
"audit_report_type": "", | ||
"number_of_audit_findings": 0, | ||
"amount_expended": 500, | ||
"federal_program_total": 500 | ||
}, | ||
"loan_or_loan_guarantee": { | ||
"is_guaranteed": "N", | ||
"loan_balance_at_audit_period_end": 0 | ||
}, | ||
"direct_or_indirect_award": { | ||
"is_direct": "N", | ||
"entities": [ | ||
{ | ||
"passthrough_name": "Lothlórien", | ||
"passthrough_identifying_number": "54321" | ||
} | ||
] | ||
}, | ||
"cluster": { | ||
"cluster_name": "N/A", | ||
"cluster_total": 0 | ||
}, | ||
"subrecipients": { | ||
"is_passed": "N" | ||
}, | ||
"award_reference": "AWARD-0001" | ||
} | ||
] | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
backend/audit/fixtures/json/general-information--test0001test--simple-pass.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"ein": "123456789", | ||
"audit_type": "single-audit", | ||
"auditee_uei": "TEST0001TEST", | ||
"auditee_zip": "94109", | ||
"auditor_ein": "987654321", | ||
"auditor_zip": "94109", | ||
"auditee_city": "HAL", | ||
"auditee_name": "IBM", | ||
"auditor_city": "Rivendell", | ||
"is_usa_based": true, | ||
"auditee_email": "[email protected]", | ||
"auditee_phone": "5558675309", | ||
"auditee_state": "CA", | ||
"auditor_email": "[email protected]", | ||
"auditor_phone": "5558675309", | ||
"auditor_state": "CA", | ||
"auditor_country": "United States", | ||
"auditor_firm_name": "Fellowship", | ||
"audit_period_covered": "annual", | ||
"auditee_contact_name": "Frodo Baggins", | ||
"auditor_contact_name": "Sauron", | ||
"auditee_contact_title": "Ringbearer", | ||
"auditor_contact_title": "Dark Lord", | ||
"multiple_eins_covered": false, | ||
"multiple_ueis_covered": false, | ||
"auditee_address_line_1": "HAL", | ||
"auditor_address_line_1": "Main Hall", | ||
"met_spending_threshold": true, | ||
"auditee_fiscal_period_end": "2023-01-01", | ||
"ein_not_an_ssn_attestation": true, | ||
"auditee_fiscal_period_start": "2022-01-01", | ||
"user_provided_organization_type": "non-profit", | ||
"auditor_ein_not_an_ssn_attestation": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
backend/audit/migrations/0032_singleauditchecklist_auditee_certification_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Generated by Django 4.2.3 on 2023-08-07 18:21 | ||
|
||
import audit.validators | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("audit", "0031_singleauditreportfile_component_page_numbers"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="singleauditchecklist", | ||
name="auditee_certification", | ||
field=models.JSONField( | ||
blank=True, | ||
null=True, | ||
validators=[audit.validators.validate_auditee_certification_json], | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="singleauditchecklist", | ||
name="auditor_certification", | ||
field=models.JSONField( | ||
blank=True, | ||
null=True, | ||
validators=[audit.validators.validate_auditor_certification_json], | ||
), | ||
), | ||
] |
22 changes: 22 additions & 0 deletions
22
backend/audit/migrations/0033_singleauditchecklist_tribal_data_consent.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by Django 4.2.3 on 2023-08-10 19:49 | ||
|
||
import audit.validators | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("audit", "0032_singleauditchecklist_auditee_certification_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="singleauditchecklist", | ||
name="tribal_data_consent", | ||
field=models.JSONField( | ||
blank=True, | ||
null=True, | ||
validators=[audit.validators.validate_tribal_data_consent_json], | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.