Skip to content

Commit

Permalink
fix keydate for FV2504 (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
hf-kklein committed Jun 19, 2024
1 parent e4ed6b4 commit b8ef0cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/maus/edifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class EdifactFormatVersion(str, Enum):
FV2310 = "FV2310" #: valid from 2023-10-01 onwards
FV2404 = "FV2404" #: valid from 2024-04-01 onwards
FV2410 = "FV2410" #: valid from 2024-10-01 onwards
FV2504 = "FV2504" #: valid from 2025-01-01 onwards
FV2504 = "FV2504" #: valid from 2025-04-04 onwards
FV2510 = "FV2510" #: valid from 2025-10-01 onwards
# whenever you add another value here, please also make sure to add its key date to get_edifact_format_version below

Expand All @@ -103,7 +103,7 @@ def get_edifact_format_version(key_date: datetime.datetime) -> EdifactFormatVers
(datetime.datetime(2023, 9, 30, 22, 0, 0, 0, tzinfo=datetime.timezone.utc), EdifactFormatVersion.FV2304),
(datetime.datetime(2024, 4, 2, 22, 0, 0, 0, tzinfo=datetime.timezone.utc), EdifactFormatVersion.FV2310),
(datetime.datetime(2024, 9, 30, 22, 0, 0, 0, tzinfo=datetime.timezone.utc), EdifactFormatVersion.FV2404),
(datetime.datetime(2025, 3, 31, 22, 0, 0, 0, tzinfo=datetime.timezone.utc), EdifactFormatVersion.FV2410),
(datetime.datetime(2025, 4, 3, 22, 0, 0, 0, tzinfo=datetime.timezone.utc), EdifactFormatVersion.FV2410),
(datetime.datetime(2025, 9, 30, 22, 0, 0, 0, tzinfo=datetime.timezone.utc), EdifactFormatVersion.FV2504),
]

Expand Down
3 changes: 2 additions & 1 deletion tests/unit_tests/test_edifact_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def test_pruefi_to_format(self, expectation_tuple: Tuple[str, EdifactFormat]):
pytest.param(datetime(2024, 4, 2, 22, 0, 0, tzinfo=timezone.utc), EdifactFormatVersion.FV2404),
pytest.param(datetime(2024, 9, 30, 21, 59, 59, tzinfo=timezone.utc), EdifactFormatVersion.FV2404),
pytest.param(datetime(2024, 9, 30, 22, 0, 0, 0, tzinfo=timezone.utc), EdifactFormatVersion.FV2410),
pytest.param(datetime(2025, 3, 31, 22, 0, 0, tzinfo=timezone.utc), EdifactFormatVersion.FV2504),
pytest.param(datetime(2025, 3, 31, 22, 0, 0, tzinfo=timezone.utc), EdifactFormatVersion.FV2410),
pytest.param(datetime(2025, 4, 3, 22, 0, 0, tzinfo=timezone.utc), EdifactFormatVersion.FV2504),
pytest.param(datetime(2025, 9, 30, 22, 0, 0, tzinfo=timezone.utc), EdifactFormatVersion.FV2510),
pytest.param(
datetime(2050, 10, 1, 0, 0, 0, tzinfo=timezone.utc), EdifactFormatVersion.FV2510
Expand Down

0 comments on commit b8ef0cf

Please sign in to comment.