diff --git a/src/api/endpoints/annotate/all/post/models/request.py b/src/api/endpoints/annotate/all/post/models/request.py index 3480f346..939eafab 100644 --- a/src/api/endpoints/annotate/all/post/models/request.py +++ b/src/api/endpoints/annotate/all/post/models/request.py @@ -24,36 +24,6 @@ def forbid_record_type_if_meta_url_or_individual_record(self): raise FailedValidationException("record_type must be None if suggested_status is META_URL") return self - @model_validator(mode="after") - def require_record_type_if_data_source(self): - if self.suggested_status == URLType.DATA_SOURCE and self.record_type is None: - raise FailedValidationException("record_type must be provided if suggested_status is DATA_SOURCE") - return self - - @model_validator(mode="after") - def require_location_if_relevant(self): - if self.suggested_status not in [ - URLType.META_URL, - URLType.DATA_SOURCE, - URLType.INDIVIDUAL_RECORD, - ]: - return self - if len(self.location_ids) == 0: - raise FailedValidationException("location_ids must be provided if suggested_status is META_URL or DATA_SOURCE") - return self - - @model_validator(mode="after") - def require_agency_id_if_relevant(self): - if self.suggested_status not in [ - URLType.META_URL, - URLType.DATA_SOURCE, - URLType.INDIVIDUAL_RECORD, - ]: - return self - if len(self.agency_ids) == 0: - raise FailedValidationException("agencies must be provided if suggested_status is META_URL or DATA_SOURCE") - return self - @model_validator(mode="after") def forbid_all_else_if_not_relevant(self): if self.suggested_status != URLType.NOT_RELEVANT: diff --git a/tests/automated/unit/api/test_all_annotation_post_info.py b/tests/automated/unit/api/test_all_annotation_post_info.py index c3b7a526..4649c655 100644 --- a/tests/automated/unit/api/test_all_annotation_post_info.py +++ b/tests/automated/unit/api/test_all_annotation_post_info.py @@ -54,42 +54,6 @@ class TestAllAnnotationPostInfoParams(BaseModel): location_ids=[3, 4], raise_exception=True ), - TestAllAnnotationPostInfoParams( - suggested_status=URLType.META_URL, - record_type=None, - agency_ids=[], # No agency IDs - location_ids=[3, 4], - raise_exception=True - ), - TestAllAnnotationPostInfoParams( - suggested_status=URLType.META_URL, - record_type=None, - agency_ids=[1, 2], - location_ids=[], # No Location IDs - raise_exception=True - ), - # Error Paths - Data Source - TestAllAnnotationPostInfoParams( - suggested_status=URLType.DATA_SOURCE, - record_type=None, # No record type - agency_ids=[1, 2], - location_ids=[3, 4], - raise_exception=True - ), - TestAllAnnotationPostInfoParams( - suggested_status=URLType.DATA_SOURCE, - record_type=RecordType.ACCIDENT_REPORTS, - agency_ids=[], # No Agency IDs - location_ids=[3, 4], - raise_exception=True - ), - TestAllAnnotationPostInfoParams( - suggested_status=URLType.DATA_SOURCE, - record_type=RecordType.ACCIDENT_REPORTS, - agency_ids=[1, 2], - location_ids=[], # No Location IDs - raise_exception=True - ), # Error Paths - Not Relevant TestAllAnnotationPostInfoParams( suggested_status=URLType.NOT_RELEVANT, @@ -120,20 +84,6 @@ class TestAllAnnotationPostInfoParams(BaseModel): location_ids=[], raise_exception=True ), - TestAllAnnotationPostInfoParams( - suggested_status=URLType.INDIVIDUAL_RECORD, - record_type=None, - agency_ids=[1, 2], # Agency IDs Included - location_ids=[], - raise_exception=True - ), - TestAllAnnotationPostInfoParams( - suggested_status=URLType.INDIVIDUAL_RECORD, - record_type=None, - agency_ids=[], - location_ids=[1, 2], # Location IDs included - raise_exception=True - ) ] ) def test_all_annotation_post_info(