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

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

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

/**
 * 添加第三方平台工人条目。
 */
@Schema(description = "第三方平台工人条目")
public class ThirdPartyWorkerAddItem {

    @JsonProperty("worker_id")
    @JsonAlias({"workerId"})
    @Schema(description = "工人 ID（第三方 Mock / 档案 ID，可空）")
    private Long workerId;

    @NotBlank(message = "real_name 不能为空")
    @JsonProperty("real_name")
    @JsonAlias({"realName"})
    @Schema(description = "姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "王强")
    private String realName;

    @NotBlank(message = "mobile 不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @JsonProperty("mobile")
    @JsonAlias({"phone", "contactMobile", "contact_mobile"})
    @Schema(description = "手机号明文（入库加密）", requiredMode = Schema.RequiredMode.REQUIRED, example = "13812341001")
    private String mobile;

    @NotBlank(message = "id_card_no 不能为空")
    @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 = "身份证号格式不正确")
    @JsonProperty("id_card_no")
    @JsonAlias({"idCardNo", "idCard", "legalPersonIdCard"})
    @Schema(description = "身份证号明文（入库加密）", requiredMode = Schema.RequiredMode.REQUIRED, example = "110101199001011234")
    private String idCardNo;

    @NotBlank(message = "confirmed_work_type 不能为空")
    @JsonProperty("confirmed_work_type")
    @JsonAlias({"confirmedWorkType", "jobType", "job_type"})
    @Schema(description = "工种，须属于订单用工明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "搬运工")
    private String confirmedWorkType;

    public Long getWorkerId() {
        return workerId;
    }

    public void setWorkerId(Long workerId) {
        this.workerId = workerId;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getIdCardNo() {
        return idCardNo;
    }

    public void setIdCardNo(String idCardNo) {
        this.idCardNo = idCardNo;
    }

    public String getConfirmedWorkType() {
        return confirmedWorkType;
    }

    public void setConfirmedWorkType(String confirmedWorkType) {
        this.confirmedWorkType = confirmedWorkType;
    }
}
