Skip to content

Instantly share code, notes, and snippets.

@ehabqadah
Last active July 18, 2020 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ehabqadah/43e844c35d96a19bb692003d1f25e62b to your computer and use it in GitHub Desktop.
Save ehabqadah/43e844c35d96a19bb692003d1f25e62b to your computer and use it in GitHub Desktop.
/**
* 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