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=TradeOrderPromotion">
14   * 交易明细中的优惠信息的数据结构</a>.
15   */
16  public class TradeOrderPromotion implements Serializable {
17  
18  	private static final long serialVersionUID = 2016062001L;
19  
20  	/**
21  	 * 优惠的类型。
22  	 * 可选值:
23  	 * <ul>
24  	 * <li>MEMBER_CARD_DISCOUNT(会员卡折扣)</li>
25  	 * <li>SCAN_DISCOUNT(扫码折扣)</li>
26  	 * <li>SCAN_DECREASE(扫码减额优惠)</li>
27  	 * <li>TIMELIMITED_DISCOUNT(限时折扣)</li>
28  	 * </ul>
29  	 */
30  	private String promotionType;
31  
32  	/**
33  	 * 应用优惠的时间
34  	 */
35  	private Instant applyAt;
36  
37  	/**
38  	 * 优惠的名称
39  	 */
40  	private String promotionName;
41  
42  	/**
43  	 * 优惠的金额,单位:元,精确到小数点后两位。
44  	 */
45  	private BigDecimal discountFee;
46  
47  	public TradeOrderPromotion() {
48  	}
49  
50  	public TradeOrderPromotion(
51  		@JsonProperty("promotion_type") String promotionType,
52  		@JsonProperty("apply_at")
53  		@JsonDeserialize(using = InstantDeserializer.class)
54  		Instant applyAt,
55  		@JsonProperty("promotion_name") String promotionName,
56  		@JsonProperty("discount_fee") BigDecimal discountFee
57  	) {
58  		this.promotionType = promotionType;
59  		this.applyAt = applyAt;
60  		this.promotionName = promotionName;
61  		this.discountFee = discountFee;
62  	}
63  
64  	public String getPromotionType() {
65  		return promotionType;
66  	}
67  
68  	public void setPromotionType(String promotionType) {
69  		this.promotionType = promotionType;
70  	}
71  
72  	public Instant getApplyAt() {
73  		return applyAt;
74  	}
75  
76  	public void setApplyAt(Instant applyAt) {
77  		this.applyAt = applyAt;
78  	}
79  
80  	public String getPromotionName() {
81  		return promotionName;
82  	}
83  
84  	public void setPromotionName(String promotionName) {
85  		this.promotionName = promotionName;
86  	}
87  
88  	public BigDecimal getDiscountFee() {
89  		return discountFee;
90  	}
91  
92  	public void setDiscountFee(BigDecimal discountFee) {
93  		this.discountFee = discountFee;
94  	}
95  
96  }