package com.red.circle.order.inner.service.impl;

import com.red.circle.order.domain.gateway.UserFreightRechargeRecordGateway;
import com.red.circle.order.infra.database.rds.service.count.UserFreightRechargeRecordService;
import com.red.circle.order.inner.service.UserFreightRechargeRecordClientService;
import java.math.BigDecimal;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 用户货运代理冲值.
 *
 * @author pengliang on 2023/12/27
 */
@Service
@RequiredArgsConstructor
public class UserFreightRechargeRecordClientServiceImpl implements
    UserFreightRechargeRecordClientService {

  private final UserFreightRechargeRecordGateway userFreightRechargeRecordGateway;
  private final UserFreightRechargeRecordService userFreightRechargeRecordService;

  @Override
  public List<Long> listNowMonthBySysOrigin(String sysOrigin) {
    return userFreightRechargeRecordService.listNowMonthBySysOrigin(sysOrigin);
  }

  @Override
  public BigDecimal inrNowMonthAmount(Long userId, BigDecimal amount) {
    return userFreightRechargeRecordGateway.inrNowMonthAmount(userId, amount);
  }

  @Override
  public BigDecimal countAmount(Long userId) {
    return userFreightRechargeRecordService.countAmount(userId);
  }

}
