Add utility lookup by EIA ID#222
Closed
texture-coding-agent wants to merge 1 commit into
Closed
Conversation
Adds GET /api/v1/utilities/by-eia-id/{eiaId}, a sibling to the existing
slug-based detail route for consumers that hold canonical EIA Utility IDs.
The new route mirrors the slug route response shape and supports the same
?include=iso,rto,ba and ?fields sparse-fieldset semantics. It excludes
soft-deleted utilities and returns a normal public API 404 when no matching
EIA ID exists.
Also adds shared edge caching headers to utility detail responses:
public, s-maxage=3600, stale-while-revalidate=86400.
Validation: npm run build includes /api/v1/utilities/by-eia-id/[eiaId].
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
LGTM on /by-eia-id/{eiaId}.
- Identical structure to the slug route (handleGet + withRequestId/withErrorHandling/withTiming chain + publicJsonResponse) — minimal surface area for drift.
- Same include=iso,rto,ba + ?fields= semantics so downstream clients get a stable contract across both lookup paths.
- Cache-Control
public, s-maxage=3600, stale-while-revalidate=86400is the right profile for fields that change a few times a year. Applied to both /slug and /by-eia-id consistently. - Zero Texture-internal framing, purely generic.
This is the key endpoint for CRM's Organization.fundamentals DataLoader — my N9 resolver wires against this once it merges.
Approving.
Contributor
|
Closing — re-opening with fleet-app authorship so the claude-review CI bot runs cleanly. Same content, fresh branch. |
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
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
Adds a public utility-detail lookup route by EIA Utility ID:
This is a sibling to the existing slug-based route and is useful for consumers that store or exchange canonical EIA Utility IDs rather than CommonGrid slugs.
Details
GET /api/v1/utilities/{slug}response shape?include=iso,rto,baand?fields=sparse-fieldset semanticsCache-Control: public, s-maxage=3600, stale-while-revalidate=86400Validation
npm run build✅ — route appears in the app route manifest as/api/v1/utilities/by-eia-id/[eiaId]