package com.schoolinout.system.domain.dto;

import io.swagger.v3.oas.annotations.media.Schema;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * @author sakura
 * @date 2024/1/9 10:10:44 Tue
 */
@Schema(name = "新增家长请求参数实体")
public class ParentDto {

    @Schema(description = "家长id")
    private Long id;

    @Schema(description = "绑定学生列表")
    @NotNull(message = "学生不能为空")
    private List<Long> studentIds;

    /**
     * 家长姓名
     */
    @Schema(description = "家长姓名")
    @NotBlank(message = "姓名不能为空")
    private String parentName;

    /**
     * 家长电话
     */
    @Schema(description = "家长电话")
    @NotNull(message = "家长电话不能为空")
    @Pattern(regexp = "^1[34578]\\d{9}$", message = "家长电话格式不正确")
    private String parentPhone;

    /**
     * 与学生的关系
     */
    @Schema(description = "与学生的关系")
    @NotBlank(message = "关系不能为空")
    private String relation;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "AddParentDto{" +
                "studentIds=" + studentIds +
                ", parentName='" + parentName + '\'' +
                ", parentPhone='" + parentPhone + '\'' +
                ", relation='" + relation + '\'' +
                '}';
    }

    public List<Long> getStudentIds() {
        return studentIds;
    }

    public void setStudentIds(List<Long> studentIds) {
        this.studentIds = studentIds;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public String getParentPhone() {
        return parentPhone;
    }

    public void setParentPhone(String parentPhone) {
        this.parentPhone = parentPhone;
    }

    public String getRelation() {
        return relation;
    }

    public void setRelation(String relation) {
        this.relation = relation;
    }
}
