Skip to content

Conversation

@silte
Copy link
Collaborator

@silte silte commented Apr 9, 2025

Refactor the backend database repository structure following best practices and move each feature-related repository under related modules. Change all data classes to explicitly assign each parameter value instead of using Object.assign.

  • AccountRepo: Move AccountRepo class to packages/backend/src/modules/accounts/account.repo.ts. Update import path for PrismaService. Explicitly assign each parameter value in create and update methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
  • TransactionRepo: Move TransactionRepo class to packages/backend/src/modules/transactions/transaction.repo.ts. Update import path for PrismaService. Explicitly assign each parameter value in create and update methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
  • AccountBalanceChangeRepo: Move AccountBalanceChangeRepo class to packages/backend/src/modules/account-balance-changes/account-balance-change.repo.ts. Update import path for PrismaService. Explicitly assign each parameter value in create and update methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
  • TransactionCategoryRepo: Move TransactionCategoryRepo class to packages/backend/src/modules/transaction-categories/transaction-category.repo.ts. Update import path for PrismaService. Explicitly assign each parameter value in create and update methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
  • TransactionCategoryMappingRepo: Move TransactionCategoryMappingRepo class to packages/backend/src/modules/transaction-category-mappings/transaction-category-mapping.repo.ts. Update import path for PrismaService. Explicitly assign each parameter value in create and update methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
  • TransactionTemplateRepo: Move TransactionTemplateRepo class to packages/backend/src/modules/transaction-templates/transaction-template.repo.ts. Update import path for PrismaService. Explicitly assign each parameter value in create and update methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
  • TransactionTemplateLogRepo: Move TransactionTemplateLogRepo class to packages/backend/src/modules/transaction-templates/transaction-template-log.repo.ts. Update import path for PrismaService. Explicitly assign each parameter value in create and update methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
  • UserPreferencesRepo: Move UserPreferencesRepo class to packages/backend/src/modules/user-preferences/user-preferences.repo.ts. Update import path for PrismaService. Explicitly assign each parameter value in create and update methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
  • UserRepo: Move UserRepo class to packages/backend/src/modules/users/user.repo.ts. Update import path for PrismaService. Explicitly assign each parameter value in create and update methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
  • Test Updates: Update import paths in related test files to reflect the new repository locations. Verify that the tests are not broken with the changes.

For more details, open the Copilot Workspace session.

Refactor the backend database repository structure following best practices and move each feature-related repository under related modules. Change all data classes to explicitly assign each parameter value instead of using `Object.assign`.

* **AccountRepo**: Move `AccountRepo` class to `packages/backend/src/modules/accounts/account.repo.ts`. Update import path for `PrismaService`. Explicitly assign each parameter value in `create` and `update` methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
* **TransactionRepo**: Move `TransactionRepo` class to `packages/backend/src/modules/transactions/transaction.repo.ts`. Update import path for `PrismaService`. Explicitly assign each parameter value in `create` and `update` methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
* **AccountBalanceChangeRepo**: Move `AccountBalanceChangeRepo` class to `packages/backend/src/modules/account-balance-changes/account-balance-change.repo.ts`. Update import path for `PrismaService`. Explicitly assign each parameter value in `create` and `update` methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
* **TransactionCategoryRepo**: Move `TransactionCategoryRepo` class to `packages/backend/src/modules/transaction-categories/transaction-category.repo.ts`. Update import path for `PrismaService`. Explicitly assign each parameter value in `create` and `update` methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
* **TransactionCategoryMappingRepo**: Move `TransactionCategoryMappingRepo` class to `packages/backend/src/modules/transaction-category-mappings/transaction-category-mapping.repo.ts`. Update import path for `PrismaService`. Explicitly assign each parameter value in `create` and `update` methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
* **TransactionTemplateRepo**: Move `TransactionTemplateRepo` class to `packages/backend/src/modules/transaction-templates/transaction-template.repo.ts`. Update import path for `PrismaService`. Explicitly assign each parameter value in `create` and `update` methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
* **TransactionTemplateLogRepo**: Move `TransactionTemplateLogRepo` class to `packages/backend/src/modules/transaction-templates/transaction-template-log.repo.ts`. Update import path for `PrismaService`. Explicitly assign each parameter value in `create` and `update` methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
* **UserPreferencesRepo**: Move `UserPreferencesRepo` class to `packages/backend/src/modules/user-preferences/user-preferences.repo.ts`. Update import path for `PrismaService`. Explicitly assign each parameter value in `create` and `update` methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
* **UserRepo**: Move `UserRepo` class to `packages/backend/src/modules/users/user.repo.ts`. Update import path for `PrismaService`. Explicitly assign each parameter value in `create` and `update` methods. Add repository operations to avoid leaking Prisma query-related stuff to other services.
* **Test Updates**: Update import paths in related test files to reflect the new repository locations. Verify that the tests are not broken with the changes.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/sebarickert/financer?shareId=XXXX-XXXX-XXXX-XXXX).
@silte silte requested a review from Copilot April 9, 2025 17:42
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 9, 2025

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 9, 2025

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 9, 2025

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