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

import com.github.microservice.auth.security.type.AuthType;
import com.github.microservice.components.data.mongo.mongo.dao.MongoDao;
import com.zhongshu.card.client.type.OrganizationState;
import com.zhongshu.card.server.core.dao.org.extend.OrganizationDaoExtend;
import com.zhongshu.card.server.core.domain.org.Organization;

import java.util.List;

/**
 * @author TRX
 * @date 2024/3/21
 */
public interface OrganizationDao extends MongoDao<Organization>, OrganizationDaoExtend {

    Organization findTopById(String id);

    Organization findTopByOid(String oid);

    List<Organization> findByProjectOidAndIsOrg(String projectOid, Boolean isOrg);

    Organization findTopByOrgCode(String orgCode);

    Organization findTopByNameAndAuthType(String name, AuthType authType);

    List<Organization> findByOidIn(List<String> oids);

    Organization findTopByName(String name);

    Organization findTopByAuthType(AuthType authType);

    List<Organization> findByAuthType(AuthType authType);

    Organization findTopByCode(String code);

    List<Organization> findByAuthTypeAndStateOrderByCreateTimeDesc(AuthType authType, OrganizationState state);

    Organization findTopByProjectOidAndName(String projectOid, String name);

}
