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

import com.red.circle.console.app.convertor.order.OrderOtherRechargeAppConvertor;
import com.red.circle.console.app.dto.cmd.app.order.OrderOtherRechargeCmd;
import com.red.circle.framework.core.asserts.ResponseAssert;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.order.inner.endpoint.OrderOtherRechargeClientClient;
import com.red.circle.order.inner.model.cmd.inapp.OrderOtherRechargePageQryCmd;
import com.red.circle.order.inner.model.dto.inapp.OrderOtherRechargeDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 其他支付订单.
 *
 * @author pengliang on 2023/11/3 */
@Service
@RequiredArgsConstructor
public class OtherRechargeOrderServiceImpl implements OtherRechargeOrderService {

  private final OrderOtherRechargeClientClient otherRechargeOrderClient;
  private final OrderOtherRechargeAppConvertor orderOtherRechargeAppConvertor;

  @Override
  public void add(OrderOtherRechargeCmd cmd) {
    otherRechargeOrderClient.add(
        orderOtherRechargeAppConvertor.toOrderOtherRechargeDTO(cmd)
    );
  }

  @Override
  public PageResult<OrderOtherRechargeDTO> pageOps(OrderOtherRechargePageQryCmd qryCmd) {
    return ResponseAssert.requiredSuccess(
        otherRechargeOrderClient.pageOps(qryCmd)
    );
  }
}
