Documents & CRM Dealflow Modules
Documents & CRM Dealflow Modules
This guide covers the Document Management (lib/features/documents/) and CRM Dealflow (lib/features/dealflow/, lib/features/clients/) modules used for managing contracts, cooperative statutes, and business relationships.
1. Document Management (lib/features/documents/)
PLANOVI includes an enterprise document management workspace supporting WYSIWYG rich text authoring, multi-format media preview, and templated document generation.
graph TD
DocsList[DocumentsListScreen] --> Editor[DocumentEditorScreen - Quill]
DocsList --> Reader[DocumentReaderScreen]
Reader --> DocxCross{Platform Dispatch}
DocxCross -->|Web Platform| DocxWeb["docx_viewer_web.dart / IFrame"]
DocxCross -->|"Mobile / Desktop"| DocxNative[docx_viewer_mobile.dart]
DocxCross -->|Server Conversion| EdgeDocx[docx-to-html Edge Function]
Editor --> SupaStorage[("Supabase Storage: documents")]
Key Components
- Rich Text Editor (
document_editor_screen.dart):- Powered by
flutter_quill. - Supports headings, numbered/bulleted lists, custom font styles, inline code, hyperlinking, and embedded image attachments.
- Delta JSON serialized directly to Postgres or uploaded to Supabase Storage as formatted documents.
- Powered by
- Universal Document Reader (
document_reader_screen.dart):- Multi-format reader capable of displaying PDFs, raster images, and formatted text documents.
- Cross-Platform DOCX Viewer:
- Employs conditional compilation imports (
docx_viewer_stub.dart,docx_viewer_web.dart,docx_viewer_mobile.dart) to provide seamless rendering across Flutter Web, iOS, Android, and Windows. - On web, uses the
docx-to-htmlSupabase Edge function or sandboxed iframe preview. - On mobile/desktop, utilizes native view registries or PDF preview bridges.
- Employs conditional compilation imports (
2. Dealflow & CRM (lib/features/dealflow/, lib/features/clients/)
The CRM system organizes prospects, installations, and client contracts through Kanban pipelines.
Key Screens
- Dealflow Entries (
dealflow_entries_screen.dart):- Kanban board displaying deals across customizable pipeline stages (e.g.
New Inquiry,Site Audit Scheduled,PV Offer Prepared,Contract Signed,Installation Complete). - Drag-and-drop deal movement with status update triggers.
- Kanban board displaying deals across customizable pipeline stages (e.g.
- Dealflow Setup (
dealflow_setup_screen.dart&create_dealflow_screen.dart):- Pipeline configuration screen to define stage names, probabilities, required documents, and milestone requirements.
- Client Profile (
client_profile_screen.dart):- 360-degree customer view containing contact details, associated deals, connected IoT meters, billing history, and attached PDF contracts.