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

import com.xunhong.erp.turbo.api.biz.dto.common.OrderShipItem;
import com.xunhong.erp.turbo.biz.infrastructure.entity.OrderShipItemDO;
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 OrderShipItemConvert {

    @Mapping(target = "version", ignore = true)
    @Mapping(target = "updatedAt", ignore = true)
    @Mapping(target = "isDelete", ignore = true)
    @Mapping(target = "createdAt", ignore = true)
    OrderShipItemDO toOrderShipItemDO(OrderShipItem orderShipItem);

    @Mapping(target = "itemId", ignore = true)
    @Mapping(target = "orderShipId", ignore = true)
    @Mapping(target = "version", ignore = true)
    @Mapping(target = "updatedAt", ignore = true)
    @Mapping(target = "isDelete", ignore = true)
    @Mapping(target = "createdAt", ignore = true)
    void toOrderShipItemDO(@MappingTarget OrderShipItemDO orderShipItemDO, OrderShipItem orderShipItem);
}