Skip to content

feat: add payroll draft adjustments API#501

Open
auracule007 wants to merge 23 commits into
SafeVault:mainfrom
auracule007:payroll-adjustments-api-478
Open

feat: add payroll draft adjustments API#501
auracule007 wants to merge 23 commits into
SafeVault:mainfrom
auracule007:payroll-adjustments-api-478

Conversation

@auracule007
Copy link
Copy Markdown
Contributor

Summary #478

This PR implements the Payroll Bonuses and Deductions API for active payroll drafts.

It adds a new payroll draft database model and introduces an adjustments endpoint that lets an authenticated organization user apply one-time bonuses or custom deductions to a specific employee within an active payroll draft. When an adjustment is submitted, the API updates the employee payload, recalculates the employee’s netPay, recalculates the draft totalAmount, and persists the updated draft record.

This gives payroll managers a way to make last-minute draft payroll changes while keeping both employee-level and draft-level totals in sync.

Type of Change

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

Linked Issues

Fixes #478

Key Changes

  • Added payroll_draft_status enum with active, processed, and cancelled states.
  • Added payroll_drafts table to store draft payroll payloads, draft status, organization ownership, and total amount.
  • Added database migration for the payroll draft table and indexes.
  • Added POST /api/v1/payroll/[draftId]/adjustments for applying payroll adjustments.
  • Added PATCH /api/v1/payroll/[draftId]/adjustments for adding or removing payroll adjustments.
  • Added request validation for draftId, employeeId, adjustment type, amount, action, and optional reason.
  • Restricted updates to active payroll drafts owned by the authenticated user’s organization.
  • Recalculated the target employee’s netPay after applying bonuses or deductions.
  • Recalculated the payroll draft totalAmount after employee payload updates.
  • Returned clear error responses for invalid payloads, missing organization access, inactive/missing drafts, missing employees, and invalid removal amounts.

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

Not applicable. This is a backend API/database change.

Closes #478

Banx17 and others added 17 commits May 28, 2026 03:49
…cent-activity-feed

feat: add paginated dashboard activity feed
Extend GET /api/v1/finance/transactions to support sortBy (date,
status, type) and order (asc, desc) query params on top of the
existing status/type/asset filters. Sorting is built dynamically
from the validated params so the frontend can natively filter and
order the transaction table.

- Add sortBy/order to ListTransactionsSchema (validated, defaulted)
- Replace hardcoded date-desc sort with dynamic comparator
- Document new params in Swagger
- Add route tests covering filtering, sorting and validation

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-global-search-api

feat: implement global search API functionality
…alculate-endpoint

Feat/payroll calculate endpoint
…ayment methods

- Add ChargeParams and ChargeResult to PaymentProvider interface
- Implement charge method in MonnifyProvider and FlutterwaveProvider
- Add atomic updateBalance to FinanceWalletService
- Implement processCharge in FiatDepositService to orchestrate charge, balance update, and transaction recording
- Create POST /api/v1/finance/deposit endpoint with validation

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
[FEATURE] Fetch Tax Jurisdiction Rates API (SafeVault#479)
…ory-filter-sort

feat(finance): add dynamic sorting to transaction history endpoint
@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

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

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added size/l and removed size/m labels May 31, 2026
@auracule007
Copy link
Copy Markdown
Contributor Author

@codeZe-us Please review this PR and check workflow

@codeZe-us
Copy link
Copy Markdown
Contributor

@auracule007 PR should point to dev branch not main branch

codeZe-us and others added 4 commits June 1, 2026 17:36
feat: implement Process Fiat Deposits API for immediate charging of p…
…count

feat: implement unlink connected bank account API
…ad-api

feat(notifications): add mark all as read API
@github-actions github-actions Bot added size/xl and removed size/l labels Jun 1, 2026
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] Apply Payroll Bonuses and Deductions API

10 participants