View Javadoc
1   package org.oxerr.youzan.dto.item;
2   
3   import java.io.Serializable;
4   import java.math.BigDecimal;
5   import java.time.Instant;
6   
7   import org.oxerr.youzan.dto.deserializer.InstantDeserializer;
8   
9   import com.fasterxml.jackson.annotation.JsonProperty;
10  import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
11  
12  /**
13   * <a href="http://open.youzan.com/structparam?struct=TradePromotion">
14   * 订单中使用到的优惠活动的数据结构</a>.
15   */
16  public class TradePromotion implements Serializable {
17  
18  	private static final long serialVersionUID = 2016062001L;
19  
20  	/**
21  	 * 优惠的类型。
22  	 * 可选值:
23  	 * <ul>
24  	 * <li>FULLREDUCE(满减满送)</li>
25  	 * <li>ORDERCASHBACK(订单返现)</li>
26  	 * <li>GROUPBUYING(商品团购)</li>
27  	 * <li>GROUPON(多人拼团)</li>
28  	 * </ul>
29  	 */
30  	private String promotionType;
31  
32  	/**
33  	 * 使用时间
34  	 */
35  	private Instant usedAt;
36  
37  	/**
38  	 * 该优惠活动的名称
39  	 */
40  	private String promotionName;
41  
42  	/**
43  	 * 优惠使用条件说明
44  	 */
45  	private String promotionCondition;
46  
47  	/**
48  	 * 该优惠活动的ID
49  	 */
50  	private Long promotionId;
51  
52  	/**
53  	 * 优惠的金额,单位:元,精确到小数点后两位。
54  	 */
55  	private BigDecimal discountFee;
56  
57  	public TradePromotion() {
58  	}
59  
60  	public TradePromotion(
61  		@JsonProperty("promotion_type") String promotionType,
62  		@JsonProperty("used_at")
63  		@JsonDeserialize(using = InstantDeserializer.class)
64  		Instant usedAt,
65  		@JsonProperty("promotion_name") String promotionName,
66  		@JsonProperty("promotion_condition") String promotionCondition,
67  		@JsonProperty("promotion_id") Long promotionId,
68  		@JsonProperty("discount_fee") BigDecimal discountFee
69  	) {
70  		this.promotionType = promotionType;
71  		this.usedAt = usedAt;
72  		this.promotionName = promotionName;
73  		this.promotionCondition = promotionCondition;
74  		this.promotionId = promotionId;
75  		this.discountFee = discountFee;
76  	}
77  
78  	public String getPromotionType() {
79  		return promotionType;
80  	}
81  
82  	public void setPromotionType(String promotionType) {
83  		this.promotionType = promotionType;
84  	}
85  
86  	public Instant getUsedAt() {
87  		return usedAt;
88  	}
89  
90  	public void setUsedAt(Instant usedAt) {
91  		this.usedAt = usedAt;
92  	}
93  
94  	public String getPromotionName() {
95  		return promotionName;
96  	}
97  
98  	public void setPromotionName(String promotionName) {
99  		this.promotionName = promotionName;
100 	}
101 
102 	public String getPromotionCondition() {
103 		return promotionCondition;
104 	}
105 
106 	public void setPromotionCondition(String promotionCondition) {
107 		this.promotionCondition = promotionCondition;
108 	}
109 
110 	public Long getPromotionId() {
111 		return promotionId;
112 	}
113 
114 	public void setPromotionId(Long promotionId) {
115 		this.promotionId = promotionId;
116 	}
117 
118 	public BigDecimal getDiscountFee() {
119 		return discountFee;
120 	}
121 
122 	public void setDiscountFee(BigDecimal discountFee) {
123 		this.discountFee = discountFee;
124 	}
125 
126 }