package com.zhongshu.card.server.core.domain.school;

import com.zhongshu.card.client.utils.ITree;
import com.zhongshu.card.client.type.DataState;
import com.zhongshu.card.server.core.domain.base.SuperMain;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.checkerframework.common.aliasing.qual.NonLeaked;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * 院级管理
 *
 * @author TRX
 * @date 2024/6/3
 */
@Data
@Document
@AllArgsConstructor
@NoArgsConstructor
@NonLeaked
public class College extends SuperMain {

    @Schema(description = "院级名称")
    private String name;

    @Schema(description = "院级编码")
    private String code;

    @Schema(description = "院级状态")
    private DataState state = DataState.Enable;

    @Schema(description = "上级ID")
    @Indexed
    private String parentId = ITree.ROOT_ID;

    public static College build(String id) {
        College entity = new College();
        entity.setId(id);
        return entity;
    }
}
