001    package org.cocome.tradingsystem.systests.interfaces;
002    
003    /**
004     * Interface of the entire enterprise. This is used to create new products and
005     * check some global conditions on order state (so for most implementations this
006     * is just another database wrapper).
007     * 
008     * @author Benjamin Hummel
009     * @author Christian Pfaller
010     * @author $Author: hummel $
011     * @version $Rev: 47 $
012     * @levd.rating GREEN Rev: 47
013     */
014    public interface IEnterprise {
015    
016            /**
017             * Creates a new product. This is used for the initial creation of test
018             * data. Additional fields required by the database should be provided by
019             * the test driver.
020             * 
021             * @param barcode
022             *            the barcode of the product.
023             * @param purchasePrice
024             *            the purchase price in Cent.
025             * @param name
026             *            the name of the product.
027             * @return the product created.
028             */
029            IProduct createProduct(int barcode, int purchasePrice, String name)
030                            throws Exception;
031    
032            /**
033             * Returns whether there is a product transfer requested (might be visible
034             * by orders in the database). The number of products is not relevant here.
035             * 
036             * @param product
037             *            the product to be transfered.
038             * @param storeFrom
039             *            the store which has to deliver the product.
040             * @param storeTo
041             *            the store which should receive the product.
042             * @return whether there is a product transfer requested.
043             */
044            boolean existsProductTransfer(IProduct product, IStorePC storeFrom,
045                            IStorePC storeTo);
046    }