package cn.ysk.cashier.mybatis.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.Instant;
import java.util.Date;
import java.util.List;

@Data
public class TbFreeDineConfig {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Integer id;

    @NotNull
    @Column(name = "enable", nullable = false)
    private Boolean enable = false;

    @NotNull
    @Column(name = "recharge_times", nullable = false)
    private Integer rechargeTimes;

    @NotNull
    @Column(name = "recharge_threshold", nullable = false, precision = 10, scale = 2)
    private BigDecimal rechargeThreshold;

    @NotNull
    @Column(name = "with_coupon", nullable = false)
    private Boolean withCoupon = false;

    @NotNull
    @Column(name = "with_points", nullable = false)
    private Boolean withPoints = false;

    @Size(max = 500)
    @Column(name = "recharge_desc", length = 500)
    private String rechargeDesc;

    @Size(max = 255)
    @Column(name = "use_type")
    private String useType;

    @NotNull
    @Column(name = "shop_id", nullable = false)
    private Integer shopId;

    @Column(name = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @Column(name = "update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @Size(max = 255)
    @Column(name = "child_shop_id_list")
    private String childShopIdList;

    @TableField(exist = false)
    private List<String> useTypeList;

}
