AnalogIO / analog-core

.NET 8 backend for Cafe Analog's coffee card app
https://core.prd.analogio.dk/swagger
MIT License
4 stars 1 forks source link

Changes to products API #253

Closed A-Guldborg closed 7 months ago

A-Guldborg commented 7 months ago

This PR moves MenuItems into their own directories instead of residing amongst the products.

Furthermore, this PR removes the ChangedProductResponse and replaces this with the ProductResponse. The ChangedProductResponse 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 value IsPerk nor the Id. 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 :-)

ghost commented 7 months ago
👇 Click on the image for a new way to code review #### [![Review these changes using an interactive CodeSee Map](https://s3.us-east-2.amazonaws.com/maps.codesee.io/images/github/AnalogIO/analog-core/253/98fdbe62/5b0cd887f186a9b2a7573620777fb95d80310a42.svg)](https://app.codesee.io/r/reviews?pr=253&src=https%3A%2F%2Fgithub.com%2FAnalogIO%2Fanalog-core) #### Legend CodeSee Map legend
A-Guldborg commented 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)

sonarcloud[bot] commented 7 months ago

Quality Gate Failed Quality Gate failed

Failed conditions
73.2% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud