package org.xmx0632.deliciousfruit.entity;
import java.math.BigDecimal;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import org.apache.commons.lang3.builder.ToStringBuilder;
/**
* OrderPayByGiftCard.
*/
@Entity
@Table(name = "tbl_order_pay_by_gift_card")
public class OrderPayByGiftCard extends IdEntity {
private Order order;
private String giftCardId;
private BigDecimal deductionAmount;
private BigDecimal balance;
public OrderPayByGiftCard() {
}
public OrderPayByGiftCard(Order order, String giftCardId) {
this.order = order;
this.giftCardId = giftCardId;
}
@ManyToOne
@JoinColumn(name = "order_id")
public Order getOrder() {
return order;
}
public void setOrder(Order order) {
this.order = order;
}
@NotNull
public String getGiftCardId() {
return this.giftCardId;
}
public void setGiftCardId(String giftCardId) {
this.giftCardId = giftCardId;
}
public BigDecimal getDeductionAmount() {
return this.deductionAmount;
}
public void setDeductionAmount(BigDecimal deductionAmount) {
this.deductionAmount = deductionAmount;
}
public BigDecimal getBalance() {
return this.balance;
}
public void setBalance(BigDecimal balance) {
this.balance = balance;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
}