Java-DZGS / ingreedio-api

1 stars 0 forks source link

Code review and refactor #78

Open kubazuch opened 1 month ago

kubazuch commented 1 month ago

Read current code and refactor all weak points.

DDD plan

Smaller tasks, divided by domain

migoox commented 1 month ago

Looks great, I would suggest to either use exactly one repository or to use other services in a service.

It should nicely layer our app: Repository -> Repository manager service -> Service -> Controller

On the other hand it may be overkill for our app, let me know what do you think

mslup commented 1 month ago

Delete review endpoint shouldn't be managed by the product controller. Deleting should be done with the reviewId, user can delete only their review, moderator can delete any review.

PUT requests should be changed to PATCH requests.

kubazuch commented 1 month ago

PUT requests should be changed to PATCH requests.

Not all. Some of the request can still be PUT but I want to have both PUT and PATCH for most of the endpoints

kubazuch commented 1 month ago

Delete review endpoint shouldn't be managed by the product controller. Deleting should be done with the reviewId, user can delete only their review, moderator can delete any review.

I think that the placement of all endpoints needs to be reconsidered. We will discuss that during next meeting.