package com.xunhong.erp.turbo.infra.app.executor.query;

import com.xunhong.erp.turbo.api.infra.dto.qry.AgreementShowQry;
import com.xunhong.erp.turbo.api.infra.dto.vo.AgreementVO;
import com.xunhong.erp.turbo.infra.app.assembler.AgreementAssembler;
import com.xunhong.erp.turbo.infra.domain.entity.Agreement;
import com.xunhong.erp.turbo.infra.domain.gateway.AgreementGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author shenyifei
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class AgreementShowQryExe {

	private final AgreementAssembler agreementAssembler;
	private final AgreementGateway agreementGateway;

	public AgreementVO execute(AgreementShowQry agreementShowQry) {
		Agreement agreement = agreementGateway.show(agreementShowQry);

		return agreementAssembler.toAgreementVO(agreement);
	}
}

