Conversation
…mentation Complete implementation of Statement and StatementRef entities per customer.xsd specification (lines 285-307, 373-393) following Phase 17/18 patterns. Schema Compliance Changes: - StatementRefEntity: Changed from @entity to @embeddable (extends Object, not IdentifiedObject) - Removed UUID primary key, now stored as @ElementCollection in StatementEntity - statement_refs table: Removed id column, now collection table with statement_id FK only - StatementDto: Removed ALL IdentifiedObject fields, keeps ONLY issueDateTime + statementRef per XSD - StatementRefDto: Fixed to match XSD (fileName, mediaType, statementURL only) Entity Enhancements: - Added @manytoone relationships for Controller API navigation: * customer_id → CustomerEntity * customer_account_id → CustomerAccountEntity * customer_agreement_id → CustomerAgreementEntity * usage_summary_id → UsageSummaryEntity - Updated toString() to follow database field sequence per CLAUDE.md guidelines - @AssociationOverride for statement_related_links (bidirectional Atom protocol links) Database Migration (V3): - statements table: Added customer_account_id, customer_agreement_id, usage_summary_id FKs - Removed non-schema fields: statement_date, billing_period_start, billing_period_duration - statement_refs table: Restructured as @ElementCollection table (no id column) - Added indexes for all relationship foreign keys Mapper Implementation: - StatementMapper: Maps ONLY customer.xsd fields (issueDateTime, statementRef) - StatementRefMapper: Direct 1:1 field mapping (3 fields) - Uses qualifiedByName for DateTimeMapper epoch conversions - Follows DRY principle - Atom metadata handled by AtomEntryDto/LinkDto Repository & Service Simplification: - Removed 7 non-ID query methods from StatementRepository - Added 4 ID-based relationship queries (Customer, CustomerAccount, CustomerAgreement, UsageSummary) - Removed 10 methods from StatementService (date/description/count queries) - Kept only CRUD + ID-based operations per ESPI compliance patterns Resolves #28 Phase 19 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Test Coverage: - StatementRepositoryTest: 7 tests for CRUD + ID-based relationship queries - StatementPostgreSQLIntegrationTest: 4 tests with real PostgreSQL TestContainer - StatementMySQLIntegrationTest: 4 tests with real MySQL TestContainer Key Test Scenarios: - @ElementCollection StatementRef persistence (no id column) - All 4 relationship queries (Customer, CustomerAccount, CustomerAgreement, UsageSummary) - Cascading delete of @ElementCollection - CRUD operations with real databases Results: 781 total tests passing (added 15 new tests) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…lity Issue: CI/CD failing due to timestamp precision mismatch between platforms - Windows: microseconds (6 decimals) - Linux/Mac: nanoseconds (9 decimals) Solution: Truncate all test timestamps to MICROS using .truncatedTo(ChronoUnit.MICROS) Changes: - StatementRepositoryTest: 3 occurrences fixed - StatementMySQLIntegrationTest: 3 occurrences fixed - StatementPostgreSQLIntegrationTest: 3 occurrences fixed Results: All 781 tests passing locally Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This was referenced Feb 3, 2026
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
Complete implementation of Statement and StatementRef entities per customer.xsd specification (lines 285-307, 373-393) following Phase 17/18 established patterns.
Schema Compliance Changes
StatementRef (@embeddable)
@Entityto@Embeddable(extends Object, not IdentifiedObject per XSD)@ElementCollectionin StatementEntitystatement_refscollection table withstatement_idFK only (no id column)StatementDto
issueDateTime,statementRefcollectionAtomEntryDto/LinkDtowrappersStatementRefDto
fileName,mediaType,statementURL(3 fields only)Entity Enhancements
Relationship Support (Controller API Navigation)
Added
@ManyToOnerelationships with foreign keys:customer_id→CustomerEntitycustomer_account_id→CustomerAccountEntitycustomer_agreement_id→CustomerAgreementEntityusage_summary_id→UsageSummaryEntityOther Improvements
toString()to follow database field sequence per CLAUDE.md@AssociationOverrideforstatement_related_links(bidirectional Atom protocol)Database Migration (V3)
statements Table
customer_account_id,customer_agreement_id,usage_summary_idstatement_date,billing_period_start,billing_period_durationstatement_refs Table
@ElementCollectiontable (noidcolumn)statement_id(FK),file_name,media_type,statement_urlidx_statement_ref_statement_idMapper Implementation
StatementMapper
issueDateTime,statementRefcollectionqualifiedByName = "offsetToLong"/"longToOffset"for DateTimeMapper conversionsStatementRefMapper
Repository & Service Simplification
StatementRepository
findByCustomerId(UUID)findByCustomerAccountId(UUID)findByCustomerAgreementId(UUID)findByUsageSummaryId(UUID)StatementService
Test Coverage
Unit Tests (7 tests)
StatementRepositoryTest: CRUD + all ID-based relationship queries@ElementCollectionStatementRef persistenceIntegration Tests (8 tests)
StatementPostgreSQLIntegrationTest: 4 tests with real PostgreSQL TestContainerStatementMySQLIntegrationTest: 4 tests with real MySQL TestContainerResults
Resolves
Resolves #28 Phase 19
🤖 Generated with Claude Code