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

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * 小程序新增/编辑常用游客请求体，字段对齐 C 端 {@code VisitorInfo}。
 *
 * @author jeesharp
 * @since 2026-05-12
 */
@Data
@Schema(description = "常用游客保存请求")
public class MemberVisitorBodyDTO {

    @NotBlank(message = "姓名不能为空")
    @Size(max = 64, message = "姓名过长")
    @Schema(description = "真实姓名", requiredMode = Schema.RequiredMode.REQUIRED)
    private String name;

    @NotBlank(message = "身份证号不能为空")
    @Pattern(regexp = "^\\d{15}$|^\\d{17}[\\dXx]$", message = "身份证号格式不正确")
    @Schema(description = "身份证号（15 或 18 位）", requiredMode = Schema.RequiredMode.REQUIRED)
    private String idCard;

    @Pattern(regexp = "^$|^1\\d{10}$", message = "手机号需为 11 位")
    @Schema(description = "手机号（选填）")
    private String phone;
}
