diff --git a/backend/audit/intakelib/constants.py b/backend/audit/intakelib/constants.py index bc1961cf20..0985857c6b 100644 --- a/backend/audit/intakelib/constants.py +++ b/backend/audit/intakelib/constants.py @@ -9,4 +9,5 @@ FEDERAL_AGENCY_PREFIX = "federal_agency_prefix" THREE_DIGIT_EXTENSION = "three_digit_extension" SECTION_NAME = "section_name" +VERSION = "version" XLSX_TEMPLATE_DEFINITION_DIR = settings.XLSX_TEMPLATE_JSON_DIR diff --git a/backend/audit/intakelib/mapping_meta.py b/backend/audit/intakelib/mapping_meta.py index 47eca97dc1..8c01486e55 100644 --- a/backend/audit/intakelib/mapping_meta.py +++ b/backend/audit/intakelib/mapping_meta.py @@ -1,5 +1,6 @@ from .constants import ( SECTION_NAME, + VERSION, ) from .mapping_util import ( @@ -9,4 +10,5 @@ meta_mapping: FieldMapping = { SECTION_NAME: (f"Meta.{SECTION_NAME}", _set_by_path), + VERSION: (f"Meta.{VERSION}", _set_by_path), } diff --git a/backend/audit/intakelib/transforms/runners.py b/backend/audit/intakelib/transforms/runners.py index 48ed5ef234..0feaf0b239 100644 --- a/backend/audit/intakelib/transforms/runners.py +++ b/backend/audit/intakelib/transforms/runners.py @@ -1,6 +1,8 @@ import logging from copy import deepcopy +from .xform_clean_version_value import remove_equals_and_quotes + from .xform_resize_award_references import resize_award_reference from .xform_all_amount_expended_need_to_be_integers import ( @@ -93,6 +95,7 @@ def run_all_secondary_auditors_transforms(ir): general_transforms = [ convert_to_stripped_string, + remove_equals_and_quotes, ] notes_to_sefa_transforms = general_transforms + [ diff --git a/backend/audit/intakelib/transforms/xform_clean_version_value.py b/backend/audit/intakelib/transforms/xform_clean_version_value.py new file mode 100644 index 0000000000..70b73d9058 --- /dev/null +++ b/backend/audit/intakelib/transforms/xform_clean_version_value.py @@ -0,0 +1,20 @@ +import logging +from audit.intakelib.intermediate_representation import ( + get_range_by_name, + replace_range_by_name, +) + +logger = logging.getLogger(__name__) + + +def remove_equals_and_quotes(ir): + versions = get_range_by_name(ir, "version") + new_values = list( + map( + lambda v: v.replace("=", "").replace('"', "") if v else v, + versions["values"], + ) + ) + new_ir = replace_range_by_name(ir, "version", new_values) + + return new_ir diff --git a/backend/schemas/output/sections/AdditionalEINs.schema.json b/backend/schemas/output/sections/AdditionalEINs.schema.json index 888519ad32..c83ce2cb5a 100644 --- a/backend/schemas/output/sections/AdditionalEINs.schema.json +++ b/backend/schemas/output/sections/AdditionalEINs.schema.json @@ -65,7 +65,18 @@ "type": "string" }, "version": { - "const": "1.1.3", + "enum": [ + "1.0.0", + "1.0.1", + "1.0.2", + "1.0.3", + "1.0.4", + "1.0.5", + "1.1.0", + "1.1.1", + "1.1.2", + "1.1.3" + ], "type": "string" } }, diff --git a/backend/schemas/output/sections/AdditionalUEIs.schema.json b/backend/schemas/output/sections/AdditionalUEIs.schema.json index 6b1510bb0b..77d31fae36 100644 --- a/backend/schemas/output/sections/AdditionalUEIs.schema.json +++ b/backend/schemas/output/sections/AdditionalUEIs.schema.json @@ -88,7 +88,18 @@ "type": "string" }, "version": { - "const": "1.1.3", + "enum": [ + "1.0.0", + "1.0.1", + "1.0.2", + "1.0.3", + "1.0.4", + "1.0.5", + "1.1.0", + "1.1.1", + "1.1.2", + "1.1.3" + ], "type": "string" } }, diff --git a/backend/schemas/output/sections/AuditFindingsText.schema.json b/backend/schemas/output/sections/AuditFindingsText.schema.json index b2219898cc..33ebd0543a 100644 --- a/backend/schemas/output/sections/AuditFindingsText.schema.json +++ b/backend/schemas/output/sections/AuditFindingsText.schema.json @@ -89,7 +89,18 @@ "type": "string" }, "version": { - "const": "1.1.3", + "enum": [ + "1.0.0", + "1.0.1", + "1.0.2", + "1.0.3", + "1.0.4", + "1.0.5", + "1.1.0", + "1.1.1", + "1.1.2", + "1.1.3" + ], "type": "string" } }, diff --git a/backend/schemas/output/sections/CorrectiveActionPlan.schema.json b/backend/schemas/output/sections/CorrectiveActionPlan.schema.json index e94196d758..e0da37cce5 100644 --- a/backend/schemas/output/sections/CorrectiveActionPlan.schema.json +++ b/backend/schemas/output/sections/CorrectiveActionPlan.schema.json @@ -89,7 +89,18 @@ "type": "string" }, "version": { - "const": "1.1.3", + "enum": [ + "1.0.0", + "1.0.1", + "1.0.2", + "1.0.3", + "1.0.4", + "1.0.5", + "1.1.0", + "1.1.1", + "1.1.2", + "1.1.3" + ], "type": "string" } }, diff --git a/backend/schemas/output/sections/FederalAwards.schema.json b/backend/schemas/output/sections/FederalAwards.schema.json index c8b650b745..c82b6909f7 100644 --- a/backend/schemas/output/sections/FederalAwards.schema.json +++ b/backend/schemas/output/sections/FederalAwards.schema.json @@ -577,7 +577,18 @@ "type": "string" }, "version": { - "const": "1.1.3", + "enum": [ + "1.0.0", + "1.0.1", + "1.0.2", + "1.0.3", + "1.0.4", + "1.0.5", + "1.1.0", + "1.1.1", + "1.1.2", + "1.1.3" + ], "type": "string" } }, diff --git a/backend/schemas/output/sections/FederalAwardsAuditFindings.schema.json b/backend/schemas/output/sections/FederalAwardsAuditFindings.schema.json index f478774a4b..2783377cea 100644 --- a/backend/schemas/output/sections/FederalAwardsAuditFindings.schema.json +++ b/backend/schemas/output/sections/FederalAwardsAuditFindings.schema.json @@ -8670,7 +8670,18 @@ "type": "string" }, "version": { - "const": "1.1.3", + "enum": [ + "1.0.0", + "1.0.1", + "1.0.2", + "1.0.3", + "1.0.4", + "1.0.5", + "1.1.0", + "1.1.1", + "1.1.2", + "1.1.3" + ], "type": "string" } }, diff --git a/backend/schemas/output/sections/NotesToSefa.schema.json b/backend/schemas/output/sections/NotesToSefa.schema.json index 364753fe2d..73ece56b28 100644 --- a/backend/schemas/output/sections/NotesToSefa.schema.json +++ b/backend/schemas/output/sections/NotesToSefa.schema.json @@ -13,7 +13,18 @@ "type": "string" }, "version": { - "const": "1.1.3", + "enum": [ + "1.0.0", + "1.0.1", + "1.0.2", + "1.0.3", + "1.0.4", + "1.0.5", + "1.1.0", + "1.1.1", + "1.1.2", + "1.1.3" + ], "type": "string" } }, diff --git a/backend/schemas/output/sections/SecondaryAuditors.schema.json b/backend/schemas/output/sections/SecondaryAuditors.schema.json index 6c095962e2..8c2c76ad96 100644 --- a/backend/schemas/output/sections/SecondaryAuditors.schema.json +++ b/backend/schemas/output/sections/SecondaryAuditors.schema.json @@ -13,7 +13,18 @@ "type": "string" }, "version": { - "const": "1.1.3", + "enum": [ + "1.0.0", + "1.0.1", + "1.0.2", + "1.0.3", + "1.0.4", + "1.0.5", + "1.1.0", + "1.1.1", + "1.1.2", + "1.1.3" + ], "type": "string" } }, diff --git a/backend/schemas/source/sections/AdditionalEINs.schema.jsonnet b/backend/schemas/source/sections/AdditionalEINs.schema.jsonnet index 49c4d3af49..cc0804c3cf 100644 --- a/backend/schemas/source/sections/AdditionalEINs.schema.jsonnet +++ b/backend/schemas/source/sections/AdditionalEINs.schema.jsonnet @@ -9,10 +9,10 @@ local Meta = Types.object { section_name: Types.string { enum: [Sheets.section_names.ADDITIONAL_EINS], }, - // FIXME: 2023-08-15 MSHD: The 'Version' is currently used here as a placeholder, and it is not being enforced at the moment. - // Once we establish a versioning pattern, we can update this and enforce it accordingly. + //Because we now pass the version to the SAC record, + //we want to make sure we allow backwards compatibility version: Types.string { - const: Sheets.WORKBOOKS_VERSION, + enum: ["1.0.0", "1.0.1", "1.0.2", "1.0.3", "1.0.4", "1.0.5", "1.1.0", "1.1.1", "1.1.2", Sheets.WORKBOOKS_VERSION] }, }, required: ['section_name'], diff --git a/backend/schemas/source/sections/AdditionalUEIs.schema.jsonnet b/backend/schemas/source/sections/AdditionalUEIs.schema.jsonnet index 49c6603121..5149a24ef8 100644 --- a/backend/schemas/source/sections/AdditionalUEIs.schema.jsonnet +++ b/backend/schemas/source/sections/AdditionalUEIs.schema.jsonnet @@ -9,10 +9,10 @@ local Meta = Types.object { section_name: Types.string { enum: [Sheets.section_names.ADDITIONAL_UEIS], }, - // FIXME: 2023-08-07 MSHD: The 'Version' is currently used here as a placeholder, and it is not being enforced at the moment. - // Once we establish a versioning pattern, we can update this and enforce it accordingly. + //Because we now pass the version to the SAC record, + //we want to make sure we allow backwards compatibility version: Types.string { - const: Sheets.WORKBOOKS_VERSION, + enum: ["1.0.0", "1.0.1", "1.0.2", "1.0.3", "1.0.4", "1.0.5", "1.1.0", "1.1.1", "1.1.2", Sheets.WORKBOOKS_VERSION] }, }, required: ['section_name'], diff --git a/backend/schemas/source/sections/AuditFindingsText.schema.jsonnet b/backend/schemas/source/sections/AuditFindingsText.schema.jsonnet index 35e0da571b..1e34117fa8 100644 --- a/backend/schemas/source/sections/AuditFindingsText.schema.jsonnet +++ b/backend/schemas/source/sections/AuditFindingsText.schema.jsonnet @@ -9,10 +9,10 @@ local Meta = Types.object { section_name: Types.string { enum: [Sheets.section_names.AUDIT_FINDINGS_TEXT], }, - // FIXME: 2023-08-07 MSHD: The 'Version' is currently used here as a placeholder, and it is not being enforced at the moment. - // Once we establish a versioning pattern, we can update this and enforce it accordingly. + //Because we now pass the version to the SAC record, + //we want to make sure we allow backwards compatibility version: Types.string { - const: Sheets.WORKBOOKS_VERSION, + enum: ["1.0.0", "1.0.1", "1.0.2", "1.0.3", "1.0.4", "1.0.5", "1.1.0", "1.1.1", "1.1.2", Sheets.WORKBOOKS_VERSION] }, }, required: ['section_name'], diff --git a/backend/schemas/source/sections/CorrectiveActionPlan.schema.jsonnet b/backend/schemas/source/sections/CorrectiveActionPlan.schema.jsonnet index ecc3888460..33ff8bac80 100644 --- a/backend/schemas/source/sections/CorrectiveActionPlan.schema.jsonnet +++ b/backend/schemas/source/sections/CorrectiveActionPlan.schema.jsonnet @@ -9,10 +9,10 @@ local Meta = Types.object { section_name: Types.string { enum: [Sheets.section_names.CORRECTIVE_ACTION_PLAN], }, - // FIXME: 2023-08-07 MSHD: The 'Version' is currently used here as a placeholder, and it is not being enforced at the moment. - // Once we establish a versioning pattern, we can update this and enforce it accordingly. + //Because we now pass the version to the SAC record, + //we want to make sure we allow backwards compatibility version: Types.string { - const: Sheets.WORKBOOKS_VERSION, + enum: ["1.0.0", "1.0.1", "1.0.2", "1.0.3", "1.0.4", "1.0.5", "1.1.0", "1.1.1", "1.1.2", Sheets.WORKBOOKS_VERSION] }, }, required: ['section_name'], diff --git a/backend/schemas/source/sections/FederalAwards.schema.jsonnet b/backend/schemas/source/sections/FederalAwards.schema.jsonnet index a3fb05f639..74b4203b0f 100644 --- a/backend/schemas/source/sections/FederalAwards.schema.jsonnet +++ b/backend/schemas/source/sections/FederalAwards.schema.jsonnet @@ -377,10 +377,10 @@ local Meta = Types.object { section_name: Types.string { enum: [Sheets.section_names.FEDERAL_AWARDS, Sheets.section_names.FEDERAL_AWARDS_EXPENDED], }, - // FIXME: 2023-08-07 MSHD: The 'Version' is currently used here as a placeholder, and it is not being enforced at the moment. - // Once we establish a versioning pattern, we can update this and enforce it accordingly. + //Because we now pass the version to the SAC record, + //we want to make sure we allow backwards compatibility version: Types.string { - const: Sheets.WORKBOOKS_VERSION, + enum: ["1.0.0", "1.0.1", "1.0.2", "1.0.3", "1.0.4", "1.0.5", "1.1.0", "1.1.1", "1.1.2", Sheets.WORKBOOKS_VERSION] }, }, required: ['section_name'], diff --git a/backend/schemas/source/sections/FederalAwardsAuditFindings.schema.jsonnet b/backend/schemas/source/sections/FederalAwardsAuditFindings.schema.jsonnet index f54763ce9c..b42d991d07 100644 --- a/backend/schemas/source/sections/FederalAwardsAuditFindings.schema.jsonnet +++ b/backend/schemas/source/sections/FederalAwardsAuditFindings.schema.jsonnet @@ -12,10 +12,10 @@ local Meta = Types.object { section_name: Types.string { enum: [Sheets.section_names.FEDERAL_AWARDS_AUDIT_FINDINGS], }, - // FIXME: 2023-08-07 MSHD: The 'Version' is currently used here as a placeholder, and it is not being enforced at the moment. - // Once we establish a versioning pattern, we can update this and enforce it accordingly. + //Because we now pass the version to the SAC record, + //we want to make sure we allow backwards compatibility version: Types.string { - const: Sheets.WORKBOOKS_VERSION, + enum: ["1.0.0", "1.0.1", "1.0.2", "1.0.3", "1.0.4", "1.0.5", "1.1.0", "1.1.1", "1.1.2", Sheets.WORKBOOKS_VERSION] }, }, required: ['section_name'], diff --git a/backend/schemas/source/sections/NotesToSefa.schema.jsonnet b/backend/schemas/source/sections/NotesToSefa.schema.jsonnet index 0d454b8fa6..60a2eac535 100644 --- a/backend/schemas/source/sections/NotesToSefa.schema.jsonnet +++ b/backend/schemas/source/sections/NotesToSefa.schema.jsonnet @@ -9,8 +9,10 @@ local Meta = Types.object { section_name: Types.string { enum: [Sheets.section_names.NOTES_TO_SEFA], }, + //Because we now pass the version to the SAC record, + //we want to make sure we allow backwards compatibility version: Types.string { - const: Sheets.WORKBOOKS_VERSION, + enum: ["1.0.0", "1.0.1", "1.0.2", "1.0.3", "1.0.4", "1.0.5", "1.1.0", "1.1.1", "1.1.2", Sheets.WORKBOOKS_VERSION] }, }, required: ['section_name'], diff --git a/backend/schemas/source/sections/SecondaryAuditors.schema.jsonnet b/backend/schemas/source/sections/SecondaryAuditors.schema.jsonnet index b55c9da9cb..08caf56f30 100644 --- a/backend/schemas/source/sections/SecondaryAuditors.schema.jsonnet +++ b/backend/schemas/source/sections/SecondaryAuditors.schema.jsonnet @@ -9,10 +9,10 @@ local Meta = Types.object { section_name: Types.string { enum: [Sheets.section_names.SECONDARY_AUDITORS], }, - // FIXME: 2023-08-07 MSHD: The 'Version' is currently used here as a placeholder, and it is not being enforced at the moment. - // Once we establish a versioning pattern, we can update this and enforce it accordingly. + //Because we now pass the version to the SAC record, + //we want to make sure we allow backwards compatibility version: Types.string { - const: Sheets.WORKBOOKS_VERSION, + enum: ["1.0.0", "1.0.1", "1.0.2", "1.0.3", "1.0.4", "1.0.5", "1.1.0", "1.1.1", "1.1.2", Sheets.WORKBOOKS_VERSION] }, }, required: ['section_name'],