Skip to content

Commit 8f92b2f

Browse files
dfcoffinclaude
andcommitted
feat: ESPI 4.0 Schema Compliance - Phase 26: Meter Complete Implementation
Implements full ESPI 4.0 compliance for Meter resource per customer.xsd. Changes: - Extracted shared embeddables to domain/customer/common/: * ElectronicAddress (customer.xsd lines 886-936) * StreetAddress (customer.xsd lines 1285-1320) * TelephoneNumber (customer.xsd lines 1428-1478) * MeterMultiplier (customer.xsd MeterMultiplier type) - MeterEntity: Added meterMultipliers @ElementCollection - MeterDto: Added 19 XSD-compliant fields including meterMultipliers - MeterMultiplierDto: New DTO for meter multiplier collection - MeterMapper: MapStruct mapper with UUID v5 generation - MeterService: Simplified to 6 CRUD methods (ESPI 4.0 pattern) - MeterRepository: Removed 11 non-ID query methods - Flyway V3: Added meter_multipliers collection table - TestDataBuilders: Added createValidMeter() helper - Tests: 16 unit tests + 18 integration tests (MySQL/PostgreSQL) - BigDecimal assertions: Use isEqualByComparingTo() for cross-platform precision - CLAUDE.md: Added file modification best practices (NEVER use sed/awk) Updated entities to use extracted embeddables: - Organisation, Asset, Location, CustomerEntity, CustomerAccountEntity, CustomerAgreementEntity, EndDeviceEntity, OrganisationRole, ServiceLocationEntity and all related mappers and tests All 736 tests passing. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ccac8e5 commit 8f92b2f

File tree

49 files changed

+3277
-1103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3277
-1103
lines changed

CLAUDE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,40 @@ ESPI uses Atom XML feeds for data exchange. Key patterns:
237237

238238
### Common Development Patterns
239239

240+
#### File Modification Best Practices
241+
**CRITICAL: Always use the Edit tool with visible diffs instead of sed/awk for file modifications**
242+
243+
- **NEVER use sed, awk, or bash text manipulation** for modifying source code or test files
244+
- **ALWAYS use the Edit tool** which shows explicit diffs for review
245+
- **Benefits of Edit tool**:
246+
- Changes are visible and reviewable before execution
247+
- Prevents cascading errors from bulk updates
248+
- Easy to verify correctness with explicit old_string → new_string diff
249+
- Catches errors immediately rather than discovering them during compilation
250+
251+
- **When multiple files need the same change**:
252+
- Use multiple Edit tool calls (one per file) in a single message
253+
- Show exactly what's changing in each file
254+
- Do NOT use sed/awk loops even if it seems more efficient
255+
256+
- **Exception**: Only use bash text tools (grep, find) for **searching/analysis**, never for modifications
257+
258+
**Example - WRONG approach:**
259+
```bash
260+
# DON'T DO THIS - sed makes changes invisibly
261+
sed -i '' 's/OldClass/NewClass/g' src/**/*.java
262+
```
263+
264+
**Example - CORRECT approach:**
265+
```
266+
# DO THIS - Use Edit tool with explicit diffs
267+
Edit tool call showing:
268+
old_string: "import com.example.OldClass;"
269+
new_string: "import com.example.NewClass;"
270+
```
271+
272+
This practice prevents issues like missing imports, broken references, and compilation errors that are difficult to track down.
273+
240274
#### Adding New ESPI Entity
241275
1. Create entity in `openespi-common/src/main/java/org/greenbuttonalliance/espi/common/domain/usage/` (or `/customer/`)
242276
2. Extend `IdentifiedObject` base class

0 commit comments

Comments
 (0)