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

import com.red.circle.common.business.dto.cmd.app.AppIdLongCmd;
import com.red.circle.other.app.convertor.team.TeamAppConvertor;
import com.red.circle.other.app.dto.clientobject.team.TeamBillCO;
import com.red.circle.other.infra.database.mongo.service.team.team.TeamBillCycleService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 获取指定团队账单.
 *
 * @author pengliang on 2023/2/23
 */
@Component
@RequiredArgsConstructor
public class TeamBillOnQryExe {

  private final TeamAppConvertor teamAppConvertor;
  private final TeamBillCycleService teamBillCycleService;

  public TeamBillCO execute(AppIdLongCmd cmd) {
    return teamAppConvertor.toTeamBillCO(teamBillCycleService.getByBillId(cmd.getId()));
  }

}
