package com.czg.account.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import java.io.Serial;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 霸王餐配置信息表 实体类。
 *
 * @author zs
 * @since 2025-02-21
 */
@Data

@NoArgsConstructor
@AllArgsConstructor
@Table("tb_free_dine_config")
public class FreeDineConfig implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 是否启用
     */
    private Boolean enable;

    /**
     * 充值多少倍免单
     */
    private Integer rechargeTimes;

    /**
     * 订单满多少元可以使用
     */
    private BigDecimal rechargeThreshold;

    /**
     * 是否与优惠券共享
     */
    private Boolean withCoupon;

    /**
     * 是否与积分同享
     */
    private Boolean withPoints;

    /**
     * 充值说明
     */
    private String rechargeDesc;

//    /**
//     * 使用类型 dine-in店内 takeout 自取 post快递，takeaway外卖
//     */
    private String useType;

    /**
     * 门店id
     */
    @Id
    private Long shopId;

    /**
     * 创建时间
     */
    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @Column(onInsertValue = "now()", onUpdateValue = "now()")
    private LocalDateTime updateTime;

    /**
     * 可用的子门店id
     */
    private String shopIdList;
    private String useShopType;

    public Integer getMultiple() {
        return rechargeTimes == null ? 2 : rechargeTimes;
    }
}
