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

Rename-accounts-to-wallets #140

Merged
merged 2 commits into from
Aug 13, 2024
Merged

Conversation

EduardSchwarzkopf
Copy link
Owner

@EduardSchwarzkopf EduardSchwarzkopf commented Aug 13, 2024

Summary by Sourcery

Rename 'accounts' to 'wallets' throughout the codebase, including in models, services, routes, templates, and tests, to align with updated terminology and improve consistency across the application.

Enhancements:

  • Rename all instances of 'account' to 'wallet' across the codebase, including variable names, function names, and comments, to reflect a shift in terminology.
  • Update database schema and migration scripts to replace 'accounts' with 'wallets', ensuring consistency in database operations and constraints.
  • Modify API endpoints and routes to use 'wallets' instead of 'accounts', aligning with the new terminology.
  • Adjust templates and UI elements to reflect the change from 'accounts' to 'wallets', ensuring user-facing components are updated.

Tests:

  • Update test cases to reflect the change from 'accounts' to 'wallets', ensuring all test scenarios are aligned with the new terminology.
  • Modify test fixtures and utilities to support the updated 'wallet' terminology, maintaining test coverage and functionality.

Copy link
Contributor

sourcery-ai bot commented Aug 13, 2024

Reviewer's Guide by Sourcery

This pull request renames "accounts" to "wallets" throughout the codebase. It's a comprehensive change that affects multiple files, including models, services, routers, templates, and utility functions. The change is primarily a renaming operation, with minimal functional changes to the application logic.

File-Level Changes

Files Changes
app/models.py Renamed 'Account' model to 'Wallet' and updated all related fields and relationships
alembic/versions/b8097c295e4a_update_transaction_model.py
alembic/versions/544b25e4c6f6_cascade_on_delete.py
alembic/versions/4885a032ce2e_init.py
Updated database migration scripts to reflect the change from 'accounts' to 'wallets'
app/services/wallets.py
app/services/base_transaction.py
app/services/scheduled_transactions.py
app/services/transactions.py
Renamed 'AccountService' to 'WalletService' and updated all related methods
app/routers/api/wallets.py
app/routers/api/transactions.py
app/routers/api/scheduled_transactions.py
Updated API routers to use 'wallets' instead of 'accounts'
app/routers/wallets.py
app/routers/transactions.py
app/routers/scheduled_transactions.py
templates/pages/dashboard/page_list_wallets.html
templates/pages/dashboard/page_single_wallet.html
templates/pages/dashboard/page_form_wallet.html
Updated page routers and templates to reflect the change from 'accounts' to 'wallets'
app/utils/wallet_utils.py
app/utils/template_utils.py
app/config.py
Updated utility functions and configuration to use 'wallet' terminology
tests/api/test_api_transactions.py
tests/api/test_api_wallets.py
tests/api/test_api_scheduled_transactions.py
tests/fixtures.py
tests/queue/test_queue_transactions.py
tests/utils.py
Updated test files to use 'wallet' instead of 'account'
app/schemas.py Updated schemas to use 'Wallet' instead of 'Account'
app/repository.py Updated repository methods to use 'wallet' terminology
app/tasks.py Updated task processing to use 'wallet' instead of 'account'
app/routes.py Updated route configurations to use 'wallets' instead of 'accounts'
templates/emails/transaction-import-report.html
templates/macros/form_controls.html
templates/macros/modal.html
Updated email templates and form controls to use 'wallet' terminology
templates/pages/auth/page_login.html
templates/pages/auth/page_register.html
Updated authentication pages to use 'wallet' instead of 'account'

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @EduardSchwarzkopf - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Ensure there's a clear migration plan for existing data and update any external API documentation to reflect the 'account' to 'wallet' terminology change.
  • Consider adding comprehensive integration tests to verify that all wallet-related functionality (creation, updates, deletions, and especially financial calculations) works correctly after this refactoring.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -15,7 +15,7 @@
from app.date_manager import get_day_delta, get_tomorrow, get_yesterday, now
from app.repository import Repository
from app.utils.enums import DatabaseFilterOperator, RequestMethod
from tests.utils import get_other_user_account, make_http_request
from tests.utils import get_other_user_wallet, make_http_request
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (code-quality): Don't import test modules. (dont-import-test-modules)

ExplanationDon't import test modules.

Tests should be self-contained and don't depend on each other.

If a helper function is used by multiple tests,
define it in a helper module,
instead of importing one test from the other.

@@ -14,7 +14,7 @@
from app.repository import Repository
from app.utils.classes import RoundedDecimal
from app.utils.enums import DatabaseFilterOperator, RequestMethod
from tests.utils import get_user_offset_account, make_http_request
from tests.utils import get_user_offset_wallet, make_http_request
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (code-quality): Don't import test modules. (dont-import-test-modules)

ExplanationDon't import test modules.

Tests should be self-contained and don't depend on each other.

If a helper function is used by multiple tests,
define it in a helper module,
instead of importing one test from the other.

@EduardSchwarzkopf EduardSchwarzkopf merged commit fa438c8 into main Aug 13, 2024
5 checks passed
@EduardSchwarzkopf EduardSchwarzkopf deleted the rename-accounts-to-wallets branch August 13, 2024 19:42
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.

1 participant