Skip to content

Conversation

@hf-kklein
Copy link
Contributor

No description provided.

hf-kklein and others added 3 commits January 7, 2026 13:12
Design for adding SQLModel support for Message Implementation Guides,
mirroring the existing AHB SQLModel implementation patterns.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add SQL model classes for MIGs mirroring the existing AHB SQLModel
implementation patterns:

- MigCode, MigDataElement, MigDataElementGroup, MigSegment,
  MigSegmentGroup, MigSegmentGroupLink, MessageImplementationGuide
- from_model() and to_model() conversion methods
- Position fields for stable list ordering
- Self-referential SegmentGroup relationship via link table
- SQL-only fields: gueltig_von, gueltig_bis, edifact_format_version

Includes roundtrip tests verifying XML -> Pydantic -> SQL -> Pydantic
equality for all example MIG files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Update SQL Models section to include MIG support with code example.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@hf-kklein hf-kklein changed the title Feat/mig sqlmodels feat: Add SQL persistence for MIGs too (similar to AHBs) Jan 7, 2026
Apply black/isort formatting and fix line-too-long pylint error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Pylint 4.0.4 incorrectly reports that Relationship fields (which are
lists at runtime) don't have an 'append' member. This is a false
positive specific to SQLModel's typing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@hf-kklein hf-kklein requested a review from Copilot January 7, 2026 12:31
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@hf-kklein hf-kklein marked this pull request as ready for review January 7, 2026 12:42
Copy link
Contributor

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 pull request adds SQL persistence support for Message Implementation Guides (MIGs), mirroring the existing implementation for Anwendungshandbücher (AHBs). The implementation enables storing and retrieving MIG data from SQL databases using SQLModel.

Key Changes:

  • New SQLModel classes for all MIG components with proper relationships and constraints
  • Comprehensive test suite with roundtrip validation for data integrity
  • Updated module exports and documentation

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/fundamend/sqlmodels/messageimplementationguide.py Complete SQLModel implementation for MIG persistence, including 7 model classes with bidirectional conversion methods
unittests/test_sqlmodels_messageimplementationguide.py Test suite covering single MIGs, MIGs with Uebertragungsdatei, example files, and submodule integration
src/fundamend/sqlmodels/__init__.py Added exports for MIG-related SQLModel classes
README.md Added documentation and code examples for MIG SQLModel usage
src/fundamend/sqlmodels/anwendungshandbuch.py Added no-member to pylint disable list for consistency
docs/plans/2026-01-07-mig-sqlmodels-design.md Design documentation detailing the implementation approach
.gitignore Added .claude/ directory to ignore list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hf-kklein hf-kklein merged commit 762eb71 into main Jan 7, 2026
21 checks passed
@hf-kklein hf-kklein deleted the feat/mig-sqlmodels branch January 7, 2026 14:25
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.

2 participants