package com.gameplatform.server.model.dto.account;

import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.*;

@Schema(description = "账户创建请求")
public class AccountCreateRequest {
    @Schema(description = "用户类型", example = "AGENT", allowableValues = {"ADMIN", "AGENT"})
    @NotBlank(message = "userType 不能为空")
    @Pattern(regexp = "^(ADMIN|AGENT)$", message = "userType 只能是 ADMIN 或 AGENT")
    private String userType; // ADMIN | AGENT

    @Schema(description = "用户名", example = "newuser", minLength = 3, maxLength = 64)
    @NotBlank(message = "username 不能为空")
    @Size(min = 3, max = 64, message = "username 长度必须在 3-64 字符之间")
    @Pattern(regexp = "^[a-zA-Z0-9_]+$", message = "username 只能包含字母、数字、下划线")
    private String username;

    @Schema(description = "密码", example = "123456", minLength = 6, maxLength = 128)
    @NotBlank(message = "password 不能为空")
    @Size(min = 6, max = 128, message = "password 长度必须在 6-128 字符之间")
    private String password;

    @Schema(description = "账户状态", example = "ENABLED", allowableValues = {"ENABLED", "DISABLED"}, defaultValue = "ENABLED")
    private String status;

    @Schema(description = "积分余额", example = "1000", minimum = "0", defaultValue = "0")
    @Min(0)
    private Long pointsBalance; // for AGENT

    public String getUserType() { return userType; }
    public void setUserType(String userType) { this.userType = userType; }
    public String getUsername() { return username; }
    public void setUsername(String username) { this.username = username; }

    public String getStatus() { return status; }
    public void setStatus(String status) { this.status = status; }
    public String getPassword() { return password; }
    public void setPassword(String password) { this.password = password; }
    public Long getPointsBalance() { return pointsBalance; }
    public void setPointsBalance(Long pointsBalance) { this.pointsBalance = pointsBalance; }
}

