Loan Applications
Description
The Loan Application entity represents a user’s application for a loan. Applications go through underwriting and are either approved or rejected. Approved applications have a TTL and will expire if not converted to a loan within 24 hours.
Storage
| Environment | Table Name | Region |
|---|---|---|
test |
test-loc-service |
us-west-2 |
prod |
prod-loc-service |
us-east-2 |
Fields
| Field | Type | Description |
|---|---|---|
|
String |
User ID who owns the application |
|
String |
Unique application identifier (UUID) |
|
String |
Loan ID if application was converted (empty if not yet converted) |
|
String |
Pre-assigned loan number for this application |
|
String |
S3 key for the generated loan agreement PDF |
|
String |
Application status: |
|
Array |
List of reasons if application was rejected |
|
Integer |
Unix timestamp for DynamoDB TTL (only for approved applications) |
|
Integer |
Approved loan amount in cents |
|
String |
Fee type: |
|
Integer |
Origination fee amount in cents |
|
Float |
Origination fee as a percentage |
|
Integer |
Total amount to repay in cents |
|
Integer |
Amount to be sent to user in cents |
|
String |
Payment frequency: |
|
Array |
Proposed installment schedule with amounts and due dates |
|
String |
Creation timestamp (RFC3339) |
|
String |
Last update timestamp (RFC3339) |
Query Patterns
| Query | Index | Key Condition | Sort Key Condition |
|---|---|---|---|
Get application by user and ID |
Primary |
|
|
List all applications for user |
Primary |
|
|
TTL and Expiration
Approved loan applications have a 24-hour TTL. When the TTL expires:
-
DynamoDB automatically deletes the record
-
The deletion triggers a DynamoDB Stream event
-
The expiration handler processes the event
-
If no loan was created, the application is re-saved with
ABANDONEDstatus
This ensures that approved applications that are never accepted are properly tracked and don’t remain in an indefinite approved state.
Related Entities
-
Loans - Loan created from this application