Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/dve/core_engine/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/features/steps/steps_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}"""
Expand Down Expand Up @@ -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),
)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_core_engine/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down