package com.red.circle.wallet.inner.endpoint.salary.api;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.wallet.inner.model.cmd.SalaryIssueInnerCmd;
import com.red.circle.wallet.inner.model.cmd.SalaryRunningWaterQueryInnerCmd;
import com.red.circle.wallet.inner.model.cmd.SalaryWithdrawInnerCmd;
import com.red.circle.wallet.inner.model.dto.SalaryAccountBalanceDTO;
import com.red.circle.wallet.inner.model.dto.SalaryIssueResultDTO;
import com.red.circle.wallet.inner.model.dto.SalaryRunningWaterDTO;
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;

import java.math.BigDecimal;

/**
 * 工资账户 Client API.
 */
public interface UserSalaryAccountClientApi {

  String API_PREFIX = "/user-salary-account/client";

  /**
   * 查询余额.
   */
  @GetMapping("/balance")
  ResultResponse<SalaryAccountBalanceDTO> getBalance(@RequestParam("userId") Long userId, @RequestParam("salaryType") String salaryType);

  /**
   * 发放工资.
   */
  @PostMapping("/issue")
  ResultResponse<SalaryIssueResultDTO> issueSalary(@RequestBody SalaryIssueInnerCmd cmd);

  /**
   * 提现回退
   */
  @PostMapping("/withdraw-refund")
  ResultResponse<Void> withdrawRefund(@RequestBody SalaryWithdrawInnerCmd cmd);

  /**
   * 查询流水.
   */
  @PostMapping("/running-water")
  ResultResponse<PageResult<SalaryRunningWaterDTO>> queryRunningWater(
      @RequestBody SalaryRunningWaterQueryInnerCmd cmd);

  /**
   * 查询用户累计收入.
   */
  @GetMapping("/total-income")
  ResultResponse<BigDecimal> getTotalIncome(@RequestParam("userId") Long userId, @RequestParam("salaryType") String salaryType);

}
