Skip to content

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

Merged
merged 4 commits into from
Apr 24, 2025

Conversation

hf-kklein
Copy link
Contributor

@hf-kklein hf-kklein commented Apr 23, 2025

for MIG see #133

@hf-kklein hf-kklein requested a review from Copilot April 23, 2025 11:51
Copy link
Contributor

@Copilot Copilot AI left a 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
Copy link
Preview

Copilot AI Apr 23, 2025

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.

Suggested change
is_on_uebertragungsdatei_level: bool
is_on_uebertragungsdatei_level: bool = Field(default=False)

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, not here.

@hf-kklein hf-kklein changed the title feat: Support <Uebertragungsdatei> in AhbReader feat: Support <Uebertragungsdatei> in AhbReader (adds flag is_on_uebertragungsdatei_level to Segment model) Apr 23, 2025
@hf-kklein hf-kklein changed the title feat: Support <Uebertragungsdatei> in AhbReader (adds flag is_on_uebertragungsdatei_level to Segment model) feat: Support <Uebertragungsdatei> in AhbReader (adds flag is_on_uebertragungsdatei_level to AHB Segment model) Apr 23, 2025
@hf-kklein hf-kklein self-assigned this Apr 23, 2025
@hf-kklein hf-kklein enabled auto-merge (squash) April 24, 2025 09:58
@hf-kklein hf-kklein disabled auto-merge April 24, 2025 09:59
@hf-kklein hf-kklein enabled auto-merge (squash) April 24, 2025 10:13
@hf-kklein hf-kklein merged commit 46650c2 into main Apr 24, 2025
18 checks passed
@hf-kklein hf-kklein deleted the ahb-uebtr branch April 24, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support MIG+AHB Elements between <Uebertragsgungsdatei> and <M_FORMAT> (UNA, UNB)
2 participants