Architecture Track • Beginner • 3 mins review
Refactor: Return API-shaped objects from the repository
Simplifies the endpoint by letting the repository return the final API-shaped object instead of a domain record.
Scenario Goal & Context
Goal: Reduce mapping code in the controller by returning a response-ready object from the data layer.
Background: The endpoint only needed one field transformation, so the repository was updated to return the final response object directly.
Changed Files (1)
- src/repositories/InvoiceRepository.ts +3 -0
Ready to practice reviewing this PR?
Open this scenario inside the interactive DiffSense simulator to leave inline comments and receive an automated score.
Start Review Session