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

import com.github.microservice.auth.security.type.AuthType;
import com.zhongshu.card.client.model.base.SuperModel;
import com.zhongshu.card.client.type.OrganizationState;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * @author TRX
 * @date 2024/5/31
 */
@Data
public class OrganizationModel extends SuperModel {
    @Schema(description = "机构名称")
    private String name;

    @Schema(description = "编码、项目ID")
    private String code;

    @Schema(description = "统一社会信用代码")
    private String orgCode;

    @Schema(description = "联系人邮箱")
    private String contactEmail;

    @Schema(description = "联系人-用来初始管理员")
    private String contactName;

    @Schema(description = "联系人电话")
    private String contactPhone;

    @Schema(description = "logo")
    private String logo;

    @Schema(description = "地址")
    private String address;

    @Schema(description = " 行政区划编码")
    private String adminDivisionItemCode;

    @Schema(description = "地区列表")
    private List<RegionModel> regionList;

    @Schema(description = "经度")
    private String mapLon;

    @Schema(description = "纬度")
    private String mapLat;

    @Schema(description = "机构类型")
    private AuthType authType = AuthType.Enterprise;

    private String authTypeStr;

    public String getAuthTypeStr() {
        if (authType != null) {
            return authType.getRemark();
        }
        return "";
    }

    @Schema(description = "状态")
    private OrganizationState state;

    @Schema(description = "状态显示")
    private String stateStr;

    public String getStateStr() {
        if (state != null) {
            return state.getRemark();
        }
        return "";
    }

    @Schema(description = "如果是学校，关联的项目信息")
    private OrganizationSimpleModel projectModel;

}
