package com.red.circle.console.app.service.app.order;

import com.red.circle.common.business.core.enums.SysOriginPlatformEnum;
import com.red.circle.console.app.dto.clienobject.order.OrderPurchaseHistoryCO;
import com.red.circle.console.app.dto.cmd.app.order.OrderCompensateCmd;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.order.inner.model.cmd.inapp.OrderPurchaseHistoryExportQryCmd;
import com.red.circle.order.inner.model.cmd.inapp.OrderPurchaseHistoryQryCmd;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;

/**
 * <p>
 * 购买记录 服务类.
 * </p>
 *
 * @author pengliang on 2020/3/24
 */
public interface IOrderPurchaseHistoryService {

  /**
   * 补偿订单
   */
  void compensateOrder(OrderCompensateCmd cmd);

  /**
   * 补偿糖果
   *
   * @param userId ignore
   * @param candy  ignore
   */
  void compensateCandy(Long userId, BigDecimal candy);

  /**
   * 购买记录分页列表
   *
   * @return page
   */
  PageResult<OrderPurchaseHistoryCO> purchaseHistoryPage(OrderPurchaseHistoryQryCmd qryCmd);

  /**
   * 导出订单数据信息.
   */
  void exportPurchaseHistory(HttpServletResponse response, OrderPurchaseHistoryExportQryCmd qryCmd)
      throws IOException;

  /**
   * 今日内购总额.
   */
  BigDecimal purchaseTodayTotal();

  /**
   * 今日内购总额.
   *
   * @param sysOrigin 来源系统
   */
  BigDecimal purchaseTodayTotalBySysOrigin(SysOriginPlatformEnum sysOrigin);

  /**
   * 用户购买总额
   *
   * @param userId 用户id
   */
  BigDecimal getPurchaseTotalByUserId(Long userId);

}
