package com.czg.market.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
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.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 积分基本设置 实体类。
 *
 * @author ww
 * @since 2025-12-08
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("mk_points_config")
public class MkPointsConfig implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

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

    /**
     * 开启消费赠送积分 1-开启 0-关闭 开启后，所有用户可通过消费获得积分及可用积分抵扣支付
     */
    private Integer enableRewards;

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

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

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

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

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

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

}
