- Implemented uploadProofOfPayment function for per-bill proof of payment - Validates file size using MAX_PROOF_OF_PAYMENT_UPLOAD_SIZE_KB env variable - Validates PDF file type - Prevents duplicate uploads with existence check - Uses optimized database projection to minimize data transfer - Updates specific bill using MongoDB array filters - Refactored file validation in updateOrAddBill - Moved validation before serialization for fail-fast behavior - Added configurable file size limit from environment variable - Added PDF type validation - Improved error messages with specific validation failures - Updated serializeAttachment function - Changed return type from BillAttachment to FileAttachment - Added uploadedAt timestamp to attachment object - Removed unsafe type cast - Code formatting improvements throughout - Consistent spacing and indentation - Better TypeScript typing This completes the per-bill proof of payment feature implementation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
20 KiB
20 KiB