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

import com.xunhong.erp.turbo.biz.domain.entity.OrderRebate;
import com.xunhong.erp.turbo.biz.domain.entity.PurchaseOrder;
import com.xunhong.erp.turbo.biz.infrastructure.entity.OrderRebateDO;
import com.xunhong.erp.turbo.biz.infrastructure.entity.PurchaseOrderDO;
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 = "purchaseOrder", source = "purchaseOrderDO")
	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")
	PurchaseOrder toPurchaseOrder(PurchaseOrderDO purchaseOrderDO);
}
