Skip to content

refactor: introduce hexagonal ports and use case structure#5

Open
RoronoaSZ wants to merge 3 commits into
mainfrom
refactor/hexagonal-architecture
Open

refactor: introduce hexagonal ports and use case structure#5
RoronoaSZ wants to merge 3 commits into
mainfrom
refactor/hexagonal-architecture

Conversation

@RoronoaSZ
Copy link
Copy Markdown
Collaborator

@RoronoaSZ RoronoaSZ commented May 27, 2026

  • add inbound ports

  • introduce usecases folder for application workflows

  • align project structure with hexagonal architecture principles

  • modify .gitignore to accept Out directory

- add inbound ports
- introduce usecases folder for application workflows
- align project structure with hexagonal architecture principles
@RoronoaSZ RoronoaSZ requested a review from RoiPorci May 29, 2026 18:49
@RoiPorci RoiPorci requested a review from Ligax45 May 31, 2026 09:31
@RoiPorci RoiPorci marked this pull request as draft May 31, 2026 09:49
@RoiPorci RoiPorci requested review from Ligax45 and RoiPorci and removed request for Ligax45 and RoiPorci May 31, 2026 09:50
@RoronoaSZ RoronoaSZ self-assigned this May 31, 2026
@RoiPorci RoiPorci linked an issue May 31, 2026 that may be closed by this pull request
@RoiPorci RoiPorci marked this pull request as ready for review May 31, 2026 10:14
Copilot AI review requested due to automatic review settings May 31, 2026 10:14
Copy link
Copy Markdown

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.

Pull request overview

This PR refactors the application layer toward a hexagonal architecture by replacing the service-based TV show listing flow with inbound/outbound ports and a list-use-case implementation.

Changes:

  • Introduces IListTvShowsUseCase and ListTvShowsUseCase for listing TV shows.
  • Updates DI and controller dependencies to use the new inbound port.
  • Renames repository port imports toward an outbound port namespace and performs minor formatting cleanup.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
TvShow.Api/Controllers/TvShowsController.cs Updates the controller to depend on the list TV shows use case.
TvShow.Application/DependencyInjection.cs Registers the new use case implementation.
TvShow.Application/Models/TvShowResponse.cs Adds trailing whitespace-only lines.
TvShow.Application/Ports/In/IListTvShowsUseCase.cs Adds the inbound port for listing TV shows.
TvShow.Application/Ports/ITvShowRepository.cs Removes the previous repository port location.
TvShow.Application/Services/TvShowManager.cs Removes the old application service.
TvShow.Application/UseCases/ListTvShows/ListTvShowsUseCase.cs Adds the new list workflow implementation.
TvShow.Domain/TvShow.cs Normalizes spacing around property initializers.
TvShow.Infrastructure/DependencyInjection.cs Updates repository port namespace import.
TvShow.Infrastructure/Repositories/InMemoryTvShowRepository.cs Updates repository port namespace import.

Comment thread TvShow.Application/UseCases/ListTvShows/ListTvShowsUseCase.cs

public async Task<IReadOnlyList<TvShowResponse>> ExecuteAsync(CancellationToken cancellationToken = default)
{
var tvShows = await _repository.GetAllAsync();
public async Task<ActionResult<IReadOnlyList<TvShowResponse>>> GetAll(CancellationToken cancellationToken)
{
var tvShows = await tvShowManager.GetAllAsync(cancellationToken);
var tvShows = await listTvShowsUseCase.ExecuteAsync();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TvShows - Passage à l'archi hexago

3 participants