aws-infra-terraform/dynamodb.tf. All tables have server-side encryption enabled.
Rental invoices
RentalInvoices
Stores parsed rental invoice data. This is the primary table for the rental invoice feature.| Property | Value |
|---|---|
| Billing mode | PROVISIONED (5 RCU / 5 WCU base) |
| Partition key | UserID (String) |
| Sort key | InvoiceID (String) |
| GSI | due_date_year-due_date_month-index (hash: due_date_year, range: due_date_month) |
| Stream | NEW_AND_OLD_IMAGES |
| Encryption | Server-side (AES-256) |
send_invoice_notification Lambda whenever a new invoice record is inserted.
Autoscaling is configured separately — see Autoscaling below.
Users
Users
Stores user account information and Gmail connection state.| Property | Value |
|---|---|
| Billing mode | PAY_PER_REQUEST |
| Partition key | UserID (String) |
| GSI | Email-index (hash: Email) |
Email-index GSI supports login lookups by email address without a full table scan. The table also stores a last_retail_invoice_fetch timestamp used for incremental retail invoice fetching.
Retail invoices
RetailInvoices
Base table for retail invoices. Contains summary metadata for every retail invoice across all categories.| Property | Value |
|---|---|
| Billing mode | PAY_PER_REQUEST |
| Partition key | UserID (String) |
| Sort key | InvoiceID (String) |
| GSI-1 | invoice_date-index (hash: UserID, range: invoice_date) |
| GSI-2 | sub_type-invoice_date-index (hash: UserID_SubType, range: invoice_date) |
| Stream | NEW_AND_OLD_IMAGES |
| Point-in-time recovery | Enabled |
| Encryption | Server-side (AES-256) |
UserID_SubType (e.g., user_abc123_food-delivery) to efficiently retrieve all invoices for a user within a specific category.
Attributes stored per item include: vendor_name, sub_type, total_amount, currency, invoice_date, s3_path.
Retail detail tables
Each retail category has a dedicated detail table keyed byInvoiceID. These hold category-specific line-item data parsed from the invoice HTML.
| Table name | Variable default |
|---|---|
FoodDeliveryInvoices | food_delivery_invoices_table |
ClothingInvoices | clothing_invoices_table |
TechnologyInvoices | technology_invoices_table |
SubscriptionInvoices | subscription_invoices_table |
GroceryInvoices | grocery_invoices_table |
MiscellaneousUtilityInvoices | misc_utility_invoices_table |
MiscellaneousInvoices | misc_invoices_table |
TravelInvoices | travel_invoices_table |
| Property | Value |
|---|---|
| Billing mode | PAY_PER_REQUEST |
| Partition key | InvoiceID (String) |
| Encryption | Server-side (AES-256) |
Vendor configuration
VendorConfig
Drives automated retail invoice fetching. Each item represents one vendor with email patterns, subject keywords, and parser configuration.| Property | Value |
|---|---|
| Billing mode | PAY_PER_REQUEST |
| Partition key | vendor_id (String) |
| Encryption | Server-side (AES-256) |
vendor_name, invoice_sub_type, email_patterns, subject_keywords, parser_type, and an active status flag. Adding a new vendor to this table enables invoice fetching for that vendor without any code changes.
Autoscaling
Read and write autoscaling is configured for theRentalInvoices table in dynamodb_autoscaling.tf.
| Setting | Value |
|---|---|
| Min capacity | 1 unit |
| Max capacity | 10 units |
| Target utilization | 70% |
| Scale-in cooldown | 60 seconds |
| Scale-out cooldown | 60 seconds |
PAY_PER_REQUEST billing and do not require autoscaling configuration.