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

import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxBrandCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.vo.BoxBrandVO;
import com.xunhong.erp.turbo.biz.app.assembler.BoxBrandAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.BoxBrand;
import com.xunhong.erp.turbo.biz.domain.gateway.BoxBrandGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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

	private final BoxBrandAssembler boxBrandAssembler;
	private final BoxBrandGateway boxBrandGateway;

	public BoxBrandVO execute(BoxBrandCreateCmd boxBrandCreateCmd) {
		BoxBrand boxBrand = boxBrandGateway.save(boxBrandCreateCmd);

		return boxBrandAssembler.toBoxBrandVO(boxBrand);
	}
}

