package com.yaoyuan.jiscuss.dto;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

/**
 * Request payload for creating a new user account.
 * Validated at the controller boundary before reaching the service layer.
 */
public record UserCreateRequest(

        @NotBlank(message = "用户名不能为空")
        @Size(min = 3, max = 50, message = "用户名长度必须在 3-50 个字符之间")
        String username,

        /**
         * Raw password — will be BCrypt-hashed before persistence.
         * Never log or return this field.
         */
        @NotBlank(message = "密码不能为空")
        @Size(min = 8, max = 100, message = "密码长度至少 8 个字符")
        String password,

        @Email(message = "邮箱格式不正确")
        @Size(max = 100)
        String email,

        @Size(max = 50)
        String realname
) {}
