Skip to content

feat(routes-f): close #657 #661 #666 #700 (bmi, url-encode, raffle, threaded-comments)#720

Merged
davedumto merged 1 commit intoStreamFi-x:devfrom
josephchimebuka:feat/routes-f-threaded-url-raffle-bmi
Apr 28, 2026
Merged

feat(routes-f): close #657 #661 #666 #700 (bmi, url-encode, raffle, threaded-comments)#720
davedumto merged 1 commit intoStreamFi-x:devfrom
josephchimebuka:feat/routes-f-threaded-url-raffle-bmi

Conversation

@josephchimebuka
Copy link
Copy Markdown
Contributor

Description

Closes #657
Closes #661
Closes #666
Closes #700

This PR implements four routes-f API endpoints and their focused Jest test coverage:

  • BMI calculator with WHO category and ideal weight range
  • URL encode/decode endpoint supporting component and full URL modes
  • Weighted raffle picker with deterministic seeded draws
  • Threaded comments CRUD with nested replies and soft-delete behavior

Changes proposed

What were you told to do?

What did you do?

  • Added BMI endpoint and tests:
    • app/api/routes-f/bmi/route.ts
    • app/api/routes-f/bmi/tests/route.test.ts
  • Added URL encode/decode endpoint and tests:
    • app/api/routes-f/url-encode/route.ts
    • app/api/routes-f/url-encode/tests/route.test.ts
  • Added raffle endpoint and tests:
    • app/api/routes-f/raffle/route.ts
    • app/api/routes-f/raffle/tests/route.test.ts
  • Added threaded comments endpoints, in-memory store/types, and tests:
    • app/api/routes-f/comments/route.ts
    • app/api/routes-f/comments/[id]/route.ts
    • app/api/routes-f/comments/_lib/store.ts
    • app/api/routes-f/comments/_lib/types.ts
    • app/api/routes-f/comments/tests/route.test.ts

Implementation details covered in this PR:

  • Strong request validation and clear 4xx responses for invalid input
  • Input-size guardrails for large payloads where relevant
  • Deterministic PRNG for seeded raffle selections
  • Weighted draws with and without replacement
  • Depth-constrained nested comment threads and soft delete preserving structure
  • Route-level test cases for success paths and key edge/error paths

Validation run:

  • npm test -- --runInBand --watchAll=false app/api/routes-f/bmi/tests/route.test.ts app/api/routes-f/comments/tests/route.test.ts app/api/routes-f/raffle/tests/route.test.ts app/api/routes-f/url-encode/tests/route.test.ts
  • Result: all 4 suites passed

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.
  • I am making a pull request against the main branch (left side).
  • My commit messages styles matches our requested structure.
  • My code additions will fail neither code linting checks nor unit test.
  • I am only making changes to files I was requested to.

Note: The target branch for this repo workflow is dev.

Screenshots/Videos

  • Not applicable (API endpoint implementation and tests).

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 28, 2026

@josephchimebuka is attempting to deploy a commit to the david's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 28, 2026

@josephchimebuka 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

@davedumto davedumto merged commit d6ae24b into StreamFi-x:dev Apr 28, 2026
4 of 6 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

2 participants