Skip to content

feat(backend): add GET /policies and GET /policies/:holder/:policy_id… - #113

Merged
jhayniffy merged 3 commits into
InsurNiffy:mainfrom
Petah1:feat/policies-api
Mar 25, 2026
Merged

feat(backend): add GET /policies and GET /policies/:holder/:policy_id…#113
jhayniffy merged 3 commits into
InsurNiffy:mainfrom
Petah1:feat/policies-api

Conversation

@Petah1

@Petah1 Petah1 commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements paginated policy list and single-policy detail endpoints backed by an indexed in-memory store.

Changes

  • `GET /policies` with filters (`status`, `holder`), cursor pagination, rate limiting
  • `GET /policies/:holder/:policy_id` with 404/400 handling
  • Cursor-based pagination helper (reusable across endpoints)
  • Batch claim fetching — no N+1
  • Response DTOs with coverage summary, expiry countdown, premium currency metadata, claim links
  • All token amounts as strings (7 decimals), no floats
  • Sliding-window rate limiter (60 req/min, zero new deps)
  • OpenAPI 3.1 spec at `GET /openapi.json`
  • 20 tests covering filters, pagination edge cases, cursor errors, concurrent inserts

Closes #40

@drips-wave

drips-wave Bot commented Mar 24, 2026

Copy link
Copy Markdown

@Petah1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@jhayniffy
jhayniffy merged commit 6cf507f into InsurNiffy:main Mar 25, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backend — Policies REST API: filters, cursor pagination, and OpenAPI fidelity

2 participants