Skip to content

163-expenditures-reports-pagination#177

Open
bhuvanh66 wants to merge 2 commits intomainfrom
expenditures-reports-pagination
Open

163-expenditures-reports-pagination#177
bhuvanh66 wants to merge 2 commits intomainfrom
expenditures-reports-pagination

Conversation

@bhuvanh66
Copy link
Copy Markdown
Contributor

@bhuvanh66 bhuvanh66 commented Mar 26, 2026

ℹ️ Issue

Closes #163

📝 Description

Write a short summary of what you added. Why is it important? Any member of C4C should be able to read this and understand your contribution -- not just your team members.

Adds paginated GET endpoints for expenditures and reports. Both endpoints share a consistent response (data, pagination) that aligns with the donors/donations pagination added in #162.

Changes:

Added GET /expenditures with page, limit, and optional projectId filter — orders by spent_on DESC
Added GET /reports with page, limit, and optional projectId filter — orders by date_created DESC
Both return 400 for invalid pagination params (non-integer, < 1)
Wired up the reports lambda with db.ts, auth.ts, and db-types.d.ts (it was previously a stub with no DB access)
Updated OpenAPI specs and added unit + e2e tests for both endpoints

Briefly list the changes made to the code:

  1. Added support for this.
  2. And removed redunant use of that.
  3. Also this was included for reasons.

✔️ Verification

What steps did you take to verify your changes work? These should be clear enough for someone to be able to clone the branch and follow the steps themselves.

Provide screenshots of any new components, styling changes, or pages.

Clone the branch and npm install inside apps/backend/lambdas/reports/
Run unit tests:

cd apps/backend/lambdas/expenditures && npm test
cd apps/backend/lambdas/reports && npm test
For e2e tests, start the DB and run:
npm run test:e2e
http://localhost:3000/expenditures/swagger
http://localhost:3000/reports/swagger

🏕️ (Optional) Future Work / Notes

Did you notice anything ugly during the course of this ticket? Any bugs, design challenges, or unexpected behavior? Write it down so we can clean it up in a future ticket!

@github-actions github-actions bot requested a review from Rayna-Yu March 26, 2026 22:04
github-actions bot added a commit that referenced this pull request Mar 26, 2026
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.

Pagination for Expenditures and Reports

1 participant