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

import com.xunhong.erp.turbo.api.biz.dto.cmd.GiftBoxCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.GiftBoxUpdateCmd;
import com.xunhong.erp.turbo.biz.domain.entity.GiftBox;
import com.xunhong.erp.turbo.biz.infrastructure.entity.GiftBoxDO;
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 GiftBoxConvert {

	GiftBox toGiftBox(GiftBoxDO giftBoxDO);

	@Mapping(target = "version", ignore = true)
	@Mapping(target = "updatedAt", ignore = true)
	@Mapping(target = "isDelete", ignore = true)
	@Mapping(target = "createdAt", ignore = true)
	GiftBoxDO toGiftBoxDO(GiftBoxCreateCmd giftBoxCreateCmd);

	@Mapping(target = "version", ignore = true)
	@Mapping(target = "updatedAt", ignore = true)
	@Mapping(target = "isDelete", ignore = true)
	@Mapping(target = "createdAt", ignore = true)
	void toGiftBoxDO(@MappingTarget GiftBoxDO giftBoxDO, GiftBoxUpdateCmd giftBoxUpdateCmd);
}

