Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit bc332e2

Browse files
dfcoffinclaude
andcommitted
Fix ESPI compliance: Remove ObjectEntity and make all customer entities ESPI compliant
ARCHITECTURE FIX: - Remove ObjectEntity class (violated ESPI standards) - Migrate AccountNotificationEntity and StatementRefEntity to extend IdentifiedObjectEntity - Ensure ALL customer entities are ESPI compliant with proper UUID identifiers BENEFITS: - Consistent architecture across usage and customer domains - ESPI compliant UUID5 identifiers for all entities - ATOM feed compatibility for customer resources - Proper href generation and link management - Timestamp management and audit trails COMPLIANCE: - All entities now follow NAESB ESPI 1.0 specification - Removes architectural inconsistency between domains - Enables proper Green Button interoperability for customer data 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent e6623a5 commit bc332e2

File tree

3 files changed

+12
-58
lines changed

3 files changed

+12
-58
lines changed

src/main/java/org/greenbuttonalliance/espi/common/domain/customer/entity/AccountNotificationEntity.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import lombok.NoArgsConstructor;
2626
import lombok.ToString;
2727
import org.greenbuttonalliance.espi.common.domain.customer.enums.NotificationMethodKind;
28+
import org.greenbuttonalliance.espi.common.domain.usage.IdentifiedObjectEntity;
2829

2930
import jakarta.persistence.*;
3031
import java.time.OffsetDateTime;
@@ -33,14 +34,17 @@
3334
* Pure JPA/Hibernate entity for AccountNotification without JAXB concerns.
3435
*
3536
* [extension] Customer action notification (e.g., delinquency, move in, move out)
37+
* ESPI compliant with proper UUID identifiers and ATOM feed support.
3638
*/
3739
@Entity
38-
@Table(name = "account_notifications")
40+
@Table(name = "account_notifications", uniqueConstraints = {
41+
@UniqueConstraint(columnNames = {"uuid"})
42+
})
3943
@Data
4044
@EqualsAndHashCode(callSuper = true)
4145
@NoArgsConstructor
4246
@ToString(callSuper = true)
43-
public class AccountNotificationEntity extends ObjectEntity {
47+
public class AccountNotificationEntity extends IdentifiedObjectEntity {
4448

4549
/**
4650
* Method by which the customer was notified.

src/main/java/org/greenbuttonalliance/espi/common/domain/customer/entity/ObjectEntity.java

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/main/java/org/greenbuttonalliance/espi/common/domain/customer/entity/StatementRefEntity.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,25 @@
2424
import lombok.EqualsAndHashCode;
2525
import lombok.NoArgsConstructor;
2626
import lombok.ToString;
27+
import org.greenbuttonalliance.espi.common.domain.usage.IdentifiedObjectEntity;
2728

2829
import jakarta.persistence.*;
2930

3031
/**
3132
* Pure JPA/Hibernate entity for StatementRef without JAXB concerns.
3233
*
3334
* [extension] A sequence of references to a document associated with a Statement.
35+
* ESPI compliant with proper UUID identifiers and ATOM feed support.
3436
*/
3537
@Entity
36-
@Table(name = "statement_refs")
38+
@Table(name = "statement_refs", uniqueConstraints = {
39+
@UniqueConstraint(columnNames = {"uuid"})
40+
})
3741
@Data
3842
@EqualsAndHashCode(callSuper = true)
3943
@NoArgsConstructor
4044
@ToString(callSuper = true)
41-
public class StatementRefEntity extends ObjectEntity {
45+
public class StatementRefEntity extends IdentifiedObjectEntity {
4246

4347
/**
4448
* [extension] Name of document or file including filename extension if present.

0 commit comments

Comments
 (0)