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.time.LocalDateTime;

/**
 * 会员积分流水实体，映射表 {@code app_member_points_log}，记录积分增减全量变动。
 *
 * @author jeesharp
 * @since 2026-06-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("app_member_points_log")
@Schema(description = "会员积分流水")
public class MemberPointsLog extends BaseEntity<MemberPointsLog> {

    @Schema(description = "会员ID")
    private String memberId;

    /**
     * @see com.jeesharp.business.modules.member.enums.MemberPointsTypeEnum
     */
    @Schema(description = "类型：1-获取 2-消费 3-冻结 4-解冻 5-过期 6-调整")
    private Integer pointsType;

    @Schema(description = "变动数量（正为增加，负为减少）")
    private Integer points;

    @Schema(description = "变动前可用积分")
    private Integer beforePoints;

    @Schema(description = "变动后可用积分")
    private Integer afterPoints;

    /**
     * @see com.jeesharp.business.modules.member.enums.MemberPointsBizTypeEnum
     */
    @Schema(description = "业务类型")
    private String bizType;

    @Schema(description = "业务ID")
    private String bizId;

    @Schema(description = "业务描述")
    private String bizDesc;

    @Schema(description = "积分规则ID")
    private String ruleId;

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

    @Schema(description = "积分过期时间")
    private LocalDateTime expireDate;

    @Schema(description = "操作来源：SYSTEM/ADMIN/APP/MINI")
    private String operateSource;
}
