Subversion Repositories SmartDukaan

Rev

Rev 18150 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package in.shop2020.catalog.dashboard.client;


import java.util.List;
import java.util.Map;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

import in.shop2020.catalog.dashboard.shared.BulkItemPricing;
import in.shop2020.catalog.dashboard.shared.CategoryHsnCode;
import in.shop2020.catalog.dashboard.shared.Item;
import in.shop2020.catalog.dashboard.shared.ItemInventory;
import in.shop2020.catalog.dashboard.shared.ItemStatus;
import in.shop2020.catalog.dashboard.shared.ItemWarehouse;
import in.shop2020.catalog.dashboard.shared.StateVat;

@RemoteServiceRelativePath("catalog")
public interface CatalogService extends RemoteService {
    
    /**
     * Updates all parameters of an item
     * @param item
     * @return  true if update is successful. 
     *       <br>false if any error occurred while updating
     */
    boolean updateItem(Item item);
    
    /**
     * This method calls the update item on production catalog service.
     * It updates prices of the item. (MRP, SP, and vendor prices)
     * @param item
     * @return - String. If any error occurred, then the string contains an error message to be shown to the user
     * otherwise it contains the success message 
     */
    String updateItemOnProduction(Item item);
    
        String updateExpectedDelayOnProd(Item item);

    int getItemCountByStatus(boolean useStatus, ItemStatus itemStatus);
    
    List<Item> getAllItems(int start, int limit);
    
    /**
     * @return list of PHASED_OUT items.
     */
    List<Item> getAllPhasedOutItems(int start, int limit);
    
    /**
     * @return list of PAUSED items.
     */
    List<Item> getAllPausedItems(int start, int limit);
    
    /**
     * @return list of all ACTIVE items.
     */
    List<Item> getAllActiveItems(int start, int limit);
    
    /**
     * @return list of items with status IN_PROCESS
     */
    List<Item> getAllInProcessItems(int start, int limit);
    
    /**
     * @return list of items with status CONTENT_COMPLETE 
     */
    List<Item> getAllContentCompleteItems(int start, int limit);
    
    /**
     * @return list of items which are also best deals.
     */
    List<Item> getBestDeals();
    
    /**
     * @return list of items which are also best sellers.
     */
    List<Item> getBestSellers();
    
    /**
     * @return list of latest items.
     */
    List<Item> getLatestArrivals();
    
    /**
     * @return list of items flagged as risky.
     */
    List<Item> getRiskyItems();
    
    /**
     * 
     * @param searchTerms a list of strings
     * @return list of items corresponding to the given search terms
     */
    List<Item> searchItems(int start, int limit, List<String> searchTerms);
    
    /**
     * 
     * @param searchTerms
     * @return the number of items this search will return
     */
    int getSearchResultCount(List<String> searchTerms);
    
    /**
     * This method makes a fresh call to the service to fetch details for item Id.
     * It also gets the vendor pricing details and vendor key mappings
     * and sets them as java.util.Map in item object.
     * @param itemId
     * @return item object containing details of item corresponding to the item id.
     *         <br>null if any error occurs while fetching item details.
     */
    Item getItem(long itemId);
    
    /**
     * return map of all vendors with key-value pairs of vendor Id and vendor name
     */
    Map<Long,String> getAllVendors();
    
    /**
     * return map of all sources with key-value pairs of source Id and source name
     */
    Map<Long,String> getAllSources();
    
    /**
     * @return map of all warehouses with key-value pairs of warehouse Id and warehouse name
     */
    Map<Long,String> getAllWarehouses();

    /**
     * @return map of all shipping warehouses with key-value pairs of warehouse Id and warehouse name
     */
    Map<Long,String> getShippingWarehouses();

    /**
     * Changes the status of an item to PHASED_OUT
     * @param itemId
     */
    void phaseoutItem(long itemId);
    
    /**
     * Changes the status of an item to ACTIVE
     * @param itemId
     */
    void activateItem(long itemId);
    
    /**
     * Changes the status of an item to PAUSED
     * @param itemId
     */
    void pauseItem(long itemId);
    
    /**
     * Changes the status of an item to IN_PROCESS
     * @param itemId
     */
    void markInProcess(long itemId);
    
    /**
     * Adds a new item to catalog database.
     * It also adds the vendor item pricings and vendor keys.
     * @param item
     * @return Id of the newly added item
     */
    long addItem(Item item);
    
    /**
     * This method is called while adding a new item.
     * This method is used to check if the dashboard user is trying to add an item which exits already.
     * If the item already exists, then its id is shown to the user. 
     * @param productGroup
     * @param brand
     * @param modelNumber
     * @param color
     * @return Id of an item with the same product group, brand, model number and color if exists
     *     <br>else 0
     */
    long checkSimilarItem(String brand, String modelNumber, String modelName, String color);
    
    /**
     * Sets/Resets the risky flag of an item.
     * This method will change the flag on the staging server and then on the production server.
     * @return true if the flag is changed successfully
     * <br> false if any error occurred while changing risky flag on staging and production
     */
    boolean changeItemRiskyFlag(long itemId, boolean risky);
    
    boolean deleteSimilarItem(long itemId, long catalogItemId);

        Item addSimilarItem(long itemId, long catalogItemId);

        Map<Long, ItemInventory> getProdItemInventory(long itemId);

        boolean addAuthorizationLog(long itemId, String username, String message);

        Map<String, String> getConfigdataforPriceCompare();

        List<String> getAllCategories();
        
        Map<Long, String> getAllCategoriesMap();

        List<String> getAllBrands();

        boolean deleteVoucher(Long catalogItemId, Long voucherTypeValue);

        boolean addVoucher(Long catalogItemId, Long voucherTypeValue, long voucherAmount);

        Map<Long, String> getvoucherTypes();

        boolean getConfigforentityIdMandatory();

        boolean checkEntityId(long entityId);

        List<Item> getInventoryOutofSyncItems(int offset, int limit);

        int getInventoryOutofSyncItemsCount();

        List<Long> getMonitoredWarehouseIdsForVendors(List<Long> vendorIds);

        List<ItemWarehouse> getignoredInventoryUpdateItemsIdsWarehouseIds();

        boolean addtoIgnoredInventoryUpdateItemsIdsWarehouseIds(long itemId,
                        long warehouseId);

        boolean deleteFromIgnoredInventoryUpdateItemsIdsWarehouseIds(
                        long itemId, long warehouseId);
        
        Map<Long,String> getAllInsurers();
        
        List<Item> getPrivateDealItems(int offset,int limit);
        
        Map<Long, Double> getVatRates(long itemId, long categoryId);
        
        Map<Long, String> getAllStatesMap();
        
        int getPrivateDealItemsCount();
        
        boolean markPartiallyActive(long itemId, Long categoryId);
        
        boolean updateItemStateVat(long itemId, List<StateVat> svs);
        
        BulkItemPricing addBulkPricingForItem(BulkItemPricing bulkItemPricing);
        
        List<BulkItemPricing> getBulkPricingByItemId(long item_id);
        
        boolean deleteBulkPricingForItemById(long id);
        
        boolean deleteBulkPricingForItem(long itemId);
        
        public List<CategoryHsnCode> getHsnCodesByCategoryId(int categoryId);

}