Skip to content

feat: ESPI 4.0 Schema Compliance - Phase 0.6: Customer Domain Enums#110

Merged
dfcoffin merged 1 commit intomainfrom
feature/issue-101-phase-0.6-customer-enums
Feb 13, 2026
Merged

feat: ESPI 4.0 Schema Compliance - Phase 0.6: Customer Domain Enums#110
dfcoffin merged 1 commit intomainfrom
feature/issue-101-phase-0.6-customer-enums

Conversation

@dfcoffin
Copy link
Contributor

Summary

Implements customer domain enumerations from customer.xsd with proper JAXB/Jakarta XML binding annotations and comprehensive XSD documentation.

Customer Domain Enums (10 enums, 77 total values):

  • CustomerKind (15 values) - Customer classifications: residential, commercialIndustrial, residentialAndCommercial, etc.
  • SupplierKind (6 values) - Supplier types: utility, retailer, lse, mdma, msp, other
  • ServiceKind (11 values) - Service types: electricity, gas, water, heat, refuse, sewerage, rates, tvLicence, internet, time, other
  • EnrollmentStatus (3 values) - Demand Response program enrollment: unenrolled, enrolled, enrolledPending
  • NotificationMethodKind (5 values) - Customer notification methods: call, email, letter, ivr, other
  • MeterMultiplierKind (6 values) - Meter multiplier types: kH, transformerRatio, kR, kE, ctRatio, ptRatio
  • RevenueKind (7 values) - Revenue accounting classifications: residential, nonResidential, commercial, industrial, irrigation, streetLight, other
  • ProgramDateKind (4 values) - DR program date types: enrollment, de-enrollment, termination dates
  • CRUDOperation (4 values) - CRUD operations: 0=CREATE, 1=READ, 2=UPDATE, 3=DELETE
  • MediaType (16 values) - IANA media types: application/json, application/pdf, text/csv, image/jpeg, etc.

Implementation Details

All enums include:

  • Apache License 2.0 header (copyright 2025 Green Button Alliance, Inc.)
  • Package: org.greenbuttonalliance.espi.common.domain.customer.enums
  • JAXB/Jakarta XML binding annotations (@XmlType with namespace="http://naesb.org/espi/customer")
  • getValue() and fromValue() methods with IllegalArgumentException for invalid values
  • Comprehensive Javadoc from XSD documentation with line numbers
  • Type-safe enum constants (String for most, int for CRUDOperation)

Test Updates

Updated test files to use XSD-compliant enum values:

  • CustomerKind: COMMERCIALCOMMERCIAL_INDUSTRIAL
  • SupplierKind: Uppercase values → lowercase (utility, retailer, etc.)
  • CustomerKind: Uppercase values → lowercase (residential, enterprise, etc.)

Testing

  • All tests: 781/781 passed ✓
    • Unit tests: 638/638 passed ✓
    • Integration tests: 143/143 passed ✓ (with Docker/TestContainers)
  • No breaking changes
  • Clean compilation verified

Schema Compliance

Per ESPI 4.0 specification (NAESB REQ.21) customer.xsd:

  • CustomerKind: lines 1687-1772
  • SupplierKind: lines 2231-2271
  • ServiceKind: lines 2074-2135
  • EnrollmentStatus: lines 1808-1833
  • NotificationMethodKind: lines 1961-1996
  • MeterMultiplierKind: lines 1920-1960
  • RevenueKind: lines 2028-2073
  • ProgramDateKind: lines 1997-2027
  • CRUDOperation: lines 1557-1591
  • MediaType: lines 1834-1919

Related to #101

🤖 Generated with Claude Code

Implements customer domain enumerations from customer.xsd with proper
JAXB/Jakarta XML binding annotations and comprehensive XSD documentation.

Customer Domain Enums:
- CustomerKind (15 values) - Customer classifications (residential, commercialIndustrial, etc.)
- SupplierKind (6 values) - Supplier types (utility, retailer, lse, mdma, msp, other)
- ServiceKind (11 values) - Service types (electricity, gas, water, heat, etc.)
- EnrollmentStatus (3 values) - DR program enrollment status (unenrolled, enrolled, enrolledPending)
- NotificationMethodKind (5 values) - Notification methods (call, email, letter, ivr, other)
- MeterMultiplierKind (6 values) - Meter multiplier types (kH, transformerRatio, kR, kE, ctRatio, ptRatio)
- RevenueKind (7 values) - Revenue classifications (residential, commercial, industrial, etc.)
- ProgramDateKind (4 values) - DR program date types
- CRUDOperation (4 values) - CRUD operations (0=CREATE, 1=READ, 2=UPDATE, 3=DELETE)
- MediaType (16 values) - IANA media types (application/json, application/pdf, text/csv, etc.)

All enums include:
- Apache License 2.0 header (copyright 2025 Green Button Alliance, Inc.)
- Package: org.greenbuttonalliance.espi.common.domain.customer.enums
- JAXB/Jakarta XML binding annotations (@XmlType with namespace="http://naesb.org/espi/customer")
- getValue() and fromValue() methods with IllegalArgumentException for invalid values
- Comprehensive Javadoc from XSD documentation with line numbers
- Type-safe enum constants (String or int based on XSD type)

Test Updates:
- Updated CustomerKind test values: COMMERCIAL → COMMERCIAL_INDUSTRIAL per XSD
- Updated SupplierKind test values: uppercase → lowercase per XSD
- Updated CustomerKind test values: uppercase → lowercase per XSD

Total enum values in batch: 77
Per ESPI 4.0 specification (NAESB REQ.21)

All tests: 781/781 passed ✓
- Unit tests: 638/638 passed
- Integration tests: 143/143 passed (with Docker/TestContainers)

Related to #101

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@dfcoffin dfcoffin merged commit a96b059 into main Feb 13, 2026
5 checks passed
@dfcoffin dfcoffin deleted the feature/issue-101-phase-0.6-customer-enums branch February 13, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant