package com.red.circle.other.inner.endpoint.team.target.api;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.model.cmd.team.AddTeamContactCmd;
import com.red.circle.other.inner.model.cmd.team.AddTeamRemarkCmd;
import com.red.circle.other.inner.model.cmd.team.StatusTeamBatchCmd;
import com.red.circle.other.inner.model.cmd.team.TeamApplicationProcessApprovalCmd;
import com.red.circle.other.inner.model.cmd.team.TeamApplicationProcessApprovalQryCmd;
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.model.cmd.team.TeamChangeOwnerCmd;
import com.red.circle.other.inner.model.cmd.team.TeamCreateCmd;
import com.red.circle.other.inner.model.cmd.team.TeamSalaryBackQryCmd;
import com.red.circle.other.inner.model.cmd.team.TeamTableQryCmd;
import com.red.circle.other.inner.model.cmd.team.TeamUpdateCmd;
import com.red.circle.other.inner.model.dto.agency.agency.TeamApplicationProcessApprovalDTO;
import com.red.circle.other.inner.model.dto.agency.agency.TeamApplicationProcessDTO;
import com.red.circle.other.inner.model.dto.agency.agency.TeamMemberDTO;
import com.red.circle.other.inner.model.dto.agency.agency.TeamProfileDTO;
import com.red.circle.other.inner.model.dto.agency.agency.TeamSalaryPaymentDTO;
import java.util.List;
import java.util.Set;

import org.springframework.web.bind.annotation.*;

/**
 * 团队资料.
 *
 * @author lisizhe on 2023/8/19
 */
public interface TeamProfileClientApi {

  String API_PREFIX = "/team-profile/client";


  @PostMapping("/listByMemberIds")
  ResultResponse<List<TeamMemberDTO>> listByMemberIds(@RequestBody Set<Long> memberIds);

  @PostMapping("/listByIds")
  ResultResponse<List<TeamProfileDTO>> listByIds(@RequestBody Set<Long> ids);

  @GetMapping("/getByMemberId")
  ResultResponse<TeamMemberDTO> getByMemberId(@RequestParam("userId") Long userId);

  @PostMapping("/listProcessApprovalByCondition")
  ResultResponse<List<TeamApplicationProcessApprovalDTO>> listProcessApprovalByCondition(
      @RequestBody TeamApplicationProcessApprovalQryCmd query);

  @PostMapping("/listProcessByCondition")
  ResultResponse<List<TeamApplicationProcessDTO>> listProcessByCondition(
      @RequestBody TeamApplicationProcessQryCmd query);

  @PostMapping("/changeApplicationProcessStatus")
  ResultResponse<Void> changeApplicationProcessStatus(
      @RequestBody TeamApplicationProcessChangeCmd param);

  /**
   * 获得团队申请流程数据.
   */
  @GetMapping("/getApplicationProcessById")
  ResultResponse<TeamApplicationProcessDTO> getApplicationProcessById(@RequestParam("id") Long id);

  /**
   * 新增团队申请流程-审批日志.
   */
  @PostMapping("/addApplicationProcessApproval")
  ResultResponse<TeamApplicationProcessApprovalCmd> addApplicationProcessApproval(
      @RequestBody TeamApplicationProcessApprovalCmd param);

  /**
   * 新增成员
   */
  @GetMapping("/incrCounterMember")
  ResultResponse<Void> incrCounterMember(@RequestParam("id") Long id);

  /**
   * 创建团队
   */
  @PostMapping("/createTeam")
  ResultResponse<Void> createTeam(@RequestBody TeamCreateCmd cmd);

  /**
   * 修改团队
   */
  @PostMapping("/updateTeam")
  ResultResponse<Void> updateTeam(@RequestBody TeamUpdateCmd cmd);


  /**
   * 没有状态概念了，主播直接是删除； 相关数据全部del, 修改团队-状态.
   */
  @PostMapping("/updateTeamStatusBackBatch")
  ResultResponse<Void> updateTeamStatusBackBatch(@RequestBody StatusTeamBatchCmd param);

  /**
   * 删除团队
   */
  @PostMapping("/delTeam")
  ResultResponse<Void> delTeam(@RequestBody List<Long> teamIds);

  /**
   * 获取团队列表
   */
  @PostMapping("/teamList")
  ResultResponse<List<TeamProfileDTO>> teamList(@RequestBody TeamTableQryCmd cmd);

  /**
   * 新增团队备注
   */
  @PostMapping("/addTeamRemarks")
  ResultResponse<Void> addTeamRemarks(@RequestBody AddTeamRemarkCmd cmd);

  /**
   * 删除团队备注
   */
  @GetMapping("/removeTeamRemarks")
  ResultResponse<Void> removeTeamRemarks(@RequestParam("teamId") Long teamId,
      @RequestParam("remarkId") String remarkId);

  /**
   * 新增团队备注
   */
  @PostMapping("/removeTeamRemarks")
  ResultResponse<Void> addTeamContact(@RequestBody AddTeamContactCmd cmd);

  /**
   * 移除联系方式.
   */
  @PostMapping("/removeTeamContact")
  ResultResponse<Void> removeTeamContact(@RequestParam("teamId") Long teamId,
      @RequestParam("contactId") String contactId);

  /**
   * 获得代理区域ID.
   */
  @GetMapping("/getTeamRegionId")
  ResultResponse<String> getTeamRegionId(@RequestParam("id") Long id);

  /**
   * 变更团长(务必同区域或者团长不是主播代理).
   */
  @PostMapping("/changeTeamOwnUser")
  ResultResponse<Long> changeTeamOwnUser(@RequestBody TeamChangeOwnerCmd param);

  /**
   * 后台列表查询.
   */
  @PostMapping("/listByCondition")
  ResultResponse<PageResult<TeamSalaryPaymentDTO>> listByCondition(
      @RequestBody TeamSalaryBackQryCmd cmd);

  /**
   * 获得区域下的所有团队ID.
   */
  @GetMapping("/listIdByRegion")
  ResultResponse<Set<Long>> listIdByRegion(@RequestParam("regionId") String regionId);

  @GetMapping("/listRegionAll")
  ResultResponse<List<TeamProfileDTO>> listRegionAll(@RequestParam("region") String region);

  /**
   * 获得团队拥有者用户ID.
   */

  @GetMapping(value = "/getOwnUserIdById")
  ResultResponse<Long> getOwnUserIdById(@RequestParam("id") Long id);
}
