-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Support <Uebertragungsdatei>
in AhbReader
(adds flag is_on_uebertragungsdatei_level
to AHB Segment
model)
#132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
add flag to `Segment` model
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the flag in the AhbReader by introducing a new boolean field in the Segment model and propagating its value through different layers. Key changes include:
- Adding the "is_on_uebertragungsdatei_level" flag to the SQL and Pydantic models.
- Updating the AhbReader to correctly set the flag during recursive processing.
- Introducing a new unit test to verify the flag’s behavior.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
unittests/test_ahb_serialisierung.py | Added a test function to validate the value of is_on_uebertragungsdatei_level for segments. |
src/fundamend/sqlmodels/anwendungshandbuch.py | Introduced a new boolean field in the Segment SQLModel and updated model conversion functions. |
src/fundamend/reader/ahbreader.py | Modified helper functions to pass the uebertragungsdatei flag into segment processing recursively. |
src/fundamend/models/anwendungshandbuch.py | Updated the Pydantic model to include the new flag with a default value of False. |
@@ -184,6 +184,7 @@ class Segment(SQLModel, table=True): | |||
name: str = Field(index=True) #: e.g. 'Beginn der Nachricht' | |||
number: str = Field(index=True) #: e.g. '00002' | |||
ahb_status: str | None #: e.g. 'Muss' | |||
is_on_uebertragungsdatei_level: bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider providing a default value (e.g., False) for is_on_uebertragungsdatei_level to prevent potential issues when new Segment records are created without explicitly setting this field.
is_on_uebertragungsdatei_level: bool | |
is_on_uebertragungsdatei_level: bool = Field(default=False) |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, not here.
<Uebertragungsdatei>
in AhbReader
<Uebertragungsdatei>
in AhbReader
(adds flag is_on_uebertragungsdatei_level
to Segment
model)
<Uebertragungsdatei>
in AhbReader
(adds flag is_on_uebertragungsdatei_level
to Segment
model)<Uebertragungsdatei>
in AhbReader
(adds flag is_on_uebertragungsdatei_level
to AHB Segment
model)
for MIG see #133