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.
The DynamoDB stream on this table triggers the
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.
The
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.
GSI-2 uses a composite key
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.
All eight tables share the same schema:
Vendor configuration
VendorConfig
Drives automated retail invoice fetching. Each item represents one vendor with email patterns, subject keywords, and parser configuration.
Attributes per item include:
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.
Both read and write capacity are scaled independently using the same target utilization (70%). All other tables use
PAY_PER_REQUEST billing and do not require autoscaling configuration.