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

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.wallet.inner.model.tmp.CommonRestApiCmd;
import com.red.circle.wallet.inner.model.tmp.DealerSendRestApiCmd;
import com.red.circle.wallet.inner.model.tmp.FreightAccountTmpCO;
import com.red.circle.wallet.inner.model.tmp.FreightSellerRestApiCmd;
import com.red.circle.wallet.inner.model.tmp.FreightSellerTmpCO;
import com.red.circle.wallet.inner.model.tmp.FreightSellerUsableGoldRestApiCmd;
import com.red.circle.wallet.inner.model.tmp.FreightShipSellerSendRestApiCmd;
import com.red.circle.wallet.inner.model.tmp.FreightShipSendRestApiCmd;
import java.math.BigDecimal;
import java.util.List;
import org.springframework.validation.annotation.Validated;
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/12/26
 */
public interface FreightClientRestApi {

  String API_PREFIX = "/freight/client/restapi";

  // =============================================================================================
  // 经销商 Start
  // =============================================================================================

  /**
   * 经销商添加卖家.
   */
  @PostMapping("/addFreightSeller")
  ResultResponse<Void> addFreightSeller(@RequestBody @Validated FreightSellerRestApiCmd cmd);

  /**
   * 经销商卖家列表.
   */
  @PostMapping("/listFreightSeller")
  ResultResponse<List<FreightSellerTmpCO>> listFreightSeller(
      @RequestBody @Validated CommonRestApiCmd cmd);

  /**
   * 获取货运代理相关信息.
   */
  @PostMapping("/checkSeller")
  ResultResponse<Boolean> checkSeller(@RequestBody @Validated CommonRestApiCmd cmd);

  /**
   * 获取商家信息.
   */
  @GetMapping("/searchSellerById")
  ResultResponse<FreightSellerTmpCO> searchSellerById(@RequestParam("sellerId") Long sellerId);

  /**
   * 经销商添卖家授权额度修改.
   */
  @PostMapping("/updateUsableGold")
  ResultResponse<Void> updateUsableGold(
      @RequestBody @Validated FreightSellerUsableGoldRestApiCmd cmd);

  /**
   * 获取货运代理相关信息.
   */
  @PostMapping("/getFreightAccountInfo")
  ResultResponse<FreightAccountTmpCO> getFreightAccountInfo(
      @RequestBody @Validated CommonRestApiCmd cmd);

  // =============================================================================================
  // 经销商 End
  // =============================================================================================

  // =============================================================================================
  // 货运代理 Start
  // =============================================================================================

  /**
   * 货运代理给用户发货.
   */
  @PostMapping("/sendFreightShip")
  ResultResponse<BigDecimal> sendFreightShip(@RequestBody @Validated FreightShipSendRestApiCmd cmd);

  /**
   * 经销商卖家给用户发货.
   */
  @PostMapping("/freightShipSellerSendUser")
  ResultResponse<BigDecimal> freightShipSellerSendUser(
      @RequestBody @Validated FreightShipSellerSendRestApiCmd cmd);


  /**
   * 经销商发货给货运代理，不能给经销商发
   */
  @PostMapping("/sendToFreightShip")
  ResultResponse<BigDecimal> sendToFreightShip(@RequestBody @Validated DealerSendRestApiCmd cmd);

  /**
   * 货运代理是否首次充值.
   */
  @GetMapping("/checkFreightFirstRecharge")
  ResultResponse<Boolean> checkFreightFirstRecharge(
      @RequestParam("sysOrigin") String sysOrigin,
      @RequestParam("userId") Long userId
  );

  /**
   * 货运账户.
   */
  @PostMapping("/getFreightAvailableBalance")
  ResultResponse<BigDecimal> getFreightAvailableBalance(
      @RequestBody @Validated CommonRestApiCmd cmd);

  // =============================================================================================
  // 货运代理 End
  // =============================================================================================


}
