In this little project, I explore and implement a basic [repository pattern](https://martinfowler.com/eaaCatalog/repository.html.
The role of the repository is to abstract data sources. The data source in this case, is a PostgreSQL database.
The data mapper pattern, in contrast to the active record pattern, ensures domain objects only contain business rules. Any task related to database operations is handed over to the data mapper layer.
The Repository Layer centralizes the query construction code, providing a more object-oriented way of communicating with a collection of objects.
GET ALL
curl --location 'localhost:8080/all-users'
GET BY ID
curl --location 'localhost:8080/user?id=1'
POST
curl --location 'localhost:8080/user' \
--header 'Content-Type: application/json' \
--data '{
"name": "Elio"
}'
PUT
curl --location --request PUT 'localhost:8080/user?id=2' \
--header 'Content-Type: application/json' \
--data '{
"name": "Filippo",
"isDeleted": false
}'
DELETE
curl --location --request DELETE 'localhost:8080/user?id=2'