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

import com.xunhong.erp.turbo.biz.domain.entity.Order;
import com.xunhong.erp.turbo.biz.domain.entity.OrderRebate;
import com.xunhong.erp.turbo.biz.infrastructure.entity.OrderDO;
import com.xunhong.erp.turbo.biz.infrastructure.entity.OrderRebateDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.NullValueCheckStrategy;

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

	@Mapping(target = "orderCompany", source = "orderCompanyDO")
	@Mapping(target = "order", source = "orderDO")
	OrderRebate toOrderRebate(OrderRebateDO orderRebateDO);

	@Mapping(target = "orderSupplierList", ignore = true)
	@Mapping(target = "orderShipList", ignore = true)
	@Mapping(target = "orderRebate", ignore = true)
	@Mapping(target = "orderPackageList", ignore = true)
	@Mapping(target = "orderDealer", ignore = true)
	@Mapping(target = "orderCostList", ignore = true)
	@Mapping(target = "orderCostItemList", ignore = true)
	@Mapping(target = "orderCompany", ignore = true)
	@Mapping(target = "orderVehicle", source = "orderVehicleDO")
    Order toOrder(OrderDO orderDO);
}
