From 7ae35e489db9fcf5d96abf21a52f999bb5adeb95 Mon Sep 17 00:00:00 2001 From: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> Date: Wed, 20 Sep 2023 09:58:26 -0400 Subject: [PATCH 1/3] Backup Database and put in s3 (#2109) * Add backup cf task Should only run if a tag is present * Adds django backup * adds django backup to requirements * fix DBBACKUP_STORAGE * Set to private bucket * Fix linting issue * move DBBACKUP * move backup into private s3 chunk * remove db backup? * add dbbackup back * move into other INSTALLED_APPS * Fixes settings.py * pg_dump needs to match server/client versions pg_dump: error: server version: 15.3; pg_dump version: 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1) pg_dump: error: aborting because of server version mismatch * Testing if data load works with psql 15 * both psql client versions? * try postgresql-common * remove pg_common * Bump to jammy psql v15 * Add comments to apt.yml * Remove unnecessary path * add callable script for cf tasks * Update to script and make +x * call script instead of direct command * Make db dumps a bit more readable * add correct url to apt.yml comment * rollback * Bump Mem to 1G In order to run python manage.py dbrestore, 512M wasn't enough to actually do the restore. * Set a readable name to the db dumps (again) * Set back to 1G like the other envs * Set app instance back to 512M Mem * Sketch: Add a bucket for backups, shared to appropriate spaces NOTE: NOT YET FUNCTIONAL! This is a sketch until the TODOs are addressed * Modify settings for new bucket * Bind the bucket to the running app This makes it so that we do not need to modify the manifest, and only expose the backup bucket while we are actually using it, i.e when we want to do a backup. * terraform fmt * Shares the s3 backup bucket with designated spaces Based on the values in config.tf * Fix typo on unbind-service cf command * Regenerate TF Plan * Regenerate TF Plan * Remove django-storages This appears to be redundant. Removing this does not change the requirements.txt file * Add default behavior for dbbackup if local env * Fix linting issue --------- Co-authored-by: Bret Mogilefsky --- .github/workflows/deploy-application.yml | 30 +++++++++++++++++++++++ backend/apt.yml | 13 +++++++++- backend/backup_database.sh | 5 ++++ backend/config/settings.py | 16 ++++++++++++ backend/load_data.sh | 2 +- backend/requirements.txt | 25 +++++++++++++------ backend/requirements/requirements.in | 3 ++- terraform/meta/config.tf | 14 ++++++++--- terraform/meta/meta.tf | 31 ++++++++++++++++++++++++ 9 files changed, 125 insertions(+), 14 deletions(-) create mode 100755 backend/backup_database.sh diff --git a/.github/workflows/deploy-application.yml b/.github/workflows/deploy-application.yml index 9de031d7ae..344e49a165 100644 --- a/.github/workflows/deploy-application.yml +++ b/.github/workflows/deploy-application.yml @@ -69,6 +69,36 @@ jobs: cf_space: ${{ env.space }} cf_command: update-user-provided-service fac-key-service -p '"{\"SAM_API_KEY\":\"${{ secrets.SAM_API_KEY }}\", \"DJANGO_SECRET_LOGIN_KEY\":\"${{ secrets.DJANGO_SECRET_LOGIN_KEY }}\", \"LOGIN_CLIENT_ID\":\"${{ secrets.LOGIN_CLIENT_ID }}\", \"SECRET_KEY\":\"${{ secrets.SECRET_KEY}}\"}"' + - name: Bind backup s3 bucket to prod app + if: startsWith(github.ref, 'refs/tags/v1.') + uses: cloud-gov/cg-cli-tools@main + with: + cf_username: ${{ secrets.CF_USERNAME }} + cf_password: ${{ secrets.CF_PASSWORD }} + cf_org: gsa-tts-oros-fac + cf_space: ${{ env.space }} + command: cf bind-service gsa-fac backups -w + + - name: Backup the database (Prod Only) + if: startsWith(github.ref, 'refs/tags/v1.') + uses: cloud-gov/cg-cli-tools@main + with: + cf_username: ${{ secrets.CF_USERNAME }} + cf_password: ${{ secrets.CF_PASSWORD }} + cf_org: gsa-tts-oros-fac + cf_space: ${{ env.space }} + command: cf run-task gsa-fac -k 1G -m 1G --name pg_backup --command "./backup_database.sh" + + - name: Unbind backup s3 bucket from prod app + if: startsWith(github.ref, 'refs/tags/v1.') + uses: cloud-gov/cg-cli-tools@main + with: + cf_username: ${{ secrets.CF_USERNAME }} + cf_password: ${{ secrets.CF_PASSWORD }} + cf_org: gsa-tts-oros-fac + cf_space: ${{ env.space }} + command: cf unbind-service gsa-fac backups + - name: Deploy fac to cloud.gov uses: cloud-gov/cg-cli-tools@main with: diff --git a/backend/apt.yml b/backend/apt.yml index 27c7d72c62..7f4a7d9c1b 100644 --- a/backend/apt.yml +++ b/backend/apt.yml @@ -1,3 +1,14 @@ --- +# Because cf is using jammy jellyfish, and this https://packages.ubuntu.com/jammy/amd64/database/ +# does not actually have postgresql-client-15 natively (only goes to 14), +# we are having to source the version from apt.postgresql.org. This however, +# eliminates the need to run v14 for load_data.sh, and can be run on v15. +# With v15, we are also able to run python manage.py dbbackup to backup the database +# to a defined s3 bucket. Running v15 also matches the client and server database versions. +cleancache: true +keys: +- https://www.postgresql.org/media/keys/ACCC4CF8.asc +repos: +- deb https://apt.postgresql.org/pub/repos/apt/ jammy-pgdg main packages: -- postgresql-client +- postgresql-client-15 diff --git a/backend/backup_database.sh b/backend/backup_database.sh new file mode 100755 index 0000000000..210e471dd8 --- /dev/null +++ b/backend/backup_database.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +export PATH=/home/vcap/deps/0/apt/usr/lib/postgresql/15/bin:$PATH +date=$(date '+%Y-%m-%d-%H%M') +python manage.py dbbackup -o "prod-db-backup-$date.dump" diff --git a/backend/config/settings.py b/backend/config/settings.py index 3fa3c109f7..a44c493c79 100644 --- a/backend/config/settings.py +++ b/backend/config/settings.py @@ -109,6 +109,7 @@ "corsheaders", "storages", "djangooidc", + "dbbackup", ] # Our apps @@ -252,6 +253,10 @@ DISABLE_AUTH = env.bool("DISABLE_AUTH", default=False) + # Used for backing up the database https://django-dbbackup.readthedocs.io/en/master/installation.html + DBBACKUP_STORAGE = "django.core.files.storage.FileSystemStorage" + DBBACKUP_STORAGE_OPTIONS = {"location": BASE_DIR / "backup"} + else: # One of the Cloud.gov environments STATICFILES_STORAGE = "storages.backends.s3boto3.S3ManifestStaticStorage" @@ -305,6 +310,17 @@ f"https://{AWS_S3_PRIVATE_CUSTOM_DOMAIN}/{AWS_PRIVATE_LOCATION}/" ) + elif service["instance_name"] == "backups": + s3_creds = service["credentials"] + # Used for backing up the database https://django-dbbackup.readthedocs.io/en/master/storage.html#id2 + DBBACKUP_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" + DBBACKUP_STORAGE_OPTIONS = { + "access_key": s3_creds["access_key_id"], + "secret_key": s3_creds["secret_access_key"], + "bucket_name": s3_creds["bucket"], + "default_acl": "private", + } + # secure headers MIDDLEWARE.append("csp.middleware.CSPMiddleware") # see settings options https://django-csp.readthedocs.io/en/latest/configuration.html#configuration-chapter diff --git a/backend/load_data.sh b/backend/load_data.sh index 93f019c102..9443b227bd 100755 --- a/backend/load_data.sh +++ b/backend/load_data.sh @@ -6,6 +6,6 @@ git config --global http.proxy "$https_proxy" git clone https://github.com/GSA-TTS/fac-historic-public-csvs.git cd fac-historic-public-csvs -export PATH=/home/vcap/deps/0/apt/usr/lib/postgresql/14/bin:$PATH +export PATH=/home/vcap/deps/0/apt/usr/lib/postgresql/15/bin:$PATH ./create-dumps.sh ./wait-and-load.sh diff --git a/backend/requirements.txt b/backend/requirements.txt index ae999d18ef..9c4cfb60b1 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,8 +1,8 @@ # -# This file is autogenerated by pip-compile with Python 3.10 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --allow-unsafe --config=pyproject.toml --generate-hashes --output-file=requirements.txt ./requirements/requirements.in +# pip-compile --allow-unsafe --generate-hashes --output-file=requirements.txt ./requirements/requirements.in # annotated-types==0.5.0 \ --hash=sha256:47cdc3490d9ac1506ce92c7aaa76c579dc3509ff11e098fc867e5130ab7be802 \ @@ -21,7 +21,9 @@ attrs==23.1.0 \ boto3==1.28.27 \ --hash=sha256:8da9621931291b6c261fdaae465f05737c16519b9667d8463181cb8b88444572 \ --hash=sha256:a336cf53a6d86ee6d27b2f6d8b78ec9b320209127e5126359881bbd68f33d0b9 - # via -r ./requirements/requirements.in + # via + # -r ./requirements/requirements.in + # django-storages botocore==1.31.27 \ --hash=sha256:13af1588023750c9bc66d202bb5a934c9412a7dc52587532264ab725c42c2c50 \ --hash=sha256:739d09e13751e3b9b0f341b5ffe5bf8d0452b8769d435c4084ee88739d42b7f7 @@ -230,6 +232,7 @@ django==4.2.4 \ # dj-database-url # django-cors-headers # django-csp + # django-dbbackup # django-storages # djangorestframework # djangorestframework-simplejwt @@ -245,11 +248,15 @@ django-csp==3.7 \ --hash=sha256:01443a07723f9a479d498bd7bb63571aaa771e690f64bde515db6cdb76e8041a \ --hash=sha256:01eda02ad3f10261c74131cdc0b5a6a62b7c7ad4fd017fbefb7a14776e0a9727 # via -r ./requirements/requirements.in +django-dbbackup==4.0.2 \ + --hash=sha256:1874d684abc22260972a67668a6db3331b24d7e1e8af89eaffdcd61eb27dbc2a \ + --hash=sha256:3ccde831f1a8268fb031b37a8e7e2de3abb556623023af1e859cd7104c09ea2a + # via -r ./requirements/requirements.in django-fsm==2.8.1 \ --hash=sha256:e2c02cbf273fb9691aa9a907c29990afdd21a4adea09c5640344c93fbe03f8d9 \ --hash=sha256:fd9f8de9f33188e50f876ce53908fbd7289e5031a44ffdb97d43909e56699ef8 # via -r ./requirements/requirements.in -django-storages==1.13.2 \ +django-storages[boto3]==1.13.2 \ --hash=sha256:31dc5a992520be571908c4c40d55d292660ece3a55b8141462b4e719aa38eab3 \ --hash=sha256:cbadd15c909ceb7247d4ffc503f12a9bec36999df8d0bef7c31e57177d512688 # via -r ./requirements/requirements.in @@ -343,7 +350,9 @@ greenlet==2.0.2 \ --hash=sha256:eff4eb9b7eb3e4d0cae3d28c283dc16d9bed6b193c2e1ace3ed86ce48ea8df19 \ --hash=sha256:f82d4d717d8ef19188687aa32b8363e96062911e63ba22a0cff7802a8e58e5f1 \ --hash=sha256:fc3a569657468b6f3fb60587e48356fe512c1754ca05a564f11366ac9e306526 - # via -r ./requirements/requirements.in + # via + # -r ./requirements/requirements.in + # sqlalchemy gunicorn==21.2.0 \ --hash=sha256:3213aa5e8c24949e792bcacfc176fef362e7aac80b76c56f6b5122bf350722f0 \ --hash=sha256:88ec8bff1d634f98e61b9f65bc4bf3cd918a90806c6f5c48bc5603849ec81033 @@ -816,6 +825,7 @@ pytz==2023.3 \ --hash=sha256:1d8ce29db189191fb55338ee6d0387d82ab59f3d00eac103412d64e0ebd0c588 \ --hash=sha256:a151b3abb88eda1d4e34a9814df37de2a80e301e68ba0fd856fb9b46bfbbbffb # via + # django-dbbackup # djangorestframework # pandas pyyaml==6.0.1 \ @@ -1040,7 +1050,6 @@ typing-extensions==4.7.1 \ --hash=sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36 \ --hash=sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2 # via - # asgiref # dj-database-url # pydantic # pydantic-core @@ -1049,7 +1058,9 @@ typing-extensions==4.7.1 \ tzdata==2023.3 \ --hash=sha256:11ef1e08e54acb0d4f95bdb1be05da659673de4acbd21bf9c69e94cc5e907a3a \ --hash=sha256:7e65763eef3120314099b6939b5546db7adce1e7d6f2e179e3df563c70511eda - # via pandas + # via + # django + # pandas uritemplate==4.1.1 \ --hash=sha256:4346edfc5c3b79f694bccd6d6099a322bbeb628dbf2cd86eea55a456ce5124f0 \ --hash=sha256:830c08b8d99bdd312ea4ead05994a38e8936266f84b9a7878232db50b044e02e diff --git a/backend/requirements/requirements.in b/backend/requirements/requirements.in index 338e6582fc..6f1d73ce48 100644 --- a/backend/requirements/requirements.in +++ b/backend/requirements/requirements.in @@ -3,7 +3,8 @@ cfenv cryptography>=41.0.2 django-cors-headers django-csp -django-storages +django-dbbackup +django-storages[boto3] Django>=4.2.3 djangorestframework djangorestframework-simplejwt diff --git a/terraform/meta/config.tf b/terraform/meta/config.tf index 741300b93b..59d1b27d9e 100644 --- a/terraform/meta/config.tf +++ b/terraform/meta/config.tf @@ -1,10 +1,16 @@ locals { org_name = "gsa-tts-oros-fac" spaces = { - "dev" = {}, - "staging" = {}, - "preview" = {}, - "production" = { allow_ssh = false }, + "dev" = {}, + "preview" = {}, + "staging" = { + uses_backups = true + }, + "production" = { + allow_ssh = false, + uses_backups = true, + is_production = true + }, } # All spaces have the same SpaceDevelopers for now diff --git a/terraform/meta/meta.tf b/terraform/meta/meta.tf index 05446c8c96..3c2c02e1ca 100644 --- a/terraform/meta/meta.tf +++ b/terraform/meta/meta.tf @@ -34,3 +34,34 @@ module "environments" { # bootstrap-env module manage both spaces in a future PR! asgs = lookup(each.value, "allow_egress", false) ? tolist(local.egress_asgs) : tolist(local.internal_asgs) } + +locals { + # Filters the list of spaces with a value of true for "uses_backups". We only want to share the bucket to those spaces. + spaces_that_use_backups = join(" ", [for key, config in local.spaces : lookup(config, "uses_backups", false) ? key : ""]) +} + +module "s3-backups" { + source = "github.com/18f/terraform-cloudgov//s3?ref=v0.5.1" + + cf_org_name = local.org_name + # TODO: This should be the key for the first space that says "is_production = + # true" rather than being hardcoded + cf_space_name = "production" + name = "backups" + s3_plan_name = "basic" +} + +# TODO: We should have a corresponding "unshar-backup-from-spaces" resource, in +# case a space is removed from the list + +resource "null_resource" "share-backup-to-spaces" { + provisioner "local-exec" { + environment = { + SPACES = "${local.spaces_that_use_backups}" + } + command = "for space in $SPACES ; do cf share-service backups -s $space; done" + } + depends_on = [ + module.s3-backups + ] +} From 35be843d3de74934afa75868a26b8728656e8f3e Mon Sep 17 00:00:00 2001 From: Matthew Jadud Date: Wed, 20 Sep 2023 10:45:50 -0400 Subject: [PATCH 2/3] Fixes a regression. (#2177) We don't want to disseminate the field 'secondary_auditors_exist'. --- backend/audit/intake_to_dissemination.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/audit/intake_to_dissemination.py b/backend/audit/intake_to_dissemination.py index fbec941b67..b70a1c1ff9 100644 --- a/backend/audit/intake_to_dissemination.py +++ b/backend/audit/intake_to_dissemination.py @@ -290,6 +290,7 @@ def load_general(self): "is_usa_based", "met_spending_threshold", "multiple_eins_covered", + "secondary_auditors_exist", ) general_data = omit(gen_key_exceptions, general_information) general_data = general_data | { From f38ad9d4f60c37b6001aba51295e7d210ceb8fbe Mon Sep 17 00:00:00 2001 From: Tim Ballard <1425377+timoballard@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:09:48 -0500 Subject: [PATCH 3/3] Migration reset (#2178) * reset audit migrations * reset dissemination, user migrations * reset support migrations * linter --- backend/audit/migrations/0001_initial.py | 472 ++++++++++ backend/audit/migrations/0001_initial_sac.py | 184 ---- ...ser_provided_organization_type_and_more.py | 76 -- ...ditchecklist_auditor_firm_name_and_more.py | 56 -- ..._singleauditchecklist_submission_status.py | 29 - .../0005_singleauditchecklist_report_id.py | 17 - ...06_alter_singleauditchecklist_report_id.py | 17 - ..._alter_singleauditchecklist_auditee_uei.py | 32 - ...ons_rename_user_id_access_user_and_more.py | 35 - .../0009_alter_access_role_and_more.py | 51 -- ...checklist_audit_period_covered_and_more.py | 177 ---- .../migrations/0011_alter_access_role.py | 27 - ...ss)s_single_certifying_auditee_and_more.py | 36 - ...013_singleauditchecklist_federal_awards.py | 20 - ...ter_singleauditchecklist_federal_awards.py | 22 - ...ingleauditchecklist_general_information.py | 22 - ...checklist_audit_period_covered_and_more.py | 140 --- backend/audit/migrations/0017_excelfile.py | 48 - .../migrations/0018_alter_excelfile_file.py | 20 - ...ecklist_corrective_action_plan_and_more.py | 31 - ...0020_singleauditchecklist_findings_text.py | 22 - ..._singleauditchecklist_submission_status.py | 29 - ...ve_access_audit_single_creator_and_more.py | 29 - .../migrations/0023_alter_access_role.py | 25 - .../migrations/0024_excelfile_form_section.py | 17 - .../0025_alter_excelfile_form_section.py | 17 - ...auditchecklist_transition_date_and_more.py | 39 - ...auditchecklist_additional_ueis_and_more.py | 106 --- ...0028_singleauditchecklist_notes_to_sefa.py | 22 - ...singleauditchecklist_secondary_auditors.py | 22 - ..._singleauditchecklist_audit_information.py | 22 - ...eauditreportfile_component_page_numbers.py | 22 - ...hecklist_auditee_certification_and_more.py | 31 - ...ingleauditchecklist_tribal_data_consent.py | 22 - ...34_singleauditchecklist_additional_eins.py | 22 - .../0035_singleauditchecklist_data_source.py | 17 - .../migrations/0036_cognizantbaseline.py | 58 -- .../audit/migrations/0037_access_fullname.py | 17 - .../audit/migrations/0038_submissionevent.py | 93 -- .../0039_delete_cognizantbaseline_and_more.py | 35 - .../dissemination/migrations/0001_initial.py | 852 +++++++++++++++++- .../migrations/0002_additionalein.py | 31 - .../0003_note_contains_chart_or_table.py | 21 - ...19_censuscfda22_censusgen19_censusgen22.py | 836 ----------------- backend/support/migrations/0001_initial.py | 69 +- ...nt_cognizantbaseline_is_active_and_more.py | 84 -- ...create_user_profile.py => 0001_initial.py} | 3 +- .../0002_add_default_for_jsonfield.py | 22 - backend/users/migrations/0003_logingovuser.py | 37 - .../0004_alter_logingovuser_login_id.py | 17 - .../migrations/0005_delete_logingovuser.py | 15 - 51 files changed, 1368 insertions(+), 2798 deletions(-) create mode 100644 backend/audit/migrations/0001_initial.py delete mode 100644 backend/audit/migrations/0001_initial_sac.py delete mode 100644 backend/audit/migrations/0002_alter_singleauditchecklist_user_provided_organization_type_and_more.py delete mode 100644 backend/audit/migrations/0003_rename_auditor_name_singleauditchecklist_auditor_firm_name_and_more.py delete mode 100644 backend/audit/migrations/0004_singleauditchecklist_submission_status.py delete mode 100644 backend/audit/migrations/0005_singleauditchecklist_report_id.py delete mode 100644 backend/audit/migrations/0006_alter_singleauditchecklist_report_id.py delete mode 100644 backend/audit/migrations/0007_alter_singleauditchecklist_auditee_uei.py delete mode 100644 backend/audit/migrations/0008_alter_access_options_rename_user_id_access_user_and_more.py delete mode 100644 backend/audit/migrations/0009_alter_access_role_and_more.py delete mode 100644 backend/audit/migrations/0010_alter_singleauditchecklist_audit_period_covered_and_more.py delete mode 100644 backend/audit/migrations/0011_alter_access_role.py delete mode 100644 backend/audit/migrations/0012_remove_access_audit_$(class)s_single_certifying_auditee_and_more.py delete mode 100644 backend/audit/migrations/0013_singleauditchecklist_federal_awards.py delete mode 100644 backend/audit/migrations/0014_alter_singleauditchecklist_federal_awards.py delete mode 100644 backend/audit/migrations/0015_singleauditchecklist_general_information.py delete mode 100644 backend/audit/migrations/0016_remove_singleauditchecklist_audit_period_covered_and_more.py delete mode 100644 backend/audit/migrations/0017_excelfile.py delete mode 100644 backend/audit/migrations/0018_alter_excelfile_file.py delete mode 100644 backend/audit/migrations/0019_singleauditchecklist_corrective_action_plan_and_more.py delete mode 100644 backend/audit/migrations/0020_singleauditchecklist_findings_text.py delete mode 100644 backend/audit/migrations/0021_alter_singleauditchecklist_submission_status.py delete mode 100644 backend/audit/migrations/0022_remove_access_audit_single_creator_and_more.py delete mode 100644 backend/audit/migrations/0023_alter_access_role.py delete mode 100644 backend/audit/migrations/0024_excelfile_form_section.py delete mode 100644 backend/audit/migrations/0025_alter_excelfile_form_section.py delete mode 100644 backend/audit/migrations/0026_singleauditchecklist_transition_date_and_more.py delete mode 100644 backend/audit/migrations/0027_singleauditchecklist_additional_ueis_and_more.py delete mode 100644 backend/audit/migrations/0028_singleauditchecklist_notes_to_sefa.py delete mode 100644 backend/audit/migrations/0029_singleauditchecklist_secondary_auditors.py delete mode 100644 backend/audit/migrations/0030_singleauditchecklist_audit_information.py delete mode 100644 backend/audit/migrations/0031_singleauditreportfile_component_page_numbers.py delete mode 100644 backend/audit/migrations/0032_singleauditchecklist_auditee_certification_and_more.py delete mode 100644 backend/audit/migrations/0033_singleauditchecklist_tribal_data_consent.py delete mode 100644 backend/audit/migrations/0034_singleauditchecklist_additional_eins.py delete mode 100644 backend/audit/migrations/0035_singleauditchecklist_data_source.py delete mode 100644 backend/audit/migrations/0036_cognizantbaseline.py delete mode 100644 backend/audit/migrations/0037_access_fullname.py delete mode 100644 backend/audit/migrations/0038_submissionevent.py delete mode 100644 backend/audit/migrations/0039_delete_cognizantbaseline_and_more.py delete mode 100644 backend/dissemination/migrations/0002_additionalein.py delete mode 100644 backend/dissemination/migrations/0003_note_contains_chart_or_table.py delete mode 100644 backend/dissemination/migrations/0004_censuscfda19_censuscfda22_censusgen19_censusgen22.py delete mode 100644 backend/support/migrations/0002_cognizantassignment_cognizantbaseline_is_active_and_more.py rename backend/users/migrations/{0001_create_user_profile.py => 0001_initial.py} (93%) delete mode 100644 backend/users/migrations/0002_add_default_for_jsonfield.py delete mode 100644 backend/users/migrations/0003_logingovuser.py delete mode 100644 backend/users/migrations/0004_alter_logingovuser_login_id.py delete mode 100644 backend/users/migrations/0005_delete_logingovuser.py diff --git a/backend/audit/migrations/0001_initial.py b/backend/audit/migrations/0001_initial.py new file mode 100644 index 0000000000..3118977b69 --- /dev/null +++ b/backend/audit/migrations/0001_initial.py @@ -0,0 +1,472 @@ +# Generated by Django 4.2.3 on 2023-09-20 13:57 + +import audit.models +import audit.validators +from django.conf import settings +import django.contrib.postgres.fields +from django.db import migrations, models +import django.db.models.deletion +import django_fsm + + +class Migration(migrations.Migration): + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name="SingleAuditChecklist", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("date_created", models.DateTimeField(auto_now_add=True)), + ( + "submission_status", + django_fsm.FSMField( + choices=[ + ("in_progress", "In Progress"), + ("ready_for_certification", "Ready for Certification"), + ("auditor_certified", "Auditor Certified"), + ("auditee_certified", "Auditee Certified"), + ("certified", "Certified"), + ("submitted", "Submitted"), + ("disseminated", "Disseminated"), + ], + default="in_progress", + max_length=50, + ), + ), + ("data_source", models.CharField(default="GSA")), + ( + "transition_name", + django.contrib.postgres.fields.ArrayField( + base_field=models.CharField( + choices=[ + ("in_progress", "In Progress"), + ("ready_for_certification", "Ready for Certification"), + ("auditor_certified", "Auditor Certified"), + ("auditee_certified", "Auditee Certified"), + ("certified", "Certified"), + ("submitted", "Submitted"), + ("disseminated", "Disseminated"), + ], + max_length=40, + ), + blank=True, + default=list, + null=True, + size=None, + ), + ), + ( + "transition_date", + django.contrib.postgres.fields.ArrayField( + base_field=models.DateTimeField(), + blank=True, + default=list, + null=True, + size=None, + ), + ), + ("report_id", models.CharField(max_length=17, unique=True)), + ( + "audit_type", + models.CharField( + blank=True, + choices=[ + ("single-audit", "Single Audit"), + ("program-specific", "Program-Specific Audit"), + ], + max_length=20, + null=True, + ), + ), + ( + "general_information", + models.JSONField( + blank=True, + null=True, + validators=[audit.validators.validate_general_information_json], + ), + ), + ( + "audit_information", + models.JSONField( + blank=True, + null=True, + validators=[audit.validators.validate_audit_information_json], + ), + ), + ( + "federal_awards", + models.JSONField( + blank=True, + null=True, + validators=[audit.validators.validate_federal_award_json], + ), + ), + ( + "corrective_action_plan", + models.JSONField( + blank=True, + null=True, + validators=[ + audit.validators.validate_corrective_action_plan_json + ], + ), + ), + ( + "findings_text", + models.JSONField( + blank=True, + null=True, + validators=[audit.validators.validate_findings_text_json], + ), + ), + ( + "findings_uniform_guidance", + models.JSONField( + blank=True, + null=True, + validators=[ + audit.validators.validate_findings_uniform_guidance_json + ], + ), + ), + ( + "additional_ueis", + models.JSONField( + blank=True, + null=True, + validators=[audit.validators.validate_additional_ueis_json], + ), + ), + ( + "additional_eins", + models.JSONField( + blank=True, + null=True, + validators=[audit.validators.validate_additional_eins_json], + ), + ), + ( + "secondary_auditors", + models.JSONField( + blank=True, + null=True, + validators=[audit.validators.validate_secondary_auditors_json], + ), + ), + ( + "notes_to_sefa", + models.JSONField( + blank=True, + null=True, + validators=[audit.validators.validate_notes_to_sefa_json], + ), + ), + ( + "auditor_certification", + models.JSONField( + blank=True, + null=True, + validators=[ + audit.validators.validate_auditor_certification_json + ], + ), + ), + ( + "auditee_certification", + models.JSONField( + blank=True, + null=True, + validators=[ + audit.validators.validate_auditee_certification_json + ], + ), + ), + ( + "tribal_data_consent", + models.JSONField( + blank=True, + null=True, + validators=[audit.validators.validate_tribal_data_consent_json], + ), + ), + ( + "cognizant_agency", + models.CharField( + blank=True, + max_length=2, + null=True, + verbose_name="Agency assigned to this large submission. Computed when the submisson is finalized, but may be overridden", + ), + ), + ( + "oversight_agency", + models.CharField( + blank=True, + max_length=2, + null=True, + verbose_name="Agency assigned to this not so large submission. Computed when the submisson is finalized", + ), + ), + ( + "submitted_by", + models.ForeignKey( + on_delete=django.db.models.deletion.PROTECT, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + options={ + "verbose_name": "SF-SAC", + "verbose_name_plural": "SF-SACs", + }, + bases=(models.Model, audit.models.GeneralInformationMixin), + ), + migrations.CreateModel( + name="SubmissionEvent", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("timestamp", models.DateTimeField(auto_now_add=True)), + ( + "event", + models.CharField( + choices=[ + ("access-granted", "Access granted"), + ("additional-eins-updated", "Additional EINs updated"), + ("additional-ueis-updated", "Additional UEIs updated"), + ("audit-information-updated", "Audit information updated"), + ("audit-report-pdf-updated", "Audit report PDF updated"), + ( + "auditee-certification-completed", + "Auditee certification completed", + ), + ( + "auditor-certification-completed", + "Auditor certification completed", + ), + ( + "corrective-action-plan-updated", + "Corrective action plan updated", + ), + ("created", "Created"), + ("federal-awards-updated", "Federal awards updated"), + ( + "federal-awards-audit-findings-updated", + "Federal awards audit findings updated", + ), + ( + "federal-awards-audit-findings-text-updated", + "Federal awards audit findings text updated", + ), + ( + "findings-uniform-guidance-updated", + "Findings uniform guidance updated", + ), + ( + "general-information-updated", + "General information updated", + ), + ("locked-for-certification", "Locked for certification"), + ("notes-to-sefa-updated", "Notes to SEFA updated"), + ( + "secondary-auditors-updated", + "Secondary auditors updated", + ), + ("submitted", "Submitted to the FAC for processing"), + ] + ), + ), + ( + "sac", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="audit.singleauditchecklist", + ), + ), + ( + "user", + models.ForeignKey( + on_delete=django.db.models.deletion.PROTECT, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + ), + migrations.CreateModel( + name="SingleAuditReportFile", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "file", + models.FileField( + upload_to=audit.models.single_audit_report_path, + validators=[audit.validators.validate_single_audit_report_file], + ), + ), + ("filename", models.CharField(max_length=255)), + ("date_created", models.DateTimeField(auto_now_add=True)), + ( + "component_page_numbers", + models.JSONField( + blank=True, + null=True, + validators=[audit.validators.validate_component_page_numbers], + ), + ), + ( + "sac", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="audit.singleauditchecklist", + ), + ), + ( + "user", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + ), + migrations.CreateModel( + name="ExcelFile", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "file", + models.FileField( + upload_to=audit.models.excel_file_path, + validators=[audit.validators.validate_excel_file], + ), + ), + ("filename", models.CharField(max_length=255)), + ("form_section", models.CharField(max_length=255)), + ("date_created", models.DateTimeField(auto_now_add=True)), + ( + "sac", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="audit.singleauditchecklist", + ), + ), + ( + "user", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + ), + migrations.CreateModel( + name="Access", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "role", + models.CharField( + choices=[ + ( + "certifying_auditee_contact", + "Auditee Certifying Official", + ), + ( + "certifying_auditor_contact", + "Auditor Certifying Official", + ), + ("editor", "Audit Editor"), + ], + help_text="Access type granted to this user", + max_length=50, + ), + ), + ("fullname", models.CharField(blank=True)), + ("email", models.EmailField(max_length=254)), + ( + "sac", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="audit.singleauditchecklist", + ), + ), + ( + "user", + models.ForeignKey( + help_text="User ID associated with this email address, empty if no FAC account exists", + null=True, + on_delete=django.db.models.deletion.PROTECT, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + options={ + "verbose_name_plural": "accesses", + }, + ), + migrations.AddConstraint( + model_name="access", + constraint=models.UniqueConstraint( + condition=models.Q(("role", "certifying_auditee_contact")), + fields=("sac",), + name="audit_$(class)s_single_certifying_auditee", + ), + ), + migrations.AddConstraint( + model_name="access", + constraint=models.UniqueConstraint( + condition=models.Q(("role", "certifying_auditor_contact")), + fields=("sac",), + name="audit_access_single_certifying_auditor", + ), + ), + ] diff --git a/backend/audit/migrations/0001_initial_sac.py b/backend/audit/migrations/0001_initial_sac.py deleted file mode 100644 index ecea3b1e5b..0000000000 --- a/backend/audit/migrations/0001_initial_sac.py +++ /dev/null @@ -1,184 +0,0 @@ -# Generated by Django 4.0.4 on 2022-04-18 18:51 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name="SingleAuditChecklist", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("date_created", models.DateTimeField(auto_now_add=True)), - ( - "user_provided_organization_type", - models.CharField( - choices=[ - ("state", "State"), - ("local", "Local Government"), - ("tribal", "Indian Tribe or Tribal Organization"), - ("non-profit", "Non-profit"), - ("unknown", "Unknown"), - ("none", "None of these (for example, for-profit"), - ], - max_length=12, - ), - ), - ("met_spending_threshold", models.BooleanField()), - ( - "is_usa_based", - models.BooleanField(verbose_name="Is USA Based"), - ), - ( - "uei", - models.CharField( - help_text="Unique Entity Identifier", - max_length=12, - verbose_name="UEI", - ), - ), - ("auditee_fiscal_period_start", models.DateField()), - ("auditee_fiscal_period_end", models.DateField()), - ( - "audit_type", - models.CharField( - choices=[ - ("single-audit", "Single Audit"), - ("program-specific", "Program-Specific Audit"), - ], - max_length=20, - null=True, - ), - ), - ( - "audit_period_covered", - models.CharField( - choices=[ - ("annual", "Annual"), - ("biennial", "Biennial"), - ("other", "Other"), - ], - max_length=20, - null=True, - ), - ), - ( - "ein", - models.CharField( - help_text="Auditee Employer Identification Number", - max_length=12, - null=True, - verbose_name="EIN", - ), - ), - ( - "ein_not_an_ssn_attestation", - models.BooleanField( - null=True, verbose_name="Attestation: EIN Not an SSN" - ), - ), - ( - "multiple_eins_covered", - models.BooleanField( - null=True, verbose_name="Multiple EINs covered" - ), - ), - ( - "multiple_ueis_covered", - models.BooleanField( - null=True, verbose_name="Multiple UEIs covered" - ), - ), - ("auditee_name", models.CharField(max_length=100, null=True)), - ( - "auditee_address_line_1", - models.CharField(max_length=100, null=True), - ), - ( - "auditee_address_line_2", - models.CharField(max_length=100, null=True), - ), - ("auditee_city", models.CharField(max_length=100, null=True)), - ("auditee_zip", models.CharField(max_length=100, null=True)), - ("auditee_state", models.CharField(max_length=2, null=True)), - ( - "auditee_contact_title", - models.CharField(max_length=100, null=True), - ), - ( - "auditee_contact_name", - models.CharField(max_length=100, null=True), - ), - ( - "auditee_email", - models.EmailField(max_length=100, null=True), - ), - ("auditee_phone", models.CharField(max_length=100, null=True)), - ("auditor_name", models.CharField(max_length=100, null=True)), - ( - "auditor_ein", - models.CharField( - max_length=12, null=True, verbose_name="Auditor EIN" - ), - ), - ( - "auditor_ein_not_an_ssn_attestation", - models.BooleanField( - null=True, - verbose_name="Attestation: Auditor EIN Not an SSN", - ), - ), - ( - "auditor_address_line_1", - models.CharField(max_length=100, null=True), - ), - ( - "auditor_address_line_2", - models.CharField(max_length=100, null=True), - ), - ("auditor_city", models.CharField(max_length=100, null=True)), - ("auditor_zip", models.CharField(max_length=100, null=True)), - ("auditor_state", models.CharField(max_length=100, null=True)), - ( - "auditor_contact_title", - models.CharField(max_length=100, null=True), - ), - ( - "auditor_contact_name", - models.CharField(max_length=100, null=True), - ), - ( - "auditor_email", - models.EmailField(max_length=100, null=True), - ), - ("auditor_phone", models.CharField(max_length=100, null=True)), - ( - "submitted_by", - models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, - to=settings.AUTH_USER_MODEL, - ), - ), - ], - options={ - "verbose_name": "SF-SAC", - "verbose_name_plural": "SF-SACs", - }, - ), - ] diff --git a/backend/audit/migrations/0002_alter_singleauditchecklist_user_provided_organization_type_and_more.py b/backend/audit/migrations/0002_alter_singleauditchecklist_user_provided_organization_type_and_more.py deleted file mode 100644 index d2cd27ad50..0000000000 --- a/backend/audit/migrations/0002_alter_singleauditchecklist_user_provided_organization_type_and_more.py +++ /dev/null @@ -1,76 +0,0 @@ -# Generated by Django 4.0.4 on 2022-04-22 19:09 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ("audit", "0001_initial_sac"), - ] - - operations = [ - migrations.AlterField( - model_name="singleauditchecklist", - name="user_provided_organization_type", - field=models.CharField( - choices=[ - ("state", "State"), - ("local", "Local Government"), - ("tribal", "Indian Tribe or Tribal Organization"), - ("higher-ed", "Institution of higher education (IHE)"), - ("non-profit", "Non-profit"), - ("unknown", "Unknown"), - ("none", "None of these (for example, for-profit"), - ], - max_length=12, - ), - ), - migrations.CreateModel( - name="Access", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "role", - models.CharField( - choices=[ - ("auditee_contact", "Auditee Contact"), - ("auditee_cert", "Auditee Certifying Official"), - ("auditor_contact", "Auditor Contact"), - ("auditor_cert", "Auditor Certifying Official"), - ], - help_text="Access type granted to this user", - max_length=15, - ), - ), - ("email", models.EmailField(max_length=254)), - ( - "sac", - models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, - related_name="users", - to="audit.singleauditchecklist", - ), - ), - ( - "user_id", - models.ForeignKey( - help_text="User ID associated with this email address, empty if no FAC account exists", - null=True, - on_delete=django.db.models.deletion.PROTECT, - to=settings.AUTH_USER_MODEL, - ), - ), - ], - ), - ] diff --git a/backend/audit/migrations/0003_rename_auditor_name_singleauditchecklist_auditor_firm_name_and_more.py b/backend/audit/migrations/0003_rename_auditor_name_singleauditchecklist_auditor_firm_name_and_more.py deleted file mode 100644 index 7d314a6794..0000000000 --- a/backend/audit/migrations/0003_rename_auditor_name_singleauditchecklist_auditor_firm_name_and_more.py +++ /dev/null @@ -1,56 +0,0 @@ -# Generated by Django 4.0.4 on 2022-05-20 22:33 - -import audit.validators -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ( - "audit", - "0002_alter_singleauditchecklist_user_provided_organization_type_and_more", - ), - ] - - operations = [ - migrations.RenameField( - model_name="singleauditchecklist", - old_name="auditor_name", - new_name="auditor_firm_name", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditee_address_line_2", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditor_address_line_2", - ), - migrations.AddField( - model_name="singleauditchecklist", - name="auditor_country", - field=models.CharField(max_length=100, null=True), - ), - migrations.RenameField( - model_name="singleauditchecklist", - old_name="uei", - new_name="auditee_uei", - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditee_uei", - field=models.CharField( - help_text="Auditee Unique Entity Identifier", - max_length=12, - validators=[ - django.core.validators.MinLengthValidator(12), - audit.validators.validate_uei_alphanumeric, - audit.validators.validate_uei_valid_chars, - audit.validators.validate_uei_leading_char, - audit.validators.validate_uei_nine_digit_sequences, - ], - verbose_name="Auditee UEI", - ), - ), - ] diff --git a/backend/audit/migrations/0004_singleauditchecklist_submission_status.py b/backend/audit/migrations/0004_singleauditchecklist_submission_status.py deleted file mode 100644 index 1e8205c22d..0000000000 --- a/backend/audit/migrations/0004_singleauditchecklist_submission_status.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 4.0.4 on 2022-06-08 19:39 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ( - "audit", - "0003_rename_auditor_name_singleauditchecklist_auditor_firm_name_and_more", - ), - ] - - operations = [ - migrations.AddField( - model_name="singleauditchecklist", - name="submission_status", - field=models.CharField( - choices=[ - ("in_progress", "In progress"), - ("submitted", "Submitted"), - ("received", "Received"), - ("available", "Available"), - ], - default="in_progress", - max_length=16, - ), - ), - ] diff --git a/backend/audit/migrations/0005_singleauditchecklist_report_id.py b/backend/audit/migrations/0005_singleauditchecklist_report_id.py deleted file mode 100644 index 008934d668..0000000000 --- a/backend/audit/migrations/0005_singleauditchecklist_report_id.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 4.0.4 on 2022-06-29 06:59 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0004_singleauditchecklist_submission_status"), - ] - - operations = [ - migrations.AddField( - model_name="singleauditchecklist", - name="report_id", - field=models.CharField(default="foo", max_length=17, unique=True), - ), - ] diff --git a/backend/audit/migrations/0006_alter_singleauditchecklist_report_id.py b/backend/audit/migrations/0006_alter_singleauditchecklist_report_id.py deleted file mode 100644 index 863a729fca..0000000000 --- a/backend/audit/migrations/0006_alter_singleauditchecklist_report_id.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 4.0.4 on 2022-06-29 07:00 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0005_singleauditchecklist_report_id"), - ] - - operations = [ - migrations.AlterField( - model_name="singleauditchecklist", - name="report_id", - field=models.CharField(max_length=17, unique=True), - ), - ] diff --git a/backend/audit/migrations/0007_alter_singleauditchecklist_auditee_uei.py b/backend/audit/migrations/0007_alter_singleauditchecklist_auditee_uei.py deleted file mode 100644 index 17dce83720..0000000000 --- a/backend/audit/migrations/0007_alter_singleauditchecklist_auditee_uei.py +++ /dev/null @@ -1,32 +0,0 @@ -# Generated by Django 4.0.4 on 2022-07-06 19:50 - -import audit.validators -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0006_alter_singleauditchecklist_report_id"), - ] - - operations = [ - migrations.AlterField( - model_name="singleauditchecklist", - name="auditee_uei", - field=models.CharField( - blank=True, - help_text="Auditee Unique Entity Identifier", - max_length=12, - null=True, - validators=[ - django.core.validators.MinLengthValidator(12), - audit.validators.validate_uei_alphanumeric, - audit.validators.validate_uei_valid_chars, - audit.validators.validate_uei_leading_char, - audit.validators.validate_uei_nine_digit_sequences, - ], - verbose_name="Auditee UEI", - ), - ), - ] diff --git a/backend/audit/migrations/0008_alter_access_options_rename_user_id_access_user_and_more.py b/backend/audit/migrations/0008_alter_access_options_rename_user_id_access_user_and_more.py deleted file mode 100644 index 6dfc12c6bd..0000000000 --- a/backend/audit/migrations/0008_alter_access_options_rename_user_id_access_user_and_more.py +++ /dev/null @@ -1,35 +0,0 @@ -# Generated by Django 4.0.4 on 2022-08-05 14:29 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0007_alter_singleauditchecklist_auditee_uei"), - ] - - operations = [ - migrations.AlterModelOptions( - name="access", - options={"verbose_name_plural": "accesses"}, - ), - migrations.RenameField( - model_name="access", - old_name="user_id", - new_name="user", - ), - migrations.AlterField( - model_name="access", - name="sac", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="audit.singleauditchecklist", - ), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditee_name", - field=models.CharField(blank=True, max_length=100, null=True), - ), - ] diff --git a/backend/audit/migrations/0009_alter_access_role_and_more.py b/backend/audit/migrations/0009_alter_access_role_and_more.py deleted file mode 100644 index 44393991f8..0000000000 --- a/backend/audit/migrations/0009_alter_access_role_and_more.py +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by Django 4.0.4 on 2022-08-05 17:33 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0008_alter_access_options_rename_user_id_access_user_and_more"), - ] - - operations = [ - migrations.AlterField( - model_name="access", - name="role", - field=models.CharField( - choices=[ - ("auditee_contact", "Auditee Contact"), - ("auditee_cert", "Auditee Certifying Official"), - ("auditor_contact", "Auditor Contact"), - ("auditor_cert", "Auditor Certifying Official"), - ("creator", "Audit Creator"), - ], - help_text="Access type granted to this user", - max_length=15, - ), - ), - migrations.AddConstraint( - model_name="access", - constraint=models.UniqueConstraint( - condition=models.Q(("role", "creator")), - fields=("sac",), - name="audit_$(class)s_single_creator", - ), - ), - migrations.AddConstraint( - model_name="access", - constraint=models.UniqueConstraint( - condition=models.Q(("role", "auditee_cert")), - fields=("sac",), - name="audit_$(class)s_single_certifying_auditee", - ), - ), - migrations.AddConstraint( - model_name="access", - constraint=models.UniqueConstraint( - condition=models.Q(("role", "auditor_cert")), - fields=("sac",), - name="audit_access_single_certifying_auditor", - ), - ), - ] diff --git a/backend/audit/migrations/0010_alter_singleauditchecklist_audit_period_covered_and_more.py b/backend/audit/migrations/0010_alter_singleauditchecklist_audit_period_covered_and_more.py deleted file mode 100644 index f4edcd7276..0000000000 --- a/backend/audit/migrations/0010_alter_singleauditchecklist_audit_period_covered_and_more.py +++ /dev/null @@ -1,177 +0,0 @@ -# Generated by Django 4.0.4 on 2022-08-12 18:20 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0009_alter_access_role_and_more"), - ] - - operations = [ - migrations.AlterField( - model_name="singleauditchecklist", - name="audit_period_covered", - field=models.CharField( - blank=True, - choices=[ - ("annual", "Annual"), - ("biennial", "Biennial"), - ("other", "Other"), - ], - max_length=20, - null=True, - ), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="audit_type", - field=models.CharField( - blank=True, - choices=[ - ("single-audit", "Single Audit"), - ("program-specific", "Program-Specific Audit"), - ], - max_length=20, - null=True, - ), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditee_address_line_1", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditee_city", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditee_contact_name", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditee_contact_title", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditee_email", - field=models.EmailField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditee_phone", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditee_state", - field=models.CharField(blank=True, max_length=2, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditee_zip", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditor_address_line_1", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditor_city", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditor_contact_name", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditor_contact_title", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditor_country", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditor_ein", - field=models.CharField( - blank=True, max_length=12, null=True, verbose_name="Auditor EIN" - ), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditor_ein_not_an_ssn_attestation", - field=models.BooleanField( - blank=True, - null=True, - verbose_name="Attestation: Auditor EIN Not an SSN", - ), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditor_email", - field=models.EmailField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditor_firm_name", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditor_phone", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditor_state", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="auditor_zip", - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="ein", - field=models.CharField( - blank=True, - help_text="Auditee Employer Identification Number", - max_length=12, - null=True, - verbose_name="EIN", - ), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="ein_not_an_ssn_attestation", - field=models.BooleanField( - blank=True, null=True, verbose_name="Attestation: EIN Not an SSN" - ), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="multiple_eins_covered", - field=models.BooleanField( - blank=True, null=True, verbose_name="Multiple EINs covered" - ), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="multiple_ueis_covered", - field=models.BooleanField( - blank=True, null=True, verbose_name="Multiple UEIs covered" - ), - ), - ] diff --git a/backend/audit/migrations/0011_alter_access_role.py b/backend/audit/migrations/0011_alter_access_role.py deleted file mode 100644 index 1d2926aba5..0000000000 --- a/backend/audit/migrations/0011_alter_access_role.py +++ /dev/null @@ -1,27 +0,0 @@ -# Generated by Django 4.0.4 on 2022-09-12 20:19 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0010_alter_singleauditchecklist_audit_period_covered_and_more"), - ] - - operations = [ - migrations.AlterField( - model_name="access", - name="role", - field=models.CharField( - choices=[ - ("auditee_contact", "Auditee Contact"), - ("auditor_contact", "Auditor Contact"), - ("certifying_auditee_contact ", "Auditee Certifying Official"), - ("certifying_auditor_contact ", "Auditor Certifying Official"), - ("creator", "Audit Creator"), - ], - help_text="Access type granted to this user", - max_length=50, - ), - ), - ] diff --git a/backend/audit/migrations/0012_remove_access_audit_$(class)s_single_certifying_auditee_and_more.py b/backend/audit/migrations/0012_remove_access_audit_$(class)s_single_certifying_auditee_and_more.py deleted file mode 100644 index 2cd9c5e62a..0000000000 --- a/backend/audit/migrations/0012_remove_access_audit_$(class)s_single_certifying_auditee_and_more.py +++ /dev/null @@ -1,36 +0,0 @@ -# Generated by Django 4.0.4 on 2022-09-12 20:26 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0011_alter_access_role"), - ] - - operations = [ - migrations.RemoveConstraint( - model_name="access", - name="audit_$(class)s_single_certifying_auditee", - ), - migrations.RemoveConstraint( - model_name="access", - name="audit_access_single_certifying_auditor", - ), - migrations.AddConstraint( - model_name="access", - constraint=models.UniqueConstraint( - condition=models.Q(("role", "certifying_auditee_contact")), - fields=("sac",), - name="audit_$(class)s_single_certifying_auditee", - ), - ), - migrations.AddConstraint( - model_name="access", - constraint=models.UniqueConstraint( - condition=models.Q(("role", "certifying_auditor_contact")), - fields=("sac",), - name="audit_access_single_certifying_auditor", - ), - ), - ] diff --git a/backend/audit/migrations/0013_singleauditchecklist_federal_awards.py b/backend/audit/migrations/0013_singleauditchecklist_federal_awards.py deleted file mode 100644 index 54d1b854d8..0000000000 --- a/backend/audit/migrations/0013_singleauditchecklist_federal_awards.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 4.1 on 2022-10-26 19:51 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ( - "audit", - "0012_remove_access_audit_$(class)s_single_certifying_auditee_and_more", - ), - ] - - operations = [ - migrations.AddField( - model_name="singleauditchecklist", - name="federal_awards", - field=models.JSONField(blank=True, null=True), - ), - ] diff --git a/backend/audit/migrations/0014_alter_singleauditchecklist_federal_awards.py b/backend/audit/migrations/0014_alter_singleauditchecklist_federal_awards.py deleted file mode 100644 index 7fedecada5..0000000000 --- a/backend/audit/migrations/0014_alter_singleauditchecklist_federal_awards.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 4.1.3 on 2022-11-23 16:27 - -import audit.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0013_singleauditchecklist_federal_awards"), - ] - - operations = [ - migrations.AlterField( - model_name="singleauditchecklist", - name="federal_awards", - field=models.JSONField( - blank=True, - null=True, - validators=[audit.validators.validate_federal_award_json], - ), - ), - ] diff --git a/backend/audit/migrations/0015_singleauditchecklist_general_information.py b/backend/audit/migrations/0015_singleauditchecklist_general_information.py deleted file mode 100644 index 3886b51ab7..0000000000 --- a/backend/audit/migrations/0015_singleauditchecklist_general_information.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 4.1.4 on 2022-12-16 14:36 - -import audit.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0014_alter_singleauditchecklist_federal_awards"), - ] - - operations = [ - migrations.AddField( - model_name="singleauditchecklist", - name="general_information", - field=models.JSONField( - blank=True, - null=True, - validators=[audit.validators.validate_general_information_json], - ), - ), - ] diff --git a/backend/audit/migrations/0016_remove_singleauditchecklist_audit_period_covered_and_more.py b/backend/audit/migrations/0016_remove_singleauditchecklist_audit_period_covered_and_more.py deleted file mode 100644 index 931c28e420..0000000000 --- a/backend/audit/migrations/0016_remove_singleauditchecklist_audit_period_covered_and_more.py +++ /dev/null @@ -1,140 +0,0 @@ -# Generated by Django 4.1.4 on 2022-12-16 18:23 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0015_singleauditchecklist_general_information"), - ] - - operations = [ - migrations.RemoveField( - model_name="singleauditchecklist", - name="audit_period_covered", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditee_address_line_1", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditee_city", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditee_contact_name", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditee_contact_title", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditee_email", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditee_fiscal_period_end", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditee_fiscal_period_start", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditee_name", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditee_phone", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditee_state", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditee_uei", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditee_zip", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditor_address_line_1", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditor_city", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditor_contact_name", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditor_contact_title", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditor_country", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditor_ein", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditor_ein_not_an_ssn_attestation", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditor_email", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditor_firm_name", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditor_phone", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditor_state", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="auditor_zip", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="ein", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="ein_not_an_ssn_attestation", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="is_usa_based", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="met_spending_threshold", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="multiple_eins_covered", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="multiple_ueis_covered", - ), - migrations.RemoveField( - model_name="singleauditchecklist", - name="user_provided_organization_type", - ), - ] diff --git a/backend/audit/migrations/0017_excelfile.py b/backend/audit/migrations/0017_excelfile.py deleted file mode 100644 index 9525af6564..0000000000 --- a/backend/audit/migrations/0017_excelfile.py +++ /dev/null @@ -1,48 +0,0 @@ -# Generated by Django 4.1.4 on 2023-02-09 16:09 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ("audit", "0016_remove_singleauditchecklist_audit_period_covered_and_more"), - ] - - operations = [ - migrations.CreateModel( - name="ExcelFile", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("file", models.FileField(upload_to="excel")), - ("filename", models.CharField(max_length=255)), - ("date_created", models.DateTimeField(auto_now_add=True)), - ( - "sac", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="audit.singleauditchecklist", - ), - ), - ( - "user", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to=settings.AUTH_USER_MODEL, - ), - ), - ], - ), - ] diff --git a/backend/audit/migrations/0018_alter_excelfile_file.py b/backend/audit/migrations/0018_alter_excelfile_file.py deleted file mode 100644 index 84772d6269..0000000000 --- a/backend/audit/migrations/0018_alter_excelfile_file.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 4.1.4 on 2023-02-22 13:24 - -import audit.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0017_excelfile"), - ] - - operations = [ - migrations.AlterField( - model_name="excelfile", - name="file", - field=models.FileField( - upload_to="excel", validators=[audit.validators.validate_excel_file] - ), - ), - ] diff --git a/backend/audit/migrations/0019_singleauditchecklist_corrective_action_plan_and_more.py b/backend/audit/migrations/0019_singleauditchecklist_corrective_action_plan_and_more.py deleted file mode 100644 index b1f662bc93..0000000000 --- a/backend/audit/migrations/0019_singleauditchecklist_corrective_action_plan_and_more.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 4.1.7 on 2023-04-20 21:27 - -import audit.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0018_alter_excelfile_file"), - ] - - operations = [ - migrations.AddField( - model_name="singleauditchecklist", - name="corrective_action_plan", - field=models.JSONField( - blank=True, - null=True, - validators=[audit.validators.validate_corrective_action_plan_json], - ), - ), - migrations.AddField( - model_name="singleauditchecklist", - name="findings_uniform_guidance", - field=models.JSONField( - blank=True, - null=True, - validators=[audit.validators.validate_findings_uniform_guidance_json], - ), - ), - ] diff --git a/backend/audit/migrations/0020_singleauditchecklist_findings_text.py b/backend/audit/migrations/0020_singleauditchecklist_findings_text.py deleted file mode 100644 index daabdc07b0..0000000000 --- a/backend/audit/migrations/0020_singleauditchecklist_findings_text.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 4.1.7 on 2023-04-26 14:14 - -import audit.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0019_singleauditchecklist_corrective_action_plan_and_more"), - ] - - operations = [ - migrations.AddField( - model_name="singleauditchecklist", - name="findings_text", - field=models.JSONField( - blank=True, - null=True, - validators=[audit.validators.validate_findings_text_json], - ), - ), - ] diff --git a/backend/audit/migrations/0021_alter_singleauditchecklist_submission_status.py b/backend/audit/migrations/0021_alter_singleauditchecklist_submission_status.py deleted file mode 100644 index 6ec19e43f7..0000000000 --- a/backend/audit/migrations/0021_alter_singleauditchecklist_submission_status.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 4.1.7 on 2023-04-12 20:32 - -from django.db import migrations -import django_fsm - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0020_singleauditchecklist_findings_text"), - ] - - operations = [ - migrations.AlterField( - model_name="singleauditchecklist", - name="submission_status", - field=django_fsm.FSMField( - choices=[ - ("in_progress", "In Progress"), - ("ready_for_certification", "Ready for Certification"), - ("auditor_certified", "Auditor Certified"), - ("auditee_certified", "Auditee Certified"), - ("certified", "Certified"), - ("submitted", "Submitted"), - ], - default="in_progress", - max_length=50, - ), - ), - ] diff --git a/backend/audit/migrations/0022_remove_access_audit_single_creator_and_more.py b/backend/audit/migrations/0022_remove_access_audit_single_creator_and_more.py deleted file mode 100644 index bd1604661e..0000000000 --- a/backend/audit/migrations/0022_remove_access_audit_single_creator_and_more.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 4.1.7 on 2023-05-02 17:51 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0021_alter_singleauditchecklist_submission_status"), - ] - - operations = [ - migrations.RemoveConstraint( - model_name="access", - name="audit_$(class)s_single_creator", - ), - migrations.AlterField( - model_name="access", - name="role", - field=models.CharField( - choices=[ - ("certifying_auditee_contact ", "Auditee Certifying Official"), - ("certifying_auditor_contact ", "Auditor Certifying Official"), - ("editor", "Audit Editor"), - ], - help_text="Access type granted to this user", - max_length=50, - ), - ), - ] diff --git a/backend/audit/migrations/0023_alter_access_role.py b/backend/audit/migrations/0023_alter_access_role.py deleted file mode 100644 index 123684c5d6..0000000000 --- a/backend/audit/migrations/0023_alter_access_role.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 4.1.7 on 2023-05-11 16:42 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0022_remove_access_audit_single_creator_and_more"), - ] - - operations = [ - migrations.AlterField( - model_name="access", - name="role", - field=models.CharField( - choices=[ - ("certifying_auditee_contact", "Auditee Certifying Official"), - ("certifying_auditor_contact", "Auditor Certifying Official"), - ("editor", "Audit Editor"), - ], - help_text="Access type granted to this user", - max_length=50, - ), - ), - ] diff --git a/backend/audit/migrations/0024_excelfile_form_section.py b/backend/audit/migrations/0024_excelfile_form_section.py deleted file mode 100644 index eda9354584..0000000000 --- a/backend/audit/migrations/0024_excelfile_form_section.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 4.2.1 on 2023-06-17 00:25 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0023_alter_access_role"), - ] - - operations = [ - migrations.AddField( - model_name="excelfile", - name="form_section", - field=models.CharField(default="not-actually-default", max_length=255), - ), - ] diff --git a/backend/audit/migrations/0025_alter_excelfile_form_section.py b/backend/audit/migrations/0025_alter_excelfile_form_section.py deleted file mode 100644 index 0c7cc10f1a..0000000000 --- a/backend/audit/migrations/0025_alter_excelfile_form_section.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 4.2.1 on 2023-06-17 06:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0024_excelfile_form_section"), - ] - - operations = [ - migrations.AlterField( - model_name="excelfile", - name="form_section", - field=models.CharField(max_length=255), - ), - ] diff --git a/backend/audit/migrations/0026_singleauditchecklist_transition_date_and_more.py b/backend/audit/migrations/0026_singleauditchecklist_transition_date_and_more.py deleted file mode 100644 index 6a34da9a59..0000000000 --- a/backend/audit/migrations/0026_singleauditchecklist_transition_date_and_more.py +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by Django 4.2.1 on 2023-06-22 00:05 - -import django.contrib.postgres.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0025_alter_excelfile_form_section"), - ] - - operations = [ - migrations.AddField( - model_name="singleauditchecklist", - name="transition_date", - field=django.contrib.postgres.fields.ArrayField( - base_field=models.DateTimeField(), null=True, size=None - ), - ), - migrations.AddField( - model_name="singleauditchecklist", - name="transition_name", - field=django.contrib.postgres.fields.ArrayField( - base_field=models.CharField( - choices=[ - ("in_progress", "In Progress"), - ("ready_for_certification", "Ready for Certification"), - ("auditor_certified", "Auditor Certified"), - ("auditee_certified", "Auditee Certified"), - ("certified", "Certified"), - ("submitted", "Submitted"), - ], - max_length=40, - ), - null=True, - size=None, - ), - ), - ] diff --git a/backend/audit/migrations/0027_singleauditchecklist_additional_ueis_and_more.py b/backend/audit/migrations/0027_singleauditchecklist_additional_ueis_and_more.py deleted file mode 100644 index 68abe5100e..0000000000 --- a/backend/audit/migrations/0027_singleauditchecklist_additional_ueis_and_more.py +++ /dev/null @@ -1,106 +0,0 @@ -# Generated by Django 4.2.2 on 2023-07-07 20:17 - -import audit.models -import audit.validators -from django.conf import settings -import django.contrib.postgres.fields -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ("audit", "0026_singleauditchecklist_transition_date_and_more"), - ] - - operations = [ - migrations.AddField( - model_name="singleauditchecklist", - name="additional_ueis", - field=models.JSONField( - blank=True, - null=True, - validators=[audit.validators.validate_additional_ueis_json], - ), - ), - migrations.AlterField( - model_name="excelfile", - name="file", - field=models.FileField( - upload_to=audit.models.excel_file_path, - validators=[audit.validators.validate_excel_file], - ), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="transition_date", - field=django.contrib.postgres.fields.ArrayField( - base_field=models.DateTimeField(), - blank=True, - default=list, - null=True, - size=None, - ), - ), - migrations.AlterField( - model_name="singleauditchecklist", - name="transition_name", - field=django.contrib.postgres.fields.ArrayField( - base_field=models.CharField( - choices=[ - ("in_progress", "In Progress"), - ("ready_for_certification", "Ready for Certification"), - ("auditor_certified", "Auditor Certified"), - ("auditee_certified", "Auditee Certified"), - ("certified", "Certified"), - ("submitted", "Submitted"), - ], - max_length=40, - ), - blank=True, - default=list, - null=True, - size=None, - ), - ), - migrations.CreateModel( - name="SingleAuditReportFile", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "file", - models.FileField( - upload_to=audit.models.single_audit_report_path, - validators=[audit.validators.validate_single_audit_report_file], - ), - ), - ("filename", models.CharField(max_length=255)), - ("date_created", models.DateTimeField(auto_now_add=True)), - ( - "sac", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="audit.singleauditchecklist", - ), - ), - ( - "user", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to=settings.AUTH_USER_MODEL, - ), - ), - ], - ), - ] diff --git a/backend/audit/migrations/0028_singleauditchecklist_notes_to_sefa.py b/backend/audit/migrations/0028_singleauditchecklist_notes_to_sefa.py deleted file mode 100644 index b16f363211..0000000000 --- a/backend/audit/migrations/0028_singleauditchecklist_notes_to_sefa.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 4.2.1 on 2023-07-13 16:33 - -import audit.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0027_singleauditchecklist_additional_ueis_and_more"), - ] - - operations = [ - migrations.AddField( - model_name="singleauditchecklist", - name="notes_to_sefa", - field=models.JSONField( - blank=True, - null=True, - validators=[audit.validators.validate_notes_to_sefa_json], - ), - ), - ] diff --git a/backend/audit/migrations/0029_singleauditchecklist_secondary_auditors.py b/backend/audit/migrations/0029_singleauditchecklist_secondary_auditors.py deleted file mode 100644 index 64d83d367c..0000000000 --- a/backend/audit/migrations/0029_singleauditchecklist_secondary_auditors.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 4.2.1 on 2023-07-19 07:00 - -import audit.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0028_singleauditchecklist_notes_to_sefa"), - ] - - operations = [ - migrations.AddField( - model_name="singleauditchecklist", - name="secondary_auditors", - field=models.JSONField( - blank=True, - null=True, - validators=[audit.validators.validate_secondary_auditors_json], - ), - ), - ] diff --git a/backend/audit/migrations/0030_singleauditchecklist_audit_information.py b/backend/audit/migrations/0030_singleauditchecklist_audit_information.py deleted file mode 100644 index dbf4fb2d2f..0000000000 --- a/backend/audit/migrations/0030_singleauditchecklist_audit_information.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 4.2.3 on 2023-07-31 17:38 - -import audit.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0029_singleauditchecklist_secondary_auditors"), - ] - - operations = [ - migrations.AddField( - model_name="singleauditchecklist", - name="audit_information", - field=models.JSONField( - blank=True, - null=True, - validators=[audit.validators.validate_audit_information_json], - ), - ), - ] diff --git a/backend/audit/migrations/0031_singleauditreportfile_component_page_numbers.py b/backend/audit/migrations/0031_singleauditreportfile_component_page_numbers.py deleted file mode 100644 index d6f72bd465..0000000000 --- a/backend/audit/migrations/0031_singleauditreportfile_component_page_numbers.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 4.2.3 on 2023-08-04 16:00 - -import audit.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0030_singleauditchecklist_audit_information"), - ] - - operations = [ - migrations.AddField( - model_name="singleauditreportfile", - name="component_page_numbers", - field=models.JSONField( - blank=True, - null=True, - validators=[audit.validators.validate_component_page_numbers], - ), - ), - ] diff --git a/backend/audit/migrations/0032_singleauditchecklist_auditee_certification_and_more.py b/backend/audit/migrations/0032_singleauditchecklist_auditee_certification_and_more.py deleted file mode 100644 index 634e0c5884..0000000000 --- a/backend/audit/migrations/0032_singleauditchecklist_auditee_certification_and_more.py +++ /dev/null @@ -1,31 +0,0 @@ -# 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], - ), - ), - ] diff --git a/backend/audit/migrations/0033_singleauditchecklist_tribal_data_consent.py b/backend/audit/migrations/0033_singleauditchecklist_tribal_data_consent.py deleted file mode 100644 index f8ab5dd211..0000000000 --- a/backend/audit/migrations/0033_singleauditchecklist_tribal_data_consent.py +++ /dev/null @@ -1,22 +0,0 @@ -# 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], - ), - ), - ] diff --git a/backend/audit/migrations/0034_singleauditchecklist_additional_eins.py b/backend/audit/migrations/0034_singleauditchecklist_additional_eins.py deleted file mode 100644 index 014ee2b411..0000000000 --- a/backend/audit/migrations/0034_singleauditchecklist_additional_eins.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 4.2.3 on 2023-08-15 19:58 - -import audit.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0033_singleauditchecklist_tribal_data_consent"), - ] - - operations = [ - migrations.AddField( - model_name="singleauditchecklist", - name="additional_eins", - field=models.JSONField( - blank=True, - null=True, - validators=[audit.validators.validate_additional_eins_json], - ), - ), - ] diff --git a/backend/audit/migrations/0035_singleauditchecklist_data_source.py b/backend/audit/migrations/0035_singleauditchecklist_data_source.py deleted file mode 100644 index 61d42dab83..0000000000 --- a/backend/audit/migrations/0035_singleauditchecklist_data_source.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 4.2.3 on 2023-08-16 21:12 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0034_singleauditchecklist_additional_eins"), - ] - - operations = [ - migrations.AddField( - model_name="singleauditchecklist", - name="data_source", - field=models.CharField(default="GSA"), - ), - ] diff --git a/backend/audit/migrations/0036_cognizantbaseline.py b/backend/audit/migrations/0036_cognizantbaseline.py deleted file mode 100644 index eaba7d9a82..0000000000 --- a/backend/audit/migrations/0036_cognizantbaseline.py +++ /dev/null @@ -1,58 +0,0 @@ -# Generated by Django 4.2.3 on 2023-08-18 15:38 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0035_singleauditchecklist_data_source"), - ] - - operations = [ - migrations.CreateModel( - name="CognizantBaseline", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "dbkey", - models.IntegerField( - null=True, - verbose_name="Identifier for a submission along with audit_year in C-FAC", - ), - ), - ( - "audit_year", - models.IntegerField( - null=True, verbose_name="Audit year from fy_start_date" - ), - ), - ( - "ein", - models.CharField( - max_length=30, - null=True, - verbose_name="Primary Employer Identification Number", - ), - ), - ( - "cognizant_agency", - models.CharField( - max_length=2, - null=True, - verbose_name="Two digit Federal agency prefix of the cognizant agency", - ), - ), - ], - options={ - "unique_together": {("dbkey", "audit_year")}, - }, - ), - ] diff --git a/backend/audit/migrations/0037_access_fullname.py b/backend/audit/migrations/0037_access_fullname.py deleted file mode 100644 index 34f12e98f8..0000000000 --- a/backend/audit/migrations/0037_access_fullname.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 4.2.3 on 2023-08-18 19:38 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0036_cognizantbaseline"), - ] - - operations = [ - migrations.AddField( - model_name="access", - name="fullname", - field=models.CharField(blank=True), - ), - ] diff --git a/backend/audit/migrations/0038_submissionevent.py b/backend/audit/migrations/0038_submissionevent.py deleted file mode 100644 index d076a0defa..0000000000 --- a/backend/audit/migrations/0038_submissionevent.py +++ /dev/null @@ -1,93 +0,0 @@ -# Generated by Django 4.2.3 on 2023-08-30 20:04 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ("audit", "0037_access_fullname"), - ] - - operations = [ - migrations.CreateModel( - name="SubmissionEvent", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("timestamp", models.DateTimeField(auto_now_add=True)), - ( - "event", - models.CharField( - choices=[ - ("access-granted", "Access granted"), - ("additional-eins-updated", "Additional EINs updated"), - ("additional-ueis-updated", "Additional UEIs updated"), - ("audit-information-updated", "Audit information updated"), - ("audit-report-pdf-updated", "Audit report PDF updated"), - ( - "auditee-certification-completed", - "Auditee certification completed", - ), - ( - "auditor-certification-completed", - "Auditor certification completed", - ), - ( - "corrective-action-plan-updated", - "Corrective action plan updated", - ), - ("created", "Created"), - ("federal-awards-updated", "Federal awards updated"), - ( - "federal-awards-audit-findings-updated", - "Federal awards audit findings updated", - ), - ( - "federal-awards-audit-findings-text-updated", - "Federal awards audit findings text updated", - ), - ( - "findings-uniform-guidance-updated", - "Findings uniform guidance updated", - ), - ( - "general-information-updated", - "General information updated", - ), - ("locked-for-certification", "Locked for certification"), - ("notes-to-sefa-updated", "Notes to SEFA updated"), - ( - "secondary-auditors-updated", - "Secondary auditors updated", - ), - ("submitted", "Submitted to the FAC for processing"), - ] - ), - ), - ( - "sac", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="audit.singleauditchecklist", - ), - ), - ( - "user", - models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, - to=settings.AUTH_USER_MODEL, - ), - ), - ], - ), - ] diff --git a/backend/audit/migrations/0039_delete_cognizantbaseline_and_more.py b/backend/audit/migrations/0039_delete_cognizantbaseline_and_more.py deleted file mode 100644 index b1e418b620..0000000000 --- a/backend/audit/migrations/0039_delete_cognizantbaseline_and_more.py +++ /dev/null @@ -1,35 +0,0 @@ -# Generated by Django 4.2.3 on 2023-09-11 21:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("audit", "0038_submissionevent"), - ] - - operations = [ - migrations.DeleteModel( - name="CognizantBaseline", - ), - migrations.AddField( - model_name="singleauditchecklist", - name="cognizant_agency", - field=models.CharField( - blank=True, - max_length=2, - null=True, - verbose_name="Agency assigned to this large submission. Computed when the submisson is finalized, but may be overridden", - ), - ), - migrations.AddField( - model_name="singleauditchecklist", - name="oversight_agency", - field=models.CharField( - blank=True, - max_length=2, - null=True, - verbose_name="Agency assigned to this not so large submission. Computed when the submisson is finalized", - ), - ), - ] diff --git a/backend/dissemination/migrations/0001_initial.py b/backend/dissemination/migrations/0001_initial.py index d84c1810ee..cd60944111 100644 --- a/backend/dissemination/migrations/0001_initial.py +++ b/backend/dissemination/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.3 on 2023-09-11 19:37 +# Generated by Django 4.2.3 on 2023-09-20 14:33 from django.db import migrations, models @@ -9,6 +9,849 @@ class Migration(migrations.Migration): dependencies = [] operations = [ + migrations.CreateModel( + name="CensusCfda19", + fields=[ + ( + "index", + models.BigIntegerField( + blank=True, primary_key=True, serialize=False + ), + ), + ( + "audityear", + models.TextField(blank=True, db_column="AUDITYEAR", null=True), + ), + ("dbkey", models.TextField(blank=True, db_column="DBKEY", null=True)), + ("ein", models.TextField(blank=True, db_column="EIN", null=True)), + ("cfda", models.TextField(blank=True, db_column="CFDA", null=True)), + ( + "awardidentification", + models.TextField( + blank=True, db_column="AWARDIDENTIFICATION", null=True + ), + ), + ("rd", models.TextField(blank=True, db_column="RD", null=True)), + ( + "federalprogramname", + models.TextField( + blank=True, db_column="FEDERALPROGRAMNAME", null=True + ), + ), + ("amount", models.TextField(blank=True, db_column="AMOUNT", null=True)), + ( + "clustername", + models.TextField(blank=True, db_column="CLUSTERNAME", null=True), + ), + ( + "stateclustername", + models.TextField( + blank=True, db_column="STATECLUSTERNAME", null=True + ), + ), + ( + "programtotal", + models.TextField(blank=True, db_column="PROGRAMTOTAL", null=True), + ), + ( + "clustertotal", + models.TextField(blank=True, db_column="CLUSTERTOTAL", null=True), + ), + ("direct", models.TextField(blank=True, db_column="DIRECT", null=True)), + ( + "passthroughaward", + models.TextField( + blank=True, db_column="PASSTHROUGHAWARD", null=True + ), + ), + ( + "passthroughamount", + models.TextField( + blank=True, db_column="PASSTHROUGHAMOUNT", null=True + ), + ), + ( + "majorprogram", + models.TextField(blank=True, db_column="MAJORPROGRAM", null=True), + ), + ( + "typereport_mp", + models.TextField(blank=True, db_column="TYPEREPORT_MP", null=True), + ), + ( + "typerequirement", + models.TextField( + blank=True, db_column="TYPEREQUIREMENT", null=True + ), + ), + ( + "qcosts2", + models.TextField(blank=True, db_column="QCOSTS2", null=True), + ), + ( + "findings", + models.TextField(blank=True, db_column="FINDINGS", null=True), + ), + ( + "findingrefnums", + models.TextField(blank=True, db_column="FINDINGREFNUMS", null=True), + ), + ("arra", models.TextField(blank=True, db_column="ARRA", null=True)), + ("loans", models.TextField(blank=True, db_column="LOANS", null=True)), + ( + "loanbalance", + models.TextField(blank=True, db_column="LOANBALANCE", null=True), + ), + ( + "findingscount", + models.TextField(blank=True, db_column="FINDINGSCOUNT", null=True), + ), + ( + "elecauditsid", + models.TextField(blank=True, db_column="ELECAUDITSID", null=True), + ), + ( + "otherclustername", + models.TextField( + blank=True, db_column="OTHERCLUSTERNAME", null=True + ), + ), + ( + "cfdaprogramname", + models.TextField( + blank=True, db_column="CFDAPROGRAMNAME", null=True + ), + ), + ], + options={ + "db_table": "census_cfda19", + "managed": False, + }, + ), + migrations.CreateModel( + name="CensusCfda22", + fields=[ + ( + "index", + models.BigIntegerField( + blank=True, primary_key=True, serialize=False + ), + ), + ( + "audityear", + models.TextField(blank=True, db_column="AUDITYEAR", null=True), + ), + ("dbkey", models.TextField(blank=True, db_column="DBKEY", null=True)), + ("ein", models.TextField(blank=True, db_column="EIN", null=True)), + ("cfda", models.TextField(blank=True, db_column="CFDA", null=True)), + ( + "awardidentification", + models.TextField( + blank=True, db_column="AWARDIDENTIFICATION", null=True + ), + ), + ("rd", models.TextField(blank=True, db_column="RD", null=True)), + ( + "federalprogramname", + models.TextField( + blank=True, db_column="FEDERALPROGRAMNAME", null=True + ), + ), + ("amount", models.TextField(blank=True, db_column="AMOUNT", null=True)), + ( + "clustername", + models.TextField(blank=True, db_column="CLUSTERNAME", null=True), + ), + ( + "stateclustername", + models.TextField( + blank=True, db_column="STATECLUSTERNAME", null=True + ), + ), + ( + "programtotal", + models.TextField(blank=True, db_column="PROGRAMTOTAL", null=True), + ), + ( + "clustertotal", + models.TextField(blank=True, db_column="CLUSTERTOTAL", null=True), + ), + ("direct", models.TextField(blank=True, db_column="DIRECT", null=True)), + ( + "passthroughaward", + models.TextField( + blank=True, db_column="PASSTHROUGHAWARD", null=True + ), + ), + ( + "passthroughamount", + models.TextField( + blank=True, db_column="PASSTHROUGHAMOUNT", null=True + ), + ), + ( + "majorprogram", + models.TextField(blank=True, db_column="MAJORPROGRAM", null=True), + ), + ( + "typereport_mp", + models.TextField(blank=True, db_column="TYPEREPORT_MP", null=True), + ), + ( + "typerequirement", + models.TextField( + blank=True, db_column="TYPEREQUIREMENT", null=True + ), + ), + ( + "qcosts2", + models.TextField(blank=True, db_column="QCOSTS2", null=True), + ), + ( + "findings", + models.TextField(blank=True, db_column="FINDINGS", null=True), + ), + ( + "findingrefnums", + models.TextField(blank=True, db_column="FINDINGREFNUMS", null=True), + ), + ("arra", models.TextField(blank=True, db_column="ARRA", null=True)), + ("loans", models.TextField(blank=True, db_column="LOANS", null=True)), + ( + "loanbalance", + models.TextField(blank=True, db_column="LOANBALANCE", null=True), + ), + ( + "findingscount", + models.TextField(blank=True, db_column="FINDINGSCOUNT", null=True), + ), + ( + "elecauditsid", + models.TextField(blank=True, db_column="ELECAUDITSID", null=True), + ), + ( + "otherclustername", + models.TextField( + blank=True, db_column="OTHERCLUSTERNAME", null=True + ), + ), + ( + "cfdaprogramname", + models.TextField( + blank=True, db_column="CFDAPROGRAMNAME", null=True + ), + ), + ], + options={ + "db_table": "census_cfda22", + "managed": False, + }, + ), + migrations.CreateModel( + name="CensusGen19", + fields=[ + ( + "index", + models.BigIntegerField( + blank=True, primary_key=True, serialize=False + ), + ), + ( + "audityear", + models.TextField(blank=True, db_column="AUDITYEAR", null=True), + ), + ("dbkey", models.TextField(blank=True, db_column="DBKEY", null=True)), + ( + "typeofentity", + models.TextField(blank=True, db_column="TYPEOFENTITY", null=True), + ), + ( + "fyenddate", + models.TextField(blank=True, db_column="FYENDDATE", null=True), + ), + ( + "audittype", + models.TextField(blank=True, db_column="AUDITTYPE", null=True), + ), + ( + "periodcovered", + models.TextField(blank=True, db_column="PERIODCOVERED", null=True), + ), + ( + "numbermonths", + models.TextField(blank=True, db_column="NUMBERMONTHS", null=True), + ), + ("ein", models.TextField(blank=True, db_column="EIN", null=True)), + ( + "multipleeins", + models.TextField(blank=True, db_column="MULTIPLEEINS", null=True), + ), + ( + "einsubcode", + models.TextField(blank=True, db_column="EINSUBCODE", null=True), + ), + ("duns", models.TextField(blank=True, db_column="DUNS", null=True)), + ( + "multipleduns", + models.TextField(blank=True, db_column="MULTIPLEDUNS", null=True), + ), + ( + "auditeename", + models.TextField(blank=True, db_column="AUDITEENAME", null=True), + ), + ( + "street1", + models.TextField(blank=True, db_column="STREET1", null=True), + ), + ( + "street2", + models.TextField(blank=True, db_column="STREET2", null=True), + ), + ("city", models.TextField(blank=True, db_column="CITY", null=True)), + ("state", models.TextField(blank=True, db_column="STATE", null=True)), + ( + "zipcode", + models.TextField(blank=True, db_column="ZIPCODE", null=True), + ), + ( + "auditeecontact", + models.TextField(blank=True, db_column="AUDITEECONTACT", null=True), + ), + ( + "auditeetitle", + models.TextField(blank=True, db_column="AUDITEETITLE", null=True), + ), + ( + "auditeephone", + models.TextField(blank=True, db_column="AUDITEEPHONE", null=True), + ), + ( + "auditeefax", + models.TextField(blank=True, db_column="AUDITEEFAX", null=True), + ), + ( + "auditeeemail", + models.TextField(blank=True, db_column="AUDITEEEMAIL", null=True), + ), + ( + "auditeedatesigned", + models.TextField( + blank=True, db_column="AUDITEEDATESIGNED", null=True + ), + ), + ( + "auditeenametitle", + models.TextField( + blank=True, db_column="AUDITEENAMETITLE", null=True + ), + ), + ( + "cpafirmname", + models.TextField(blank=True, db_column="CPAFIRMNAME", null=True), + ), + ( + "cpastreet1", + models.TextField(blank=True, db_column="CPASTREET1", null=True), + ), + ( + "cpastreet2", + models.TextField(blank=True, db_column="CPASTREET2", null=True), + ), + ( + "cpacity", + models.TextField(blank=True, db_column="CPACITY", null=True), + ), + ( + "cpastate", + models.TextField(blank=True, db_column="CPASTATE", null=True), + ), + ( + "cpazipcode", + models.TextField(blank=True, db_column="CPAZIPCODE", null=True), + ), + ( + "cpacontact", + models.TextField(blank=True, db_column="CPACONTACT", null=True), + ), + ( + "cpatitle", + models.TextField(blank=True, db_column="CPATITLE", null=True), + ), + ( + "cpaphone", + models.TextField(blank=True, db_column="CPAPHONE", null=True), + ), + ("cpafax", models.TextField(blank=True, db_column="CPAFAX", null=True)), + ( + "cpaemail", + models.TextField(blank=True, db_column="CPAEMAIL", null=True), + ), + ( + "cpadatesigned", + models.TextField(blank=True, db_column="CPADATESIGNED", null=True), + ), + ( + "cog_over", + models.TextField(blank=True, db_column="COG_OVER", null=True), + ), + ( + "cogagency", + models.TextField(blank=True, db_column="COGAGENCY", null=True), + ), + ( + "oversightagency", + models.TextField( + blank=True, db_column="OVERSIGHTAGENCY", null=True + ), + ), + ( + "typereport_fs", + models.TextField(blank=True, db_column="TYPEREPORT_FS", null=True), + ), + ( + "sp_framework", + models.TextField(blank=True, db_column="SP_FRAMEWORK", null=True), + ), + ( + "sp_framework_required", + models.TextField( + blank=True, db_column="SP_FRAMEWORK_REQUIRED", null=True + ), + ), + ( + "typereport_sp_framework", + models.TextField( + blank=True, db_column="TYPEREPORT_SP_FRAMEWORK", null=True + ), + ), + ( + "goingconcern", + models.TextField(blank=True, db_column="GOINGCONCERN", null=True), + ), + ( + "reportablecondition", + models.TextField( + blank=True, db_column="REPORTABLECONDITION", null=True + ), + ), + ( + "materialweakness", + models.TextField( + blank=True, db_column="MATERIALWEAKNESS", null=True + ), + ), + ( + "materialnoncompliance", + models.TextField( + blank=True, db_column="MATERIALNONCOMPLIANCE", null=True + ), + ), + ( + "typereport_mp", + models.TextField(blank=True, db_column="TYPEREPORT_MP", null=True), + ), + ( + "dup_reports", + models.TextField(blank=True, db_column="DUP_REPORTS", null=True), + ), + ( + "dollarthreshold", + models.TextField( + blank=True, db_column="DOLLARTHRESHOLD", null=True + ), + ), + ( + "lowrisk", + models.TextField(blank=True, db_column="LOWRISK", null=True), + ), + ( + "reportablecondition_mp", + models.TextField( + blank=True, db_column="REPORTABLECONDITION_MP", null=True + ), + ), + ( + "materialweakness_mp", + models.TextField( + blank=True, db_column="MATERIALWEAKNESS_MP", null=True + ), + ), + ("qcosts", models.TextField(blank=True, db_column="QCOSTS", null=True)), + ( + "cyfindings", + models.TextField(blank=True, db_column="CYFINDINGS", null=True), + ), + ( + "pyschedule", + models.TextField(blank=True, db_column="PYSCHEDULE", null=True), + ), + ( + "totfedexpend", + models.TextField(blank=True, db_column="TOTFEDEXPEND", null=True), + ), + ( + "datefirewall", + models.TextField(blank=True, db_column="DATEFIREWALL", null=True), + ), + ( + "previousdatefirewall", + models.TextField( + blank=True, db_column="PREVIOUSDATEFIREWALL", null=True + ), + ), + ( + "reportrequired", + models.TextField(blank=True, db_column="REPORTREQUIRED", null=True), + ), + ( + "multiple_cpas", + models.TextField(blank=True, db_column="MULTIPLE_CPAS", null=True), + ), + ( + "auditor_ein", + models.TextField(blank=True, db_column="AUDITOR_EIN", null=True), + ), + ( + "facaccepteddate", + models.TextField( + blank=True, db_column="FACACCEPTEDDATE", null=True + ), + ), + ( + "cpaforeign", + models.TextField(blank=True, db_column="CPAFOREIGN", null=True), + ), + ( + "cpacountry", + models.TextField(blank=True, db_column="CPACOUNTRY", null=True), + ), + ( + "entity_type", + models.TextField(blank=True, db_column="ENTITY_TYPE", null=True), + ), + ("uei", models.TextField(blank=True, db_column="UEI", null=True)), + ( + "multipleueis", + models.TextField(blank=True, db_column="MULTIPLEUEIS", null=True), + ), + ], + options={ + "db_table": "census_gen19", + "managed": False, + }, + ), + migrations.CreateModel( + name="CensusGen22", + fields=[ + ( + "index", + models.BigIntegerField( + blank=True, primary_key=True, serialize=False + ), + ), + ( + "audityear", + models.TextField(blank=True, db_column="AUDITYEAR", null=True), + ), + ("dbkey", models.TextField(blank=True, db_column="DBKEY", null=True)), + ( + "typeofentity", + models.TextField(blank=True, db_column="TYPEOFENTITY", null=True), + ), + ( + "fyenddate", + models.TextField(blank=True, db_column="FYENDDATE", null=True), + ), + ( + "audittype", + models.TextField(blank=True, db_column="AUDITTYPE", null=True), + ), + ( + "periodcovered", + models.TextField(blank=True, db_column="PERIODCOVERED", null=True), + ), + ( + "numbermonths", + models.TextField(blank=True, db_column="NUMBERMONTHS", null=True), + ), + ("ein", models.TextField(blank=True, db_column="EIN", null=True)), + ( + "multipleeins", + models.TextField(blank=True, db_column="MULTIPLEEINS", null=True), + ), + ( + "einsubcode", + models.TextField(blank=True, db_column="EINSUBCODE", null=True), + ), + ("duns", models.TextField(blank=True, db_column="DUNS", null=True)), + ( + "multipleduns", + models.TextField(blank=True, db_column="MULTIPLEDUNS", null=True), + ), + ( + "auditeename", + models.TextField(blank=True, db_column="AUDITEENAME", null=True), + ), + ( + "street1", + models.TextField(blank=True, db_column="STREET1", null=True), + ), + ( + "street2", + models.TextField(blank=True, db_column="STREET2", null=True), + ), + ("city", models.TextField(blank=True, db_column="CITY", null=True)), + ("state", models.TextField(blank=True, db_column="STATE", null=True)), + ( + "zipcode", + models.TextField(blank=True, db_column="ZIPCODE", null=True), + ), + ( + "auditeecontact", + models.TextField(blank=True, db_column="AUDITEECONTACT", null=True), + ), + ( + "auditeetitle", + models.TextField(blank=True, db_column="AUDITEETITLE", null=True), + ), + ( + "auditeephone", + models.TextField(blank=True, db_column="AUDITEEPHONE", null=True), + ), + ( + "auditeefax", + models.TextField(blank=True, db_column="AUDITEEFAX", null=True), + ), + ( + "auditeeemail", + models.TextField(blank=True, db_column="AUDITEEEMAIL", null=True), + ), + ( + "auditeedatesigned", + models.TextField( + blank=True, db_column="AUDITEEDATESIGNED", null=True + ), + ), + ( + "auditeenametitle", + models.TextField( + blank=True, db_column="AUDITEENAMETITLE", null=True + ), + ), + ( + "cpafirmname", + models.TextField(blank=True, db_column="CPAFIRMNAME", null=True), + ), + ( + "cpastreet1", + models.TextField(blank=True, db_column="CPASTREET1", null=True), + ), + ( + "cpastreet2", + models.TextField(blank=True, db_column="CPASTREET2", null=True), + ), + ( + "cpacity", + models.TextField(blank=True, db_column="CPACITY", null=True), + ), + ( + "cpastate", + models.TextField(blank=True, db_column="CPASTATE", null=True), + ), + ( + "cpazipcode", + models.TextField(blank=True, db_column="CPAZIPCODE", null=True), + ), + ( + "cpacontact", + models.TextField(blank=True, db_column="CPACONTACT", null=True), + ), + ( + "cpatitle", + models.TextField(blank=True, db_column="CPATITLE", null=True), + ), + ( + "cpaphone", + models.TextField(blank=True, db_column="CPAPHONE", null=True), + ), + ("cpafax", models.TextField(blank=True, db_column="CPAFAX", null=True)), + ( + "cpaemail", + models.TextField(blank=True, db_column="CPAEMAIL", null=True), + ), + ( + "cpadatesigned", + models.TextField(blank=True, db_column="CPADATESIGNED", null=True), + ), + ( + "cog_over", + models.TextField(blank=True, db_column="COG_OVER", null=True), + ), + ( + "cogagency", + models.TextField(blank=True, db_column="COGAGENCY", null=True), + ), + ( + "oversightagency", + models.TextField( + blank=True, db_column="OVERSIGHTAGENCY", null=True + ), + ), + ( + "typereport_fs", + models.TextField(blank=True, db_column="TYPEREPORT_FS", null=True), + ), + ( + "sp_framework", + models.TextField(blank=True, db_column="SP_FRAMEWORK", null=True), + ), + ( + "sp_framework_required", + models.TextField( + blank=True, db_column="SP_FRAMEWORK_REQUIRED", null=True + ), + ), + ( + "typereport_sp_framework", + models.TextField( + blank=True, db_column="TYPEREPORT_SP_FRAMEWORK", null=True + ), + ), + ( + "goingconcern", + models.TextField(blank=True, db_column="GOINGCONCERN", null=True), + ), + ( + "reportablecondition", + models.TextField( + blank=True, db_column="REPORTABLECONDITION", null=True + ), + ), + ( + "materialweakness", + models.TextField( + blank=True, db_column="MATERIALWEAKNESS", null=True + ), + ), + ( + "materialnoncompliance", + models.TextField( + blank=True, db_column="MATERIALNONCOMPLIANCE", null=True + ), + ), + ( + "typereport_mp", + models.TextField(blank=True, db_column="TYPEREPORT_MP", null=True), + ), + ( + "dup_reports", + models.TextField(blank=True, db_column="DUP_REPORTS", null=True), + ), + ( + "dollarthreshold", + models.TextField( + blank=True, db_column="DOLLARTHRESHOLD", null=True + ), + ), + ( + "lowrisk", + models.TextField(blank=True, db_column="LOWRISK", null=True), + ), + ( + "reportablecondition_mp", + models.TextField( + blank=True, db_column="REPORTABLECONDITION_MP", null=True + ), + ), + ( + "materialweakness_mp", + models.TextField( + blank=True, db_column="MATERIALWEAKNESS_MP", null=True + ), + ), + ("qcosts", models.TextField(blank=True, db_column="QCOSTS", null=True)), + ( + "cyfindings", + models.TextField(blank=True, db_column="CYFINDINGS", null=True), + ), + ( + "pyschedule", + models.TextField(blank=True, db_column="PYSCHEDULE", null=True), + ), + ( + "totfedexpend", + models.TextField(blank=True, db_column="TOTFEDEXPEND", null=True), + ), + ( + "datefirewall", + models.TextField(blank=True, db_column="DATEFIREWALL", null=True), + ), + ( + "previousdatefirewall", + models.TextField( + blank=True, db_column="PREVIOUSDATEFIREWALL", null=True + ), + ), + ( + "reportrequired", + models.TextField(blank=True, db_column="REPORTREQUIRED", null=True), + ), + ( + "multiple_cpas", + models.TextField(blank=True, db_column="MULTIPLE_CPAS", null=True), + ), + ( + "auditor_ein", + models.TextField(blank=True, db_column="AUDITOR_EIN", null=True), + ), + ( + "facaccepteddate", + models.TextField( + blank=True, db_column="FACACCEPTEDDATE", null=True + ), + ), + ( + "cpaforeign", + models.TextField(blank=True, db_column="CPAFOREIGN", null=True), + ), + ( + "cpacountry", + models.TextField(blank=True, db_column="CPACOUNTRY", null=True), + ), + ( + "entity_type", + models.TextField(blank=True, db_column="ENTITY_TYPE", null=True), + ), + ("uei", models.TextField(blank=True, db_column="UEI", null=True)), + ( + "multipleueis", + models.TextField(blank=True, db_column="MULTIPLEUEIS", null=True), + ), + ], + options={ + "db_table": "census_gen22", + "managed": False, + }, + ), + migrations.CreateModel( + name="AdditionalEin", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "report_id", + models.TextField(verbose_name="; foreign key everywhere else"), + ), + ("additional_ein", models.TextField()), + ], + ), migrations.CreateModel( name="AdditionalUei", fields=[ @@ -393,6 +1236,13 @@ class Migration(migrations.Migration): verbose_name="Note title", ), ), + ( + "contains_chart_or_table", + models.TextField( + help_text="Census mapping: ", + verbose_name="Indicates whether or not the text contained charts or tables that could not be entered due to formatting restrictions", + ), + ), ], ), migrations.CreateModel( diff --git a/backend/dissemination/migrations/0002_additionalein.py b/backend/dissemination/migrations/0002_additionalein.py deleted file mode 100644 index 0869e6907d..0000000000 --- a/backend/dissemination/migrations/0002_additionalein.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 4.2.3 on 2023-09-12 14:28 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("dissemination", "0001_initial"), - ] - - operations = [ - migrations.CreateModel( - name="AdditionalEin", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "report_id", - models.TextField(verbose_name="; foreign key everywhere else"), - ), - ("additional_ein", models.TextField()), - ], - ), - ] diff --git a/backend/dissemination/migrations/0003_note_contains_chart_or_table.py b/backend/dissemination/migrations/0003_note_contains_chart_or_table.py deleted file mode 100644 index fd813f91f5..0000000000 --- a/backend/dissemination/migrations/0003_note_contains_chart_or_table.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 4.2.3 on 2023-09-15 05:50 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("dissemination", "0002_additionalein"), - ] - - operations = [ - migrations.AddField( - model_name="note", - name="contains_chart_or_table", - field=models.TextField( - help_text="Census mapping: ", - verbose_name="Indicates whether or not the text contained charts or tables that could not be entered due to formatting restrictions", - ), - preserve_default=False, - ), - ] diff --git a/backend/dissemination/migrations/0004_censuscfda19_censuscfda22_censusgen19_censusgen22.py b/backend/dissemination/migrations/0004_censuscfda19_censuscfda22_censusgen19_censusgen22.py deleted file mode 100644 index 93854323f6..0000000000 --- a/backend/dissemination/migrations/0004_censuscfda19_censuscfda22_censusgen19_censusgen22.py +++ /dev/null @@ -1,836 +0,0 @@ -# Generated by Django 4.2.3 on 2023-09-19 21:45 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("dissemination", "0003_note_contains_chart_or_table"), - ] - - operations = [ - migrations.CreateModel( - name="CensusCfda19", - fields=[ - ( - "index", - models.BigIntegerField( - blank=True, primary_key=True, serialize=False - ), - ), - ( - "audityear", - models.TextField(blank=True, db_column="AUDITYEAR", null=True), - ), - ("dbkey", models.TextField(blank=True, db_column="DBKEY", null=True)), - ("ein", models.TextField(blank=True, db_column="EIN", null=True)), - ("cfda", models.TextField(blank=True, db_column="CFDA", null=True)), - ( - "awardidentification", - models.TextField( - blank=True, db_column="AWARDIDENTIFICATION", null=True - ), - ), - ("rd", models.TextField(blank=True, db_column="RD", null=True)), - ( - "federalprogramname", - models.TextField( - blank=True, db_column="FEDERALPROGRAMNAME", null=True - ), - ), - ("amount", models.TextField(blank=True, db_column="AMOUNT", null=True)), - ( - "clustername", - models.TextField(blank=True, db_column="CLUSTERNAME", null=True), - ), - ( - "stateclustername", - models.TextField( - blank=True, db_column="STATECLUSTERNAME", null=True - ), - ), - ( - "programtotal", - models.TextField(blank=True, db_column="PROGRAMTOTAL", null=True), - ), - ( - "clustertotal", - models.TextField(blank=True, db_column="CLUSTERTOTAL", null=True), - ), - ("direct", models.TextField(blank=True, db_column="DIRECT", null=True)), - ( - "passthroughaward", - models.TextField( - blank=True, db_column="PASSTHROUGHAWARD", null=True - ), - ), - ( - "passthroughamount", - models.TextField( - blank=True, db_column="PASSTHROUGHAMOUNT", null=True - ), - ), - ( - "majorprogram", - models.TextField(blank=True, db_column="MAJORPROGRAM", null=True), - ), - ( - "typereport_mp", - models.TextField(blank=True, db_column="TYPEREPORT_MP", null=True), - ), - ( - "typerequirement", - models.TextField( - blank=True, db_column="TYPEREQUIREMENT", null=True - ), - ), - ( - "qcosts2", - models.TextField(blank=True, db_column="QCOSTS2", null=True), - ), - ( - "findings", - models.TextField(blank=True, db_column="FINDINGS", null=True), - ), - ( - "findingrefnums", - models.TextField(blank=True, db_column="FINDINGREFNUMS", null=True), - ), - ("arra", models.TextField(blank=True, db_column="ARRA", null=True)), - ("loans", models.TextField(blank=True, db_column="LOANS", null=True)), - ( - "loanbalance", - models.TextField(blank=True, db_column="LOANBALANCE", null=True), - ), - ( - "findingscount", - models.TextField(blank=True, db_column="FINDINGSCOUNT", null=True), - ), - ( - "elecauditsid", - models.TextField(blank=True, db_column="ELECAUDITSID", null=True), - ), - ( - "otherclustername", - models.TextField( - blank=True, db_column="OTHERCLUSTERNAME", null=True - ), - ), - ( - "cfdaprogramname", - models.TextField( - blank=True, db_column="CFDAPROGRAMNAME", null=True - ), - ), - ], - options={ - "db_table": "census_cfda19", - "managed": False, - }, - ), - migrations.CreateModel( - name="CensusCfda22", - fields=[ - ( - "index", - models.BigIntegerField( - blank=True, primary_key=True, serialize=False - ), - ), - ( - "audityear", - models.TextField(blank=True, db_column="AUDITYEAR", null=True), - ), - ("dbkey", models.TextField(blank=True, db_column="DBKEY", null=True)), - ("ein", models.TextField(blank=True, db_column="EIN", null=True)), - ("cfda", models.TextField(blank=True, db_column="CFDA", null=True)), - ( - "awardidentification", - models.TextField( - blank=True, db_column="AWARDIDENTIFICATION", null=True - ), - ), - ("rd", models.TextField(blank=True, db_column="RD", null=True)), - ( - "federalprogramname", - models.TextField( - blank=True, db_column="FEDERALPROGRAMNAME", null=True - ), - ), - ("amount", models.TextField(blank=True, db_column="AMOUNT", null=True)), - ( - "clustername", - models.TextField(blank=True, db_column="CLUSTERNAME", null=True), - ), - ( - "stateclustername", - models.TextField( - blank=True, db_column="STATECLUSTERNAME", null=True - ), - ), - ( - "programtotal", - models.TextField(blank=True, db_column="PROGRAMTOTAL", null=True), - ), - ( - "clustertotal", - models.TextField(blank=True, db_column="CLUSTERTOTAL", null=True), - ), - ("direct", models.TextField(blank=True, db_column="DIRECT", null=True)), - ( - "passthroughaward", - models.TextField( - blank=True, db_column="PASSTHROUGHAWARD", null=True - ), - ), - ( - "passthroughamount", - models.TextField( - blank=True, db_column="PASSTHROUGHAMOUNT", null=True - ), - ), - ( - "majorprogram", - models.TextField(blank=True, db_column="MAJORPROGRAM", null=True), - ), - ( - "typereport_mp", - models.TextField(blank=True, db_column="TYPEREPORT_MP", null=True), - ), - ( - "typerequirement", - models.TextField( - blank=True, db_column="TYPEREQUIREMENT", null=True - ), - ), - ( - "qcosts2", - models.TextField(blank=True, db_column="QCOSTS2", null=True), - ), - ( - "findings", - models.TextField(blank=True, db_column="FINDINGS", null=True), - ), - ( - "findingrefnums", - models.TextField(blank=True, db_column="FINDINGREFNUMS", null=True), - ), - ("arra", models.TextField(blank=True, db_column="ARRA", null=True)), - ("loans", models.TextField(blank=True, db_column="LOANS", null=True)), - ( - "loanbalance", - models.TextField(blank=True, db_column="LOANBALANCE", null=True), - ), - ( - "findingscount", - models.TextField(blank=True, db_column="FINDINGSCOUNT", null=True), - ), - ( - "elecauditsid", - models.TextField(blank=True, db_column="ELECAUDITSID", null=True), - ), - ( - "otherclustername", - models.TextField( - blank=True, db_column="OTHERCLUSTERNAME", null=True - ), - ), - ( - "cfdaprogramname", - models.TextField( - blank=True, db_column="CFDAPROGRAMNAME", null=True - ), - ), - ], - options={ - "db_table": "census_cfda22", - "managed": False, - }, - ), - migrations.CreateModel( - name="CensusGen19", - fields=[ - ( - "index", - models.BigIntegerField( - blank=True, primary_key=True, serialize=False - ), - ), - ( - "audityear", - models.TextField(blank=True, db_column="AUDITYEAR", null=True), - ), - ("dbkey", models.TextField(blank=True, db_column="DBKEY", null=True)), - ( - "typeofentity", - models.TextField(blank=True, db_column="TYPEOFENTITY", null=True), - ), - ( - "fyenddate", - models.TextField(blank=True, db_column="FYENDDATE", null=True), - ), - ( - "audittype", - models.TextField(blank=True, db_column="AUDITTYPE", null=True), - ), - ( - "periodcovered", - models.TextField(blank=True, db_column="PERIODCOVERED", null=True), - ), - ( - "numbermonths", - models.TextField(blank=True, db_column="NUMBERMONTHS", null=True), - ), - ("ein", models.TextField(blank=True, db_column="EIN", null=True)), - ( - "multipleeins", - models.TextField(blank=True, db_column="MULTIPLEEINS", null=True), - ), - ( - "einsubcode", - models.TextField(blank=True, db_column="EINSUBCODE", null=True), - ), - ("duns", models.TextField(blank=True, db_column="DUNS", null=True)), - ( - "multipleduns", - models.TextField(blank=True, db_column="MULTIPLEDUNS", null=True), - ), - ( - "auditeename", - models.TextField(blank=True, db_column="AUDITEENAME", null=True), - ), - ( - "street1", - models.TextField(blank=True, db_column="STREET1", null=True), - ), - ( - "street2", - models.TextField(blank=True, db_column="STREET2", null=True), - ), - ("city", models.TextField(blank=True, db_column="CITY", null=True)), - ("state", models.TextField(blank=True, db_column="STATE", null=True)), - ( - "zipcode", - models.TextField(blank=True, db_column="ZIPCODE", null=True), - ), - ( - "auditeecontact", - models.TextField(blank=True, db_column="AUDITEECONTACT", null=True), - ), - ( - "auditeetitle", - models.TextField(blank=True, db_column="AUDITEETITLE", null=True), - ), - ( - "auditeephone", - models.TextField(blank=True, db_column="AUDITEEPHONE", null=True), - ), - ( - "auditeefax", - models.TextField(blank=True, db_column="AUDITEEFAX", null=True), - ), - ( - "auditeeemail", - models.TextField(blank=True, db_column="AUDITEEEMAIL", null=True), - ), - ( - "auditeedatesigned", - models.TextField( - blank=True, db_column="AUDITEEDATESIGNED", null=True - ), - ), - ( - "auditeenametitle", - models.TextField( - blank=True, db_column="AUDITEENAMETITLE", null=True - ), - ), - ( - "cpafirmname", - models.TextField(blank=True, db_column="CPAFIRMNAME", null=True), - ), - ( - "cpastreet1", - models.TextField(blank=True, db_column="CPASTREET1", null=True), - ), - ( - "cpastreet2", - models.TextField(blank=True, db_column="CPASTREET2", null=True), - ), - ( - "cpacity", - models.TextField(blank=True, db_column="CPACITY", null=True), - ), - ( - "cpastate", - models.TextField(blank=True, db_column="CPASTATE", null=True), - ), - ( - "cpazipcode", - models.TextField(blank=True, db_column="CPAZIPCODE", null=True), - ), - ( - "cpacontact", - models.TextField(blank=True, db_column="CPACONTACT", null=True), - ), - ( - "cpatitle", - models.TextField(blank=True, db_column="CPATITLE", null=True), - ), - ( - "cpaphone", - models.TextField(blank=True, db_column="CPAPHONE", null=True), - ), - ("cpafax", models.TextField(blank=True, db_column="CPAFAX", null=True)), - ( - "cpaemail", - models.TextField(blank=True, db_column="CPAEMAIL", null=True), - ), - ( - "cpadatesigned", - models.TextField(blank=True, db_column="CPADATESIGNED", null=True), - ), - ( - "cog_over", - models.TextField(blank=True, db_column="COG_OVER", null=True), - ), - ( - "cogagency", - models.TextField(blank=True, db_column="COGAGENCY", null=True), - ), - ( - "oversightagency", - models.TextField( - blank=True, db_column="OVERSIGHTAGENCY", null=True - ), - ), - ( - "typereport_fs", - models.TextField(blank=True, db_column="TYPEREPORT_FS", null=True), - ), - ( - "sp_framework", - models.TextField(blank=True, db_column="SP_FRAMEWORK", null=True), - ), - ( - "sp_framework_required", - models.TextField( - blank=True, db_column="SP_FRAMEWORK_REQUIRED", null=True - ), - ), - ( - "typereport_sp_framework", - models.TextField( - blank=True, db_column="TYPEREPORT_SP_FRAMEWORK", null=True - ), - ), - ( - "goingconcern", - models.TextField(blank=True, db_column="GOINGCONCERN", null=True), - ), - ( - "reportablecondition", - models.TextField( - blank=True, db_column="REPORTABLECONDITION", null=True - ), - ), - ( - "materialweakness", - models.TextField( - blank=True, db_column="MATERIALWEAKNESS", null=True - ), - ), - ( - "materialnoncompliance", - models.TextField( - blank=True, db_column="MATERIALNONCOMPLIANCE", null=True - ), - ), - ( - "typereport_mp", - models.TextField(blank=True, db_column="TYPEREPORT_MP", null=True), - ), - ( - "dup_reports", - models.TextField(blank=True, db_column="DUP_REPORTS", null=True), - ), - ( - "dollarthreshold", - models.TextField( - blank=True, db_column="DOLLARTHRESHOLD", null=True - ), - ), - ( - "lowrisk", - models.TextField(blank=True, db_column="LOWRISK", null=True), - ), - ( - "reportablecondition_mp", - models.TextField( - blank=True, db_column="REPORTABLECONDITION_MP", null=True - ), - ), - ( - "materialweakness_mp", - models.TextField( - blank=True, db_column="MATERIALWEAKNESS_MP", null=True - ), - ), - ("qcosts", models.TextField(blank=True, db_column="QCOSTS", null=True)), - ( - "cyfindings", - models.TextField(blank=True, db_column="CYFINDINGS", null=True), - ), - ( - "pyschedule", - models.TextField(blank=True, db_column="PYSCHEDULE", null=True), - ), - ( - "totfedexpend", - models.TextField(blank=True, db_column="TOTFEDEXPEND", null=True), - ), - ( - "datefirewall", - models.TextField(blank=True, db_column="DATEFIREWALL", null=True), - ), - ( - "previousdatefirewall", - models.TextField( - blank=True, db_column="PREVIOUSDATEFIREWALL", null=True - ), - ), - ( - "reportrequired", - models.TextField(blank=True, db_column="REPORTREQUIRED", null=True), - ), - ( - "multiple_cpas", - models.TextField(blank=True, db_column="MULTIPLE_CPAS", null=True), - ), - ( - "auditor_ein", - models.TextField(blank=True, db_column="AUDITOR_EIN", null=True), - ), - ( - "facaccepteddate", - models.TextField( - blank=True, db_column="FACACCEPTEDDATE", null=True - ), - ), - ( - "cpaforeign", - models.TextField(blank=True, db_column="CPAFOREIGN", null=True), - ), - ( - "cpacountry", - models.TextField(blank=True, db_column="CPACOUNTRY", null=True), - ), - ( - "entity_type", - models.TextField(blank=True, db_column="ENTITY_TYPE", null=True), - ), - ("uei", models.TextField(blank=True, db_column="UEI", null=True)), - ( - "multipleueis", - models.TextField(blank=True, db_column="MULTIPLEUEIS", null=True), - ), - ], - options={ - "db_table": "census_gen19", - "managed": False, - }, - ), - migrations.CreateModel( - name="CensusGen22", - fields=[ - ( - "index", - models.BigIntegerField( - blank=True, primary_key=True, serialize=False - ), - ), - ( - "audityear", - models.TextField(blank=True, db_column="AUDITYEAR", null=True), - ), - ("dbkey", models.TextField(blank=True, db_column="DBKEY", null=True)), - ( - "typeofentity", - models.TextField(blank=True, db_column="TYPEOFENTITY", null=True), - ), - ( - "fyenddate", - models.TextField(blank=True, db_column="FYENDDATE", null=True), - ), - ( - "audittype", - models.TextField(blank=True, db_column="AUDITTYPE", null=True), - ), - ( - "periodcovered", - models.TextField(blank=True, db_column="PERIODCOVERED", null=True), - ), - ( - "numbermonths", - models.TextField(blank=True, db_column="NUMBERMONTHS", null=True), - ), - ("ein", models.TextField(blank=True, db_column="EIN", null=True)), - ( - "multipleeins", - models.TextField(blank=True, db_column="MULTIPLEEINS", null=True), - ), - ( - "einsubcode", - models.TextField(blank=True, db_column="EINSUBCODE", null=True), - ), - ("duns", models.TextField(blank=True, db_column="DUNS", null=True)), - ( - "multipleduns", - models.TextField(blank=True, db_column="MULTIPLEDUNS", null=True), - ), - ( - "auditeename", - models.TextField(blank=True, db_column="AUDITEENAME", null=True), - ), - ( - "street1", - models.TextField(blank=True, db_column="STREET1", null=True), - ), - ( - "street2", - models.TextField(blank=True, db_column="STREET2", null=True), - ), - ("city", models.TextField(blank=True, db_column="CITY", null=True)), - ("state", models.TextField(blank=True, db_column="STATE", null=True)), - ( - "zipcode", - models.TextField(blank=True, db_column="ZIPCODE", null=True), - ), - ( - "auditeecontact", - models.TextField(blank=True, db_column="AUDITEECONTACT", null=True), - ), - ( - "auditeetitle", - models.TextField(blank=True, db_column="AUDITEETITLE", null=True), - ), - ( - "auditeephone", - models.TextField(blank=True, db_column="AUDITEEPHONE", null=True), - ), - ( - "auditeefax", - models.TextField(blank=True, db_column="AUDITEEFAX", null=True), - ), - ( - "auditeeemail", - models.TextField(blank=True, db_column="AUDITEEEMAIL", null=True), - ), - ( - "auditeedatesigned", - models.TextField( - blank=True, db_column="AUDITEEDATESIGNED", null=True - ), - ), - ( - "auditeenametitle", - models.TextField( - blank=True, db_column="AUDITEENAMETITLE", null=True - ), - ), - ( - "cpafirmname", - models.TextField(blank=True, db_column="CPAFIRMNAME", null=True), - ), - ( - "cpastreet1", - models.TextField(blank=True, db_column="CPASTREET1", null=True), - ), - ( - "cpastreet2", - models.TextField(blank=True, db_column="CPASTREET2", null=True), - ), - ( - "cpacity", - models.TextField(blank=True, db_column="CPACITY", null=True), - ), - ( - "cpastate", - models.TextField(blank=True, db_column="CPASTATE", null=True), - ), - ( - "cpazipcode", - models.TextField(blank=True, db_column="CPAZIPCODE", null=True), - ), - ( - "cpacontact", - models.TextField(blank=True, db_column="CPACONTACT", null=True), - ), - ( - "cpatitle", - models.TextField(blank=True, db_column="CPATITLE", null=True), - ), - ( - "cpaphone", - models.TextField(blank=True, db_column="CPAPHONE", null=True), - ), - ("cpafax", models.TextField(blank=True, db_column="CPAFAX", null=True)), - ( - "cpaemail", - models.TextField(blank=True, db_column="CPAEMAIL", null=True), - ), - ( - "cpadatesigned", - models.TextField(blank=True, db_column="CPADATESIGNED", null=True), - ), - ( - "cog_over", - models.TextField(blank=True, db_column="COG_OVER", null=True), - ), - ( - "cogagency", - models.TextField(blank=True, db_column="COGAGENCY", null=True), - ), - ( - "oversightagency", - models.TextField( - blank=True, db_column="OVERSIGHTAGENCY", null=True - ), - ), - ( - "typereport_fs", - models.TextField(blank=True, db_column="TYPEREPORT_FS", null=True), - ), - ( - "sp_framework", - models.TextField(blank=True, db_column="SP_FRAMEWORK", null=True), - ), - ( - "sp_framework_required", - models.TextField( - blank=True, db_column="SP_FRAMEWORK_REQUIRED", null=True - ), - ), - ( - "typereport_sp_framework", - models.TextField( - blank=True, db_column="TYPEREPORT_SP_FRAMEWORK", null=True - ), - ), - ( - "goingconcern", - models.TextField(blank=True, db_column="GOINGCONCERN", null=True), - ), - ( - "reportablecondition", - models.TextField( - blank=True, db_column="REPORTABLECONDITION", null=True - ), - ), - ( - "materialweakness", - models.TextField( - blank=True, db_column="MATERIALWEAKNESS", null=True - ), - ), - ( - "materialnoncompliance", - models.TextField( - blank=True, db_column="MATERIALNONCOMPLIANCE", null=True - ), - ), - ( - "typereport_mp", - models.TextField(blank=True, db_column="TYPEREPORT_MP", null=True), - ), - ( - "dup_reports", - models.TextField(blank=True, db_column="DUP_REPORTS", null=True), - ), - ( - "dollarthreshold", - models.TextField( - blank=True, db_column="DOLLARTHRESHOLD", null=True - ), - ), - ( - "lowrisk", - models.TextField(blank=True, db_column="LOWRISK", null=True), - ), - ( - "reportablecondition_mp", - models.TextField( - blank=True, db_column="REPORTABLECONDITION_MP", null=True - ), - ), - ( - "materialweakness_mp", - models.TextField( - blank=True, db_column="MATERIALWEAKNESS_MP", null=True - ), - ), - ("qcosts", models.TextField(blank=True, db_column="QCOSTS", null=True)), - ( - "cyfindings", - models.TextField(blank=True, db_column="CYFINDINGS", null=True), - ), - ( - "pyschedule", - models.TextField(blank=True, db_column="PYSCHEDULE", null=True), - ), - ( - "totfedexpend", - models.TextField(blank=True, db_column="TOTFEDEXPEND", null=True), - ), - ( - "datefirewall", - models.TextField(blank=True, db_column="DATEFIREWALL", null=True), - ), - ( - "previousdatefirewall", - models.TextField( - blank=True, db_column="PREVIOUSDATEFIREWALL", null=True - ), - ), - ( - "reportrequired", - models.TextField(blank=True, db_column="REPORTREQUIRED", null=True), - ), - ( - "multiple_cpas", - models.TextField(blank=True, db_column="MULTIPLE_CPAS", null=True), - ), - ( - "auditor_ein", - models.TextField(blank=True, db_column="AUDITOR_EIN", null=True), - ), - ( - "facaccepteddate", - models.TextField( - blank=True, db_column="FACACCEPTEDDATE", null=True - ), - ), - ( - "cpaforeign", - models.TextField(blank=True, db_column="CPAFOREIGN", null=True), - ), - ( - "cpacountry", - models.TextField(blank=True, db_column="CPACOUNTRY", null=True), - ), - ( - "entity_type", - models.TextField(blank=True, db_column="ENTITY_TYPE", null=True), - ), - ("uei", models.TextField(blank=True, db_column="UEI", null=True)), - ( - "multipleueis", - models.TextField(blank=True, db_column="MULTIPLEUEIS", null=True), - ), - ], - options={ - "db_table": "census_gen22", - "managed": False, - }, - ), - ] diff --git a/backend/support/migrations/0001_initial.py b/backend/support/migrations/0001_initial.py index 7493b40ca3..d32cba7509 100644 --- a/backend/support/migrations/0001_initial.py +++ b/backend/support/migrations/0001_initial.py @@ -1,17 +1,14 @@ -# Generated by Django 4.2.3 on 2023-09-07 10:03 +# Generated by Django 4.2.3 on 2023-09-20 14:52 from django.db import migrations, models -from typing import List class Migration(migrations.Migration): initial = True - dependencies: List[str] = [] - operations = [ migrations.CreateModel( - name="CognizantBaseline", + name="CognizantAssignment", fields=[ ( "id", @@ -22,43 +19,63 @@ class Migration(migrations.Migration): verbose_name="ID", ), ), + ("report_id", models.CharField(max_length=17)), ( - "dbkey", - models.CharField( - max_length=20, - null=True, - verbose_name="Identifier for a submission along with audit_year in Census FAC", + "cognizant_agency", + models.CharField(max_length=2, verbose_name="Cog Agency"), + ), + ( + "date_assigned", + models.DateTimeField( + auto_now_add=True, verbose_name="Date Assigned" ), ), ( - "ein", + "assignor_email", + models.EmailField(max_length=254, verbose_name="Email"), + ), + ("override_comment", models.TextField(verbose_name="Comment")), + ( + "assignment_type", models.CharField( - max_length=30, - null=True, - verbose_name="Primary Employer Identification Number", + choices=[ + ("computed", "Computed by FAC"), + ("manual", "Manual Override"), + ], + default="computed", + max_length=20, + verbose_name="Type", ), ), + ], + ), + migrations.CreateModel( + name="CognizantBaseline", + fields=[ ( - "uei", - models.CharField( - max_length=30, - null=True, - verbose_name="Unique Employer Identification Number", + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", ), ), + ( + "dbkey", + models.CharField(max_length=20, null=True, verbose_name="dbkey"), + ), + ("ein", models.CharField(max_length=30, null=True, verbose_name="EIN")), + ("uei", models.CharField(max_length=30, null=True, verbose_name="UEI")), ( "cognizant_agency", - models.CharField( - max_length=2, - verbose_name="Two digit Federal agency prefix of the cognizant agency", - ), + models.CharField(max_length=2, verbose_name="Cog Agency"), ), ( "date_assigned", - models.DateTimeField( - verbose_name="Time when the cog agency was assigned to the entity" - ), + models.DateTimeField(null=True, verbose_name="Date Assigned"), ), + ("is_active", models.BooleanField(default=True, verbose_name="Active")), ], ), ] diff --git a/backend/support/migrations/0002_cognizantassignment_cognizantbaseline_is_active_and_more.py b/backend/support/migrations/0002_cognizantassignment_cognizantbaseline_is_active_and_more.py deleted file mode 100644 index 1d365b4a3c..0000000000 --- a/backend/support/migrations/0002_cognizantassignment_cognizantbaseline_is_active_and_more.py +++ /dev/null @@ -1,84 +0,0 @@ -# Generated by Django 4.2.3 on 2023-09-14 09:18 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("support", "0001_initial"), - ] - - operations = [ - migrations.CreateModel( - name="CognizantAssignment", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("report_id", models.CharField(max_length=17)), - ( - "cognizant_agency", - models.CharField(max_length=2, verbose_name="Cog Agency"), - ), - ( - "date_assigned", - models.DateTimeField( - auto_now_add=True, verbose_name="Date Assigned" - ), - ), - ( - "assignor_email", - models.EmailField(max_length=254, verbose_name="Email"), - ), - ("override_comment", models.TextField(verbose_name="Comment")), - ( - "assignment_type", - models.CharField( - choices=[ - ("computed", "Computed by FAC"), - ("manual", "Manual Override"), - ], - default="computed", - max_length=20, - verbose_name="Type", - ), - ), - ], - ), - migrations.AddField( - model_name="cognizantbaseline", - name="is_active", - field=models.BooleanField(default=True, verbose_name="Active"), - ), - migrations.AlterField( - model_name="cognizantbaseline", - name="cognizant_agency", - field=models.CharField(max_length=2, verbose_name="Cog Agency"), - ), - migrations.AlterField( - model_name="cognizantbaseline", - name="date_assigned", - field=models.DateTimeField(null=True, verbose_name="Date Assigned"), - ), - migrations.AlterField( - model_name="cognizantbaseline", - name="dbkey", - field=models.CharField(max_length=20, null=True, verbose_name="dbkey"), - ), - migrations.AlterField( - model_name="cognizantbaseline", - name="ein", - field=models.CharField(max_length=30, null=True, verbose_name="EIN"), - ), - migrations.AlterField( - model_name="cognizantbaseline", - name="uei", - field=models.CharField(max_length=30, null=True, verbose_name="UEI"), - ), - ] diff --git a/backend/users/migrations/0001_create_user_profile.py b/backend/users/migrations/0001_initial.py similarity index 93% rename from backend/users/migrations/0001_create_user_profile.py rename to backend/users/migrations/0001_initial.py index 8087919081..bb6138d5f6 100644 --- a/backend/users/migrations/0001_create_user_profile.py +++ b/backend/users/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.0.4 on 2022-04-22 19:09 +# Generated by Django 4.2.3 on 2023-09-20 14:33 from django.conf import settings from django.db import migrations, models @@ -29,6 +29,7 @@ class Migration(migrations.Migration): "entry_form_data", models.JSONField( blank=True, + default=dict, help_text="Store of form data for Eligiblity, Info, and access steps prior to creation of an SF-SAC", null=True, ), diff --git a/backend/users/migrations/0002_add_default_for_jsonfield.py b/backend/users/migrations/0002_add_default_for_jsonfield.py deleted file mode 100644 index 5763020222..0000000000 --- a/backend/users/migrations/0002_add_default_for_jsonfield.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 4.0.4 on 2022-04-25 14:34 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("users", "0001_create_user_profile"), - ] - - operations = [ - migrations.AlterField( - model_name="userprofile", - name="entry_form_data", - field=models.JSONField( - blank=True, - default=dict, - help_text="Store of form data for Eligiblity, Info, and access steps prior to creation of an SF-SAC", - null=True, - ), - ), - ] diff --git a/backend/users/migrations/0003_logingovuser.py b/backend/users/migrations/0003_logingovuser.py deleted file mode 100644 index 9093865da0..0000000000 --- a/backend/users/migrations/0003_logingovuser.py +++ /dev/null @@ -1,37 +0,0 @@ -# Generated by Django 4.0.4 on 2022-06-27 15:38 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ("users", "0002_add_default_for_jsonfield"), - ] - - operations = [ - migrations.CreateModel( - name="LoginGovUser", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("login_id", models.CharField(max_length=100, unique=True)), - ( - "user", - models.OneToOneField( - on_delete=django.db.models.deletion.CASCADE, - to=settings.AUTH_USER_MODEL, - ), - ), - ], - ), - ] diff --git a/backend/users/migrations/0004_alter_logingovuser_login_id.py b/backend/users/migrations/0004_alter_logingovuser_login_id.py deleted file mode 100644 index 1d4e227b7f..0000000000 --- a/backend/users/migrations/0004_alter_logingovuser_login_id.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 4.0.4 on 2022-07-06 19:50 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("users", "0003_logingovuser"), - ] - - operations = [ - migrations.AlterField( - model_name="logingovuser", - name="login_id", - field=models.CharField(max_length=50, unique=True), - ), - ] diff --git a/backend/users/migrations/0005_delete_logingovuser.py b/backend/users/migrations/0005_delete_logingovuser.py deleted file mode 100644 index 245602bb5b..0000000000 --- a/backend/users/migrations/0005_delete_logingovuser.py +++ /dev/null @@ -1,15 +0,0 @@ -# Generated by Django 4.1.3 on 2022-11-23 16:25 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("users", "0004_alter_logingovuser_login_id"), - ] - - operations = [ - migrations.DeleteModel( - name="LoginGovUser", - ), - ]