package com.jeesharp.business.modules.member.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.jeesharp.framework.mybatis.core.dataobject.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 会员积分场景规则实体，映射 {@code app_member_points_rule}。
 *
 * @author jeesharp
 * @since 2026-06-23
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("app_member_points_rule")
@Schema(description = "会员积分场景规则")
public class MemberPointsRule extends BaseEntity<MemberPointsRule> {

    @Schema(description = "场景编码")
    private String sceneCode;

    @Schema(description = "规则名称")
    private String ruleName;

    /**
     * @see com.jeesharp.business.modules.member.enums.MemberPointsCalcTypeEnum
     */
    @Schema(description = "计算方式")
    private String calcType;

    @Schema(description = "基础固定分")
    private Integer basePoints;

    @Schema(description = "每元积分（按金额计分）")
    private BigDecimal amountRate;

    @Schema(description = "是否乘以等级 points_rate：0-否 1-是")
    private Integer applyLevelRate;

    @Schema(description = "积分有效天数（0=永久）")
    private Integer validDays;

    @Schema(description = "每人每日上限次数（0=不限）")
    private Integer dailyLimit;

    @Schema(description = "每人累计上限次数（0=不限）")
    private Integer totalLimit;

    @Schema(description = "状态：0-禁用 1-启用")
    private Integer status;
}
