Skip to content

Reporting

The apps.reporting module generates business and regulatory reports asynchronously via Celery.

Report Types

Report Description
Portfolio summary Active balances, counts, weighted avg rate per portfolio
Delinquency aging 30/60/90/120+ day aging buckets with amounts
Payment activity Payment volume and breakdown over a date range
Interest income Earned vs. accrued interest over a date range
Charge-off / recovery Charge-offs, write-offs, and post-charge-off recoveries
Collection performance PTP rates, contact rates, cure rates per collector and queue
Modification summary Modification volume by type, before/after term comparison
Loan tape Full loan-level data export for investors and auditors
Trial balance Ledger trial balance as of a specified date
General ledger Full GL detail for a date range
Compliance summary Pass/fail rates across all compliance rules
Fee revenue Fee income by type, waivers, and net revenue
Portfolio returns IRR and MOIC per portfolio, program, and vintage
Loan profitability Per-loan IRR and total return

Report Generation Flow

1. User requests report via API (or scheduled trigger)
2. Report record created with status "pending"
3. Celery task dispatched for async generation
4. Report generator processes data
5. Output written (CSV or XLSX)
6. Status updated to "completed" with file URL

Report Model

Field Description
report_type Type of report
status pending, generating, completed, or failed
parameters JSONB with report parameters (date range, portfolio, etc.)
report_data JSONB with generated report data
output_format CSV or XLSX
file_url URL to download the generated file
generated_at Completion timestamp
error_message Error details (if failed)

Provider Pattern

Reports use the ReportGeneratorProtocol provider pattern for extensibility:

  • Each report type has a dedicated generator implementation
  • Generators are registered in the provider registry
  • New report types can be added without modifying existing code

See Provider Pattern for implementation details.

Output Formats

Format Use Case
CSV Data analysis, import into other systems
XLSX Human review, formatted output with headers

Key Reports

Portfolio Summary

Aggregated metrics per portfolio:

  • Total principal outstanding
  • Loan count
  • Weighted average interest rate
  • Delinquency breakdown

Delinquency Aging

Aging analysis across all delinquency buckets:

  • Loan count and total amount per bucket
  • Transition rates between buckets
  • Historical trend data

Loan Tape

Comprehensive loan-level export for investors:

  • All loan fields (balances, rates, statuses, dates)
  • Payment history summary
  • Delinquency history
  • Configurable field selection via Loan Tape Config

Trial Balance

Ledger trial balance as of a specified date:

  • All GL account balances
  • Debit/credit totals
  • Verification that the ledger balances

See General Ledger for ledger structure.

See Also