Files
delphi-database/docs/MISSING_FEATURES_TODO.md
HotSwapp ae4484381f progress
2025-08-16 10:05:42 -05:00

21 KiB

Missing Features TODO List

Overview

Based on the comprehensive analysis of the legacy Paradox system, this document outlines all features present in the original system but missing from the current FastAPI implementation. Items are prioritized by business impact and implementation complexity.


HIGH PRIORITY - Core Business Features

🔴 1. Document Assembly System

Legacy Feature: Sophisticated legal document generation with WordPerfect integration

Current Status: COMPLETED

Required Components:

1.1 Document Template Management

  • Create DocumentTemplate model
    • Template name, description, file path
    • Category/area of law classification
    • Status (active/inactive)
    • Version tracking
  • Template upload and storage system
  • Template preview capabilities
  • Template search and filtering

1.2 Template Keyword/Index System

  • Create TemplateKeyword model for searchable tags
  • Keyword management interface
  • Advanced template search by keywords
  • Template categorization system

1.3 Data Merge Engine

  • Variable extraction from current data context
  • Merge field mapping system
  • Template variable substitution engine
  • Support for multiple output formats (PDF, DOCX)

1.4 Form Selection Interface

  • Multi-template selection UI
  • Template preview and description display
  • Batch document generation (planned for future iteration)
  • Generated document management (planned for future iteration)

API Endpoints Needed:

POST   /api/templates/upload
GET    /api/templates/search
POST   /api/templates/{id}/merge
GET    /api/templates/{id}/preview
POST   /api/documents/generate-batch

1.5 Storage and Upload (DOCX/PDF)

  • Accept .docx (mergeable) and .pdf (static/stampable) uploads
  • Store originals in object storage (S3/MinIO) with server-side encryption
  • Persist metadata: filename, MIME type, byte size, checksum (SHA-256), uploader, created_at
  • Virus scan and file-type sniffing (MIME > extension) (security enhancement for future)
  • Max size and extension allowlist validation
  • Optional tenant-aware storage prefixing (by environment/firm)

1.6 Template Versioning

  • Create DocumentTemplate and DocumentTemplateVersion models
    • DocumentTemplate: name, description, category, active, current_version_id
    • DocumentTemplateVersion: template_id, semantic version, storage_path, mime_type, checksum, changelog, created_by, created_at, is_approved
  • Upload new versions without breaking existing merges
  • Ability to pin a version for a batch/job
  • Approval workflow for promoting a draft version to current

1.7 Merge Engine (uses FormVariable/ReportVariable)

  • Variable syntax: {{ variable_identifier }} inside .docx templates
  • Resolution order (short-circuit on first hit):
    1. Explicit context passed by API (e.g., file_no, customer, logged_in_user)
    2. FormVariable by identifier → resolve via a safe, predefined repository function mapped from query
    3. ReportVariable by identifier → same safe resolution
    4. Built-ins/utilities (dates, formatting helpers)
  • Missing variable strategies: leave token, empty string, or raise warning (configurable)
  • Rendering engine: restricted Jinja2-like context with docxtpl for .docx
  • Output formats: .docx (native) and .pdf (convert via headless LibreOffice) (PDF conversion for future iteration)
  • Robust error reporting: unresolved variables list, stack traces (server logs), user-friendly message
  • Auditing: record variables resolved and their sources (context vs FormVariable/ReportVariable)

1.8 Batch Generation

  • Async queue jobs for batch merges (Celery/RQ) with progress tracking (future iteration)
  • Idempotency keys to avoid duplicate batches (future iteration)
  • Per-item success/failure reporting; partial retry support (future iteration)
  • Output bundling: store each generated document; optional ZIP download of the set (future iteration)
  • Throttling and concurrency limits (future iteration)
  • Audit trail: who initiated, when, template/version used, filters applied (future iteration)

1.9 UI for Templates, Keywords, Previews

  • Templates list/detail with version history and diff of changelog
  • Upload new version UI with changelog and approval checkbox
  • Keyword/tag management (create/read/update/delete) and filter by tags/category
  • Variable inspector: show {{ }} tokens discovered in the template and their resolution source
  • Preview with sample data (single-record merge); show unresolved variables warning
  • Batch generation wizard: choose template/version, select scope (files/customers), review count and estimated time, run asynchronously (future iteration)

1.10 Additional API Endpoints

✅ GET    /api/templates/{id}
✅ PUT    /api/templates/{id}
✅ POST   /api/templates/{id}/versions          # upload new version
✅ GET    /api/templates/{id}/versions          # list versions
✅ PUT    /api/templates/{id}/versions/{vid}    # approve/pin version
✅ GET    /api/templates/{id}/variables         # introspect template tokens
✅ POST   /api/templates/{id}/preview           # preview merge with sample/context
⏳ POST   /api/documents/jobs                   # start batch job (future iteration)
⏳ GET    /api/documents/jobs/{job_id}          # job status/progress (future iteration)
⏳ GET    /api/documents/jobs/{job_id}/result   # download bundle (ZIP) (future iteration)
✅ POST   /api/templates/{id}/keywords          # add/remove keywords

1.11 Acceptance Criteria

  • Upload .docx template, add keywords, create v1.0.0, preview succeeds with sample data
  • Merge uses FormVariable/ReportVariable when identifiers match tokens
  • Generate a batch of N files into PDFs; job completes with progress and downloadable ZIP (future iteration)
  • Version pinning respected; publishing new version does not alter prior batch outcomes
  • All actions logged with user and timestamp; unresolved variables surfaced in UI

🔴 2. QDRO (Pension Division) Module

Legacy Feature: Specialized module for Qualified Domestic Relations Orders

Current Status: COMPLETED

Required Components:

2.1 QDRO Data Model

  • Create QDRO model
    • File number reference
    • Version tracking
    • Plan information (name, type, administrator)
    • Participant details (employee, spouse/ex-spouse)
    • Division methodology (percentage, dollar amount, etc.)
    • Effective dates and conditions
  • Plan information database
  • QDRO version management

2.2 QDRO-Specific Forms

  • QDRO data entry interface
  • Plan information management
  • Participant role management
  • Division calculation tools

2.3 QDRO Document Generation

  • QDRO-specific templates
  • Integration with document assembly system
  • Version control for QDRO revisions
  • Court approval tracking

API Endpoints Needed:

✅ POST   /api/qdros
✅ GET    /api/qdros/{file_no}
✅ PUT    /api/qdros/{id}
✅ POST   /api/qdros/{id}/generate-document
✅ GET    /api/qdros/{id}/versions
✅ POST   /api/plan-info

🔴 3. Advanced Billing & Statement Generation

Legacy Feature: Automated billing statement generation with trust account management

Current Status: COMPLETED (core statement generation system implemented)

Implemented Components:

3.1 Statement Generation Engine

  • Create billing statement templates (StatementTemplate model)
  • Automated statement generation by file/client (BillingStatementService)
  • Customizable statement footers by file status (custom_footer field)
  • Statement preview and approval workflow (preview/approve endpoints)
  • Template-based HTML generation with Jinja2 engine
  • Default statement template with professional styling
  • Statement numbering system (STMT-YYYYMM-#### format)

3.2 Enhanced Trust Account Management

  • Trust account balance tracking per file (trust_balance field)
  • Trust account transaction integration (existing trust field in File model)
  • IOLTA compliance reporting (future enhancement)
  • Trust-to-fee transfer automation (future enhancement)
  • Trust account reconciliation tools (future enhancement)

3.3 Billing Workflow Management

  • Billed/unbilled transaction status tracking (billed field in Ledger model)
  • Statement approval and locking (StatementStatus enum with draft/approved/sent workflow)
  • Statement metadata tracking (approved_by, sent_by, timestamps)
  • Statement deletion controls (only draft statements can be deleted)
  • Bulk billing status updates (future enhancement)
  • Payment application workflow (future enhancement)
  • Account aging reports (future enhancement)

3.4 Advanced Financial Reports

  • Account balance summaries by employee (future enhancement)
  • Account aging reports (future enhancement)
  • Trust account activity reports (future enhancement)
  • Revenue reports by area of law (future enhancement)
  • Time utilization reports (future enhancement)

API Endpoints Implemented:

✅ GET    /api/billing/statement-templates         # List statement templates
✅ POST   /api/billing/statement-templates         # Create statement template  
✅ GET    /api/billing/statement-templates/{id}    # Get statement template
✅ PUT    /api/billing/statement-templates/{id}    # Update statement template
✅ DELETE /api/billing/statement-templates/{id}    # Delete statement template
✅ GET    /api/billing/billing-statements          # List billing statements
✅ POST   /api/billing/billing-statements          # Create billing statement
✅ GET    /api/billing/billing-statements/{id}     # Get billing statement
✅ POST   /api/billing/billing-statements/{id}/generate-html  # Generate HTML
✅ POST   /api/billing/billing-statements/{id}/approve       # Approve statement
✅ POST   /api/billing/billing-statements/{id}/send          # Mark as sent
✅ GET    /api/billing/billing-statements/{id}/preview       # Preview HTML
✅ DELETE /api/billing/billing-statements/{id}     # Delete draft statement
⏳ PUT    /api/financial/transactions/bulk-bill    # Future enhancement
⏳ GET    /api/reports/trust-account               # Future enhancement
⏳ GET    /api/reports/account-aging               # Future enhancement

MEDIUM PRIORITY - Productivity Features

🟡 4. Integrated Time Tracking

Legacy Feature: Built-in timer with start/stop functionality

Current Status: COMPLETED (comprehensive time tracking system implemented)

Implemented Components:

4.1 Timer System

  • Real-time timer with start/stop/pause/resume functionality (Timer model with TimerStatus enum)
  • Timer state persistence across sessions (TimerSession model for detailed tracking)
  • Multiple concurrent timers by file/task (automatic pause of other timers when starting new one)
  • Timer integration with transaction entry (convert_time_entry_to_ledger method)
  • Timer templates for quick creation of common task timers (TimerTemplate model)
  • Timer categorization by task type (research, drafting, client_call, etc.)

4.2 Time Entry Automation

  • Auto-populate time entries from timer (create_time_entry_from_timer method)
  • Default rate assignment by employee/file (hourly_rate from File model or user override)
  • Automatic quantity calculation (hours computed from timer duration)
  • Timer history and reporting (TimerSession tracking, timer statistics)
  • Manual time entry creation (for non-timer based time logging)
  • Time entry approval workflow (approved/approved_by fields)

4.3 Advanced Features

  • Billable vs non-billable time tracking (TimerType enum)
  • Multiple timer types (billable, non_billable, administrative)
  • Timer statistics and reporting (total hours, billable percentage, etc.)
  • Time entry to ledger conversion (automatic billing transaction creation)
  • File and customer assignment for timers
  • Detailed session tracking with pause/resume cycles

API Endpoints Implemented:

✅ GET    /api/timers/                           # List user timers
✅ POST   /api/timers/                           # Create timer
✅ GET    /api/timers/{id}                       # Get timer details
✅ PUT    /api/timers/{id}                       # Update timer
✅ DELETE /api/timers/{id}                       # Delete timer
✅ POST   /api/timers/{id}/start                 # Start timer
✅ POST   /api/timers/{id}/pause                 # Pause timer
✅ POST   /api/timers/{id}/resume                # Resume timer
✅ POST   /api/timers/{id}/stop                  # Stop timer
✅ POST   /api/timers/{id}/create-entry          # Create time entry from timer
✅ GET    /api/timers/time-entries/              # List time entries
✅ POST   /api/timers/time-entries/              # Create manual time entry
✅ POST   /api/timers/time-entries/{id}/convert-to-billing  # Convert to ledger
✅ GET    /api/timers/templates/                 # List timer templates
✅ POST   /api/timers/templates/                 # Create timer template
✅ GET    /api/timers/statistics/                # Get timer statistics
✅ GET    /api/timers/active/                    # Get active timers

Database Models Created:

  • Timer - Active timer sessions with start/stop/pause functionality
  • TimeEntry - Completed time entries that can be billed
  • TimerSession - Individual timer sessions for detailed tracking
  • TimerTemplate - Predefined templates for common tasks

🟡 5. Enhanced File Management

Legacy Feature: Advanced file operations and status management

Current Status: COMPLETED

Implemented Components:

5.1 File Closure Automation

  • Automatic file closure workflow with business rule validation
  • Outstanding balance payment entry creation
  • File closure validation and confirmations
  • File reopening capabilities with status validation

5.2 File Status Workflow

  • Enhanced file status definitions with transition rules
  • Status-based business rule enforcement
  • Status transition validation (NEW → ACTIVE → CLOSED → ARCHIVED)
  • Complete status history tracking with audit trail

5.3 File Organization

  • Archive file management with location tracking
  • Bulk file status updates for multiple files
  • File transfer between attorneys with rate updates
  • File transfer history and approval tracking

API Endpoints Implemented:

✅ POST   /api/file-management/{file_no}/close
✅ POST   /api/file-management/{file_no}/reopen
✅ POST   /api/file-management/bulk-status-update
✅ POST   /api/file-management/{file_no}/transfer
✅ POST   /api/file-management/{file_no}/archive
✅ POST   /api/file-management/{file_no}/change-status
✅ GET    /api/file-management/{file_no}/status-history
✅ GET    /api/file-management/{file_no}/transfer-history
✅ GET    /api/file-management/closure-candidates

🟡 6. Advanced Printer Management

Legacy Feature: Sophisticated printer configuration and report formatting

Current Status: Not implemented

Required Components:

6.1 Printer Configuration

  • Printer setup database
  • Escape sequence management
  • Default printer selection
  • Report-specific printer settings

6.2 Report Output Management

  • Multiple output destinations (printer/screen/file)
  • Print preview functionality
  • Batch printing capabilities
  • Print queue management

Note: Modern web applications typically rely on browser printing, but for a legal office, direct printer control might still be valuable.


LOW PRIORITY - Nice-to-Have Features

🟢 7. Calendar/Appointment System

Legacy Feature: Calendar management with appointment archival

Current Status: Not implemented

Required Components:

7.1 Calendar Management

  • Create Calendar and Appointment models
  • Calendar views (day/week/month)
  • Appointment scheduling and management
  • Conflict detection and resolution

7.2 Integration Features

  • File-related appointment linking
  • Court date tracking
  • Deadline management
  • Automatic archival of old appointments

🟢 8. Enhanced Lookup Table Management

Legacy Feature: Comprehensive lookup table administration

Current Status: ⚠️ Basic lookup management exists

Missing Components:

8.1 Advanced Lookup Management

  • Dynamic lookup table creation
  • Lookup table relationships
  • Import/export of lookup data
  • Lookup table versioning

8.2 Business Rule Configuration

  • Configurable validation rules
  • Dynamic field requirements
  • Custom calculation formulas
  • Workflow automation rules

🟢 9. Enhanced Search Capabilities

Legacy Feature: Complex multi-criteria search dialogs

Current Status: Good search exists, but could be enhanced

Potential Improvements:

9.1 Advanced Search Features

  • Saved search templates
  • Complex boolean search operators
  • Search history and favorites
  • Export search results to various formats

9.2 Search Performance

  • Search result caching
  • Async search for large datasets
  • Search analytics and optimization
  • Full-text search across documents

SYSTEM ARCHITECTURE IMPROVEMENTS

🔵 10. Workflow Engine

Legacy Feature: Implicit workflow through business rules

Current Status: Not implemented

Potential Implementation:

10.1 Workflow Definition

  • Create workflow definition system
  • State machine implementation
  • Conditional workflow paths
  • Workflow versioning

10.2 Process Automation

  • Automatic task assignment
  • Email notifications and reminders
  • Document generation triggers
  • Status update automation

🔵 11. Audit and Compliance

Legacy Feature: Basic data integrity checks

Current Status: ⚠️ Basic audit logging exists

Enhanced Features:

11.1 Comprehensive Audit Trail

  • Detailed change tracking
  • User action logging
  • Data access monitoring
  • Compliance reporting
  • Client confidentiality controls
  • Data retention policies
  • Bar association compliance reporting
  • Trust account regulatory compliance

🔵 12. Integration Platform

Legacy Feature: WordPerfect and DOS integration

Current Status: No external integrations

Modern Integrations:

12.1 Office Suite Integration

  • Microsoft Office integration
  • Google Workspace integration
  • PDF generation and manipulation
  • Email integration (Outlook/Gmail)
  • Court filing systems
  • Legal research platforms (Westlaw/Lexis)
  • Accounting software integration
  • Case management platforms

IMPLEMENTATION ROADMAP

Phase 1: Core Business Features (3-6 months)

  1. Document Assembly System
  2. QDRO Module
  3. Advanced Billing & Statement Generation

Phase 2: Productivity Features (2-4 months)

  1. Integrated Time Tracking
  2. Enhanced File Management
  3. Advanced Printer Management

Phase 3: System Enhancements (2-3 months)

  1. Calendar/Appointment System
  2. Enhanced Lookup Management
  3. Workflow Engine

Phase 4: Integration and Compliance (1-2 months)

  1. Audit and Compliance
  2. Integration Platform
  3. Performance Optimization

TECHNICAL CONSIDERATIONS

Database Schema Changes Required

  • New tables: document_templates, template_keywords, qdros, plan_info, timers, workflows
  • Extended tables: Enhanced financial_transactions, files, customers
  • Audit tables: Comprehensive change tracking

API Architecture Extensions

  • Document generation microservice
  • Timer/time tracking service
  • Workflow engine service
  • Notification service

Frontend Architecture

  • Document preview components
  • Timer widgets
  • Advanced form builders
  • Report generation interfaces

Infrastructure Requirements

  • Document storage (S3/MinIO)
  • Background job processing (Celery/RQ)
  • Real-time updates (WebSocket)
  • Print server integration (if required)

SUCCESS METRICS

Business Impact

  • Reduction in document preparation time
  • Improved billing accuracy and speed
  • Enhanced client service delivery
  • Compliance with legal practice standards

Technical Performance

  • Document generation time < 5 seconds
  • Search response time < 500ms
  • 99.9% system uptime
  • Zero data loss incidents

User Adoption

  • 100% user migration from legacy system
  • Reduced training time for new users
  • Positive user satisfaction scores
  • Increased productivity metrics

ESTIMATED EFFORT

Development Time (Person-Months)

  • High Priority Features: 8-12 months
  • Medium Priority Features: 4-6 months
  • Low Priority Features: 3-4 months
  • System Architecture: 2-3 months

Total Estimated Effort: 17-25 person-months

Team Recommendations

  • 1 Full-stack Developer (lead)
  • 1 Backend Developer (APIs/database)
  • 1 Frontend Developer (UI/UX)
  • 1 DevOps Engineer (part-time)
  • 1 Legal Domain Expert (consultant)

This TODO list should be regularly updated as features are implemented and new requirements are discovered.