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

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.model.cmd.team.TeamMemberWorkQryCmd;
import com.red.circle.other.inner.model.cmd.team.UpdateStatusByTeamIdsCmd;
import com.red.circle.other.inner.model.dto.agency.agency.TeamMemberChangeRecordDTO;
import com.red.circle.other.inner.model.dto.agency.agency.TeamMemberTargetDTO;
import com.red.circle.other.inner.model.dto.agency.agency.TeamMemberWorkDTO;
import com.red.circle.other.inner.model.dto.agency.agency.TeamTargetBillRes;
import java.math.BigDecimal;
import java.util.List;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 成员工作目标.
 *
 * @author pengliang on 2023/8/19
 */
public interface TeamMemberTargetClientApi {

  String API_PREFIX = "/team-member-target/client";

  /**
   * 累计减去接收礼物.
   */
  @GetMapping("/decrAcceptGiftValue")
  ResultResponse<Void> decrAcceptGiftValue(
      @RequestParam("userId") Long userId,
      @RequestParam("dateNumber") Integer dateNumber,
      @RequestParam("giftValue") Long giftValue
  );

  /**
   * 礼物流水.
   *
   * @param userId   用户lid
   * @param quantity 数量
   */
  @GetMapping("/incrementGiftValue")
  ResultResponse<TeamTargetBillRes> incrementGiftValue(
      @RequestParam("userId") Long userId,
      @RequestParam("quantity") BigDecimal quantity
  );

  /**
   * 个人房间流水.
   *
   * @param userId   用户lid
   * @param quantity 数量
   */
  @GetMapping("/incrementRoomValue")
  ResultResponse<Void> incrementRoomValue(
      @RequestParam("userId") Long userId,
      @RequestParam("quantity") BigDecimal quantity
  );

  /**
   * 发送礼物数量.
   *
   * @param userId   用户lid
   * @param quantity 数量
   */
  @GetMapping("/incrementSendGiftQuantity")
  ResultResponse<Void> incrementSendGiftQuantity(
      @RequestParam("userId") Long userId,
      @RequestParam("quantity") BigDecimal quantity
  );

  @GetMapping("/listByBillBelong")
  ResultResponse<List<TeamMemberTargetDTO>> listByBillBelong(@RequestParam("teamId") Long teamId,
      @RequestParam("userId") Integer billBelong);

  /**
   * 团队成员工作情况
   */
  @PostMapping("/listMemberWork")
  ResultResponse<List<TeamMemberWorkDTO>> listMemberWork(@RequestBody TeamMemberWorkQryCmd query);

  /**
   * 根据团队id修改本月成员目标状态
   */
  @PostMapping("/updateStatusByTeamIds")
  ResultResponse<Void> updateStatusByTeamIds(@RequestBody UpdateStatusByTeamIdsCmd cmd);


  /**
   * 获取最新进行中目标数量.
   */
  @GetMapping("/getLatestInProgressTarget")
  Long getLatestInProgressTarget(@RequestParam("id") Long userId);

  /**
   * 移除用户目标.
   */
  @GetMapping("/removeUserTarget")
  void removeUserTarget(@RequestParam("billBelong") Integer billBelong,
                        @RequestParam("userId") Long userId);
}
