Commit 18a8e8b
feat: ESPI 4.0 Schema Compliance - Phase 17: ProgramDateIdMappings Complete Implementation (#100)
* feat: Phase 17 (Part 1) - ProgramDateIdMapping Core Structure
Implements Phases A, B, and G of Issue #28 Phase 17: ProgramDateIdMappings
ESPI 4.0 schema compliance. Establishes the foundational enum, embeddable,
entity, and database structure per customer.xsd specification.
Phase A: Enum and Embeddable Creation
- Created ProgramDateKind enum with 4 XSD-defined values (lines 1997-2030)
* CUST_DR_PROGRAM_ENROLLMENT_DATE
* CUST_DR_PROGRAM_DE_ENROLLMENT_DATE
* CUST_DR_PROGRAM_TERM_DATE_REGARDLESS_FINANCIAL
* CUST_DR_PROGRAM_TERM_DATE_WITHOUT_FINANCIAL
- Created ProgramDateIdMapping @embeddable (customer.xsd lines 1223-1251)
* 4 fields: programDateType, code, name, note
* Extends Object (not IdentifiedObject) per XSD
Phase B: Entity Updates
- Updated ProgramDateIdMappingsEntity (customer.xsd lines 269-283)
* Added @Embedded programDateIdMapping field
* Implemented equals(), hashCode(), toString() methods
* Follows Hibernate proxy-safe pattern
* relatedLinks infrastructure already present from Issue #97
Phase G: Database Migration
- Updated V3 migration: program_date_id_mappings table
* Removed non-XSD fields: program_date, program_id
* Added XSD-compliant embedded fields: program_date_type, code, name, note
* Removed non-ID indexes per CLAUDE.md guidelines
* program_date_id_mapping_related_links table already exists from Issue #97
Technical Details:
- Follows customer.xsd structure exactly
- ProgramDateIdMappingsEntity has ONE field beyond IdentifiedObject
- ProgramDateIdMapping is embedded (not separate entity)
- Database columns match JPA @column definitions
- All 760 existing tests passing - no regressions
Remaining Work (Phases C-I):
- Phase C: DTO implementation
- Phase D: Mapper implementation
- Phase E: Repository implementation
- Phase F: Service implementation
- Phase H: DtoExportService integration
- Phase I: Comprehensive testing (48 new tests)
Related: Issue #28 (Phase 17: ProgramDateIdMappings)
Note: DO NOT close Issue #28 - more phases (18+) remain after Phase 17
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* feat: ESPI 4.0 Schema Compliance - Phase 17: ProgramDateIdMappings C-I Implementation
Complete DTO, Mapper, Repository, Service, and Testing implementation for
ProgramDateIdMappings customer domain entity per NAESB ESPI 4.0 customer.xsd
specification (lines 269-283, 1223-1251, 1997-2030).
Phase C: DTO Implementation
- Created ProgramDateIdMappingDto for embedded complex type (4 fields)
- Updated ProgramDateIdMappingsDto to follow AtomEntryDto pattern
- Removed IdentifiedObject fields from resource DTO (handled by wrapper)
Phase D: Mapper Implementation
- Created ProgramDateIdMappingMapper for embedded object mapping
- Created ProgramDateIdMappingsMapper for resource mapping
- No explicit ignore mappings (follows DRY principle)
Phase E: Repository Implementation
- Created ProgramDateIdMappingsRepository extending JpaRepository
- ID-based queries only per ESPI standard
Phase F: Service Implementation
- Created ProgramDateIdMappingsService interface
- Created ProgramDateIdMappingsServiceImpl
- No UUID generation in service (expects ID set before save)
Phase H: DtoExportService Integration
- ProgramDateIdMappingsDto already registered in JAXB context
- Generic marshalling methods support all customer domain resources
Phase I: Comprehensive Testing (787 tests passing, +16 new)
- ProgramDateIdMappingsRepositoryTest (11 H2 unit tests)
* CRUD operations (5 tests)
* Embedded object persistence (4 tests)
* IdentifiedObject fields (2 tests)
- ProgramDateIdMappingsMySQLIntegrationTest (TestContainers)
* CRUD, bulk operations, embedded persistence
- ProgramDateIdMappingsPostgreSQLIntegrationTest (TestContainers)
* CRUD, bulk operations, embedded persistence
All tests verify:
- All 4 ProgramDateKind enum values persist correctly
- Embedded ProgramDateIdMapping persistence
- Null handling for embedded objects and fields
- AssertJ chained assertions throughout
Related: #28 Phase 17
Builds on: 9639490 (Phases A-G)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent fe77497 commit 18a8e8b
14 files changed
Lines changed: 1544 additions & 91 deletions
File tree
- openespi-common/src
- main
- java/org/greenbuttonalliance/espi/common
- domain/customer
- common
- entity
- enums
- dto/customer
- mapper/customer
- repositories/customer
- service/customer
- impl
- resources/db/migration
- test/java/org/greenbuttonalliance/espi/common/repositories
- customer
- integration
Lines changed: 66 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
Lines changed: 39 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
49 | | - | |
50 | | - | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | | - | |
53 | | - | |
54 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
55 | 87 | | |
Lines changed: 58 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
Lines changed: 85 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
0 commit comments