Skip to content

Commit d794f31

Browse files
committed
refactor: added reporting_period_start and end attribute to submission_info model
1 parent 0a49761 commit d794f31

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

src/dve/core_engine/models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ class SubmissionInfo(AuditRecord):
5555
"""The method that the file was submitted"""
5656
submitting_org: str = None # type: ignore
5757
"""The organisation who submitted the file."""
58-
reporting_period: str = None # type: ignore
59-
"""The reporting period the submission relates to."""
58+
reporting_period_start: str = None # type: ignore
59+
"""The start of the reporting period the submission relates to."""
60+
reporting_period_end: str = None # type: ignore
61+
"""The end of the reporting period the submission relates to."""
6062
file_size: int = None # type: ignore
6163
"""The size (in bytes) of the file received."""
6264
datetime_received: dt.datetime = None # type: ignore

tests/features/steps/steps_pipeline.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ def submit_file_for_processing(context: Context, dataset: str, file_name: str):
225225
"dataset_id": dataset,
226226
"file_name": file_name,
227227
"file_extension": Path(file_name).suffix,
228+
"reporting_period_start": "2025-11-01 00:00:00",
229+
"reporting_period_end": "2025-11-30 23:59:59"
228230
}
229231
ctxt.set_submission_info(context, SubmissionInfo(**sub_info)) # type: ignore
230232
# add processing location

tests/test_core_engine/test_backends/test_implementations/test_duckdb/test_audit_ddb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def dve_metadata_file() -> Iterator[Path]:
4040
"file_extension": "xml",
4141
"file_size": 123456789,
4242
"submitting_org": "TEST",
43-
"reporting_period": "FY2023-24_TEST",
43+
"reporting_period_start": "FY2023-24_START_TEST",
44+
"reporting_period_end": "FY2023-24_END_TEST",
4445
"dataset_id": "TEST_DATASET",
4546
"datetime_received": "2023-10-03T10:53:36.1231998Z"
4647
}"""

tests/test_core_engine/test_backends/test_implementations/test_spark/test_audit_spark.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def dve_metadata_file() -> Iterator[Path]:
4343
"file_extension": "xml",
4444
"file_size": 123456789,
4545
"submitting_org": "TEST",
46-
"reporting_period": "FY2023-24_TEST",
46+
"reporting_period_start": "FY2023-24_START_TEST",
47+
"reporting_period_end": "FY2023-24_END_TEST",
4748
"dataset_id": "TEST_DATASET",
4849
"datetime_received": "2023-10-03T10:53:36.1231998Z"
4950
}"""
@@ -147,7 +148,8 @@ def test_submission_info_from_metadata_file(dve_metadata_file):
147148
submitting_org="TEST",
148149
file_name="TESTFILE_TEST_20230323T084600",
149150
file_extension="xml",
150-
reporting_period="FY2023-24_TEST",
151+
reporting_period_start="FY2023-24_START_TEST",
152+
reporting_period_end="FY2023-24_END_TEST",
151153
file_size=123456789,
152154
datetime_received=datetime(2023, 10, 3, 10, 53, 36, 123199, tzinfo=timezone.utc),
153155
)

tests/test_core_engine/test_models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def test_submission_info( # pylint: disable=missing-function-docstring
7373
"time_updated",
7474
"submission_method",
7575
"submitting_org",
76-
"reporting_period",
76+
"reporting_period_start",
77+
"reporting_period_end",
7778
"file_size",
7879
"datetime_received",
7980
]

0 commit comments

Comments
 (0)