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 javax.validation.constraints.NotNull;
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 = "会员标签", example = "[红色, 快乐]")
    private List<String> tagNames;

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

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

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

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

    @Schema(description = "当前身价级别", example = "等级一")
    private String currentMemberWorthLevel;

    @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 String ancNickName;

    @Schema(description = "当前红积分", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long redCurrentQuota;

    @Schema(description = "当前黄积分", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long yellowCurrentQuota;

    @Schema(description = "当前绿积分", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long greenCurrentQuota;

    @Schema(description = "峰值累计")
    private Long highQuotaTotal;

    @Schema(description = "用户名", example = "张三")
    private String username;

    @Schema(description = "是否首次充值")
    private Boolean isFirst;

    @Schema(description = "是否是代理商 0：否 1：是")
    private Boolean agent;

    @Schema(description = "用户类型")
    private Integer categoryId;
}
