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

import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderShipUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.vo.OrderShipVO;
import com.xunhong.erp.turbo.biz.app.assembler.OrderShipAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.OrderShip;
import com.xunhong.erp.turbo.biz.domain.gateway.OrderShipGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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

	private final OrderShipAssembler orderShipAssembler;
	private final OrderShipGateway orderShipGateway;

	public OrderShipVO execute(OrderShipUpdateCmd orderShipUpdateCmd) {
		OrderShip orderShip = orderShipGateway.update(orderShipUpdateCmd);
		return orderShipAssembler.toOrderShipVO(orderShip);
	}
}
