Skip to content

Commit

Permalink
Patch small bugs (#125)
Browse files Browse the repository at this point in the history
* fix small bug for all message formats

* Changed pattern for nr in NachrichtenstrukturZeile

* Update src/migmose/mig/nachrichtenstrukturzeile.py

Co-authored-by: konstantin <konstantin.klein@hochfrequenz.de>

---------

Co-authored-by: konstantin <konstantin.klein@hochfrequenz.de>
  • Loading branch information
DeltaDaniel and hf-kklein authored Jul 30, 2024
1 parent 0d93de1 commit 923642a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/migmose/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion src/migmose/mig/nachrichtenstrukturzeile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 923642a

Please sign in to comment.