package com.xunhong.erp.turbo.biz.infrastructure.convert;

import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecUpdateCmd;
import com.xunhong.erp.turbo.biz.domain.entity.BoxSpec;
import com.xunhong.erp.turbo.biz.infrastructure.entity.BoxSpecDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValueCheckStrategy;

/**
 * @author shenyifei
 */
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface BoxSpecConvert {

	BoxSpec toBoxSpec(BoxSpecDO boxSpecDO);

	@Mapping(target = "version", ignore = true)
	@Mapping(target = "updatedAt", ignore = true)
	@Mapping(target = "isDelete", ignore = true)
	@Mapping(target = "createdAt", ignore = true)
	BoxSpecDO toBoxSpecDO(BoxSpecCreateCmd boxSpecCreateCmd);

	@Mapping(target = "version", ignore = true)
	@Mapping(target = "updatedAt", ignore = true)
	@Mapping(target = "isDelete", ignore = true)
	@Mapping(target = "createdAt", ignore = true)
	void toBoxSpecDO(@MappingTarget BoxSpecDO boxSpecDO, BoxSpecUpdateCmd boxSpecUpdateCmd);
}

