Feat: Implement four invoice management features (#437, #439, #441, #443)#453
Open
OZILSOLAR wants to merge 4 commits into
Open
Feat: Implement four invoice management features (#437, #439, #441, #443)#453OZILSOLAR wants to merge 4 commits into
OZILSOLAR wants to merge 4 commits into
Conversation
- Create fraudRiskScorer.ts with calculateFraudRiskScore function - Aggregate anomaly signals into composite 0-100 risk rating - Implement risk tier classification (low/medium/high) - Create FraudRiskPanel component with gauge visualization - Add unit tests for fraud risk calculations - Support high-risk confirmation gate for scores > 70
- Create archiveInvoices utility with localStorage persistence - Support archive/unarchive operations with undo capability - Add PATCH /api/invoices/bulk endpoint for bulk operations - Enhance BulkActionBar with archive/unarchive buttons - Display undo toast with 10-second timeout - Show archive count in bulk selection summary - Add comprehensive tests for archive operations
- Create expirySnooze utility for managing countdown state - Support snooze durations: 1h, 4h, until tomorrow - Create ExpiryCountdownBanner component with real-time updates - Show amber banner for invoices within 72 hours of expiry - Show red banner for overdue invoices - Add snooze menu (creator-only feature) - Display countdown in days, hours, minutes format - Automatically update every minute via setInterval - Add comprehensive tests for snooze and countdown logic
- Create PaymentReceiptEmail React component for HTML email template - Create paymentReceiptEmailer utility for sending automated receipts - Implement PATCH /api/invoices/[id]/payment-confirmed webhook endpoint - Support idempotency via transaction hash tracking - Format payment amounts and details for email display - Add batch email sending with concurrency control and rate limiting - Include transaction hash and payment confirmation in receipts - Add audit logging for email delivery tracking - Support both creator and recipient email notifications - Add comprehensive tests for email sender functionality
|
@OZILSOLAR is attempting to deploy a commit to the kingsman-99's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@OZILSOLAR 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! 🚀 |
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.
feat: Implement four invoice management features (#437, #439, #441, #443)
Summary
This PR implements four major invoice management features to enhance security, user experience, and workflow efficiency:
Changes Implemented
1. Invoice Payment Fraud Risk Score Display (#437)
Files:
src/lib/fraudRiskScorer.ts,src/components/invoice/FraudRiskPanel.tsxFraudRiskPanelcomponent featuring:Test Coverage: 112 lines, 6 test cases
2. Invoice Bulk Archive/Unarchive with Filter (#439)
Files:
src/lib/archiveInvoices.ts,src/components/BulkActionBar.tsx,src/app/api/invoices/bulk/route.tsBulkActionBarcomponent with:PATCH /api/invoices/bulkendpoint for:Test Coverage: 89 lines, 7 test cases
3. Invoice Expiry Countdown Banner with Snooze (#441)
Files:
src/lib/expirySnooze.ts,src/components/ExpiryCountdownBanner.tsxExpiryCountdownBannercomponent with:Test Coverage: 109 lines, 8 test cases
4. Invoice Payment Receipt Email Sender (#443)
Files:
src/emails/PaymentReceiptEmail.tsx,src/lib/paymentReceiptEmailer.ts,src/app/api/invoices/[id]/payment-confirmed/route.tsPaymentReceiptEmailReact component for professional HTML email templatesPOST /api/invoices/[id]/payment-confirmedfeaturing:Test Coverage: 131 lines, 6 test cases
Testing
Breaking Changes
None - All features are additive and backward compatible.
Migration Notes
Files Changed
New Components: 5 (FraudRiskPanel, ExpiryCountdownBanner, PaymentReceiptEmail, 2 API routes)
Files:
src/emails/PaymentReceiptEmail.tsx,src/lib/paymentReceiptEmailer.ts,src/app/api/invoices/[id]/payment-confirmed/route.tsCreated
PaymentReceiptEmailReact component for professional HTML email templatesImplemented payment receipt emailer with:
Built webhook endpoint
POST /api/invoices/[id]/payment-confirmedfeaturing:Email receipt includes:
Infrastructure ready for integration with:
Test Coverage: 131 lines, 6 test cases
Testing
Breaking Changes
None - All features are additive and backward compatible.
Migration Notes
Files Changed
Closes
Closes #437
Closes #439
Closes #441
Closes #443