-
✅ ServiceLocationEntity.java
- Added
status.remark@AttributeOverride (4th field) - Added
usagePointHrefsList with @ElementCollection - Replaced
phoneNumberscollection with embeddedphone1andphone2 - Used repeatable @AttributeOverride (JDK 25 feature)
- All 16 phone fields mapped (8 per phone × 2 phones)
- Added
-
✅ Organisation.TelephoneNumber @Embeddable Created
- 8 fields per customer.xsd lines 1428-1478
- countryCode, areaCode, cityCode, localNumber, ext, dialOut, internationalPrefix, ituPhone
- Lombok @Getter/@Setter with manual equals/hashCode/toString
-
✅ CustomerDto.TelephoneNumberDto Created
- 8 fields with full JAXB annotations
- @XmlType with propOrder
- Implements Serializable
- Renamed from PhoneNumberDto → TelephoneNumberDto
- ✅ ServiceLocationDto.java - Partial
- ✅ Removed 5 Atom fields (published, updated, selfLink, upLink, relatedLinks)
- ✅ Removed description field (Atom title)
- ✅ Removed customerAgreement relationship field
- ✅ Removed helper methods (getSelfHref, generateSelfHref, etc.)
- ✅ Updated imports (removed LinkDto, OffsetDateTime)
- ❌ Missing Location fields (type, mainAddress, secondaryAddress, phone1, phone2, electronicAddress, status)
- ❌ Missing usagePointHrefs collection field
- ❌ Missing outageBlock field
- ❌ PropOrder not updated
Fields to Add:
// Location fields (from IdentifiedObject + Location)
@XmlElement(name = "type", namespace = "http://naesb.org/espi/customer")
private String type;
@XmlElement(name = "mainAddress", namespace = "http://naesb.org/espi/customer")
private CustomerDto.StreetAddressDto mainAddress;
@XmlElement(name = "secondaryAddress", namespace = "http://naesb.org/espi/customer")
private CustomerDto.StreetAddressDto secondaryAddress;
@XmlElement(name = "phone1", namespace = "http://naesb.org/espi/customer")
private CustomerDto.TelephoneNumberDto phone1;
@XmlElement(name = "phone2", namespace = "http://naesb.org/espi/customer")
private CustomerDto.TelephoneNumberDto phone2;
@XmlElement(name = "electronicAddress", namespace = "http://naesb.org/espi/customer")
private CustomerDto.ElectronicAddressDto electronicAddress;
@XmlElement(name = "status", namespace = "http://naesb.org/espi/customer")
private StatusDto status;
// StatusDto nested class (4 fields)
public static class StatusDto implements Serializable {
// value, dateTime, remark, reason
}Fields to Add:
@XmlElement(name = "UsagePoints", namespace = "http://naesb.org/espi/customer")
@XmlElementWrapper(name = "UsagePoints", namespace = "http://naesb.org/espi/customer")
private List<String> usagePointHrefs;
@XmlElement(name = "outageBlock", namespace = "http://naesb.org/espi/customer")
private String outageBlock;XSD Field Sequence:
@XmlType(name = "ServiceLocation", namespace = "http://naesb.org/espi/customer", propOrder = {
// Location fields
"type", "mainAddress", "secondaryAddress", "phone1", "phone2",
"electronicAddress", "geoInfoReference", "direction", "status",
// ServiceLocation fields
"accessMethod", "siteAccessProblem", "needsInspection", "usagePointHrefs", "outageBlock"
})Mapper Interface:
- Bidirectional Entity ↔ DTO mappings
- phone1/phone2 embedded mapping
- usagePointHrefs collection mapping
- All Location field mappings
Remove non-index queries:
- findLocationsThatNeedInspection
- findLocationsWithAccessProblems
- findByMainAddressStreetContaining
- findByDirectionContaining
- findByPhone1AreaCode
Keep only:
- JpaRepository inherited methods
- Index-based queries if needed for tests
Add to service_locations table:
-- Status remark
status_remark VARCHAR(256),
-- Phone1 fields (8)
phone1_country_code VARCHAR(256),
phone1_area_code VARCHAR(256),
phone1_city_code VARCHAR(256),
phone1_local_number VARCHAR(256),
phone1_ext VARCHAR(256),
phone1_dial_out VARCHAR(256),
phone1_international_prefix VARCHAR(256),
phone1_itu_phone VARCHAR(256),
-- Phone2 fields (8)
phone2_country_code VARCHAR(256),
phone2_area_code VARCHAR(256),
phone2_city_code VARCHAR(256),
phone2_local_number VARCHAR(256),
phone2_ext VARCHAR(256),
phone2_dial_out VARCHAR(256),
phone2_international_prefix VARCHAR(256),
phone2_itu_phone VARCHAR(256)Create new table:
CREATE TABLE service_location_usage_point_hrefs (
service_location_id CHAR(36) NOT NULL,
usage_point_href VARCHAR(512),
FOREIGN KEY (service_location_id) REFERENCES service_locations(id)
);Drop old table:
-- Remove phone_numbers table (replaced by embedded fields)
DROP TABLE IF EXISTS phone_numbers;Entities needing phone1/phone2 embedded:
- CustomerEntity
- CustomerAccountEntity
- ServiceSupplierEntity
- MeterEntity (extends EndDeviceEntity)
For each entity:
- Replace phoneNumbers collection with phone1/phone2 embedded
- Add 16 @AttributeOverride annotations (8 per phone)
- Update toString() method
- Create ServiceLocationDtoTest (5+ tests)
- Update ServiceLocationRepositoryTest
- Run all tests (fix failures)
- Run integration tests
- Commit and push
- Create PR
- Update Issue #28
Decision: Use @Embeddable Rationale:
- Performance: 1 query instead of 2, no JOIN required
- XSD alignment: phone1/phone2 are elements, not collection
- Fixed number: Always 0-2 phones, not unbounded
Decision: Use List with @ElementCollection Rationale:
- customer.xsd defines UsagePoints with maxOccurs="unbounded"
- Multiple usage points can serve one service location
- Each string stores atom:link[@rel='self']/@href URL
Decision: Use repeatable @AttributeOverride directly Rationale:
- JDK 25 supports repeatable annotations
- Cleaner, more readable code
- No wrapper needed
Decision: Defer full StreetAddress/StreetDetail/TownDetail compliance Rationale:
- Affects 5+ entities (large scope)
- Phase 23 already expanded significantly
- Can be separate future phase
- Current simplified structure functional
Current Token Usage: ~130K / 200K Remaining Work: ~70K tokens needed Recommendation: Complete T10-T12 (DTO refactoring), then checkpoint for continuation
- Add Location fields to ServiceLocationDto (T10)
- Add ServiceLocation fields (usagePointHrefs, outageBlock) to DTO (T11)
- Update propOrder (T12)
- Create ServiceLocationMapper (T13)
Estimated Tokens:
- T10-T12: ~15K tokens
- T13: ~10K tokens
- T14-T15: ~10K tokens
- Tests: ~20K tokens
- Total: ~55K tokens remaining (fits in current session)
- ServiceLocationEntity.java ✅
- Organisation.java (added TelephoneNumber) ✅
- CustomerDto.java (added TelephoneNumberDto) ✅
- ServiceLocationDto.java (partial)
⚠️
- ServiceLocationDto.java (complete Location fields)
- ServiceLocationMapper.java (create new)
- ServiceLocationRepository.java (clean up)
- V3__Create_additiional_Base_Tables.sql (add columns, tables)
- CustomerEntity.java (phone1/phone2)
- CustomerAccountEntity.java (phone1/phone2)
- ServiceSupplierEntity.java (phone1/phone2)
- MeterEntity.java (phone1/phone2)
- ServiceLocationDtoTest.java (create new)
- ServiceLocationRepositoryTest.java (update)
Total Files: 14 files to modify/create Files Complete: 3/14 (21%) Files Remaining: 11/14 (79%)