-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document marketplace #115
Document marketplace #115
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.liberologico.cloudesire.common.Regexp; | ||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import org.apache.commons.lang3.ObjectUtils; | ||
import org.hibernate.validator.constraints.Email; | ||
import org.hibernate.validator.constraints.Length; | ||
|
@@ -17,6 +19,7 @@ | |
|
||
import static com.liberologico.cloudesire.common.JsonFormatters.DATE_PATTERN; | ||
|
||
@ApiModel( "A generated coupon" ) | ||
public class CouponDTO extends BaseEntityDTO | ||
{ | ||
public static final String DISCOUNT = "discount"; | ||
|
@@ -25,12 +28,15 @@ public class CouponDTO extends BaseEntityDTO | |
public static final String DISCOUNT_GENERATOR = "discountGenerator"; | ||
public static final String FIXED_PRICE_GENERATOR = "fixedPriceGenerator"; | ||
|
||
@ApiModelProperty( value = "Email address to notify customer of the coupon", readOnly = true ) | ||
@Email( regexp = Regexp.INTERNET_EMAIL ) | ||
private String emailCustomer; | ||
|
||
@ApiModelProperty( value = "Unique identifier of the coupon", readOnly = true ) | ||
@Length ( min = 48, max = 48 ) | ||
private String hash; | ||
|
||
@ApiModelProperty( value = "Human readable code of the coupon", readOnly = true ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not updatable |
||
@Length( max = 36 ) | ||
private String code; | ||
|
||
|
@@ -40,36 +46,46 @@ public class CouponDTO extends BaseEntityDTO | |
@Valid | ||
private UrlEntityDTO product; | ||
|
||
@ApiModelProperty( value = "Coupon type", allowableValues = "bundle, discount, extendedTrial, fixedPrice", readOnly = true ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not updatable |
||
@NotNull | ||
private String type; | ||
|
||
@ApiModelProperty( value = "When the coupon has been created", readOnly = true ) | ||
@NotNull | ||
@JsonFormat( pattern = DATE_PATTERN ) | ||
private Date creationDate = new Date(); | ||
|
||
@ApiModelProperty( value = "When the coupon will expire", readOnly = true ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not updatable |
||
@JsonFormat( pattern = DATE_PATTERN ) | ||
private Date expirationDate; | ||
|
||
@ApiModelProperty( value = "Fixed price", readOnly = true ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not updatable |
||
@JsonInclude ( JsonInclude.Include.NON_NULL ) | ||
@Min ( 0 ) | ||
private BigDecimal newPrice; | ||
|
||
@ApiModelProperty( value = "Discount percentage", readOnly = true ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not updatable |
||
@JsonInclude ( JsonInclude.Include.NON_NULL ) | ||
@Min ( 0 ) | ||
@Max ( 100 ) | ||
private BigDecimal percentage; | ||
|
||
@ApiModelProperty( value = "Days of extension", readOnly = true ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not updatable |
||
@JsonInclude ( JsonInclude.Include.NON_NULL ) | ||
@Min ( 1 ) | ||
private Integer days; | ||
|
||
@ApiModelProperty( value = "Maximum budget for an extended trial", readOnly = true ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updatable? |
||
@JsonInclude ( JsonInclude.Include.NON_NULL ) | ||
private BigDecimal plafond; | ||
|
||
@ApiModelProperty( value = "Coupon state", allowableValues = "NEW, SENT, EXPIRED, USED", readOnly = true ) | ||
private String state; | ||
|
||
@ApiModelProperty( value = "Whether the coupon is reusable", readOnly = true ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not updatable |
||
private boolean reusable; | ||
|
||
@ApiModelProperty( value = "Whether the coupon applies to the license cost only", readOnly = true ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not updatable |
||
private boolean licenseOnly = true; | ||
|
||
public String getEmailCustomer() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not readonly, not updatable