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

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.enums.team.TeamBillCycleStatus;
import com.red.circle.other.inner.model.cmd.team.AddTeamRemarkCmd;
import com.red.circle.other.inner.model.cmd.team.TeamBillByConditionQryCmd;
import com.red.circle.other.inner.model.cmd.team.TeamBillCycleBackQryCmd;
import com.red.circle.other.inner.model.cmd.team.TeamCalculatorWorkCmd;
import com.red.circle.other.inner.model.cmd.team.TeamMemberTargetResetCmd;
import com.red.circle.other.inner.model.dto.agency.agency.TeamBillAnchorStatisticsModelDTO;
import com.red.circle.other.inner.model.dto.agency.agency.TeamBillCycleDTO;
import com.red.circle.other.inner.model.dto.agency.agency.TeamCalculatorWorkResultDTO;
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/10/17
 */
public interface TeamBillCycleClientApi {

  String API_PREFIX = "/team-bill-cycle/client";

  /**
   * 获得最新账单ID.
   */
  @GetMapping("/getLatestBillIdByTeamId")
  ResultResponse<Long> getLatestBillIdByTeamId(@RequestParam("teamId") Long teamId);

  @PostMapping("/listBillTable")
  ResultResponse<List<TeamBillCycleDTO>> listBillTable(@RequestBody TeamBillCycleBackQryCmd query);

  @PostMapping("/calculatorWork")
  ResultResponse<TeamCalculatorWorkResultDTO> calculatorWork(
      @RequestBody TeamCalculatorWorkCmd param);

  @PostMapping("/addInternalRemarks")
  ResultResponse<Void> addInternalRemarks(@RequestBody AddTeamRemarkCmd cmd);

  @GetMapping("/removeInternalRemarks")
  ResultResponse<Void> removeInternalRemarks(@RequestParam("id") Long id,
      @RequestParam("remarkId") String remarkId);

  @GetMapping("/updateRemarks")
  ResultResponse<Void> updateRemarks(@RequestParam("id") Long id,
      @RequestParam("remarks") String remarks);

  @GetMapping("/updateStatus")
  ResultResponse<Void> updateStatus(@RequestParam("billId") Long billId,
      @RequestParam("status") TeamBillCycleStatus status,
      @RequestParam("updateUser") Long updateUser);


  @PostMapping("/queryTeamBillByCondition")
  ResultResponse<List<TeamBillAnchorStatisticsModelDTO>> queryTeamBillByCondition(
      @RequestBody TeamBillByConditionQryCmd cmd);

  @PostMapping("/resetUnpaidBillMemberTarget")
  ResultResponse<Void> resetUnpaidBillMemberTarget(@RequestBody TeamMemberTargetResetCmd param);

  @GetMapping("/getBillByTeamId")
  ResultResponse<TeamBillCycleDTO> getBillByTeamId(@RequestParam("teamId") Long teamId);
}
