You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently for creating a new Order we use below code,
publicrecordOrderRequest(
@Positive(message = "CustomerId should be positive") LongcustomerId,
@NotEmpty(message = "Order without items not valid") List<OrderItemRequest> items) {}
we have validation set up at the Order (parent) level. However, we need to extend this validation to the OrderItem level (child) to ensure that all key attributes are properly validated.
Specifically, we need to enforce the following validation rules for OrderItemRequest:
Quantity should not be zero.
Price should not be zero.
A valid product code must be provided.
To implement this enhancement, the following tasks need to be completed:
Modify OrderItemRequest.java : Add validation logic to the OrderItemRequest class to enforce the above-mentioned rules.
Create a New JUnit : Develop a new test case in the OrderControllerIT.java class to demonstrate that the extended validation at the child level is functioning correctly. This test case should cover various scenarios to ensure thorough testing.
The text was updated successfully, but these errors were encountered:
rajadilipkolli
changed the title
While Creating Order had all 3 values for orderItem as mandatory
While Creating Order, it should have all 3 values of orderItem as mandatory
Oct 2, 2023
Currently for creating a new Order we use below code,
we have validation set up at the Order (parent) level. However, we need to extend this validation to the OrderItem level (child) to ensure that all key attributes are properly validated.
Specifically, we need to enforce the following validation rules for OrderItemRequest:
To implement this enhancement, the following tasks need to be completed:
OrderItemRequest.java
: Add validation logic to the OrderItemRequest class to enforce the above-mentioned rules.OrderControllerIT.java
class to demonstrate that the extended validation at the child level is functioning correctly. This test case should cover various scenarios to ensure thorough testing.The text was updated successfully, but these errors were encountered: