feat(claims): implement V2-BE-024 claim feed & detail endpoints - #391
Merged
dDevAhmed merged 1 commit intoAug 31, 2026
Conversation
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.
closes #359
V2-BE-024 — Claim Feed and Claim Detail Query Endpoints
Implements versioned claim feed and claim detail query endpoints backed by projections on the V2 Optimism/EVM pipeline: contracts emit facts, the indexer projects them, and the API serves those projections. No backend-authoritative protocol mutation is introduced.
What was built
GET /api/v2/claims— cursor-paginated claim feedeffectiveAt DESC, id DESCwith base64url-encoded JSON cursor,hasMore/nextCursor)state(PENDING|RESOLVED|FINALIZED),creator(via stake join),from/todate range,limit(1–100, default 20)GET /api/v2/claims/:id— claim detail404 NotFoundExceptioncontract for missing claims1788000000000-AddDeadlineEffectiveAtToClaimsaddingdeadlineandeffectiveAttimestamp columns + indexes (effectiveAt,effectiveAt+id), backfillingeffectiveAtfromcreatedAtArchitecture
src/claims/v2/claim-feed.service.ts— feed/detail logic, cursor encoding/decoding, confirmations, stable orderingsrc/claims/v2/claim-feed.controller.ts— route + Swagger contractssrc/claims/v2/claim-feed.module.ts— wiring (Claim, IndexedEvent, Stake repos + cache)src/claims/v2/dto/*— request/response DTOs with validation and OpenAPI schemasClaimsCache,IndexedEvent) rather than raw-event storageOverlapping current code — audit
src/pagination/users.pagination.tsand V1 claim routes).Security & integrity
Migration / rebuild impact
deadline+effectiveAt(nullable backfilled fromcreatedAt) and two indexes toclaims. Down migration drops them.effectiveAt = createdAtas a deterministic rebuild default; re-projectable.Observability
NotFoundException); no PII logged.Tests
claim-feed.service.spec.ts,claim-feed.controller.spec.ts) for success path + validation/error branches (cursor decode, not-found, filters, confirmations).claim-feed.integration.spec.ts) across the nearest DB boundary using an in-memory SQLite harness: full feed, lifecycle filter, detail, not-found, and multi-page cursor traversal.Commands run (evidence)
npx tsc --noEmit— v2 files emit no type errors (pre-existing unrelated baseline errors in other files reported separately).npx jest src/claims/v2/...— unit, controller, and integration suites.Residual risks
getConfirmationscurrently resolves the latestClaimCreatedindexed event for the confirmations metadata; confirmations are not yet scoped per claim id in the indexed-event store (seeV2-BE-025evidence counterparts). Noted as a follow-up to tighten per-claim finality when the event store is enriched.Acceptance criteria mapping
Non-goals