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

import com.xunhong.erp.turbo.api.infra.dto.cmd.PlatformUpdateCmd;
import com.xunhong.erp.turbo.api.infra.dto.vo.PlatformVO;
import com.xunhong.erp.turbo.infra.app.assembler.PlatformAssembler;
import com.xunhong.erp.turbo.infra.domain.entity.Platform;
import com.xunhong.erp.turbo.infra.domain.gateway.PlatformGateway;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class PlatformUpdateCmdExe {
	private final PlatformAssembler platformAssembler;
	private final PlatformGateway platformGateway;

	public PlatformVO execute(PlatformUpdateCmd platformUpdateCmd) {
		Platform platform = platformGateway.update(platformUpdateCmd);
		return platformAssembler.toPlatformVO(platform);
	}
}
