package org.dromara.main.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.main.domain.MainCompanyApply;

import java.io.Serial;
import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = MainCompanyApply.class, reverseConvertGenerate = false)
public class MainCompanyApplyBo extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    private Long id;
    private String applyNo;

    @NotBlank(message = "企业名称不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 100, message = "企业名称长度不能超过100个字符")
    private String companyName;

    @NotBlank(message = "官方邮箱不能为空", groups = {AddGroup.class, EditGroup.class})
    @Email(message = "邮箱格式不正确")
    @Size(max = 100, message = "邮箱长度不能超过100个字符")
    private String officialAccount;

    @NotBlank(message = "办公地址不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 200, message = "办公地址长度不能超过200个字符")
    private String officeAddress;

    @NotBlank(message = "统一社会信用代码不能为空", groups = {AddGroup.class, EditGroup.class})
    @Pattern(regexp = "^[0-9A-HJ-NPQRTUWXY]{2}\\d{6}[0-9A-HJ-NPQRTUWXY]{10}$", message = "统一社会信用代码格式不正确")
    private String creditCode;

    // 门户端会上传 OSS ID 字符串，入库前再转成 Long。
    private String authLetter;
    private String avatar;

    @NotBlank(message = "姓氏不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 20, message = "姓氏长度不能超过20个字符")
    private String surname;

    @Size(max = 50, message = "名字长度不能超过50个字符")
    private String name;

    @NotBlank(message = "手机号不能为空", groups = {AddGroup.class, EditGroup.class})
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String mobile;
    private BigDecimal latitude;
    private BigDecimal longitude;
    private Integer applyStatus;
    @NotBlank(message = "验证码不能为空", groups = {AddGroup.class})
    private String smsCode;
    private String keyword;
}
