Commit a17e725
feat: ESPI 4.0 Schema Compliance - Phase 13: RetailCustomer (#80)
* feat: ESPI 4.0 Schema Compliance - Phase 13: RetailCustomer (#80)
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: Update datacustodian controllers for RetailCustomer Long ID type
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: Update thirdparty RetailCustomerController for Long ID type
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>
* fix: Update thirdparty UUID to Long for RetailCustomer
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>
* fix: Update thirdparty test files for RetailCustomer Long ID type
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>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent f2361a9 commit a17e725
42 files changed
Lines changed: 280 additions & 620 deletions
File tree
- openespi-common/src
- main
- java/org/greenbuttonalliance/espi/common
- domain/usage
- dto/usage
- mapper/usage
- repositories/usage
- service
- impl
- resources/db
- migration
- vendor
- h2
- mysql
- postgres
- test/java/org/greenbuttonalliance/espi/common
- repositories/usage
- test
- openespi-datacustodian/src/main/java/org/greenbuttonalliance/espi/datacustodian/web/custodian
- openespi-thirdparty/src
- main/java/org/greenbuttonalliance/espi/thirdparty
- repository
- impl
- service
- impl
- utils/factories
- web
- custodian
- test/java/org/greenbuttonalliance/espi/thirdparty
- integration/repository
- repository/impl
- service/impl
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 26 additions & 120 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| 44 | + | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
57 | | - | |
58 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
59 | 66 | | |
60 | 67 | | |
61 | 68 | | |
| |||
288 | 295 | | |
289 | 296 | | |
290 | 297 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | 298 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | 299 | | |
387 | 300 | | |
388 | 301 | | |
389 | | - | |
| 302 | + | |
390 | 303 | | |
391 | 304 | | |
392 | | - | |
393 | | - | |
394 | 305 | | |
395 | 306 | | |
396 | 307 | | |
| |||
598 | 509 | | |
599 | 510 | | |
600 | 511 | | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
618 | 524 | | |
619 | 525 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| |||
openespi-common/src/main/java/org/greenbuttonalliance/espi/common/dto/usage/RetailCustomerDto.java
Lines changed: 0 additions & 118 deletions
This file was deleted.
0 commit comments