package com.huimv.employment.service.enterprise.dto;

import com.fasterxml.jackson.annotation.JsonAlias;
import io.swagger.v3.oas.annotations.media.Schema;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * 企业登记 / 认证请求体。
 */
@Schema(description = "企业登记请求")
public class EnterpriseRegisterRequest {

    @NotNull(message = "草稿 ID 不能为空")
    @Schema(description = "关联用工草稿 ID；认证成功后回填该草稿及对应订单、登记批次的 enterprise_id",
            requiredMode = Schema.RequiredMode.REQUIRED, example = "23")
    private Long draftId;

    @NotBlank(message = "企业名称不能为空")
    @Size(max = 200, message = "企业名称过长")
    private String name;

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

    @NotBlank(message = "法人姓名不能为空")
    @Size(max = 64, message = "法人姓名过长")
    private String legalPerson;

    @NotBlank(message = "法人身份证号不能为空")
    @Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[0-9Xx]$",
            message = "法人身份证号格式不正确")
    @JsonAlias({"legal_person_id_card", "legalPersonIdCardNo", "idCardNo"})
    @Schema(description = "法人身份证号（18 位）", example = "110101199001011234")
    private String legalPersonIdCard;

    @NotBlank(message = "注册地址不能为空")
    @Size(max = 500, message = "注册地址过长")
    private String registeredAddress;

    @NotBlank(message = "联系人姓名不能为空")
    @Size(max = 64, message = "联系人姓名过长")
    private String contactName;

    @NotBlank(message = "联系人手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "联系人手机号格式不正确")
    private String contactMobile;

    public Long getDraftId() {
        return draftId;
    }

    public void setDraftId(Long draftId) {
        this.draftId = draftId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCreditCode() {
        return creditCode;
    }

    public void setCreditCode(String creditCode) {
        this.creditCode = creditCode;
    }

    public String getLegalPerson() {
        return legalPerson;
    }

    public void setLegalPerson(String legalPerson) {
        this.legalPerson = legalPerson;
    }

    public String getLegalPersonIdCard() {
        return legalPersonIdCard;
    }

    public void setLegalPersonIdCard(String legalPersonIdCard) {
        this.legalPersonIdCard = legalPersonIdCard;
    }

    public String getRegisteredAddress() {
        return registeredAddress;
    }

    public void setRegisteredAddress(String registeredAddress) {
        this.registeredAddress = registeredAddress;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getContactMobile() {
        return contactMobile;
    }

    public void setContactMobile(String contactMobile) {
        this.contactMobile = contactMobile;
    }
}
