/*
 * ICESOFT COMMERCIAL SOURCE CODE LICENSE V 1.1
 *
 * The contents of this file are subject to the ICEsoft Commercial Source
 * Code License Agreement V1.1 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of the
 * License at
 * http://www.icesoft.com/license/commercial-source-v1.1.html
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations under
 * the License.
 *
 * Copyright 2009-2015 ICEsoft Technologies Canada, Corp. All Rights Reserved.
 */
package com.icesoft.faces.application.showcase.view.bean.examples.common.inventory;

import java.util.ArrayList;

/**
 * Simple interface to describe an inventory model. Not really need for this
 * example but it fun to play with generics.
 *
 * @since 1.7
 */
public interface InventoryInterface {

    /**
     * Gets a collection of items that makes up the inventory.
     *
     * @return collection of items contained in the inventory
     */
    public ArrayList getInventory();

    /**
     * Gets the total price of all the items that are contained in this
     * iventory.
     *
     * @return total price of all inventory items.
     */
    public double getInventoryPriceTotal();

    /**
     * Add the specified item to the inventory.
     *
     * @param inventory iventory to add to this instance
     */
    public void addInventoryItem(InventoryItem inventory);

    /**
     * Remove an item from this instance of inventory.
     *
     * @param inventory        inventory item to add
     * @param removeItemOnZero if true, item will be removed from the inventory
     *                         when quantity reach zero otherwise the item is left in the invenotry with
     *                         a quantity of zero.
     */
    public void removeInventoryItem(InventoryItem inventory, boolean removeItemOnZero);
}
