package com.zhongshu.card.client.model.school;

import com.zhongshu.card.client.model.base.SuperModel;
import com.zhongshu.card.client.model.org.DepartmentModel;
import com.zhongshu.card.client.model.org.OrganizationModel;
import com.zhongshu.card.client.model.org.OrganizationUserModel;
import com.zhongshu.card.client.model.org.UserCountModel;
import com.zhongshu.card.client.type.BookState;
import com.zhongshu.card.client.type.OrganizationUserType;
import com.zhongshu.card.client.type.Sex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author TRX
 * @date 2024/6/7
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BookInfoModel extends SuperModel {
    @Schema(description = "类型  学生 、教师")
    OrganizationUserType userType;

    @Schema(description = "姓名")
    private String name;

    @Schema(description = "部门，教师使用")
    private DepartmentModel department;

    @Schema(description = "性别")
    private Sex sex;

    @Schema(description = "电话")
    private String phone;

    @Schema(description = "身份证号")
    private String idCard;

    @Schema(description = "教师 入校时间")
    private Long inSchoolTime;

    @Schema(description = "学号 学生使用")
    private String code;

    @Schema(description = "学生：班级")
    private String className;

    @Schema(description = "学生：入学年份")
    private Long inSchoolYear;

    @Schema(description = "状态")
    private BookState bookState;

    private String bookStateStr;

    public String getBookStateStr() {
        if (bookState != null) {
            return bookState.getRemark();
        }
        return "";
    }

    //------------------------关联平台 数据信息 start--------------------
    @Schema(description = "所在学校")
    private OrganizationModel organization;

    @Schema(description = "关联账号信息")
    private UserCountModel userAccount;

    @Schema(description = "用户UserId")
    private String userId;

    @Schema(description = "关联的结构用户信息")
    private OrganizationUserModel organizationUser;
}
