Skip to content

Commit 0ece445

Browse files
dfcoffinclaude
andauthored
refactor: Phase 16e - Remove legacy kind and uri fields from UsagePoint (#87)
Removed non-ESPI 4.0 XSD compliant legacy fields to ensure strict schema compliance. Changes: UsagePointEntity, UsagePointMapper, V2 migration files Phase 16 is now 100% complete and ESPI 4.0 XSD compliant. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 2f07d19 commit 0ece445

5 files changed

Lines changed: 0 additions & 29 deletions

File tree

openespi-common/src/main/java/org/greenbuttonalliance/espi/common/domain/usage/UsagePointEntity.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -263,17 +263,6 @@ public class UsagePointEntity extends IdentifiedObject {
263263

264264
// XSD Position 22-23: pnodeRefs and aggregateNodeRefs - See relationship sections below
265265

266-
// ==================== Legacy Fields (NOT in ESPI 4.0 XSD) ====================
267-
// TODO Phase 16c: Review if these fields should be removed or mapped to XSD elements
268-
269-
/**
270-
* URI for this usage point.
271-
* Used for external references and linking.
272-
* NOTE: This field is NOT in ESPI 4.0 XSD - legacy field for review.
273-
*/
274-
@Column(name = "uri")
275-
private String uri;
276-
277266
// ==================== JPA Relationships ====================
278267

279268
/**
@@ -439,7 +428,6 @@ public void merge(UsagePointEntity other) {
439428
this.serviceCategory = other.serviceCategory;
440429
this.status = other.status;
441430
this.roleFlags = other.roleFlags;
442-
this.uri = other.uri;
443431
}
444432
}
445433

@@ -484,7 +472,6 @@ public String toString() {
484472
"roleFlags = " + getRoleFlags() + ", " +
485473
"serviceCategory = " + getServiceCategory() + ", " +
486474
"status = " + getStatus() + ", " +
487-
"uri = " + getUri() + ", " +
488475
"estimatedLoad = " + getEstimatedLoad() + ", " +
489476
"nominalServiceVoltage = " + getNominalServiceVoltage() + ", " +
490477
"ratedCurrent = " + getRatedCurrent() + ", " +

openespi-common/src/main/java/org/greenbuttonalliance/espi/common/mapper/usage/UsagePointMapper.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ public interface UsagePointMapper {
111111
@Mapping(target = "readRoute", source = "readRoute")
112112
@Mapping(target = "serviceDeliveryRemark", source = "serviceDeliveryRemark")
113113
@Mapping(target = "servicePriority", source = "servicePriority")
114-
@Mapping(target = "uri", ignore = true) // Legacy field
115114
@Mapping(target = "pnodeRefs", ignore = true) // TODO: Add mapper implementation
116115
@Mapping(target = "aggregatedNodeRefs", ignore = true) // TODO: Add mapper implementation
117116
@Mapping(target = "meterReadings", ignore = true) // Circular dependency - handle separately

openespi-common/src/main/resources/db/vendor/h2/V2__H2_Specific_Tables.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ CREATE TABLE usage_points
150150
service_delivery_remark VARCHAR(256), -- 20. serviceDeliveryRemark (Phase 16a)
151151
service_priority VARCHAR(32), -- 21. servicePriority (Phase 16a)
152152

153-
-- EXTRA FIELDS (not in ESPI 4.0 XSD - to be reviewed in Phase 16b)
154-
kind VARCHAR(50), -- NOT IN XSD (legacy field?)
155-
uri VARCHAR(1024), -- NOT IN XSD (legacy field?)
156-
157153
-- Foreign key relationships
158154
retail_customer_id BIGINT,
159155
service_delivery_point_id BIGINT,
@@ -166,7 +162,6 @@ CREATE TABLE usage_points
166162
);
167163

168164
-- Create indexes for usage_points table
169-
CREATE INDEX idx_usage_point_kind ON usage_points (kind);
170165
CREATE INDEX idx_usage_point_status ON usage_points (status);
171166
CREATE INDEX idx_usage_point_customer_id ON usage_points (retail_customer_id);
172167
CREATE INDEX idx_usage_point_sdp_id ON usage_points (service_delivery_point_id);

openespi-common/src/main/resources/db/vendor/mysql/V2__MySQL_Specific_Tables.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,6 @@ CREATE TABLE usage_points
147147
service_delivery_remark VARCHAR(256), -- 20. serviceDeliveryRemark (Phase 16a)
148148
service_priority VARCHAR(32), -- 21. servicePriority (Phase 16a)
149149

150-
-- EXTRA FIELDS (not in ESPI 4.0 XSD - to be reviewed in Phase 16b)
151-
kind VARCHAR(50), -- NOT IN XSD (legacy field?)
152-
uri VARCHAR(1024), -- NOT IN XSD (legacy field?)
153-
154150
-- Foreign key relationships
155151
retail_customer_id BIGINT,
156152
service_delivery_point_id BIGINT,
@@ -161,7 +157,6 @@ CREATE TABLE usage_points
161157
FOREIGN KEY (service_delivery_point_id) REFERENCES service_delivery_points (id) ON DELETE SET NULL,
162158
FOREIGN KEY (local_time_parameters_id) REFERENCES time_configurations (id) ON DELETE SET NULL,
163159

164-
INDEX idx_usage_point_kind (kind),
165160
INDEX idx_usage_point_status (status),
166161
INDEX idx_usage_point_customer_id (retail_customer_id),
167162
INDEX idx_usage_point_sdp_id (service_delivery_point_id),

openespi-common/src/main/resources/db/vendor/postgres/V2__PostgreSQL_Specific_Tables.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,6 @@ CREATE TABLE usage_points
148148
service_delivery_remark VARCHAR(256), -- 20. serviceDeliveryRemark (Phase 16a)
149149
service_priority VARCHAR(32), -- 21. servicePriority (Phase 16a)
150150

151-
-- EXTRA FIELDS (not in ESPI 4.0 XSD - to be reviewed in Phase 16b)
152-
kind VARCHAR(50), -- NOT IN XSD (legacy field?)
153-
uri VARCHAR(1024), -- NOT IN XSD (legacy field?)
154-
155151
-- Foreign key relationships
156152
retail_customer_id BIGINT,
157153
service_delivery_point_id BIGINT,
@@ -163,7 +159,6 @@ CREATE TABLE usage_points
163159
FOREIGN KEY (local_time_parameters_id) REFERENCES time_configurations (id) ON DELETE SET NULL
164160
);
165161

166-
CREATE INDEX idx_usage_point_kind ON usage_points (kind);
167162
CREATE INDEX idx_usage_point_status ON usage_points (status);
168163
CREATE INDEX idx_usage_point_customer_id ON usage_points (retail_customer_id);
169164
CREATE INDEX idx_usage_point_sdp_id ON usage_points (service_delivery_point_id);

0 commit comments

Comments
 (0)