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

import com.jeesharp.framework.pojo.dto.BaseSaveDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;

/**
 * 会员保存DTO
 *
 * @author jeesharp
 * @version 2024-01-24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "会员保存请求")
public class MemberSaveDTO extends BaseSaveDTO {
    /**
     * 会员编号（对外展示的唯一编号）
     */
    @Schema(description = "会员编号")
    private String memberNo;

    @Schema(description = "会员昵称")
    private String nickname;

    @Schema(description = "真实姓名")
    private String realName;

    @Schema(description = "头像URL")
    private String avatar;

    @Schema(description = "性别：0-未知 1-男 2-女")
    private Integer gender;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED)
    private String mobile;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "身份证号")
    private String idCard;

    @Schema(description = "生日")
    private LocalDate birthday;

    @Schema(description = "省份")
    private String province;

    @Schema(description = "城市")
    private String city;

    @Schema(description = "区县")
    private String district;

    @Schema(description = "详细地址")
    private String address;

    @Schema(description = "会员等级编码")
    private String levelCode;

    @Schema(description = "会员状态：0-禁用 1-正常 2-待审核 3-已注销")
    private Integer status;

    @Schema(description = "会员来源")
    private String source;

    @Schema(description = "备注")
    private String remarks;
}
