Closed A-Guldborg closed 7 months ago
@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 CheckUserIsAllowedToPurchaseProduct
and InitiatePaymentAsync
)
Failed conditions
73.2% Coverage on New Code (required ≥ 80%)
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 ofChangedProductResponse
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 :-)