-
Notifications
You must be signed in to change notification settings - Fork 7
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 #2731 from GSA-TTS/main
- Loading branch information
Showing
141 changed files
with
4,186 additions
and
83 deletions.
There are no files selected for viewing
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/100010-22/additional-eins-100010.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/100010-22/additional-ueis-100010.xlsx
Binary file not shown.
Binary file modified
BIN
+429 KB
(160%)
backend/audit/fixtures/workbooks/should_pass/100010-22/audit-findings-100010.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/100010-22/audit-findings-text-100010.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/100010-22/corrective-action-plan-100010.xlsx
Binary file not shown.
Binary file modified
BIN
+626 KB
(170%)
backend/audit/fixtures/workbooks/should_pass/100010-22/federal-awards-100010.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/100010-22/notes-to-sefa-100010.xlsx
Binary file not shown.
Binary file modified
BIN
+98.4 KB
(150%)
backend/audit/fixtures/workbooks/should_pass/100010-22/secondary-auditors-100010.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/134732-21/additional-eins-134732.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/134732-21/additional-ueis-134732.xlsx
Binary file not shown.
Binary file modified
BIN
+429 KB
(160%)
backend/audit/fixtures/workbooks/should_pass/134732-21/audit-findings-134732.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/134732-21/audit-findings-text-134732.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/134732-21/corrective-action-plan-134732.xlsx
Binary file not shown.
Binary file modified
BIN
+626 KB
(170%)
backend/audit/fixtures/workbooks/should_pass/134732-21/federal-awards-134732.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/134732-21/notes-to-sefa-134732.xlsx
Binary file not shown.
Binary file modified
BIN
+98.4 KB
(150%)
backend/audit/fixtures/workbooks/should_pass/134732-21/secondary-auditors-134732.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/147110-22/additional-eins-147110.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/147110-22/additional-ueis-147110.xlsx
Binary file not shown.
Binary file modified
BIN
+429 KB
(170%)
backend/audit/fixtures/workbooks/should_pass/147110-22/audit-findings-147110.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/147110-22/audit-findings-text-147110.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/147110-22/corrective-action-plan-147110.xlsx
Binary file not shown.
Binary file modified
BIN
+626 KB
(170%)
backend/audit/fixtures/workbooks/should_pass/147110-22/federal-awards-147110.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/147110-22/notes-to-sefa-147110.xlsx
Binary file not shown.
Binary file modified
BIN
+98.4 KB
(150%)
backend/audit/fixtures/workbooks/should_pass/147110-22/secondary-auditors-147110.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/171944-22/additional-eins-171944.xlsx
Binary file not shown.
Binary file modified
BIN
+24.3 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/171944-22/additional-ueis-171944.xlsx
Binary file not shown.
Binary file modified
BIN
+429 KB
(160%)
backend/audit/fixtures/workbooks/should_pass/171944-22/audit-findings-171944.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/171944-22/audit-findings-text-171944.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/171944-22/corrective-action-plan-171944.xlsx
Binary file not shown.
Binary file modified
BIN
+528 KB
(150%)
backend/audit/fixtures/workbooks/should_pass/171944-22/federal-awards-171944.xlsx
Binary file not shown.
Binary file modified
BIN
+42.6 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/171944-22/notes-to-sefa-171944.xlsx
Binary file not shown.
Binary file modified
BIN
+98.4 KB
(150%)
backend/audit/fixtures/workbooks/should_pass/171944-22/secondary-auditors-171944.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/181744-22/additional-eins-181744.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/181744-22/additional-ueis-181744.xlsx
Binary file not shown.
Binary file modified
BIN
+429 KB
(160%)
backend/audit/fixtures/workbooks/should_pass/181744-22/audit-findings-181744.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/181744-22/audit-findings-text-181744.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/181744-22/corrective-action-plan-181744.xlsx
Binary file not shown.
Binary file modified
BIN
+626 KB
(170%)
backend/audit/fixtures/workbooks/should_pass/181744-22/federal-awards-181744.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/181744-22/notes-to-sefa-181744.xlsx
Binary file not shown.
Binary file modified
BIN
+98.4 KB
(150%)
backend/audit/fixtures/workbooks/should_pass/181744-22/secondary-auditors-181744.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/182926-22/additional-eins-182926.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/182926-22/additional-ueis-182926.xlsx
Binary file not shown.
Binary file modified
BIN
+429 KB
(160%)
backend/audit/fixtures/workbooks/should_pass/182926-22/audit-findings-182926.xlsx
Binary file not shown.
Binary file modified
BIN
+42.7 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/182926-22/audit-findings-text-182926.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/182926-22/corrective-action-plan-182926.xlsx
Binary file not shown.
Binary file modified
BIN
+627 KB
(170%)
backend/audit/fixtures/workbooks/should_pass/182926-22/federal-awards-182926.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/182926-22/notes-to-sefa-182926.xlsx
Binary file not shown.
Binary file modified
BIN
+98.4 KB
(150%)
backend/audit/fixtures/workbooks/should_pass/182926-22/secondary-auditors-182926.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/191734-21/additional-eins-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/191734-21/additional-ueis-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+429 KB
(170%)
backend/audit/fixtures/workbooks/should_pass/191734-21/audit-findings-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/191734-21/audit-findings-text-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/191734-21/corrective-action-plan-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+626 KB
(170%)
backend/audit/fixtures/workbooks/should_pass/191734-21/federal-awards-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/191734-21/notes-to-sefa-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+98.4 KB
(150%)
backend/audit/fixtures/workbooks/should_pass/191734-21/secondary-auditors-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/191734-22/additional-eins-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/191734-22/additional-ueis-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+429 KB
(160%)
backend/audit/fixtures/workbooks/should_pass/191734-22/audit-findings-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/191734-22/audit-findings-text-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/191734-22/corrective-action-plan-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+626 KB
(170%)
backend/audit/fixtures/workbooks/should_pass/191734-22/federal-awards-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/191734-22/notes-to-sefa-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+98.4 KB
(150%)
backend/audit/fixtures/workbooks/should_pass/191734-22/secondary-auditors-191734.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/219107-21/additional-eins-219107.xlsx
Binary file not shown.
Binary file modified
BIN
+24.4 KB
(110%)
backend/audit/fixtures/workbooks/should_pass/219107-21/additional-ueis-219107.xlsx
Binary file not shown.
Binary file modified
BIN
+429 KB
(160%)
backend/audit/fixtures/workbooks/should_pass/219107-21/audit-findings-219107.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/219107-21/audit-findings-text-219107.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/219107-21/corrective-action-plan-219107.xlsx
Binary file not shown.
Binary file modified
BIN
+627 KB
(170%)
backend/audit/fixtures/workbooks/should_pass/219107-21/federal-awards-219107.xlsx
Binary file not shown.
Binary file modified
BIN
+42.5 KB
(120%)
backend/audit/fixtures/workbooks/should_pass/219107-21/notes-to-sefa-219107.xlsx
Binary file not shown.
Binary file modified
BIN
+98.4 KB
(150%)
backend/audit/fixtures/workbooks/should_pass/219107-21/secondary-auditors-219107.xlsx
Binary file not shown.
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,32 @@ | ||
from django.core.exceptions import ValidationError | ||
import logging | ||
from audit.intakelib.intermediate_representation import ( | ||
get_range_by_name, | ||
) | ||
from audit.intakelib.common import get_message, build_cell_error_tuple | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
AUTHORIZED_VERSIONS = {"1.0.0", "1.0.1", "1.0.2", "1.0.3"} | ||
|
||
|
||
# DESCRIPTION | ||
# This checks if the uploaded workbook version is valid. | ||
def validate_workbook_version(ir): | ||
version_range = get_range_by_name(ir, "version") | ||
errors = [] | ||
for index, version in enumerate(version_range["values"]): | ||
# Check if version is not in the set of valid versions | ||
if version not in AUTHORIZED_VERSIONS: | ||
errors.append( | ||
build_cell_error_tuple( | ||
ir, | ||
version_range, | ||
index, | ||
get_message("check_workbook_version").format(version), | ||
) | ||
) | ||
|
||
if errors: | ||
logger.info("Raising a validation error.") | ||
raise ValidationError(errors) |
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
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
21 changes: 21 additions & 0 deletions
21
backend/audit/intakelib/transforms/xform_add_transform_for_cfda_key.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,21 @@ | ||
import logging | ||
from audit.intakelib.intermediate_representation import ( | ||
get_range_by_name, | ||
replace_range_by_name, | ||
) | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def generate_cfda_keys(ir): | ||
cfda_keys = [] | ||
federal_agency_prefixes = get_range_by_name(ir, "federal_agency_prefix") | ||
three_digit_extensions = get_range_by_name(ir, "three_digit_extension") | ||
for prefix, extension in zip( | ||
federal_agency_prefixes["values"], three_digit_extensions["values"] | ||
): | ||
cfda_keys.append(f"{prefix}.{extension}" if prefix and extension else "") | ||
|
||
xform_ir = replace_range_by_name(ir, "cfda_key", cfda_keys) | ||
|
||
return xform_ir |
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,20 @@ | ||
# Census Historical Migration | ||
|
||
### How to run the historic data migrator: | ||
``` | ||
docker compose run web python manage.py historic_data_migrator --email [email protected] \ | ||
--year 22 \ | ||
--dbkey 100010 | ||
``` | ||
- The email address currently must be a User in the system. As this has only been run locally so far, it would often be a test account in my local sandbox env. | ||
- `year` and `dbkey` are optional. The script will use default values for these if they aren't provided. | ||
|
||
### How to run the historic workbook generator: | ||
``` | ||
docker compose run web python manage.py historic_workbook_generator | ||
--year 22 \ | ||
--output <your_output_directory> \ | ||
--dbkey 100010 | ||
``` | ||
- `year` is optional and defaults to `22`. | ||
- The `output` directory will be created if it doesn't already exist. |
Empty file.
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,3 @@ | ||
from django.contrib import admin # noqa: F401 | ||
|
||
# Register your models here. |
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,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class CensusHistoricalMigrationConfig(AppConfig): | ||
default_auto_field = "django.db.models.BigAutoField" | ||
name = "census_historical_migration" |
61 changes: 61 additions & 0 deletions
61
backend/census_historical_migration/management/commands/historic_data_migrator.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,61 @@ | ||
import os | ||
import logging | ||
import sys | ||
|
||
from config.settings import ENVIRONMENT | ||
from django.core.management.base import BaseCommand | ||
from census_historical_migration.workbooklib.end_to_end_core import run_end_to_end | ||
|
||
CYPRESS_TEST_EMAIL_ADDR = os.getenv("CYPRESS_LOGIN_TEST_EMAIL_AUDITEE") | ||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class Command(BaseCommand): | ||
def add_arguments(self, parser): | ||
parser.add_argument("--email", type=str, required=False) | ||
parser.add_argument("--dbkeys", type=str, required=False, default="") | ||
parser.add_argument("--years", type=str, required=False, default="") | ||
|
||
def handle(self, *args, **options): | ||
dbkeys_str = options["dbkeys"] | ||
years_str = options["years"] | ||
dbkeys = dbkeys_str.split(",") | ||
years = years_str.split(",") | ||
|
||
if len(dbkeys) != len(years): | ||
logger.error( | ||
"Received {} dbkeys and {} years. Must be equal. Exiting.".format( | ||
len(dbkeys), len(years) | ||
) | ||
) | ||
sys.exit(-1) | ||
|
||
lengths = [len(s) == 2 for s in years] | ||
if dbkeys_str and years_str and (not all(lengths)): | ||
logger.error("Years must be two digits. Exiting.") | ||
sys.exit(-2) | ||
|
||
email = options.get("email", CYPRESS_TEST_EMAIL_ADDR) | ||
|
||
defaults = [ | ||
(182926, 22), | ||
(181744, 22), | ||
(191734, 22), | ||
] | ||
|
||
if ENVIRONMENT in ["LOCAL", "DEVELOPMENT", "PREVIEW", "STAGING"]: | ||
if dbkeys_str and years_str: | ||
logger.info( | ||
f"Generating test reports for DBKEYS: {dbkeys_str} and YEARS: {years_str}" | ||
) | ||
for dbkey, year in zip(dbkeys, years): | ||
run_end_to_end(email, dbkey, year) | ||
else: | ||
for pair in defaults: | ||
logger.info("Running {}-{} end-to-end".format(pair[0], pair[1])) | ||
run_end_to_end(email, str(pair[0]), str(pair[1])) | ||
else: | ||
logger.error( | ||
"Cannot run end-to-end workbook generation in production. Exiting." | ||
) | ||
sys.exit(-3) |
Oops, something went wrong.