Commit cd1d771
feat: ESPI 4.0 Schema Compliance - Phase 0.5: OAuth and Common Domain Enums (#109)
* feat: ESPI 4.0 Schema Compliance - Phase 0.5: OAuth and Common Domain Enums
Implements OAuth 2.0 and common domain enumerations from espi.xsd with
proper JAXB/Jakarta XML binding annotations and comprehensive documentation.
OAuth Enums (String values):
- GrantType (3 values) - OAuth 2.0 grant types (authorization_code, client_credentials, refresh_token)
- TokenType (1 value) - OAuth 2.0 token types (Bearer)
- OAuthError (13 values) - OAuth 2.0 error codes per RFC 6749
- ResponseType (1 value) - OAuth 2.0 response types (code)
- TokenEndPointMethod (1 value) - Token endpoint authentication methods
Common Enums (int values):
- Currency (14 values) - ISO 4217 currency codes (USD, EUR, GBP, etc.)
- StatusCode (14 values) - HTTP status codes for transaction status
Refactoring:
- Moved enums from domain/common/ to domain/common/enums/ package
- Deleted old enum files (GrantType, TokenType, OAuthError, ResponseType)
- Updated all imports in entity and test files
- Added wildcard import for domain/common/enums in affected files
- Updated tests to use ESPI 4.0 compliant ResponseType.CODE (removed non-standard TOKEN)
All enums include:
- Apache License 2.0 header (copyright 2025 Green Button Alliance, Inc.)
- JAXB/Jakarta XML binding annotations (@XmlType, @XmlEnum, @XmlEnumValue)
- getValue() and fromValue() methods with IllegalArgumentException for invalid values
- Comprehensive Javadoc from XSD documentation with line numbers
- Type-safe enum constants (String for OAuth, int for Currency/StatusCode)
Total enum values in batch: 47
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>
* fix: Update import in ModernAuthorizationController for relocated enums
Updates import statements in openespi-thirdparty ModernAuthorizationController
to use new enum package location (domain/common/enums).
Fixes compilation error in openespi-thirdparty module.
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 44ef6d8 commit cd1d771
18 files changed
Lines changed: 731 additions & 198 deletions
File tree
- openespi-common/src
- main/java/org/greenbuttonalliance/espi/common/domain
- common
- enums
- usage
- test/java/org/greenbuttonalliance/espi/common
- repositories/usage
- test
- openespi-thirdparty/src/main/java/org/greenbuttonalliance/espi/thirdparty/web
Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 150 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 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
0 commit comments