package io.reactivesw.order.order.application.model.mapper;

import io.reactivesw.order.cart.application.model.TaxedPrice;
import io.reactivesw.order.order.domain.entity.value.TaxedPriceValue;

/**
 * Created by Davis on 17/2/6.
 */
public final class TaxedPriceMapper {
  /**
   * Instantiates a new Taxed price mapper.
   */
  public TaxedPriceMapper() {
  }

  /**
   * Model to entity taxed price value.
   *
   * @param model the model
   * @return the taxed price value
   */
  public static TaxedPriceValue modelToEntity(TaxedPrice model) {
    TaxedPriceValue entity = new TaxedPriceValue();

    // TODO: 17/2/6

    return entity;
  }

  /**
   * Entity to model taxed price.
   *
   * @param taxedPrice the taxed price
   * @return the taxed price
   */
  public static TaxedPrice entityToModel(TaxedPriceValue taxedPrice) {
    TaxedPrice model = new TaxedPrice();

    // TODO: 17/2/6
    
    return model;
  }
}

@@ -54,16 +54,70 @@
 apper;%0A%0A
+import io.reactivesw.common.model.mapper.MoneyMapper;%0A
 import i
@@ -652,31 +652,212 @@
 );%0A%0A    
-// TODO: 17/2/6
+entity.setTotalNet(MoneyMapper.modelToEntity(model.getTotalNet()));%0A    entity.setTotalGross(MoneyMapper.modelToEntity(model.getTotalGross()));%0A    // TODO: 17/2/6%0A    entity.setTaxPortions(null);
 %0A%0A    re

edit order TaxedPriceMapper