refactor: Phase 10 - LineItem ESPI 4.0 schema compliance#76
Merged
Conversation
Convert LineItem from UUID to Long ID with IDENTITY generation per ESPI 4.0 XSD (espi.xsd:1449). LineItem extends Object, not IdentifiedObject, requiring Long ID with vendor-specific auto-increment syntax. Changes: - LineItemEntity: Change ID from UUID to Long with GenerationType.IDENTITY - Add missing XSD fields: measurement (SummaryMeasurement), itemKind (required), unitCost, itemPeriod (DateTimeInterval) - LineItemRepository: Change from JpaRepository<LineItemEntity, UUID> to Long - Remove 10 non-indexed queries, keep 2 indexed queries - Create LineItemDto record matching XSD structure (no id/uuid fields) - Create LineItemMapper interface with toDto/toEntity mappings - Create SummaryMeasurementMapper for measurement field mapping - LineItemRepositoryTest: Complete rewrite with comprehensive coverage (CRUD, custom queries, relationships, business logic, persistence) - Move usage_summaries + usage_summary_related_links tables from V3 to V2 vendor-specific migrations to maintain dependency order (line_items FK requires usage_summaries to exist first) - Fix UsageSummaryRepositoryTest to include required itemKind field Database migrations: - Add line_items table to V2 vendor-specific files with auto-increment (BIGINT AUTO_INCREMENT for MySQL/H2, BIGSERIAL for PostgreSQL) - Move usage_summaries from V3 to V2 (before line_items) to resolve Flyway migration order issue All 533 tests pass. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Convert LineItem from UUID to Long ID with IDENTITY generation per ESPI 4.0 XSD specification (espi.xsd:1449). LineItem extends Object (not IdentifiedObject), requiring Long ID with vendor-specific auto-increment syntax.
Key Changes:
JpaRepository<LineItemEntity, UUID>toJpaRepository<LineItemEntity, Long>Migration Strategy:
Test plan
Files Changed:
🤖 Generated with Claude Code