package com.red.circle.other.infra.database.mongo.service.team.team;

import com.red.circle.other.infra.database.mongo.entity.team.team.TeamApplicationProcess;
import com.red.circle.other.inner.model.cmd.team.TeamApplicationProcessChangeCmd;
import com.red.circle.other.inner.model.cmd.team.TeamApplicationProcessQryCmd;
import com.red.circle.other.inner.enums.team.TeamApplicationProcessStatus;
import java.util.List;
import java.util.Set;

/**
 * 团队申请流程服务.
 *
 * @author pengliang on 2022/12/9
 */
public interface TeamApplicationProcessService {

  /**
   * 创建流程.
   */
  void add(TeamApplicationProcess process);

  /**
   * 修改流程状态.
   */
  void changeStatus(TeamApplicationProcessChangeCmd param);

  /**
   * 修改用户审核状态=拒绝.
   */
  void changeUserTeamWaitReject(Long userId);

  /**
   * 根据条件查询列表.
   */
  List<TeamApplicationProcess> listByCondition(TeamApplicationProcessQryCmd teamQuery);

  /**
   * 删除.
   */
  void deleteById(Long id);

  /**
   * 获得数据.
   */
  TeamApplicationProcess getById(Long id);

  /**
   * 是否存在待审核记录.
   */
  Boolean existWaitByUserId(Long userId);

  /**
   * 获取用户退出申请id.
   */
  String getQuitWaitApplyId(Long userId);

  /**
   * 获取用户退出申请.
   */
  TeamApplicationProcess getQuitWaitApplyById(Long id);

  /**
   * 获取用户加入申请.
   */
  TeamApplicationProcess getJoinWaitApplyById(Long id);

  /**
   * 团队是否存在为审核消息.
   */
  Boolean existTeamWaitByTeamId(Long teamId);

  /**
   * 获取团队等待审核数量.
   */
  Long countTeamWaitByTeamId(Long teamId);

  /**
   * 获取团队等待审核信息.
   */
  List<TeamApplicationProcess> listTeamByTeamId(Long teamId, TeamApplicationProcessStatus status);

  /**
   * 获取用户等待审核, 加入消息记录.
   */
  TeamApplicationProcess getTeamWaitApprovalJoin(Long userId);

  /**
   * 移除申请.
   */
  void remove(Long associateId, Long userId);

  /**
   * 删除一组指定业务信息.
   */
  void removeBatchByAssociateId(List<Long> associateIds);

  /**
   * 移除申请-根据id.
   */
  void removeById(Long id);

  /**
   * 查询申请离开团队的申请记录.
   *
   * @param day 大于创建申请离开时间多少天
   * @return 记录
   */
  List<TeamApplicationProcess> listApplyOutTeamMember(Integer day);

  /**
   * 上个月申请退出团队的成员申请记录.
   *
   * @return 记录
   */
  List<TeamApplicationProcess> listLastMonthApplyOutTeamMember();

  /**
   * 移除， 用户申请.
   */
  void removeByUserId(Long memberUserId);

  /**
   * 获取用户退出申请.
   */
  TeamApplicationProcess getQuitWaitApply(Long memberId);


  /**
   * 删除app用户待审核的记录.
   */
  void deleteWaitByAppUserIds(Set<Long> collect);

  /**
   * 根据ids查询记录.
   */
  List<TeamApplicationProcess> listByIds(Set<Long> ids);
}
