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 lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

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

/**
 * 积分基本设置 实体类。
 *
 * @author ww
 * @since 2025-02-20
 */
@Data

@NoArgsConstructor
@AllArgsConstructor
@Table("tb_points_basic_setting")
public class PointsBasicSetting implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 店铺id
     */
    @Id(keyType = KeyType.None)
    private Long shopId;

    /**
     * 开启消费赠送积分 1-开启 0-关闭
     */
    private Integer enableRewards;

    /**
     * 赠积分适用群体 all-全部 vip-仅会员
     */
    private String rewardsGroup;

    /**
     * 每消费xx元赠送1积分
     */
    private BigDecimal consumeAmount;

    /**
     * 开启下单积分抵扣 1-开启 0-关闭
     */
    private Integer enableDeduction;

    /**
     * 抵扣适用群体 all-全部 vip-仅会员
     */
    private String deductionGroup;

    /**
     * 下单实付抵扣门槛
     */
    private BigDecimal minPaymentAmount;

    /**
     * 下单最高抵扣比例
     */
    private BigDecimal maxDeductionRatio;

    /**
     * 下单抵扣积分比例 1元=?积分
     */
    private Integer equivalentPoints;

    /**
     * 开启积分商城
     */
    private Integer enablePointsMall;

    /**
     * 浏览模式 list-列表 grid-宫格
     */
    private String browseMode;

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

}
