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

import com.github.microservice.auth.security.type.AuthType;
import com.zhongshu.card.client.type.DataState;
import com.zhongshu.card.client.type.OrganizationRelationType;
import com.zhongshu.card.server.core.domain.base.SuperMain;
import com.zhongshu.card.server.core.domain.paySetting.PayShareList;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.List;

/**
 * 机构关系  比如 学校（主）关联项目  商户（主）关联 学校
 *
 * @author TRX
 * @date 2024/6/4
 */
@Data
@Document
@AllArgsConstructor
@NoArgsConstructor
public class OrganizationRelation extends SuperMain {

    @Schema(description = "主数据")
    @DBRef(lazy = true)
    private Organization mainOrganization;

    private String mainOid;

    @Schema(description = "主名称")
    private String mainName;

    @Schema(description = "主数据的类型")
    private AuthType authType = AuthType.Project;

    @Schema(description = "关联数据")
    @DBRef(lazy = true)
    private Organization relOrganization;

    @Schema(description = "关联的名称")
    private String relName;

    private String relOid;

    @Schema(description = "被绑定的数据类型")
    private AuthType relAuthType;

    @Schema(description = "绑定关联类型")
    private OrganizationRelationType relationType;

    @Schema(description = "分账配置")
    @DBRef(lazy = true)
    private PayShareList payShareList;

    @Schema(description = "负责人userId")
    private List<String> managerUserIds;

    @Schema(description = "数据状态")
    private DataState state = DataState.Enable;
}
