- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2
feat: add JSON column w/ Kommunikationsrichtungen to Anwendungsfall table (fix cyclic import problem with Kommunikationseinrichtung model) #181
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
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.
lets test it 👍
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 a JSON column to store parsed communication directions in the Anwendungsfall table to fix a cyclic import issue with the Kommunikationsrichtung model. The main change separates the Kommunikationsrichtung model into its own module and adds structured storage of communication directions alongside the existing string-based column.
- Extracts Kommunikationsrichtung model to separate module to resolve circular import
- Adds JSON column to SQL Anwendungsfall model for structured communication directions storage
- Updates imports across test files and utilities to use the new module location
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description | 
|---|---|
| src/fundamend/models/kommunikationsrichtung.py | New module containing extracted Kommunikationsrichtung model | 
| src/fundamend/models/anwendungshandbuch.py | Removes Kommunikationsrichtung definition and adds computed property | 
| src/fundamend/sqlmodels/anwendungshandbuch.py | Adds JSON column for kommunikationsrichtungen with serialization logic | 
| src/fundamend/utils.py | Updates import to use new Kommunikationsrichtung module | 
| unittests/test_utils.py | Updates imports to use separated modules | 
| unittests/test_sqlmodels_anwendungshandbuch.py | Adds test validation for JSON column serialization/deserialization | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| @property | ||
| def kommunikationsrichtungen(self) -> list[Kommunikationsrichtung] | None: | ||
| """ | ||
| the parsed 'kommunikation_von' attribute or None if it's unparsable (l)or outdated | 
    
      
    
      Copilot
AI
    
    
    
      Oct 15, 2025 
    
  
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.
Remove extra '(l)' character in the docstring.
| the parsed 'kommunikation_von' attribute or None if it's unparsable (l)or outdated | |
| the parsed 'kommunikation_von' attribute or None if it's unparsable or outdated | 
| pruefidentifikator: str = Field(index=True) #: e.g. '25001' | ||
| beschreibung: str = Field(index=True) #: e.g. 'Berechnungsformel' | ||
| kommunikation_von: str #: e.g. 'NB an MSB / LF' | ||
| kommunikationsrichtungen: list[dict[str, str]] | None = Field(default=None, sa_column=Column(JSON)) | 
    
      
    
      Copilot
AI
    
    
    
      Oct 15, 2025 
    
  
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] The type annotation list[dict[str, str]] is too generic. Consider using a more specific type like list[dict[Literal['sender', 'empfaenger'], str]] to better document the expected structure.
fixes #173