Skip to content

Model Reference

Complete inventory of all Django models organized by app.

Base Mixins

All tenant models inherit from mixins in common/models.py:

Mixin Fields Description
UUIDPrimaryKey id (UUID) Auto-generated UUIDv4 primary key
Timestamped created_at, updated_at Auto-set timestamps
ExternalID external_id (str, nullable) External system identifier, unique per tenant
Archivable is_archived (bool), archived_at (datetime) Soft-delete support

Model Inventory

Tenants (apps.tenants) --- Public Schema

Model Key Fields Tracked
Tenant name, slug, status, locale, timezone, default_currency, features (JSONB) ---
Domain domain, is_primary, tenant (FK) ---

Users (apps.users) --- Main + Tenant Schemas

Model Key Fields Tracked
User email, first_name, last_name, tenant_id, tenant_role, is_active, is_superadmin ---

Borrowers (apps.borrowers)

Model Key Fields Tracked
Borrower first_name, last_name, ssn_last_four, annual_income, language_preference, do_not_contact Yes
LoanParty borrower (FK), loan (FK), role, liability_type ---
BorrowerIdentity borrower (FK), document_type, document_number, expiration_date ---
BorrowerConsent borrower (FK), consent_type, granted_at, ip_address ---
PaymentInstrument borrower (FK), instrument_type, account_number_masked, is_default ---
AutopayPlan borrower (FK), loan (FK), frequency, amount_type, is_active ---
BusinessDetail borrower (FK), business_name, ein, entity_type, annual_revenue ---

Programs (apps.programs)

Model Key Fields Tracked
LendingProgram program_type, day_count_convention, accrual_method, payment_allocation_order (JSONB) ---
Product program (FK), interest_rate_type, default_interest_rate, term/amount limits ---
IndexRate index_name, rate, effective_date, trailing_12_month_average ---
PromotionalProgram program (FK), promo_type, start/end_date, apr ---

Loans (apps.loans)

Model Key Fields Tracked
Loan loan_number, borrower (FK), program (FK), product (FK), principal_amount, current_balance, interest_rate, status, sub_status, delinquency_bucket, days_past_due Yes
PromoRate loan (FK), rate, start/end_date ---
RateCap loan (FK), cap_type, max_rate, regulation ---
Draw loan (FK), draw_number, amount, current_balance, maturity_date ---
Purchase draw (FK), amount, description, purchase_date ---

Amortization (apps.amortization)

Model Key Fields Tracked
AmortizationSchedule loan (FK), period_number, due_date, principal_due, interest_due, total_due, status, is_deferred ---

Payments (apps.payments)

Model Key Fields Tracked
Payment loan (FK), amount, principal/interest/fees_applied, payment_date, payment_method, status, transaction_type Yes
RecurringPayment loan (FK), frequency, next_payment_date, is_active ---

Fees (apps.fees)

Model Key Fields Tracked
FeeSchedule product (FK), fee_type, calculation_method, trigger, amount, grace_period_days, max_occurrences ---
Fee loan (FK), fee_schedule (FK), amount, status, assessed_date, waived_by, waived_at Yes

Servicing (apps.servicing)

Model Key Fields Tracked
LoanModification loan (FK), modification_type, status, terms_before (JSONB), terms_after (JSONB) Yes
Forbearance loan (FK), forbearance_type, start/end_date, post_forbearance_action, interest_accrues Yes
Deferment loan (FK), periods_deferred, deferred_amount, interest_treatment Yes
PromiseToPay loan (FK), promised_amount, promised_date, status ---
PayoffQuote loan (FK), principal_balance, accrued_interest, total_payoff, good_through_date ---
SuspenseAccount loan (FK), amount, source_payment (FK), status ---
PaymentPlan loan (FK), plan_type, installment_amount, frequency, settlement_pct Yes
ServiceCredit loan (FK), credit_type, amount Yes
Form1099C loan (FK), forgiveness_amount, tax_year ---

Collateral (apps.collateral)

Model Key Fields Tracked
CollateralItem loan (FK), collateral_type, estimated_value, status, meta_data (JSONB) Yes
CollateralLien collateral_item (FK), lien_position, filing_type, filing_number, expiration_date Yes
CollateralValuation collateral_item (FK), valuation_type, value, valuation_date, appraiser ---

Disbursements (apps.disbursements)

Model Key Fields Tracked
Disbursement loan (FK), amount, method, status, recipient_type, disbursed_by (FK) ---

Collections (apps.collections)

Model Key Fields Tracked
DelinquencyRecord loan (FK), days_past_due, delinquency_bucket, amount_past_due, assigned_collector ---
CollectionQueue name, priority, assignment_rules (JSONB), is_active ---
DunningSchedule program (FK), dpd_trigger, channel, template_name, suppress_during ---
CollectionAgency name, commission_type, commission_rate ---
CollectionAction loan (FK), action_type, result, notes, next_action_date ---
PreDelinquencyRule trigger_type, dpd_threshold, action ---

Ledger (apps.ledger)

Model Key Fields Tracked
Account code, name, account_type, parent (self-FK), is_system ---
JournalEntry entry_number, entry_date, effective_date, description, posted, source_type/source_id ---
JournalLine journal_entry (FK), account (FK), debit, credit, loan (FK) ---

Documents (apps.documents)

Model Key Fields Tracked
Document document_type, file_name, mime_type, file_hash, status, storage_key ---

Portfolio (apps.portfolio)

Model Key Fields Tracked
Portfolio name, program (FK), status, criteria (JSONB) ---
PortfolioSnapshot portfolio (FK), snapshot_date, total_balance, loan_count, irr, moic ---
Investor name, investor_type ---
LoanAssignment loan (FK), investor (FK), assignment_date, purchase_price ---
LoanTapeConfig portfolio (FK), tape_format, tape_schedule, required_fields (JSONB) ---

Compliance (apps.compliance)

Model Key Fields Tracked
ComplianceRule rule_type, regulation, program (FK), config (JSONB), is_active ---
ComplianceCheck rule (FK), loan (FK), status, details (JSONB) ---
ComplianceMonitor monitor_type, borrower (FK), match_confidence, hit_details (JSONB) ---
CreditReporting loan (FK), credit_bureau, status, data_submitted (JSONB) ---
CreditDispute loan (FK), dispute_type, status, resolved_at ---

Communications (apps.communications)

Model Key Fields Tracked
CommunicationTemplate channel, template_type, program (FK), language, subject_template, body_template ---
CommunicationLog borrower (FK), loan (FK), channel, recipient, status, provider_name, triggered_by ---

Cases (apps.cases)

Model Key Fields Tracked
Case borrower (FK), case_type, status, priority, assigned_to (FK), sla_deadline ---
Interaction case (FK), direction, channel, interaction_type, notes, duration ---
Supercase name, case_type, status ---
SupercasePopulation supercase (FK), name, criteria (JSONB) ---
Campaign name, campaign_type, channel, template_name, filter_criteria (JSONB), status ---

Operations (apps.operations)

Model Key Fields Tracked
LoanEvent loan (FK), event_type, event_data (JSONB), effective_date, sequence_number ---

Providers (apps.providers)

Model Key Fields Tracked
ProviderConfig label, service_type, provider_key, config (JSONB, encrypted), is_active ---
ProviderAssignment program (FK), provider_config (FK), service_type, capability ---

Tasks (apps.tasks)

Model Key Fields Tracked
Task title, description, status, priority, assigned_to (FK), due_date ---

Notes (apps.notes)

Model Key Fields Tracked
Note subject, body, author (FK), is_pinned ---

Contacts (apps.contacts)

Model Key Fields Tracked
Address street_line_1/2, city, state, postal_code, country, is_primary, label ---
EmailContact email, is_primary, label, is_verified ---
PhoneContact phone (PhoneNumberField), phone_type, is_primary, is_verified ---

Webhooks (apps.webhooks)

Model Key Fields Tracked
WebhookSubscription url, events (array), is_active, secret ---
WebhookDelivery subscription (FK), event_type, payload, response_status ---

Generic Foreign Key Models

These models attach to multiple entity types via Django's contenttypes framework:

Model Attaches To
Address Borrower, and others
EmailContact Borrower, and others
PhoneContact Borrower, and others
Note Borrower, Loan, and others
Task Borrower, Loan, and others

See Also