package cn.newfeifan.mall.module.member.controller.admin.user.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.List;

import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 会员用户 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class MemberUserRespVO extends MemberUserBaseVO {

    @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23788")
    private Long id;

    @Schema(description = "注册 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "127.0.0.1")
    private String registerIp;

    @Schema(description = "最后登录IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "127.0.0.1")
    private String loginIp;

    @Schema(description = "最后登录时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime loginDate;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime createTime;

    // ========== 其它信息 ==========

    @Schema(description = "积分", requiredMode  = Schema.RequiredMode.REQUIRED, example = "100")
    private Integer point;

    @Schema(description = "总积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "2000")
    private Integer totalPoint;

    @Schema(description = "会员标签", example = "[红色, 快乐]")
    private List<String> tagNames;

    @Schema(description = "会员等级", example = "黄金会员")
    private String levelName;

    @Schema(description = "用户分组", example = "购物达人")
    private String groupName;

    @Schema(description = "用户经验值", requiredMode  = Schema.RequiredMode.REQUIRED, example = "200")
    private Integer experience;




    @Schema(description = "直接推荐人id", example = "15893")
    private Long recommenderdId;

    @Schema(description = "当前身价值")
    private Long currentMemberWorthValue;

    @Schema(description = "预增加身价值")
    private Long preAddedMemberWorthValue;

    @Schema(description = "未来身价值，未来身价值=当前身价值+预增加身价值")
    private Long futureMemberWorthValue;

    @Schema(description = "当前身价级别名称", example = "张三")
    private String currentMemberWorthLevelName;

    @Schema(description = "当前身价级别id", example = "24146")
    private Long currentMemberWorthLevelId;

    @Schema(description = "最后签到时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime lastSignInTime;

    @Schema(description = "连续签到天数")
    private LocalDateTime continuousSignInDays;

    @Schema(description = "当前积分值")
    private Long currentMemberPoints;

    @Schema(description = "预增加积分值")
    private Long preAddedMemberWorth;

    @Schema(description = "累计消费金额（只算人民币，单位为分）")
    private Long cumulativeSpending;
}
