Closed Ilhamfeysel closed 5 months ago
Everything works fine.
You handle advertisement and buyer ID, but not seller. I can create an order with a seller that doesn't exist in database.
It is good that you have message for the exceptions but they don't reach the "user". The messages are inside the IDE(IntelliJ). Ideally you send the message as a response in Postman. You can refer to my createReview method as an example.
I also fixed Get all for Orders. The controller was missing a proper path.
[x] Added Validations
[x] Error Handling: If something's not right (like a missing buyer or ad), you'll get a clearer error message.
[x] Checking Before Deleting: We make sure an order exists before we try to delete it.
[x] Refined Order Updates: Now, only certain parts of an order can be updated.
[x] Fixed a Method Issue: Corrected the convertToDTO method to ensure instance methods were called on the orderDTO.
[x] adjustments to ensure that all relevant order details (such as orderDate, quantity, totalPrice, isSold, createdAt, and updatedAt) are included in responses when fetching orders.