package com.akikanellis.kata01.item;

import com.akikanellis.kata01.price.Price;
import com.google.auto.value.AutoValue;

/**
 * Represents an item with a quantity of it.
 */
@AutoValue
public abstract class QuantifiedItem {

    public static QuantifiedItem create(Item item, int quantity) {
        Price totalPrice = item.price().multiplyBy(quantity);
        return new AutoValue_QuantifiedItem(item, quantity, totalPrice);
    }

    /**
     * @return the item that is represented
     */
    public abstract Item item();

    /**
     * @return the quantity of the item
     */
    public abstract int quantity();

    /**
     * The total price is calculated by multiplying the item's base price by the given quantity.
     *
     * @return the total price of the item
     */
    public abstract Price totalPrice();
}

@@ -164,16 +164,174 @@
  of it.%0A
+ * %3Cp%3E%0A * For example normal item such as a can of beans has a minimum quantity of 1 can. A weighted item such as cheese has a%0A * minimum quantity of 1 gram.%0A
  */%0A@Aut

Improve QuantifiedItem documentation