Last active
July 18, 2020 11:08
-
-
Save ehabqadah/43e844c35d96a19bb692003d1f25e62b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Incoming DTO to create a new record of {@link com.qadah.demo.data.model.Order} | |
* | |
* @author Ehab Qadah | |
*/ | |
public class OrderIncomingDto { | |
@JsonProperty(required = true) | |
@NotEmpty | |
@NotBlank | |
private String customerId; | |
@JsonProperty(required = true) | |
@NotNull | |
@PastOrPresent | |
private Instant datePurchased; | |
@JsonProperty(required = true) | |
@NotNull | |
@Positive | |
private BigDecimal total; | |
@JsonProperty(required = true) | |
@NotEmpty | |
@NotBlank | |
@Size(min = 5, max = 10) | |
private String status; | |
@JsonProperty(required = true) | |
@NotEmpty | |
private List<ProductDto> orderProducts; | |
@JsonProperty(required = true) | |
@NotEmpty | |
@NotBlank | |
private String paymentType; | |
@JsonProperty(required = true) | |
@Size(min = 2, max = 10) | |
private String shippingMode; | |
@JsonProperty(required = true) | |
@Email(message = "Customer email should be valid") | |
private String customerEmailAddress; | |
// standard setters and getters | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment