refactor: Phase 7 - ServiceDeliveryPoint ESPI 4.0 schema compliance #73
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
Phase 7 of Issue #28: Aligns ServiceDeliveryPoint DTO, mapper, and repository with ESPI 4.0 XSD specification.
Key Finding: Per ESPI 4.0 specification (espi.xsd), ServiceDeliveryPoint extends Object (not IdentifiedObject), so it has NO id/uuid/mRID fields or Atom metadata.
Changes Made
DTO Updates (ServiceDeliveryPointDto)
Long idandString uuidfields (Object type has no mRID attribute)@XmlType propOrderto match XSD element sequence: name → tariffProfile → customerAgreement → tariffRiderRefsMapper Updates (ServiceDeliveryPointMapper)
@Mappingfor id and uuid (fields no longer exist in DTO)ignore = true(XML-only field, not persisted in entity)updateEntity()method (read-only operations only)MappingTargetRepository Updates (ServiceDeliveryPointRepository)
findAllIds()findByName,findByTariffProfile,findByCustomerAgreement,findByNameContaining,countByTariffProfiledeleteByIdoverride (JpaRepository provides it)Test Updates (ServiceDeliveryPointRepositoryTest)
findAllIds()test (indexed query retained)Verification
Entity Verification
✅ ServiceDeliveryPointEntity structure already matches XSD correctly:
Long id(BIGINT primary key)Database Verification
✅ Flyway migrations verified in all vendor-specific V2 scripts:
db/vendor/mysql/V2__MySQL_Specific_Tables.sqldb/vendor/postgres/V2__PostgreSQL_Specific_Tables.sqldb/vendor/h2/V2__H2_Specific_Tables.sqlAll scripts create
service_delivery_pointstable with correct structure and indexes.Test Results
✅ All tests pass (ServiceDeliveryPointRepositoryTest: 23 tests)
✅ MySQL TestContainer integration tests pass
✅ H2 integration tests pass
Technical Notes
XSD Compliance
Per
espi.xsdline ~1161:Object base type has NO mRID attribute (unlike IdentifiedObject which has mRID). This is consistent with other Object-based types like IntervalReading and ReadingQuality.
Repository Query Removal Rationale
Removed non-indexed queries following read-only CRUD pattern from Phases 5-6:
findByName,findByTariffProfileetc. were not indexed and not usedfindAllIds()as it provides indexed bulk ID retrievalRelated Issues
Testing Checklist
🤖 Generated with Claude Code