Issue: #278 — Support financially active contracts (loans, leases, subscriptions) Date: 2026-02-22
Contracts with recurring financial obligations (loans, leases, insurance, subscriptions) are classified as generic contracts, indistinguishable from NDAs or framework agreements. Finance teams cannot filter or identify them at a glance.
Expand contract-type from 6 values to 11:
| Type | German Examples | Financially Active |
|---|---|---|
loan |
Darlehensvertrag, Kreditvertrag, Finanzierungsvertrag | Yes |
lease |
Leasingvertrag (equipment, vehicles, machinery) | Yes |
rental |
Mietvertrag, Pachtvertrag (real estate, space) | Yes |
insurance |
Versicherungsvertrag, Versicherungspolice | Yes |
subscription |
SaaS-Vertrag, Lizenzvertrag (recurring), Wartungsvertrag | Yes |
purchase |
Kaufvertrag, Erwerbsvertrag | No |
service |
Dienstleistungsvertrag, Beratungsvertrag | No |
supply |
Liefervertrag, Beschaffungsvertrag | No |
nda |
Geheimhaltungsvereinbarung, NDA | No |
framework |
Rahmenvertrag, Master Agreement | No |
other |
Anything else | No |
No database migration needed — contract-type is stored in structured_data JSONB, not as a PostgreSQL enum.
Pure function, derived from contract-type:
(def financially-active-types #{"loan" "lease" "rental" "insurance" "subscription"})
(defn financially-active? [contract-type] (contains? financially-active-types contract-type))
No DB column, no trigger changes. Used by UI layer only.
Update the classification prompt in classification.clj to teach the LLM about expanded contract types with German examples. Key disambiguation rules:
rental (real estate/space)lease (equipment, vehicles)loaninsurancesubscriptionpurchaseUpdate the contract extraction prompt to include the expanded contract-type enum so the LLM returns correct values during extraction.
Update contract-type enum in schema/contract/structured_data.clj:
[:enum "loan" "lease" "rental" "insurance" "subscription" "purchase"
"service" "supply" "nda" "framework" "other"]
Contracts where financially-active? returns true show a "Financial" badge (blue/teal) alongside lifecycle badges (Active/Expiring/Expired).
Show contract sub-type as a secondary badge (e.g., "Loan", "Lease", "Rental") on the document list for all contracts.
Add a filter option on the Document Management page. SQL:
WHERE document.type = 'contract'
AND document.structured_data->>'contract-type'
IN ('loan','lease','rental','insurance','subscription')
other