Commit Graph

12 Commits

Author SHA1 Message Date
Matt 242e33f7b9 feat: Add "Save & Close" button in InterestDetailsModal, enhance saveInterest function to conditionally close modal, and improve logging in delete-generated-document and get-expenses APIs 2025-07-10 17:36:10 -04:00
Matt a00b3918be feat: Enhance error handling and logging in expense and interest duplicate detection, add retry logic for document deletion, and improve PDF generation with detailed receipt processing 2025-07-10 09:59:17 -04:00
Matt 0b881a2588 FEAT: Correct spelling of 'Documenso' in API utility functions and add connectivity test for Documenso API 2025-06-17 15:17:19 +02:00
Matt f4f514f1e1 KEYCLOAK AUTH FIX: Phase 5 - Final Batch (COMPLETE)
**UPDATED ENDPOINTS (7 final):**
- test-eoi-cleanup.ts (updated old auth)
- eoi/send-reminders.ts (updated old auth + fixed function calls)
- eoi/delete-generated-document.ts (updated old auth)
- eoi/delete-document.ts (updated old auth + fixed function calls)
- email/test-minio-bucket.ts (updated old auth)
- email/test-connection.ts (updated old auth)
- email/process-sales-eois.ts (updated old auth)

** TASK COMPLETE - ALL 47 API ENDPOINTS UPDATED:**
 38 endpoints now use unified auth (requireAuth function)
 9 endpoints correctly remain public (auth/debug/health/test)
 Support dual auth: x-tag headers + Keycloak sessions
 Fixed 8 endpoints with NO authentication (critical security fix)
 Backward compatibility maintained for webhooks
 Dashboard users can now access all endpoints securely

**SECURITY ACHIEVEMENT:**
- Eliminated all old x-tag authentication patterns
- Unified authentication system across entire API
- Critical security vulnerabilities patched
- Production-ready authentication implementation
2025-06-15 16:41:36 +02:00
Matt 9f792be7de CRITICAL FIX: Resolve NocoDB field clearing issue for EOI cleanup
Root Cause Resolution:
- NocoDB API requires null values (not undefined) to clear database fields
- Updated updateInterest utility to automatically convert undefined  null
- This ensures signature links and documensoID are properly cleared from database

 Database Cleanup Enhancements:
- Fixed all EOI deletion endpoints to properly clear embedded signature links
- Both delete-generated-document and delete-document now clear ALL fields:
  * EmbeddedSignatureLinkClient, EmbeddedSignatureLinkCC, EmbeddedSignatureLinkDeveloper
  * Signature Link Client, Signature Link CC, Signature Link Developer
  * documensoID and all related EOI metadata

 Added Debug Capabilities:
- Created test-eoi-cleanup.ts endpoint for debugging cleanup operations
- Enhanced logging in NocoDB utility for field conversion tracking
- Better error handling and validation throughout cleanup process

 Technical Implementation:
- NocoDB utility now automatically handles undefined  null conversion
- Comprehensive field clearing in allowedFields array
- Proper TypeScript typing for all cleanup operations
- Enhanced logging for troubleshooting database operations

This resolves the persistent issue where signature links and document IDs remained in the database after EOI deletion, ensuring complete cleanup and proper state reset.
2025-06-12 17:36:27 +02:00
Matt 44a966f87a fix: Comprehensive EOI cleanup and mobile UI improvements
Database Cleanup Enhancements:
- Fixed missing embedded signature link cleanup in deletion endpoints
- Both delete-generated-document and delete-document now properly clear:
  * EmbeddedSignatureLinkClient, EmbeddedSignatureLinkCC, EmbeddedSignatureLinkDeveloper
  * All legacy signature links and documensoID references
- Enhanced validation endpoint to detect and clean orphaned records automatically

 EOI Section Reactivity Fixes:
- Added local reactive state (documentValidated, documentExists) for immediate UI updates
- EOI section now instantly shows Generate UI when documents are deleted/invalid
- No more phantom signatory status displays after document deletion
- Improved hasGeneratedEOI computed property with validation state override

 Mobile UI Improvements:
- Implemented stacked badge layout for interest table on mobile
- Contact info + status badges now stack vertically (60% width)
- Eliminated horizontal scrolling issues on mobile devices
- Enhanced email thread view with proper width constraints and text wrapping
- Made email refresh button round with better mobile styling

 Technical Enhancements:
- Comprehensive field cleanup using undefined instead of null for proper database reset
- Enhanced error handling for document validation and deletion
- Improved logging for debugging EOI state transitions
- Better handling of edge cases where documensoID exists but document was deleted externally

All EOI-related operations now properly maintain database consistency and provide immediate visual feedback to users.
2025-06-12 17:27:10 +02:00
Matt 41a6f7f1c8 feat: Implement EOI document validation and orphaned data cleanup
- Add new /api/eoi/validate-document endpoint to check document existence
- Automatically clean up orphaned database records when documents don't exist in Documenso
- Update EOISection component to validate documents on mount
- Enhanced delete-generated-document endpoint to handle already-deleted documents
- Updated check-signature-status endpoint with validation logic
- Prevents EOI section from showing when document no longer exists
- Self-healing system that fixes data inconsistencies automatically

Key improvements:
- Validates document existence before showing EOI management UI
- Cleans up documensoID, signature links, and status fields when document is missing
- Graceful handling of 404 errors from Documenso API
- Background validation with user-friendly notifications
- Prevents phantom EOI states that appear generated but don't exist
2025-06-12 17:04:45 +02:00
Matt 4916c20f64 fixes 2025-06-12 16:26:10 +02:00
Matt af3a68e51b Feat: Complete EOI improvements and PWA implementation
EOI ENHANCEMENTS:
-  Fix EOI deletion to clear ALL signature fields (embedded links, timestamps, etc.)
-  Add EOI creation time tags automatically displayed on interest cards
-  Add signature status tags showing who has signed ( Client,  CC,  Developer)
-  Add pending signature tags for unsigned parties
-  Fix TypeScript errors with new Interest type fields

 UI IMPROVEMENTS:
-  Enhanced InterestDetailsModal with comprehensive status display
-  Fixed component prop naming issues
-  Better mobile and desktop responsiveness for tags

 PWA IMPLEMENTATION:
-  Complete PWA configuration with manifest
-  App installation capability
-  Offline support with service worker
-  Multiple icon sizes (72x72 to 512x512)
-  Branded theme colors and app metadata
-  Auto-update functionality

 USER EXPERIENCE:
- Users can now see EOI creation timestamps at a glance
- Clear visual indication of signature status for all parties
- App can be installed on mobile/desktop devices
- Proper reset of EOI state when deleted
- All embedded signature links properly cleared on deletion

The platform now provides complete EOI lifecycle management with PWA capabilities!
2025-06-12 16:16:30 +02:00
Matt f992fbb5a6 updates 2025-06-11 14:08:28 +02:00
Matt 0b6601fabc updates 2025-06-11 13:54:04 +02:00
Matt a49322f852 updates 2025-06-11 13:50:51 +02:00