private static void setLineItemDomainCostValues(
      LineItem dfpLineItem, LineItemDomain lineItemDomain, OrderDomain orderDomain) {
    removeLineItemFromOrder(lineItemDomain, orderDomain);

    lineItemDomain.setRate(dfpLineItem.getCostPerUnit().getMicroAmount() / 1000000D);
    lineItemDomain.setCostType(dfpLineItem.getCostType().toString());

    if (Objects.equals(dfpLineItem.getCostType(), CostType.CPC)) {
      lineItemDomain.setGrossValue(dfpLineItem.getUnitsBought() * lineItemDomain.getRate());
    } else if (Objects.equals(dfpLineItem.getCostType(), CostType.CPM)) {
      lineItemDomain.setGrossValue(dfpLineItem.getUnitsBought() * lineItemDomain.getRate() / 1000D);
    } else if (Objects.equals(dfpLineItem.getCostType(), CostType.CPD)) {
      final long startTime = toDate(dfpLineItem.getStartDateTime()).getTime();
      final long endTime = toDate(dfpLineItem.getEndDateTime()).getTime();
      final long days = ((endTime - startTime) / 86400000L) + 1;
      lineItemDomain.setGrossValue(days * lineItemDomain.getRate());
    }

    lineItemDomain.setGoal((double) dfpLineItem.getUnitsBought());
    lineItemDomain.setNetValue(dfpLineItem.getBudget().getMicroAmount() / 1000000D);
    lineItemDomain.setGeneralDiscount(
        lineItemDomain.getGrossValue() - lineItemDomain.getNetValue());

    if (Objects.equals(dfpLineItem.getDiscountType(), LineItemDiscountType.PERCENTAGE)) {
      lineItemDomain.setDiscountPercent(dfpLineItem.getDiscount());
    } else {
      lineItemDomain.setDiscountPercent(null);
    }

    addLineItemIntoOrder(lineItemDomain, orderDomain);
  }