package com.red.circle.other.app.command.sys.query;

import com.red.circle.framework.core.dto.AppCommand;
import com.red.circle.other.infra.database.cache.service.other.EnumConfigCacheService;
import com.red.circle.other.inner.enums.config.EnumConfigKey;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 邀请奖励.
 *
 * @author pengliang on 2021/5/28
 */
@Component
@RequiredArgsConstructor
public class UserInviteRewardQryExe {

  private final EnumConfigCacheService enumConfigCacheService;

  public List<BigDecimal> execute(AppCommand cmd) {
    return Arrays.asList(
        enumConfigCacheService.goldsToDiamondQuantity(enumConfigCacheService
                .getValueBigDecimal(EnumConfigKey.INVITED_NEW_USER_REWARD, cmd.requireReqSysOrigin()),
            cmd.requireReqSysOrigin()),
        enumConfigCacheService.goldsToDiamondQuantity(enumConfigCacheService
            .getValueBigDecimal(EnumConfigKey.INVITED_USER_FIRST_RECHARGE_REWARD,
                cmd.requireReqSysOrigin()), cmd.requireReqSysOrigin()),
        enumConfigCacheService.getValueBigDecimal(EnumConfigKey.INVITED_USER_EACH_RECHARGE,
            cmd.requireReqSysOrigin())
    );
  }

}
