Skip to content

feat: UserOptionController (use only data from the external API - skip DB) #70

Description

@mikededo

Description

The goal of the issue is to develop the UserOptionController which is the controller that will run when the client chooses the user option. As of now, this issue is limited to working only with the API, meaning that it does not interact with the database anytime.

Implementation details

Domain layer

Due to JPA restrictions, we cannot reuse JpaRepository's for external queries. This implies that we must diferentiate between repositories that will obtain data from an external service, and repositories that will work with an internal service, most likely implementing the JpaRepository.
Therefore, it has been decided that repositories will be distincted by their naming:

  • Internal repositories (aka repositories that use any variant of JpaRepository), will be named as <Resource>JpaRepository.
  • External repositories (aka repositories that work with external services such as the GitHub API) will be named as <Resource>ExternalRepository.

Application layer

Since it is not possible to work with external services with JpaRepository collaborator, it is required to define different use cases. Applying the same logic as before, the name of the use case is used to differentiate between an use case that works with an internal repository collaborator, and one that works with an external repository.

  • Use cases that require an internal repository will be named as <Get|Save|Update><UseCase>.
  • Use cases that require an external repository will be named as <Fetch|Post|Put|...><UseCase>, making use of the HTTP verbs.

Infrastructure layer

The infrastructure layer needs to have the definition of the UserOptionController inside the shell package.

It also requires to have the concrete implementation of the GitHub repositories that will implement the contracts defined by the external repositories.

Tasks

The goal of this section is to give visibility to what is being worked on. For each task that one develops, they should add a new todo, which will create an issue.

Since this issue has been written after this task has started, there are many features that have already been implemented.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions