From cb63db2ce5d37db31c95577d65d22e4c700d9801 Mon Sep 17 00:00:00 2001 From: Derek Furst Date: Wed, 13 May 2026 13:44:09 -0400 Subject: [PATCH] added new valid status 'approval' --- entity-api-spec.yaml | 10 ++++++---- src/app.py | 10 ++++++---- src/schema/provenance_schema.yaml | 2 +- src/schema/schema_manager.py | 4 ++-- src/schema/schema_validators.py | 2 +- .../api-template-test/entity-Template.yaml | 3 ++- .../example-yaml-templates/dataset-schema.yaml | 3 ++- .../entity-api-spec-TEMPLATE.yaml | 3 ++- 8 files changed, 22 insertions(+), 15 deletions(-) diff --git a/entity-api-spec.yaml b/entity-api-spec.yaml index 8641138b..76fba743 100644 --- a/entity-api-spec.yaml +++ b/entity-api-spec.yaml @@ -644,7 +644,8 @@ components: - Invalid - Submitted - Incomplete - description: 'One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete' + - Approval + description: 'One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete|Approval' title: type: string description: 'The dataset title.' @@ -883,7 +884,7 @@ components: - Reorganized - Processing - Submitted - - Imcomplete + - Incomplete description: 'One of: New|Valid|Invalid|Error|Reorganized|Processing|Submitted|Incomplete' validation_message: type: string @@ -1098,8 +1099,9 @@ components: - Hold - Invalid - Submitted - - Imcomplete - description: 'One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete' + - Incomplete + - Approval + description: 'One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete|Approval' title: type: string description: 'The Publication title.' diff --git a/src/app.py b/src/app.py index ab832ddc..d58baeae 100644 --- a/src/app.py +++ b/src/app.py @@ -2105,8 +2105,9 @@ def get_siblings(id): include_revisions = request.args.get('include-old-revisions') if status is not None: status = status.lower() - if status not in ['new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted']: - bad_request_error("Invalid Dataset Status. Must be 'new', 'qa', or 'published' Case-Insensitive") + allowed_statuses = ['new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted', 'approval'] + if status not in allowed_statuses: + bad_request_error(f"Invalid Dataset Status. Must be one of: {', '.join(allowed_statuses)}") if property_key is not None: property_key = property_key.lower() result_filtering_accepted_property_keys = ['uuid'] @@ -2239,8 +2240,9 @@ def get_tuplets(id): status = request.args.get('status') if status is not None: status = status.lower() - if status not in ['new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted']: - bad_request_error("Invalid Dataset Status. Must be 'new', 'qa', or 'published' Case-Insensitive") + allowed_statuses = ['new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted', 'approval'] + if status not in allowed_statuses: + bad_request_error(f"Invalid Dataset Status. Must be one of: {', '.join(allowed_statuses)}") if property_key is not None: property_key = property_key.lower() result_filtering_accepted_property_keys = ['uuid'] diff --git a/src/schema/provenance_schema.yaml b/src/schema/provenance_schema.yaml index 3107832f..b73caaa4 100644 --- a/src/schema/provenance_schema.yaml +++ b/src/schema/provenance_schema.yaml @@ -408,7 +408,7 @@ ENTITIES: - validate_dataset_not_component generated: true indexed: true - description: "One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete" + description: "One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete|Approval" before_create_trigger: set_dataset_status_new after_create_trigger: set_status_history after_update_trigger: update_status diff --git a/src/schema/schema_manager.py b/src/schema/schema_manager.py index 075b5fea..a67d8fce 100644 --- a/src/schema/schema_manager.py +++ b/src/schema/schema_manager.py @@ -1441,12 +1441,12 @@ def normalize_entity_type(entity_type): Parameters ---------- status : str - One of the status types: New|Processing|QA|Published|Error|Hold|Invalid + One of the status types: New|Processing|QA|Published|Error|Hold|Invalid|Approval Returns ------- string - One of the normalized status types: New|Processing|QA|Published|Error|Hold|Invalid + One of the normalized status types: New|Processing|QA|Published|Error|Hold|Invalid|Approval """ def normalize_status(status): if status.lower() == "qa": diff --git a/src/schema/schema_validators.py b/src/schema/schema_validators.py index 4ec3cb21..9a1fb453 100644 --- a/src/schema/schema_validators.py +++ b/src/schema/schema_validators.py @@ -414,7 +414,7 @@ def validate_application_header_before_property_update(property_key, normalized_ def validate_dataset_status_value(property_key, normalized_entity_type, request, existing_data_dict, new_data_dict): # Use lowercase for comparison accepted_status_values = [ - 'new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted', 'incomplete' + 'new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted', 'incomplete', 'approval' ] new_status = new_data_dict[property_key].lower() diff --git a/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml b/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml index e75b2935..13a58e45 100644 --- a/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml +++ b/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml @@ -600,7 +600,8 @@ x-ref-components: - Error - Hold - Invalid - description: "One of: New|Processing|QA|Published|Error|Hold|Invalid" + - Approval + description: "One of: New|Processing|QA|Published|Error|Hold|Invalid|Approval" title: type: string description: "The dataset title." diff --git a/src/schema_templating/example-yaml-templates/dataset-schema.yaml b/src/schema_templating/example-yaml-templates/dataset-schema.yaml index 8dbd2218..12ab0bc1 100644 --- a/src/schema_templating/example-yaml-templates/dataset-schema.yaml +++ b/src/schema_templating/example-yaml-templates/dataset-schema.yaml @@ -91,7 +91,8 @@ Dataset: - Error - Hold - Invalid - description: "One of: New|Processing|QA|Published|Error|Hold|Invalid" + - Approval + description: "One of: New|Processing|QA|Published|Error|Hold|Invalid|Approval" title: type: string description: "The dataset title." diff --git a/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml b/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml index 8c4515cc..e2590261 100644 --- a/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml +++ b/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml @@ -579,7 +579,8 @@ components: - Error - Hold - Invalid - description: "One of: New|Processing|QA|Published|Error|Hold|Invalid" + - Approval + description: "One of: New|Processing|QA|Published|Error|Hold|Invalid|Approval" title: type: string description: "The dataset title."