Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor transaction enrichment to support batch processing #1803

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Shpigford
Copy link
Member

No description provided.

- Add method to enrich transactions in batches
- Implement job scheduling for unenriched transactions
- Improve logging and error handling for transaction enrichment
@Shpigford Shpigford requested a review from zachgoll February 4, 2025 20:30
app/models/account/data_enricher.rb Outdated Show resolved Hide resolved
app/models/account/data_enricher.rb Outdated Show resolved Hide resolved
- Update queries to explicitly join and reference account_entries and account_transactions tables
- Remove unnecessary name presence check before enrichment
- Improve query precision for unenriched transaction selection
candidates = account.entries.account_transactions.includes(entryable: [ :merchant, :category ])
total_unenriched = account.entries.account_transactions
.joins(:entryable)
.where("account_entries.enriched_at IS NULL OR account_transactions.merchant_id IS NULL OR account_transactions.category_id IS NULL")
Copy link
Member Author

@Shpigford Shpigford Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zachgoll Is the entryable join necessary? AI seems to think so.

@Shpigford Shpigford requested a review from zachgoll February 5, 2025 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants