-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes to products API #253
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with this PR.
@A-Guldborg I'm always discussing with myself whether it should be the controller layer or the service/repository layer which should be responsible for mapping the object. In API v2, I have generally avoided having a mapper method on the controller layer but I'm unsure whether this should be enforced, thus you get the approval with suggestions :)
@jonasanker as discussed, I have moved the mapper to the product layer. Please be vigilant when reviewing these extra changes; I do not have the knowledge to be 100% sure that this does not break anything in the purchase flow (using ProductResponse in the PurchaseController rather than the actual Product entity in |
Quality Gate failedFailed conditions |
This PR moves
MenuItem
s into their own directories instead of residing amongst the products.Furthermore, this PR removes the
ChangedProductResponse
and replaces this with theProductResponse
. TheChangedProductResponse
was used as the return type for products that was added or updated. Instead of having multiple DTOs which would each have to be updated whenever a change was made to the general entity, we now only have one.The previous implementation of
ChangedProductResponse
did not contain the valueIsPerk
nor theId
. This meant that adding a product in shifty would not be able to show the new item's ID (nor conduct further changes) without reloading the whole table of products (i.e. a get request to the /products/all endpoint).If there was any particular reason to keep these divided, please let me know @HubertWojcik10 :-)