package com.xunhong.erp.turbo.api.user.dto.cmd;


import com.alibaba.cola.dto.Command;
import com.xunhong.erp.turbo.api.user.dto.enums.SocialTypeEnum;
import com.xunhong.erp.turbo.base.annotation.Decrypt;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Pattern;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author shenyifei
 */
@Data
@Builder
@Schema(title = "用户认证新增")
@EqualsAndHashCode(callSuper = true)
public class UserAuthCreateCmd extends Command {

	/**
	 * 账号
	 */
	@Schema(title = "账号")
	private String username;

	/**
	 * 密码
	 */
	@Decrypt
	@Schema(title = "密码")
	@Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{8,}$", message = "密码必须至少8个字符，包含至少一个大写字母、一个小写字母、一个数字和一个特殊字符")
	private String password;

	/**
	 * 类型
	 */
	@Schema(title = "类型")
	private SocialTypeEnum socialType;

	/**
	 * 是否是管理员
	 */
	@Schema(title = "是否是管理员")
	private Boolean isAdmin;
}
