the-bed-stack icon indicating copy to clipboard operation
the-bed-stack copied to clipboard

Reconsider `toResponse` mapper in service layer

Open yamcodes opened this issue 6 months ago • 0 comments

Clear and concise description of the problem

Arguably, toResponse mapping should be a controller-level concern, and the service layer should not be aware of it.

Suggested solution

Move all toResponse invocations to the controller layer.

Alternative

Leave the toResponse invocations where they are in the service layer, if we determine that the service layer should have knowledge of the desired API-level format.

Additional context

Consider our "project structure" and "architecture" docs.

Validations

  • [x] Read the Contributing Guide.
  • [x] Read the README.md.
  • [x] Check that there isn't already an issue that requests the same feature.

yamcodes avatar Jul 07 '25 18:07 yamcodes