DEV Community

Discussion on: Creación de un CRUD con API REST y PostgreSQL en NestJS

Collapse
 
ahernand53 profile image
Asdrubal Hernandez

Hi Mr. Ruben, I have a question because don't understand what happens between "UserRepository" and "UserService"?, What's the different between them 2?.

Collapse
 
raguilera82 profile image
Rubén Aguilera Díaz-Heredero

Hi Asdrubal! UserRepository has the one responsability: access to database and UserService has one responsability: keep the business logic separate from database. In that way you can make fake implementation of the Repository to test the BusinessService