
package com.czg.market.dto;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.alibaba.fastjson2.annotation.JSONField;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotNull;
import lombok.experimental.Accessors;
import java.io.Serial;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 积分基本设置 实体类。
 *
 * @author ww
 * @since 2025-12-08
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class MkPointsConfigDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

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

    /**
     * 开启消费赠送积分 1-开启 0-关闭 开启后，所有用户可通过消费获得积分及可用积分抵扣支付
     */
    @NotNull(message = "开启消费开关参数错误")
    private Integer enableRewards;

    /**
     * 每消费xx元赠送1积分
     */
    @NotNull(message = "消费送积分参数错误")
    @DecimalMin(value = "0", inclusive = false, message = "消费送积分金额必须大于0")
    private BigDecimal consumeAmount;

    /**
     * 下单实付抵扣门槛
     */
//    @NotNull(message = "抵扣门槛参数错误")
    private BigDecimal minPaymentAmount;

    /**
     * 下单最高抵扣比例
     */
    @NotNull(message = "抵扣比例参数错误")
    @DecimalMin(value = "0", inclusive = false, message = "抵扣比例必须大于0")
    private BigDecimal maxDeductionRatio;

    /**
     * 下单抵扣积分比例 1元=?积分
     */
    @NotNull(message = "积分比例错误")
    @DecimalMin(value = "0", inclusive = false, message = "积分比例必须大于0")
    private Integer equivalentPoints;

    /**
     * 开启积分商城
     */
    @NotNull(message = "积分商城开关参数错误")
    private Integer enablePointsMall;

    /**
     * 创建时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

}
