This means you can now schedule transactions for your credit cards, choosing between installment-based payments or recurring ones.
Here's what I changed:
- I added a new `ScheduledTransaction` model. This will keep track of all the details for these scheduled payments, like how often they occur, the number of installments, the date of the next payment, and so on.
- I set up connections between `ScheduledTransaction` and `Account`, `Category`, and `Merchant`.
- I created a background process, `CreateTransactionsFromScheduledJob`. This process will run regularly to:
- Find any scheduled transactions that are due.
- Create the necessary `Transaction` and `Entry` records for them.
- Update the `next_occurrence_date` for the scheduled transaction.
- Manage the lifecycle of these transactions. For installments, this means increasing the count and removing the schedule when it's complete. For recurring transactions, it means removing the schedule if it's past its end date.
- I updated the user interface for Credit Cards:
- I added a new section under each credit card where you can see and manage its scheduled transactions.
- I implemented a new nested controller, `CreditCards::ScheduledTransactionsController`, to handle creating, viewing, editing, and deleting these scheduled transactions.
- I created new views and partials to display the list of scheduled transactions and a form for creating or editing them, using Turbo Streams for a smoother experience.
- I made sure that your existing transaction views will correctly show transactions generated by this new process.
- I added model tests for `ScheduledTransaction`, job tests for `CreateTransactionsFromScheduledJob`, and controller/integration tests for the new UI.
**Important Notes:**
- I generated the database migration for `ScheduledTransaction` (`db/migrate/20250524135137_create_scheduled_transactions.rb`), but I couldn't run it because of an ongoing PostgreSQL issue in my automated environment. You'll need to run this migration manually.
- Similarly, I've written the new tests, but I couldn't execute them to confirm they pass due to the same database connectivity problem. You'll need to run and verify these tests in an environment where PostgreSQL is working correctly.
Breaks our Plaid sync process out into more manageable classes. Notably, this moves the sync process to a distinct, 2-step flow:
1. Import stage - we first make API calls and import Plaid data to "mirror" tables
2. Processing stage - read the raw data, apply business rules, build internal domain models and sync balances
This provides several benefits:
- Plaid syncs can now be "replayed" without fetching API data again
- Mirror tables provide better audit and debugging capabilities
- Eliminates the "all or nothing" sync behavior that is currently in place, which is brittle
- Update BalanceSheet model to directly calculate account weights based on converted balances.
- Modify dashboard view to compute account weight as a percentage of classification total, enhancing clarity.
- Adjust group weight partial to handle effective weight, ensuring accurate rendering of weight representation.
- Add caching for classification groups and account groups in the BalanceSheet model to improve performance.
- Update views for accountable sparklines to utilize caching for rendered HTML, enhancing load times and reducing database queries.
- Implement caching for transaction totals to enhance performance, using a unique cache key based on family ID and search parameters.
- Adjust default date filter logic to use the user's preferred period when no explicit date filters are provided, reducing the load on the database for large datasets.
Note to self hosters:
If you started self hosting prior to this commit, you may have duplicate securities in your database.
This is usually not a problem, but if you'd like to clean things up, you can run the data migration
by opening a terminal on the machine you're hosting with and running:
```sh
rake data_migration:migrate_duplicate_securities
```
* Setup health check
* Security health checker cron
* Use resolver throughout codebase
* Use resolver for trade builder
* Add security health checks to schedule
* Handle no provider
* Lint fixes
* Add new chat button
* Tweak chat navigation
* Fix chat nav padding on new chat
* Make the button nicer
* Fix bad tailwind class
* Use menu icon instead of left
* Fix path
* Use rounded-full on budget allocation bar
* Fix backgrounds when balance sheet groups are open
* Add rulers between accounts and classification groups in balance sheet and account groups views.
* Update Security model to include country_code in the data definition.
* Modify Provider::SecurityConcept to define country_code for security.
* Enhance Provider::Synth to extract country_code from security data.
* Update Security::Provided to include country_code when creating security instances.
* Adjust Security::SynthComboboxOption to add country_code as an attribute.
* Revise combobox_security partial to conditionally display country flag and code.
* Create shared ruler view
* Use collection rendering/spacer templates for rules, and new shared_ruler
* Use shared ruler for all the places a ruler is used
* Use shared ruler for imports and balance sheet
* Fix brakeman by using a static partial with a defined collection
* Standardize & improve a bunch of corners, fix some backgrounds, fix merchants for dark mode
* Update balance sheet
* misc cleanup
* Fix import table
* Remove middot
* Create shared ruler view
* Use collection rendering/spacer templates for rules, and new shared_ruler
* Use shared ruler for all the places a ruler is used
* Use shared ruler for imports and balance sheet
* Fix brakeman by using a static partial with a defined collection
* Update balance sheet
* Enhance cash flow dashboard with new cash flow period handling and improved Sankey diagram rendering. Update D3 and related dependencies for better performance and features.
* Fix Rubocop offenses
* Refactor Sankey chart controller to use Number.parseFloat for value formatting and improve code readability by restructuring conditional logic for node shapes.