Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request primarily introduces a new feature to the application, allowing users to find a store by a user's ID. This change affects several files across the codebase, including repository, service, and controller classes, as well as their corresponding test files. The changes are mainly concentrated around the addition of the
getByUserId
method and its usage.New Feature Implementation:
src/store/repository/prisma/prismaStore.repository.spec.ts
,src/store/repository/prisma/prismaStore.repository.ts
,src/store/repository/store.repository.ts
: A new methodgetByUserId
was added to thePrismaStoreRepository
class and theStoreRepository
abstract class, which allows finding a store by a user's ID. The corresponding test was also added.src/store/service/store.service.spec.ts
,src/store/service/store.service.ts
: ThegetByUserId
method was also added to theStoreService
class, with the addition of error handling for cases when a store is not found. The corresponding test was also added.src/user/service/user.service.spec.ts
,src/user/service/user.service.ts
: ThegetStoreByUserId
method was added to theUserService
class, which uses thegetByUserId
method fromStoreService
. The corresponding test was also added.src/user/user.controller.ts
: Two new endpoints were added to theUsersController
class. The first one retrieves a store by a user's ID, and the second one retrieves a store by a store's ID and a user's ID. Both endpoints handle the case when a store is not found.test/store.e2e-spec.ts
: Two new end-to-end tests were added. The first one tests the retrieval of a store by a user's ID, and the second one tests the error handling when a store is not found by a user's ID.