-
Notifications
You must be signed in to change notification settings - Fork 1
feat: ESPI 4.0 Schema Compliance - Phase 13: RetailCustomer #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dfcoffin
merged 5 commits into
main
from
feature/schema-compliance-phase-13-retail-customer
Jan 14, 2026
Merged
feat: ESPI 4.0 Schema Compliance - Phase 13: RetailCustomer #80
dfcoffin
merged 5 commits into
main
from
feature/schema-compliance-phase-13-retail-customer
Jan 14, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Convert RetailCustomerEntity from IdentifiedObject to Object pattern since it is an application-specific correlation table, not part of ESPI standard. ## Changes - **Entity**: Changed RetailCustomerEntity from IdentifiedObject to Object - Removed IdentifiedObject inheritance (UUID ID, created, updated, published, links) - Changed ID from UUID to Long with auto-generated sequence - Removed description field (not needed for application table) - Removed merge(), updatePasswordDuringMerge(), getSelfHref(), getUpHref() methods - Updated toString() to remove IdentifiedObject fields - **DTO/Mapper**: Deleted RetailCustomerDto and RetailCustomerMapper - Not needed since RetailCustomer is not an ESPI resource (no XML marshalling) - **Repository**: Updated RetailCustomerRepository - Changed JpaRepository<RetailCustomerEntity, UUID> to JpaRepository<RetailCustomerEntity, Long> - Removed redundant @query annotations (let Spring Data generate queries) - Changed findLockedAccounts() to findByAccountLockedTrue() - Kept @query only for findAllIds() (performance optimization) - Changed return types from UUID to Long - **Service**: Simplified RetailCustomerService - Removed methods: findByHashedId, add, delete, importResource, associateByUUID - Changed findById parameter from UUID to Long - Kept only essential methods: findAll, findById, save, findByUsername - Removed dependencies on RetailCustomerMapper - **Database Migrations**: - Moved retail_customers table from V1 to vendor-specific V2 files (auto-increment syntax) - Added retail_customers with BIGINT AUTO_INCREMENT (H2/MySQL) and BIGSERIAL (PostgreSQL) - Kept only username index (authentication hot path) - Changed retail_customer_id columns from CHAR(36) to BIGINT in: - authorizations table (V1) - subscriptions table (V1) - usage_points table (V2) - Added FK constraints in V2 after retail_customers is created: - ALTER TABLE authorizations ADD CONSTRAINT fk_authorization_retail_customer - ALTER TABLE subscriptions ADD CONSTRAINT fk_subscription_retail_customer - ALTER TABLE usage_points ADD CONSTRAINT fk_usage_point_retail_customer - **Related Entity Updates**: - AuthorizationRepository: Changed findAllByRetailCustomerId(UUID) to (Long) - AuthorizationService: Updated all methods accepting retailCustomerId to use Long - UsagePointEntity: Changed getUpHref() to use retailCustomer.getId() instead of getHashedId() - UsagePointRepository: Changed findAllByRetailCustomerId(UUID) to (Long) - UsagePointService: Updated all methods accepting retailCustomerId to use Long - SubscriptionService: Changed findRetailCustomerId() return type from UUID to Long - SubscriptionRepository: Changed findByRetailCustomerId(UUID) to (Long) - ElectricPowerQualitySummaryRepository: Changed xpath methods to accept Long for o1Id - UsageSummaryRepository: Changed xpath methods to accept Long for o1Id - **Tests**: Updated all tests to use Long instead of UUID for retail_customer_id - RetailCustomerRepositoryTest: Updated for Long ID, removed IdentifiedObject tests - TestDataBuilders: Removed setDescription() for RetailCustomer - AuthorizationRepositoryTest: Changed UUID.randomUUID() to 999999L - UsagePointRepositoryTest: Changed UUID.randomUUID() to 999999L - SubscriptionRepositoryTest: Changed UUID.randomUUID() to 999999L - ElectricPowerQualitySummaryRepositoryTest: Updated for Long retailCustomerId - UsageSummaryRepositoryTest: Updated for Long retailCustomerId ## Test Results All 532 tests pass successfully including integration tests with H2, MySQL, and PostgreSQL. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fix compilation errors in openespi-datacustodian module after Phase 13 RetailCustomer entity conversion from UUID to Long ID: - RetailCustomerController.java: * Change @PathVariable from UUID to Long in show() method * Remove unused UUID import - AssociateUsagePointController.java: * Change @PathVariable from UUID to Long in form() and create() methods * Comment out associateByUUID() call (method removed in Phase 13) * Update commented code to use associateById() with Long type * Keep UUID import (still used by validator) Resolves CI/CD build failures in PR #80. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fix compilation error in openespi-thirdparty module after Phase 13 RetailCustomer entity conversion from UUID to Long ID. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Complete RetailCustomer ID type conversion from UUID to Long across thirdparty module repositories, services, controllers, and test factories. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Update test files to use Long instead of UUID for retailCustomerId: - UsagePointRESTRepositoryIntegrationTest.java: * Line 85: Change mock from any(UUID.class) to any(Long.class) * Line 121: Change UUID.randomUUID() to 1000001L * Line 133: Change UUID.randomUUID() to 1000004L - MeterReadingRESTRepositoryImplTests.java: * Line 46: Change UUID retailCustomerId to Long (1000002L) - MeterReadingServiceImplTests.java: * Line 50: Change UUID retailCustomerId to Long (1000003L) All thirdparty tests pass: 47 tests run, 0 failures, 0 errors. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Convert RetailCustomerEntity from IdentifiedObject to Object pattern since it is an application-specific correlation table, not part of ESPI standard.
Changes Made
Entity: Changed RetailCustomerEntity from IdentifiedObject to Object
DTO/Mapper: Deleted RetailCustomerDto and RetailCustomerMapper
Repository: Updated RetailCustomerRepository
JpaRepository<RetailCustomerEntity, UUID>toJpaRepository<RetailCustomerEntity, Long>Service: Simplified RetailCustomerService
Database Migrations:
Related Updates: Updated 10+ repositories and services that reference RetailCustomer
Test Results
✅ All 532 tests pass including integration tests with H2, MySQL, and PostgreSQL
Database Migration Impact
Related Issue
Part of #28 (ESPI 4.0 Schema Compliance - Phase 13: RetailCustomer)
🤖 Generated with Claude Code