diff --git a/src/dve/core_engine/models.py b/src/dve/core_engine/models.py index 2e6578f..75a14ed 100644 --- a/src/dve/core_engine/models.py +++ b/src/dve/core_engine/models.py @@ -51,16 +51,18 @@ class SubmissionInfo(AuditRecord): """The name of the submitted file.""" file_extension: str """The extension of the file received.""" - submission_method: str = None # type: ignore + submission_method: Optional[str] = None # type: ignore """The method that the file was submitted""" - submitting_org: str = None # type: ignore + submitting_org: Optional[str] = None # type: ignore """The organisation who submitted the file.""" - reporting_period: str = None # type: ignore - """The reporting period the submission relates to.""" - file_size: int = None # type: ignore + reporting_period_start: Optional[str] = None # type: ignore + """The start of the reporting period the submission relates to.""" + reporting_period_end: Optional[str] = None # type: ignore + """The end of the reporting period the submission relates to.""" + file_size: Optional[int] = None # type: ignore """The size (in bytes) of the file received.""" - datetime_received: dt.datetime = None # type: ignore - """The datetime the SEFT transfer finished.""" + datetime_received: Optional[dt.datetime] = None # type: ignore + """The datetime the file was received.""" @validator("file_name") def _ensure_metadata_extension_removed(cls, filename): # pylint: disable=no-self-argument diff --git a/tests/features/steps/steps_pipeline.py b/tests/features/steps/steps_pipeline.py index fb85cfb..f3d1f0f 100644 --- a/tests/features/steps/steps_pipeline.py +++ b/tests/features/steps/steps_pipeline.py @@ -225,6 +225,8 @@ def submit_file_for_processing(context: Context, dataset: str, file_name: str): "dataset_id": dataset, "file_name": file_name, "file_extension": Path(file_name).suffix, + "reporting_period_start": "2025-11-01 00:00:00", + "reporting_period_end": "2025-11-30 23:59:59" } ctxt.set_submission_info(context, SubmissionInfo(**sub_info)) # type: ignore # add processing location diff --git a/tests/test_core_engine/test_backends/test_implementations/test_duckdb/test_audit_ddb.py b/tests/test_core_engine/test_backends/test_implementations/test_duckdb/test_audit_ddb.py index b0598eb..6260965 100644 --- a/tests/test_core_engine/test_backends/test_implementations/test_duckdb/test_audit_ddb.py +++ b/tests/test_core_engine/test_backends/test_implementations/test_duckdb/test_audit_ddb.py @@ -40,7 +40,8 @@ def dve_metadata_file() -> Iterator[Path]: "file_extension": "xml", "file_size": 123456789, "submitting_org": "TEST", - "reporting_period": "FY2023-24_TEST", + "reporting_period_start": "FY2023-24_START_TEST", + "reporting_period_end": "FY2023-24_END_TEST", "dataset_id": "TEST_DATASET", "datetime_received": "2023-10-03T10:53:36.1231998Z" }""" diff --git a/tests/test_core_engine/test_backends/test_implementations/test_spark/test_audit_spark.py b/tests/test_core_engine/test_backends/test_implementations/test_spark/test_audit_spark.py index a5146f9..4b328df 100644 --- a/tests/test_core_engine/test_backends/test_implementations/test_spark/test_audit_spark.py +++ b/tests/test_core_engine/test_backends/test_implementations/test_spark/test_audit_spark.py @@ -43,7 +43,8 @@ def dve_metadata_file() -> Iterator[Path]: "file_extension": "xml", "file_size": 123456789, "submitting_org": "TEST", - "reporting_period": "FY2023-24_TEST", + "reporting_period_start": "FY2023-24_START_TEST", + "reporting_period_end": "FY2023-24_END_TEST", "dataset_id": "TEST_DATASET", "datetime_received": "2023-10-03T10:53:36.1231998Z" }""" @@ -147,7 +148,8 @@ def test_submission_info_from_metadata_file(dve_metadata_file): submitting_org="TEST", file_name="TESTFILE_TEST_20230323T084600", file_extension="xml", - reporting_period="FY2023-24_TEST", + reporting_period_start="FY2023-24_START_TEST", + reporting_period_end="FY2023-24_END_TEST", file_size=123456789, datetime_received=datetime(2023, 10, 3, 10, 53, 36, 123199, tzinfo=timezone.utc), ) diff --git a/tests/test_core_engine/test_models.py b/tests/test_core_engine/test_models.py index ef85173..87c8f9d 100644 --- a/tests/test_core_engine/test_models.py +++ b/tests/test_core_engine/test_models.py @@ -73,7 +73,8 @@ def test_submission_info( # pylint: disable=missing-function-docstring "time_updated", "submission_method", "submitting_org", - "reporting_period", + "reporting_period_start", + "reporting_period_end", "file_size", "datetime_received", ]