feat: ESPI 4.0 Schema Compliance - Phase 21: ServiceSupplier Complete Implementation #96
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
This PR implements full ESPI 4.0 schema compliance for ServiceSupplier and refactors all Organisation phone number handling from the legacy PhoneNumberEntity table to embedded TelephoneNumber fields.
Key Changes
New DTOs (JAXB/XML)
ServiceSupplierDto- 4 fields (organisation, kind, issuerIdentificationNumber, effectiveDate)OrganisationDto- 6 fields with phone1/phone2 embeddedTelephoneNumberDto- 8 fields per XSD specificationNew Mappers
ServiceSupplierMapper- Entity ↔ DTO conversionOrganisationMapper- Organisation entity ↔ DTO conversionTelephoneNumberMapper- TelephoneNumber entity ↔ DTO conversionEntity Updates
SupplierKindenum to match XSD (6 values in correct sequence: UTILITY, RETAILER, OTHER, LSE, MDMA, MSP)Organisationto use embeddedphone1andphone2(TelephoneNumber)ServiceSupplierEntitywith 16 phone @AttributeOverride annotationsCustomerEntitywith 16 phone @AttributeOverride annotationsTelephoneNumbercolumn sizes to prevent MySQL row size limitCustomerMapperto remove PhoneNumberEntity logicServiceLocationMapperto use TelephoneNumberMapperCleanup
OrganisationRole(unused wrapper)PhoneNumberEntity(replaced with embedded TelephoneNumber)PhoneNumberService(no longer needed)BaseMapperUtilsinheritance from CustomerMapper and ServiceSupplierMapper (resolved bean conflicts)usagePointIdfield from ElectricPowerQualitySummaryDtoDatabase Migration
service_supplierstable (16 phone columns)customerstable (16 phone columns)service_locationstable (phone columns with optimized sizes)customer_accountstable (16 phone columns)phone_numberstable (no longer needed)Tests
ServiceSupplierDtoTest- 8 tests for XML marshalling and field validationOrganisationDtoTest- 8 tests for Organisation DTO functionalityTelephoneNumberDtoTest- 8 tests for TelephoneNumber DTO functionalityTest Results
Integration Tests:
Breaking Changes
phone_numberstable removedservice_suppliers,customers,service_locations,customer_accountstablesPhoneNumberEntity,OrganisationRole,PhoneNumberServicedeletedSupplierKindenum values changed to match XSD specificationRelated Issues
Closes portion of #28 (Phase 21: ServiceSupplier)
Note: Issue #28 should remain open - additional phases (Phase 22+) are pending.
Verification Steps
mvn clean testmvn verify -Pintegration-testsFiles Changed
🤖 Generated with Claude Code