package com.publiccms.entities.trade;
// Generated 2023-8-7 21:42:23 by Hibernate Tools 5.6.15.Final

import java.math.BigDecimal;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.publiccms.common.generator.annotation.GeneratorColumn;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotNull;

/**
 * TradeCoupon generated by hbm2java
 */
@Entity
@Table(name = "trade_coupon")
public class TradeCoupon implements java.io.Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    @GeneratorColumn(title = "ID")
    private Long id;
    @GeneratorColumn(title = "站点", condition = true)
    @JsonIgnore
    private short siteId;
    /**
     * name
     * <p>
     * 名称
     */
    @GeneratorColumn(title = "名称")
    @NotNull
    @Length(max = 100)
    private String name;
    /**
     * category
     * <p>
     * 分类
     */
    @GeneratorColumn(title = "分类", condition = true)
    private Integer categoryId;
    /**
     * content
     * <p>
     * 内容
     */
    @GeneratorColumn(title = "内容", condition = true)
    private Long contentId;
    /**
     * start date
     * 开始日期
     */
    @GeneratorColumn(title = "开始日期", condition = true)
    private String startDate;
    /**
     * expiry date
     * 过期日期
     */
    @GeneratorColumn(title = "过期日期", condition = true)
    private String expiryDate;
    /**
     * starting amount
     * 起始金额
     */
    @GeneratorColumn(title = "起始金额")
    private BigDecimal startingAmount;
    /**
     * discount
     * 折扣
     */
    @GeneratorColumn(title = "折扣")
    private BigDecimal discount;
    /**
     * price
     * 价格
     */
    @GeneratorColumn(title = "价格")
    private BigDecimal price;
    /**
     * coupon_type
     * <p>
     * 优惠券类型
     */
    @GeneratorColumn(title = "优惠券类型", condition = true)
    private int couponType;
    /**
     * redeem code
     * <p>
     * 兑换码
     */
    @GeneratorColumn(title = "兑换码")
    private String redeemCode;
    private int duration;
    private int quantity;
    private String createDate;
    private boolean disabled;

    public TradeCoupon() {
    }

    public TradeCoupon(short siteId, String name, String startDate, int couponType, int duration, int quantity, boolean disabled) {
        this.siteId = siteId;
        this.name = name;
        this.startDate = startDate;
        this.couponType = couponType;
        this.duration = duration;
        this.quantity = quantity;
        this.disabled = disabled;
    }

    public TradeCoupon(short siteId, String name, Integer categoryId, Long contentId, String startDate, String expiryDate,
            BigDecimal startingAmount, BigDecimal discount, BigDecimal price, int couponType, String redeemCode, int duration,
            int quantity, String createDate, boolean disabled) {
        this.siteId = siteId;
        this.name = name;
        this.categoryId = categoryId;
        this.contentId = contentId;
        this.startDate = startDate;
        this.expiryDate = expiryDate;
        this.startingAmount = startingAmount;
        this.discount = discount;
        this.price = price;
        this.couponType = couponType;
        this.redeemCode = redeemCode;
        this.duration = duration;
        this.quantity = quantity;
        this.createDate = createDate;
        this.disabled = disabled;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "site_id", nullable = false)
    public short getSiteId() {
        return this.siteId;
    }

    public void setSiteId(short siteId) {
        this.siteId = siteId;
    }

    @Column(name = "name", nullable = false)
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "category_id")
    public Integer getCategoryId() {
        return this.categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    @Column(name = "content_id")
    public Long getContentId() {
        return this.contentId;
    }

    public void setContentId(Long contentId) {
        this.contentId = contentId;
    }

    @Column(name = "start_date", nullable = false)
    public String getStartDate() {
        return this.startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    @Column(name = "expiry_date")
    public String getExpiryDate() {
        return this.expiryDate;
    }

    public void setExpiryDate(String expiryDate) {
        this.expiryDate = expiryDate;
    }

    @Column(name = "starting_amount", precision = 10)
    public BigDecimal getStartingAmount() {
        return this.startingAmount;
    }

    public void setStartingAmount(BigDecimal startingAmount) {
        this.startingAmount = startingAmount;
    }

    @Column(name = "discount", precision = 10, scale = 1)
    public BigDecimal getDiscount() {
        return this.discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    @Column(name = "price", precision = 10)
    public BigDecimal getPrice() {
        return this.price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    @Column(name = "coupon_type", nullable = false)
    public int getCouponType() {
        return this.couponType;
    }

    public void setCouponType(int couponType) {
        this.couponType = couponType;
    }

    @Column(name = "redeem_code")
    public String getRedeemCode() {
        return this.redeemCode;
    }

    public void setRedeemCode(String redeemCode) {
        this.redeemCode = redeemCode;
    }

    @Column(name = "duration", nullable = false)
    public int getDuration() {
        return this.duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    @Column(name = "quantity", nullable = false)
    public int getQuantity() {
        return this.quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    @Column(name = "create_date")
    public String getCreateDate() {
        return this.createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    @Column(name = "disabled", nullable = false)
    public boolean isDisabled() {
        return this.disabled;
    }

    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

}
