Skip to content

feat(payroll): add paginated historical payroll runs API#505

Open
Ebby46 wants to merge 1 commit into
SafeVault:mainfrom
Ebby46:feat/payroll-history-endpoint
Open

feat(payroll): add paginated historical payroll runs API#505
Ebby46 wants to merge 1 commit into
SafeVault:mainfrom
Ebby46:feat/payroll-history-endpoint

Conversation

@Ebby46
Copy link
Copy Markdown

@Ebby46 Ebby46 commented Jun 2, 2026

Pull Request

Summary

This PR implements a new API endpoint to fetch a paginated list of past, completed payroll runs for a specific organization. This enables the UI to efficiently populate the Payroll History table with structural offset navigation.

Type of Change

  • Feature
  • Bug Fix
  • Refactoring
  • Documentation
  • Tests
  • Infrastructure / CI

Linked Issues

closed #481

Key Changes

  • Created a new GET handler at src/app/api/v1/payroll/history/route.ts.
  • Implemented robust dynamic pagination using page and limit query parameters, defaulting to a page size of 10 records.
  • Configured database querying via Drizzle ORM to filter records where status === 'completed'.
  • Ordered historical records dynamically by executedAt in descending order.
  • Enforced strict organization multi-tenancy isolation by checking the context against the organization's unique identifier.
  • Combined data retrieval and row counting into an asynchronous Promise.all operation to optimize latency and round-trip efficiency.

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new linting/type-checking warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have updated the documentation accordingly.

Screenshots / Recordings

- Create GET handler at
- Implement pagination using  and  query parameters (default 10)
- Filter results for 'completed' status and order by  descending
- Enforce organization multi-tenancy isolation
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

@Ebby46 is attempting to deploy a commit to the vestroll's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Paginated Historical Payroll Runs API

1 participant