-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor backend repository structure following best practices #468
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
base: main
Are you sure you want to change the base?
Conversation
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).
|
|
There was a problem hiding this 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.
|



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.AccountRepoclass topackages/backend/src/modules/accounts/account.repo.ts. Update import path forPrismaService. Explicitly assign each parameter value increateandupdatemethods. Add repository operations to avoid leaking Prisma query-related stuff to other services.TransactionRepoclass topackages/backend/src/modules/transactions/transaction.repo.ts. Update import path forPrismaService. Explicitly assign each parameter value increateandupdatemethods. Add repository operations to avoid leaking Prisma query-related stuff to other services.AccountBalanceChangeRepoclass topackages/backend/src/modules/account-balance-changes/account-balance-change.repo.ts. Update import path forPrismaService. Explicitly assign each parameter value increateandupdatemethods. Add repository operations to avoid leaking Prisma query-related stuff to other services.TransactionCategoryRepoclass topackages/backend/src/modules/transaction-categories/transaction-category.repo.ts. Update import path forPrismaService. Explicitly assign each parameter value increateandupdatemethods. Add repository operations to avoid leaking Prisma query-related stuff to other services.TransactionCategoryMappingRepoclass topackages/backend/src/modules/transaction-category-mappings/transaction-category-mapping.repo.ts. Update import path forPrismaService. Explicitly assign each parameter value increateandupdatemethods. Add repository operations to avoid leaking Prisma query-related stuff to other services.TransactionTemplateRepoclass topackages/backend/src/modules/transaction-templates/transaction-template.repo.ts. Update import path forPrismaService. Explicitly assign each parameter value increateandupdatemethods. Add repository operations to avoid leaking Prisma query-related stuff to other services.TransactionTemplateLogRepoclass topackages/backend/src/modules/transaction-templates/transaction-template-log.repo.ts. Update import path forPrismaService. Explicitly assign each parameter value increateandupdatemethods. Add repository operations to avoid leaking Prisma query-related stuff to other services.UserPreferencesRepoclass topackages/backend/src/modules/user-preferences/user-preferences.repo.ts. Update import path forPrismaService. Explicitly assign each parameter value increateandupdatemethods. Add repository operations to avoid leaking Prisma query-related stuff to other services.UserRepoclass topackages/backend/src/modules/users/user.repo.ts. Update import path forPrismaService. Explicitly assign each parameter value increateandupdatemethods. Add repository operations to avoid leaking Prisma query-related stuff to other services.For more details, open the Copilot Workspace session.