Overview
The Dealflow Management system provides comprehensive deal tracking, timeline visualization, collaborative note-taking, and deal detail management for credit agreements and loan applications. Code Reference:app/services/deal_service.py, app/api/routes.py (deal endpoints)Frontend:
client/src/components/DealDashboard.tsx, client/src/components/DealDetail.tsx
Key Features
Deal Dashboard
- Portfolio Overview: View all deals with filtering and search
- Status Filtering: Filter by deal status (draft, submitted, approved, etc.)
- Type Filtering: Filter by deal type (loan_application, refinancing, etc.)
- Search Functionality: Search deals by ID, applicant, or keywords
- Pagination: Efficient pagination for large deal portfolios
client/src/components/DealDashboard.tsx
Deal Timeline
- Visual Timeline: Visual representation of deal events and milestones
- Event Tracking: Track all deal state changes and updates
- Milestone Markers: Mark important deal milestones
- Chronological View: View events in chronological order
client/src/components/DealDetail.tsx (timeline view)
Deal Notes
- Collaborative Notes: Add notes and comments to deals
- User Attribution: Track which user added each note
- Timestamp Tracking: Automatic timestamp for all notes
- Rich Text Support: Support for formatted text in notes
app/db/models.py (DealNote model)
Deal Detail View
- Comprehensive Information: Complete deal information and metadata
- Document Management: View and manage deal documents
- Status Tracking: Track deal status and state changes
- Application Link: Link to associated application
client/src/components/DealDetail.tsx
Deal Statuses
Status Values
draft: Deal is in draft statesubmitted: Deal has been submitted for reviewunder_review: Deal is under reviewapproved: Deal has been approvedrejected: Deal has been rejectedactive: Deal is activeclosed: Deal is closedrestructuring: Deal is being restructuredwithdrawn: Deal has been withdrawn
app/db/models.py (Deal model)
Workflow
1. Create Deal
- From Application: Create deal from loan application
- Manual Creation: Manually create new deal
- Deal Configuration: Set deal type, status, and metadata
- Folder Creation: Automatic folder creation for deal documents
- Initial Note: Add initial deal note
2. Deal Management
- Update Status: Change deal status as it progresses
- Add Documents: Upload and attach documents to deal
- Add Notes: Add collaborative notes and comments
- Timeline Updates: Automatic timeline event creation
- Status Tracking: Monitor deal progress
3. Deal Completion
- Final Status: Set deal to approved, rejected, or closed
- Documentation: Ensure all documents are attached
- Notes Summary: Review all deal notes
- Archive: Archive completed deals
API Endpoints
List Deals
List all deals with filtering and pagination. Query Parameters:status: Filter by deal statusdeal_type: Filter by deal typesearch: Search querylimit: Items per page (default: 50)offset: Pagination offset
app/api/routes.py (deal endpoints)
Get Deal Details
Get detailed information about a specific deal. Response: Complete deal information including notes, documents, and timelineCreate Deal Note
Add a note to a deal. Request Body:Get Deal Timeline
Get timeline of events for a deal. Response: Chronological list of deal eventsDatabase Models
Deal
Location:app/db/models.py
Fields:
deal_id: Unique deal identifierapplicant_id: User ID of applicantapplication_id: Associated application IDstatus: Current deal statusdeal_type: Type of dealdeal_data: JSON metadatafolder_path: Storage folder path
DealNote
Location:app/db/models.py
Fields:
deal_id: Associated deal IDuser_id: User who created notenote: Note contentnote_type: Type of notecreated_at: Creation timestamp
app/db/models.py (Deal, DealNote models)
User Interface
Deal Dashboard
Location:client/src/components/DealDashboard.tsx
Features:
- Deal List: Table view of all deals
- Filtering: Status and type filters
- Search: Real-time search functionality
- Pagination: Efficient pagination controls
- Quick Actions: Quick access to deal actions
Deal Detail
Location:client/src/components/DealDetail.tsx
Features:
- Deal Information: Complete deal details
- Timeline View: Visual timeline of events
- Notes Section: Collaborative notes interface
- Documents Section: Document management
- Status Updates: Status change interface
Best Practices
- Status Management: Keep deal status updated as it progresses
- Document Organization: Organize documents in deal folders
- Note Documentation: Document important decisions in notes
- Timeline Accuracy: Ensure timeline events are accurate
- Collaboration: Use notes for team collaboration
Additional Resources
Last Updated: 2026-01-14
Code Reference:
app/services/deal_service.py, app/api/routes.py, client/src/components/DealDashboard.tsx