package io.reactivesw.order.order.application.model;

import io.reactivesw.order.order.infrastructure.enums.PaymentState;
import io.swagger.annotations.ApiModelProperty;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * Created by umasuo on 16/11/17.
 */
@Getter
@Setter
@ToString
public class OrderFromCartDraft {

  @ApiModelProperty(value = "The unique id of the cart from which an order is created.", required = true)
  private String id;

  @ApiModelProperty(required = true)
  private Integer version;

  @ApiModelProperty(value = "String that uniquely identifies an order. " +
          "It can be used to create more human-readable (in contrast to ID) identifier for the order." +
          " It should be unique across a merchant. Once it’s set it cannot be changed.",
          required = false)
  private String orderNumber;

  @ApiModelProperty(required = false)
  private PaymentState paymentState;

  @ApiModelProperty(value = "payment method token", required = false)
  private String paymentMethodToken;
}

@@ -233,16 +233,145 @@
 tring;%0A%0A
+import javax.validation.constraints.Min;%0Aimport javax.validation.constraints.NotNull;%0Aimport javax.validation.constraints.Size;%0A%0A
 /**%0A * C
@@ -563,32 +563,60 @@
 equired = true)%0A
+  @NotNull%0A  @Size(min = 1)%0A
   private String
@@ -658,16 +658,37 @@
 = true)%0A
+  @NotNull%0A  @Min(0)%0A
   privat
@@ -1166,37 +1166,64 @@
 en%22, required = 
-false
+true)%0A  @NotNull%0A  @Size(min = 1
 )%0A  private Stri

refactor order draft, add valid annotation