Skip to content

chore(types): add FE types for GET /notifications/admin/recent#2445

Open
innolope-dev wants to merge 1 commit into
mainfrom
chore/fe-types-notifications-admin-recent
Open

chore(types): add FE types for GET /notifications/admin/recent#2445
innolope-dev wants to merge 1 commit into
mainfrom
chore/fe-types-notifications-admin-recent

Conversation

@innolope-dev

@innolope-dev innolope-dev commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

What

Regenerates the committed OpenAPI snapshot (src/types/api.openapi.json) and TypeScript types (src/types/api.generated.ts) to include the new backend endpoint GET /notifications/admin/recent, added in peanut-api-ts#1197.

Notes

  • Additive only — the diff adds exactly one path to the snapshot (165 lines) and its generated types (75 lines); no existing path changes.
  • Both files are .prettierignored (snapshot is pulled verbatim from the BE spec), so the block is spliced in the BE's tab format rather than reformatted. pnpm gen:api output is idempotent, so check:api passes.
  • The endpoint is admin-only (x-admin-token), so the FE won't call it — this keeps the generated types a faithful mirror of the backend contract, nothing more.

Depends on peanut-api-ts#1197 landing (the endpoint must exist on the BE for the types to be meaningful).

Summary by CodeRabbit

  • New Features
    • Added an administrative API endpoint for retrieving recent notifications.
    • Supports filtering by user and result limit, with administrator authentication.
    • Returns notification details, delivery statuses, timestamps, provider identifiers, and error information.
    • Documents validation and authentication error responses.

Sync the OpenAPI snapshot + regenerated TS types with the new admin
diagnostics endpoint added in peanut-api-ts (surface failed notification
sends). Additive only — no existing paths change.
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
peanut-wallet Ready Ready Preview, Comment Jul 17, 2026 4:45pm

Request Review

@innolope-dev innolope-dev self-assigned this Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5f3e68ed-cb5f-4559-8605-f988115ce847

📥 Commits

Reviewing files that changed from the base of the PR and between 1c2eac8 and bf3516e.

⛔ Files ignored due to path filters (1)
  • src/types/api.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing (1)
  • src/types/api.openapi.json

📝 Walkthrough

Walkthrough

Added an OpenAPI definition for GET /notifications/admin/recent, including required authentication and query inputs, notification response fields, status constraints, and 400/401 error payloads.

Changes

Admin notification API

Layer / File(s) Summary
Recent notifications endpoint contract
src/types/api.openapi.json
Defines the required userId, limit, and x-admin-token inputs, the notification list response with field constraints, and structured 400/401 errors.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: hugo0

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding frontend types for the new GET /notifications/admin/recent endpoint.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/fe-types-notifications-admin-recent

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 6207.05 → 6207.19 (+0.14)
Findings: +2 net (+355 new, -353 resolved)

🆕 New findings (355)

  • high structural-dup — types/api.generated.ts:421 — 83 duplicate lines / 384 tokens with types/api.generated.ts:1220
  • high structural-dup — types/api.generated.ts:431 — 74 duplicate lines / 344 tokens with types/api.generated.ts:1230
  • high structural-dup — types/api.generated.ts:214 — 72 duplicate lines / 269 tokens with types/api.generated.ts:9646
  • high structural-dup — types/api.generated.ts:214 — 70 duplicate lines / 264 tokens with types/api.generated.ts:9732
  • high structural-dup — types/api.generated.ts:214 — 67 duplicate lines / 249 tokens with types/api.generated.ts:9323
  • high structural-dup — types/api.generated.ts:9268 — 55 duplicate lines / 162 tokens with types/api.generated.ts:9420
  • high structural-dup — types/api.generated.ts:9268 — 55 duplicate lines / 162 tokens with types/api.generated.ts:9591
  • high structural-dup — types/api.generated.ts:9268 — 55 duplicate lines / 165 tokens with types/api.generated.ts:9849
  • medium structural-dup — types/api.generated.ts:3467 — 49 duplicate lines / 139 tokens with types/api.generated.ts:6713
  • medium structural-dup — types/api.generated.ts:3467 — 49 duplicate lines / 137 tokens with types/api.generated.ts:7288
  • medium structural-dup — types/api.generated.ts:7365 — 40 duplicate lines / 108 tokens with types/api.generated.ts:7437
  • medium structural-dup — types/api.generated.ts:9283 — 40 duplicate lines / 120 tokens with types/api.generated.ts:9520
  • medium structural-dup — types/api.generated.ts:748 — 39 duplicate lines / 152 tokens with types/api.generated.ts:2287
  • medium structural-dup — types/api.generated.ts:1017 — 39 duplicate lines / 137 tokens with types/api.generated.ts:2718
  • medium structural-dup — types/api.generated.ts:7365 — 39 duplicate lines / 109 tokens with types/api.generated.ts:7511
  • medium structural-dup — types/api.generated.ts:8910 — 39 duplicate lines / 116 tokens with types/api.generated.ts:9060
  • medium structural-dup — types/api.generated.ts:9947 — 39 duplicate lines / 114 tokens with types/api.generated.ts:10032
  • medium structural-dup — types/api.generated.ts:214 — 38 duplicate lines / 147 tokens with types/api.generated.ts:9560
  • medium structural-dup — types/api.generated.ts:3467 — 38 duplicate lines / 108 tokens with types/api.generated.ts:7488
  • medium structural-dup — types/api.generated.ts:8533 — 38 duplicate lines / 112 tokens with types/api.generated.ts:8608

…and 335 more.

✅ Resolved (353)

  • types/api.generated.ts:346 — 83 duplicate lines / 384 tokens with types/api.generated.ts:1145
  • types/api.generated.ts:356 — 74 duplicate lines / 344 tokens with types/api.generated.ts:1155
  • types/api.generated.ts:139 — 72 duplicate lines / 269 tokens with types/api.generated.ts:9571
  • types/api.generated.ts:139 — 70 duplicate lines / 264 tokens with types/api.generated.ts:9657
  • types/api.generated.ts:139 — 67 duplicate lines / 249 tokens with types/api.generated.ts:9248
  • types/api.generated.ts:9193 — 55 duplicate lines / 162 tokens with types/api.generated.ts:9345
  • types/api.generated.ts:9193 — 55 duplicate lines / 162 tokens with types/api.generated.ts:9516
  • types/api.generated.ts:9193 — 55 duplicate lines / 165 tokens with types/api.generated.ts:9774
  • types/api.generated.ts:3392 — 49 duplicate lines / 139 tokens with types/api.generated.ts:6638
  • types/api.generated.ts:3392 — 49 duplicate lines / 137 tokens with types/api.generated.ts:7213
  • types/api.generated.ts:7290 — 40 duplicate lines / 108 tokens with types/api.generated.ts:7362
  • types/api.generated.ts:9208 — 40 duplicate lines / 120 tokens with types/api.generated.ts:9445
  • types/api.generated.ts:673 — 39 duplicate lines / 152 tokens with types/api.generated.ts:2212
  • types/api.generated.ts:942 — 39 duplicate lines / 137 tokens with types/api.generated.ts:2643
  • types/api.generated.ts:7290 — 39 duplicate lines / 109 tokens with types/api.generated.ts:7436
  • types/api.generated.ts:8835 — 39 duplicate lines / 116 tokens with types/api.generated.ts:8985
  • types/api.generated.ts:9872 — 39 duplicate lines / 114 tokens with types/api.generated.ts:9957
  • types/api.generated.ts:139 — 38 duplicate lines / 147 tokens with types/api.generated.ts:9485
  • types/api.generated.ts:3392 — 38 duplicate lines / 108 tokens with types/api.generated.ts:7413
  • types/api.generated.ts:8458 — 38 duplicate lines / 112 tokens with types/api.generated.ts:8533

…and 333 more.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 1995 ran, 0 failed, 0 skipped, 31.3s

📊 Coverage (unit)

metric %
statements 59.5%
branches 43.3%
functions 48.4%
lines 59.8%
⏱ 10 slowest test cases
time test
3.4s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
1.3s src/utils/__tests__/demo-api.test.ts › isDemoMode() is false when not running under Capacitor
0.4s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › every sticker stays within canvas at any count
0.3s src/app/(mobile-ui)/withdraw/__tests__/withdraw-states.test.tsx › Bank withdrawal keeps the $1 minimum for sub-$1 amounts
0.3s src/app/actions/__tests__/api-headers.test.ts › should include Content-Type in validateInviteCode
0.2s src/app/actions/__tests__/api-headers-extended.test.ts › should not include apiKey in validateInviteCode body
0.2s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › keeps stickers off the username pill (final pass respects the keep-out)
0.1s src/utils/__tests__/demo-balance.test.ts › auto-refills a stored balance that has no timestamp (legacy install)
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle maximum length (17 digits) US account
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle valid 9-digit US account
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

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.

1 participant