package com.backendsys.entity.B2c;

import java.time.LocalDateTime;
import com.backendsys.entity.validator.Phone;
import com.backendsys.entity.validator.RangeArray;

import jakarta.validation.constraints.*;
import lombok.Data;

@Data
public class B2cMemberDTO {
    public static interface Detail{}
    public static interface Create{}
    public static interface Update{}
    public static interface Delete{}
    public static interface Login{}

    /**
     * b2c_member
     */
    private Long id;
    
    @NotNull(message = "会员ID不能为空", groups = { B2cMemberDTO.Detail.class, B2cMemberDTO.Update.class, B2cMemberDTO.Delete.class })
    private Long member_id;

    private String open_id;

    @Size(min = 2, max = 50, message = "昵称长度在 {min}-{max} 字符", groups = { B2cMemberDTO.Create.class, B2cMemberDTO.Update.class })
    private String nickname;

    @Phone(message="手机号码格式不正确", groups = { B2cMemberDTO.Create.class, B2cMemberDTO.Update.class, B2cMemberDTO.Login.class })
    private String phone;

    @Email(message="邮箱格式不正确", groups = { B2cMemberDTO.Create.class, B2cMemberDTO.Update.class })
    private String email;

    @NotEmpty(message="密码不能为空", groups = { B2cMemberDTO.Create.class, B2cMemberDTO.Update.class, B2cMemberDTO.Login.class })
    private String password;

    @RangeArray(message="性别取值有误，范围应是(1男, 2女, 3保密)", value = {"1", "2", "3"}, groups = { B2cMemberDTO.Create.class, B2cMemberDTO.Update.class })
    private Integer gender;

    @Size(max = 1000, message = "头像路径长度不超过 {max} 字符", groups = { B2cMemberDTO.Create.class, B2cMemberDTO.Update.class })
    private String avatar;

    private String last_login_ip;
    private String last_login_uuid;
    private LocalDateTime last_login_time;

    @RangeArray(message="状态取值有误，范围应是(-1禁用, 1启用)", value = {"-1", "1"}, groups = { B2cMemberDTO.Create.class, B2cMemberDTO.Update.class })
    private Integer status;

    private Integer del_flag;



    private String create_time_begin;
    private String create_time_end;

    private String create_time;
    private String update_time;
    
}
