/*
 *  Copyright 2019-2020 Zheng Jie
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package cn.ysk.cashier.pojo.shop;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;

import javax.persistence.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @author lyf
 * @website https://eladmin.vip
 * @description /
 * @date 2024-03-20
 **/
@Entity
@Table(name = "tb_merchant_coupon")
public class TbMerchantCoupon implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "自增")
    private Integer id;

    @Column(name = "`status`")
    @ApiModelProperty(value = "状态0-关闭 1 正常")
    private Integer status;

    @Column(name = "`title`")
    @ApiModelProperty(value = " 优惠券名称")
    private String title;

    @Column(name = "`template_id`", nullable = false)
    @NotBlank
    @ApiModelProperty(value = "templateId")
    private String templateId = "0";

    @Column(name = "`shop_id`")
    @ApiModelProperty(value = "shopId")
    private String shopId;

    @Column(name = "`shop_snap`")
    @ApiModelProperty(value = "shopSnap")
    private String shopSnap;

    @Column(name = "`from_time`")
    @ApiModelProperty(value = "开始时间")
    private Timestamp fromTime;

    @Column(name = "`to_time`")
    @ApiModelProperty(value = "到期时间")
    private Timestamp toTime;

    @Column(name = "`limit_number`")
    @ApiModelProperty(value = "限领数量")
    private Integer limitNumber;

    @Column(name = "`number`")
    @ApiModelProperty(value = "发放数量")
    private Integer number;

    @Column(name = "`use_number`")
    @ApiModelProperty(value = "已核销数量")
    private Integer useNumber;

    @Column(name = "`left_number`", nullable = false)
    @ApiModelProperty(value = "剩余数量")
    private Integer leftNumber;

    @Column(name = "`amount`")
    @ApiModelProperty(value = "优惠金额")
    private BigDecimal amount;

    @Column(name = "`limit_amount`")
    @ApiModelProperty(value = "订单满赠金额")
    private BigDecimal limitAmount;

    @Column(name = "`is_show`")
    @ApiModelProperty(value = "是否显示0-不显示 1显示")
    private Integer isShow;

    @Column(name = "`pic`")
    @ApiModelProperty(value = "图标")
    private String pic;

    @Column(name = "`type`")
    @ApiModelProperty(value = "0-满减  1-折扣")
    private Integer type;

    @Column(name = "`ratio`")
    @ApiModelProperty(value = "折扣 ，一位小数")
    private Float ratio;

    @Column(name = "`max_ratio_amount`")
    @ApiModelProperty(value = "最大折扣金额")
    private BigDecimal maxRatioAmount;

    @Column(name = "`track`")
    @ApiModelProperty(value = "优惠券途径，首充|分销")
    private String track;

    @Column(name = "`class_type`")
    @ApiModelProperty(value = "品类product 商品券 ---cateogry 品类券common -通用券")
    @NotNull
    private String classType;

    @Column(name = "`effect_type`")
    @ApiModelProperty(value = "有效期类型：0-toTime有效  1-effectDays有效")
    @NotNull
    private Integer effectType;

    @Column(name = "`effect_days`")
    @ApiModelProperty(value = "领取之日有效天数")
    private Integer effectDays;

    @Column(name = "`relation_ids`")
    @ApiModelProperty(value = "关联商品Id")
    private String relationIds;

    @Column(name = "`relation_list`")
    @ApiModelProperty(value = "relationList")
    private String relationList;

    @Column(name = "`editor`")
    @ApiModelProperty(value = "发放人")
    private String editor;

    @Column(name = "`note`")
    @ApiModelProperty(value = "说明")
    private String note;

    @Column(name = "`created_at`", nullable = false)
    @NotNull
    @ApiModelProperty(value = "createdAt")
    private Long createdAt;

    @Column(name = "`updated_at`", nullable = false)
    @NotNull
    @ApiModelProperty(value = "updatedAt")
    private Long updatedAt;

    @Column(name = "`furnish_meal`")
    @ApiModelProperty(value = "支持堂食")
    private Integer furnishMeal;

    @Column(name = "`furnish_express`")
    @ApiModelProperty(value = "支持配送")
    private Integer furnishExpress;

    @Column(name = "`furnish_draw`")
    @ApiModelProperty(value = "支持自提")
    private Integer furnishDraw;

    @Column(name = "`furnish_vir`")
    @ApiModelProperty(value = "支持虚拟")
    private Integer furnishVir;

    @Column(name = "`disable_distribute`")
    @ApiModelProperty(value = "disableDistribute")
    private Integer disableDistribute;

    @Column(name = "`merchant_id`")
    @ApiModelProperty(value = "商户Id")
    private String merchantId;

    @Column(name = "`category_id`")
    @ApiModelProperty(value = "分类id")
    private String categoryId;

    public void copy(TbMerchantCoupon source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public Integer getId() {
        return id;
    }

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

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTemplateId() {
        return templateId;
    }

    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }

    public String getShopId() {
        return shopId;
    }

    public void setShopId(String shopId) {
        this.shopId = shopId;
    }

    public String getShopSnap() {
        return shopSnap;
    }

    public void setShopSnap(String shopSnap) {
        this.shopSnap = shopSnap;
    }

    public Timestamp getFromTime() {
        return fromTime;
    }

    public void setFromTime(Timestamp fromTime) {
        this.fromTime = fromTime;
    }

    public Timestamp getToTime() {
        return toTime;
    }

    public void setToTime(Timestamp toTime) {
        this.toTime = toTime;
    }

    public Integer getLimitNumber() {
        return limitNumber;
    }

    public void setLimitNumber(Integer limitNumber) {
        this.limitNumber = limitNumber;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public Integer getUseNumber() {
        return useNumber;
    }

    public void setUseNumber(Integer useNumber) {
        this.useNumber = useNumber;
    }

    public Integer getLeftNumber() {
        return leftNumber;
    }

    public void setLeftNumber(Integer leftNumber) {
        this.leftNumber = leftNumber;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getLimitAmount() {
        return limitAmount;
    }

    public void setLimitAmount(BigDecimal limitAmount) {
        this.limitAmount = limitAmount;
    }

    public Integer getIsShow() {
        return isShow;
    }

    public void setIsShow(Integer isShow) {
        this.isShow = isShow;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Float getRatio() {
        return ratio;
    }

    public void setRatio(Float ratio) {
        this.ratio = ratio;
    }

    public BigDecimal getMaxRatioAmount() {
        return maxRatioAmount;
    }

    public void setMaxRatioAmount(BigDecimal maxRatioAmount) {
        this.maxRatioAmount = maxRatioAmount;
    }

    public String getTrack() {
        return track;
    }

    public void setTrack(String track) {
        this.track = track;
    }

    public String getClassType() {
        return classType;
    }

    public void setClassType(String classType) {
        this.classType = classType;
    }

    public Integer getEffectType() {
        return effectType;
    }

    public void setEffectType(Integer effectType) {
        this.effectType = effectType;
    }

    public Integer getEffectDays() {
        return effectDays;
    }

    public void setEffectDays(Integer effectDays) {
        this.effectDays = effectDays;
    }

    public String getRelationIds() {
        return relationIds;
    }

    public void setRelationIds(String relationIds) {
        this.relationIds = relationIds;
    }

    public String getRelationList() {
        return relationList;
    }

    public void setRelationList(String relationList) {
        this.relationList = relationList;
    }

    public String getEditor() {
        return editor;
    }

    public void setEditor(String editor) {
        this.editor = editor;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Long getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Long createdAt) {
        this.createdAt = createdAt;
    }

    public Long getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Long updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Integer getFurnishMeal() {
        return furnishMeal;
    }

    public void setFurnishMeal(Integer furnishMeal) {
        this.furnishMeal = furnishMeal;
    }

    public Integer getFurnishExpress() {
        return furnishExpress;
    }

    public void setFurnishExpress(Integer furnishExpress) {
        this.furnishExpress = furnishExpress;
    }

    public Integer getFurnishDraw() {
        return furnishDraw;
    }

    public void setFurnishDraw(Integer furnishDraw) {
        this.furnishDraw = furnishDraw;
    }

    public Integer getFurnishVir() {
        return furnishVir;
    }

    public void setFurnishVir(Integer furnishVir) {
        this.furnishVir = furnishVir;
    }

    public Integer getDisableDistribute() {
        return disableDistribute;
    }

    public void setDisableDistribute(Integer disableDistribute) {
        this.disableDistribute = disableDistribute;
    }

    public String getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(String merchantId) {
        this.merchantId = merchantId;
    }

    public String getCategoryId() {
        return categoryId;
    }

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