# Brickscout - Tech Report 6 ### 1. cart_builder/entries empty response This issue is still not fixed, however I noticed another regularity. If resultEntries array is empty, eansNotFound will also return empty list. Examples with exact payloads so you can recreate the issue: Failing example: ``` POST /api/core/users/Testdirk7/cart_builder { "allowedOversales":1.25, "sensitivity":3, "entries":[ {"ean":"4057296295623","neededQuantity":1,"condition":null}, {"ean":"4057296291021","neededQuantity":1,"condition":null} ], "isoalpha3":"ITA" } Response: { "uuid": "9f8d0a6d-ea4c-4b14-b8fa-d93c7b05f278", "created": 1622878178470, "allowedOversales": 1.25, "entries": [], "amountEANs": 2, "sensitivity": 3.0, "isoalpha3": "ITA" } GET /api/core/users/Testdirk7/cart_builder/ 9f8d0a6d-ea4c-4b14-b8fa-d93c7b05f278/entries Response: { "resultEntries": [], "partiallyAvailable": [], "eansNotFound": [] } ``` Working example: ``` POST /api/core/users/Testdirk7/cart_builder { "allowedOversales": 1.25, "sensitivity": 3, "entries": [ { "ean": "4057296295623", "neededQuantity": 1, "condition": null }, { "ean": "4057296291021", "neededQuantity": 1, "condition": null }, { "ean": "4057296308149", "neededQuantity": 1, "condition": null } ], "isoalpha3": "ITA" } Response: { ... "uuid": "eec2d149-416a-4e0c-ac3f-596020203ccd" ... } GET /api/core/users/Testdirk7/cart_builder/ 9f8d0a6d-ea4c-4b14-b8fa-d93c7b05f278/entries { "resultEntries": [ { "builderUUID": "eec2d149-416a-4e0c-ac3f-596020203ccd", "productEan": "4057296308149", "neededQuantity": 1, ... < redacted info > ... "condition": "USED", "quantityType": "FULLY" } ], "partiallyAvailable": [], "eansNotFound": [ { "productEAN": "4057296291021", "neededQuantity": 1, "condition": null, "quantityType": "NOTHING" }, { "productEAN": "4057296295623", "neededQuantity": 1, "condition": null, "quantityType": "NOTHING" } ] } ``` ### 2. Subsequent requests now throw 500 instead of 409 Also additionaly validated using Postman to make sure it's not a frontend issue. It is not. ``` GET /api/core/users/Testdirk7/cart_builder/ eec2d149-416a-4e0c-ac3f-596020203ccd/entries { "type": "UnknownException", "exceptionCode": 0, "developerMessage": "It's looking like you may have taken a wrong turn. Don't worry...it happens to the best of us.", "moreInfoUrl": "/api/docs/errors/0.html", "timeStamp": 1622878928185 } ``` ### 3. Unavailable icons - non-consistent payload When item is available (in resultEntries array) it has a property named `productEan`. Property with the same semantics if eansNotFound is `productEAN`. This is not a deal breaker, but please try to keep things consistent because it helps with code reusability on frontend side. ### 4. Patching condition on Wishlist does not work Patching condition returns 200 like it was successfull, but when refetching the list, the value seems to not be stored or is not returned. Link to gif where behavior is demonstrated https://i.imgur.com/VXYOv1Q.gif ### 5. Automatic load more on scroll This can be achieved fairly easily, however automatic loading of items on scroll is usually used when list of the items is of the fixed size. In the case of the wishlist, user can opt to delete certain items in the wishlist and this required reloading certain page in order to fill that spot. This is difficult to achieve properly if products are lazily loaded. ![](https://i.imgur.com/DEc12nA.png) We've implemented 'Load more' on click to mitigate this issue, if this is acceptable please let me know. However, if lazy loading is must have, this will result in more development time to do properly. ### 6. Problems creating cart_builder directly from list #### 6.1 409 If cart_builder was already created at some point from the same list, `/api/core/users/{userName}/cart_builder/legoproduct` results in 409 (DataIntegrityViolation) #### 6.2 500 If list was large, fetching entries results in 500 error. list uuid that was used for testing: `8b5b2b95-966e-4519-a010-68a63bca7f9e`