BorisTodor0v / team6-ikt

0 stars 4 forks source link

Make changes to User #16

Closed BorisTodor0v closed 6 months ago

BorisTodor0v commented 6 months ago

To the User model: Add 3 boolean variables to represent what type of service the user offers (child care, eldercare, pet care). These will be used when searching for users that provide a service based on the required services. Add 2 salary range variables of type double. One is the minimum salary, the other is the maximum salary the user that provides a service is asking for. Add boolean variables for the following desired traits of the service provider: "Обучен за прва помош", "Удобен со миленичиња", "Високо образование", "Има автомобил", "Непушач". Additionally, make changes to all necessary DTOs to reflect these new parameters.

Data Transfer Objects (DTOs): Create a new DTO that contains filter for which to find service providers. The DTO must include salary range (to and from), desired traits and the types of services required.

To the User Service: Add a method that will look for service providers based on the filters set by the user. Take the DTO defined above as an input parameter and return a List of UserDetailDTOs that contain the details of all users that match the filters. Additionally, define method/s in the User Repository to find Users based on the filters.

To the User REST Controller Add a method to filter Users that takes the DTO defined above as a Request Body and passes it to the method defined in the service above. Define the method to return a "ResponseEntity<?>", and return a List of UserDetailsDTOs that contain the details of all users that match the filters. If there are no users that match the filters, return an error with an appropriate HttpStatus. See how other methods in the REST Controller and Exceptions are defined to properly implement this requirement.

BorisTodor0v commented 6 months ago

If possible, figure out a way to add "Days available on:" to the User model. Will require additional changes in the DTOs, repository and controller

BorisTodor0v commented 6 months ago

Solved by "Dimitar Kolev"