package com.xunhong.erp.turbo.biz.app.executor.cmd;

import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerPaymentAccountUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.vo.DealerPaymentAccountVO;
import com.xunhong.erp.turbo.biz.app.assembler.DealerPaymentAccountAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.DealerPaymentAccount;
import com.xunhong.erp.turbo.biz.domain.gateway.DealerPaymentAccountGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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

	private final DealerPaymentAccountAssembler dealerPaymentAccountAssembler;
	private final DealerPaymentAccountGateway dealerPaymentAccountGateway;

	public DealerPaymentAccountVO execute(DealerPaymentAccountUpdateCmd dealerPaymentAccountUpdateCmd) {
		DealerPaymentAccount dealerPaymentAccount = dealerPaymentAccountGateway.update(dealerPaymentAccountUpdateCmd);
		return dealerPaymentAccountAssembler.toDealerPaymentAccountVO(dealerPaymentAccount);
	}
}
