package com.red.circle.other.app.inner.service.team.impl;

import com.red.circle.other.infra.database.mongo.service.team.team.TeamApplicationProcessApprovalService;
import com.red.circle.other.app.inner.convertor.team.TeamProcessApprovalInnerConvertor;
import com.red.circle.other.app.inner.service.team.TeamProcessApprovalClientService;
import com.red.circle.other.inner.model.dto.agency.agency.TeamApplicationProcessApprovalDTO;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 团队申请流程-审批日志 实现.
 *
 * @author pengliang on 2023/11/21
 */
@Service
@RequiredArgsConstructor
public class TeamProcessApprovalClientServiceImpl implements
    TeamProcessApprovalClientService {

  private final TeamProcessApprovalInnerConvertor teamProcessApprovalInnerConvertor;
  private final TeamApplicationProcessApprovalService teamApplicationProcessApprovalService;

  @Override
  public void addProcessLog(TeamApplicationProcessApprovalDTO dto) {
    teamApplicationProcessApprovalService.add(
        teamProcessApprovalInnerConvertor.toTeamApplicationProcessApproval(dto)
    );
  }

  @Override
  public void addBatchProcessLog(List<TeamApplicationProcessApprovalDTO> list) {
    teamApplicationProcessApprovalService.addBatch(
        teamProcessApprovalInnerConvertor.toListTeamApplicationProcessApproval(list)
    );
  }

}
