From 923642a279d1310ecc1f18ac44ef98b68c9b21ab Mon Sep 17 00:00:00 2001 From: Daniel <139119540+DeltaDaniel@users.noreply.github.com> Date: Tue, 30 Jul 2024 09:12:08 +0200 Subject: [PATCH] Patch small bugs (#125) * fix small bug for all message formats * Changed pattern for nr in NachrichtenstrukturZeile * Update src/migmose/mig/nachrichtenstrukturzeile.py Co-authored-by: konstantin --------- Co-authored-by: konstantin --- src/migmose/__main__.py | 2 +- src/migmose/mig/nachrichtenstrukturzeile.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/migmose/__main__.py b/src/migmose/__main__.py index f589e2a..bebb73e 100644 --- a/src/migmose/__main__.py +++ b/src/migmose/__main__.py @@ -19,7 +19,7 @@ def check_message_format(ctx, param, value) -> list[EdifactFormat]: # type: ign """ Check if the message format is valid. """ - if value is None: + if len(value) == 0: value = map(lambda x: x.name, EdifactFormat) return list(value) diff --git a/src/migmose/mig/nachrichtenstrukturzeile.py b/src/migmose/mig/nachrichtenstrukturzeile.py index 2963438..00b1655 100644 --- a/src/migmose/mig/nachrichtenstrukturzeile.py +++ b/src/migmose/mig/nachrichtenstrukturzeile.py @@ -24,7 +24,9 @@ class for lines in mig tables, e.g. (ORDCHG): """ zaehler: str - nr: str | None = Field(default=None, pattern=r"^\d{5}$") #: the segment ID (can be used to match with AHBs) + nr: str | None = Field( + default=None, pattern=r"^(?:\d{5})|(?:[A-Za-z]+\d{4})$" + ) #: the segment ID (can be used to match with AHBs) bezeichnung: str standard_status: str bdew_status: str