feat: Add invoice duplication and overdue listing routes#377
Open
HuiNeng6 wants to merge 2 commits intodavedumto:mainfrom
Open
feat: Add invoice duplication and overdue listing routes#377HuiNeng6 wants to merge 2 commits intodavedumto:mainfrom
HuiNeng6 wants to merge 2 commits intodavedumto:mainfrom
Conversation
- GET /api/routes-b/analytics/invoices - invoice counts grouped by status - GET /api/routes-b/dashboard - combined dashboard summary Features: - Parallel queries using Promise.all - Default zeros for missing statuses - Earnings summary with thisMonth filter - Recent transactions limited to 5 Fixes: davedumto#369, davedumto#370
- POST /api/routes-b/invoices/[id]/duplicate - copy invoice with fresh number - GET /api/routes-b/invoices/overdue - list pending invoices past due date Features: - Fresh invoice number generation - daysOverdue calculation - Proper auth and ownership validation Fixes: davedumto#371, davedumto#373
|
@HuiNeng6 is attempting to deploy a commit to the david's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds two invoice-related routes-b API endpoints.
Endpoints Added
Invoice Duplication
Overdue Invoices
Acceptance Criteria Met
Duplicate
✅ Returns 201 with new invoice
✅ Unique invoiceNumber and fresh paymentLink
✅ Status set to 'pending'
✅ dueDate/paidAt/cancelledAt NOT copied
✅ Returns 403 for wrong user
✅ Returns 404 for missing invoice
✅ Returns 401 for unauthenticated
Overdue
✅ Returns 200 with overdue invoices sorted
✅ Includes daysOverdue as positive integer
✅ Only includes invoices with dueDate
✅ Only includes pending invoices
✅ Returns empty array (not 404) when none overdue
✅ Returns 401 for unauthenticated
Fixes: #371
Fixes: #373