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

import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderSupplierUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.vo.OrderSupplierVO;
import com.xunhong.erp.turbo.biz.app.assembler.OrderSupplierAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.OrderSupplier;
import com.xunhong.erp.turbo.biz.domain.gateway.OrderSupplierGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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

    private final OrderSupplierAssembler orderSupplierAssembler;
    private final OrderSupplierGateway orderSupplierGateway;

    public OrderSupplierVO execute(OrderSupplierUpdateCmd orderSupplierUpdateCmd) {
        OrderSupplier orderSupplier = orderSupplierGateway.update(orderSupplierUpdateCmd);
        return orderSupplierAssembler.toOrderSupplierVO(orderSupplier);
    }
}
