Subversion Repositories SmartDukaan

Rev

Rev 3872 | Rev 4431 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1961 ankur.sing 1
package in.shop2020.catalog.dashboard.client;
2
 
3
 
4
import in.shop2020.catalog.dashboard.shared.Item;
3850 chandransh 5
import in.shop2020.catalog.dashboard.shared.ItemStatus;
1961 ankur.sing 6
 
7
import java.util.List;
2066 ankur.sing 8
import java.util.Map;
1961 ankur.sing 9
 
10
import com.google.gwt.user.client.rpc.RemoteService;
11
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
12
 
13
@RemoteServiceRelativePath("catalog")
14
public interface CatalogService extends RemoteService {
2427 ankur.sing 15
 
16
    /**
17
     * Updates all parameters of an item
18
     * @param item
19
     * @return  true if update is successful. 
20
     *       <br>false if any error occurred while updating
21
     */
1992 ankur.sing 22
    boolean updateItem(Item item);
2427 ankur.sing 23
 
24
    /**
25
     * This method calls the update item on production catalog service.
26
     * It updates prices of the item. (MRP, SP, and vendor prices)
27
     * @param item
28
     * @return - String. If any error occurred, then the string contains an error message to be shown to the user
29
     * otherwise it contains the success message 
30
     */
31
    String updateItemOnProduction(Item item);
2208 ankur.sing 32
 
3850 chandransh 33
    int getItemCountByStatus(boolean useStatus, ItemStatus itemStatus);
2427 ankur.sing 34
 
3850 chandransh 35
    List<Item> getAllItems(int start, int limit);
36
 
2427 ankur.sing 37
    /**
38
     * @return list of PHASED_OUT items.
39
     */
3850 chandransh 40
    List<Item> getAllPhasedOutItems(int start, int limit);
2427 ankur.sing 41
 
42
    /**
43
     * @return list of PAUSED items.
44
     */
3850 chandransh 45
    List<Item> getAllPausedItems(int start, int limit);
2427 ankur.sing 46
 
47
    /**
48
     * @return list of all ACTIVE items.
49
     */
3850 chandransh 50
    List<Item> getAllActiveItems(int start, int limit);
2427 ankur.sing 51
 
52
    /**
53
     * @return list of items with status IN_PROCESS
54
     */
3850 chandransh 55
    List<Item> getAllInProcessItems(int start, int limit);
2427 ankur.sing 56
 
57
    /**
58
     * @return list of items with status CONTENT_COMPLETE 
59
     */
3850 chandransh 60
    List<Item> getAllContentCompleteItems(int start, int limit);
2359 ankur.sing 61
 
2427 ankur.sing 62
    /**
63
     * @return list of items which are also best deals.
64
     */
1961 ankur.sing 65
    List<Item> getBestDeals();
2427 ankur.sing 66
 
67
    /**
68
     * @return list of items which are also best sellers.
69
     */
1961 ankur.sing 70
    List<Item> getBestSellers();
2427 ankur.sing 71
 
72
    /**
73
     * @return list of latest items.
74
     */
1961 ankur.sing 75
    List<Item> getLatestArrivals();
2427 ankur.sing 76
 
77
    /**
78
     * @return list of items flagged as risky.
79
     */
2359 ankur.sing 80
    List<Item> getRiskyItems();
2208 ankur.sing 81
 
2427 ankur.sing 82
    /**
3872 chandransh 83
     * 
84
     * @param searchTerms a list of strings
85
     * @return list of items corresponding to the given search terms
86
     */
87
    List<Item> searchItems(int start, int limit, List<String> searchTerms);
88
 
89
    /**
90
     * 
91
     * @param searchTerms
92
     * @return the number of items this search will return
93
     */
94
    int getSearchResultCount(List<String> searchTerms);
95
 
96
    /**
2427 ankur.sing 97
     * This method makes a fresh call to the service to fetch details for item Id.
98
     * It also gets the vendor pricing details and vendor key mappings
99
     * and sets them as java.util.Map in item object.
100
     * @param itemId
101
     * @return item object containing details of item corresponding to the item id.
102
     *         <br>null if any error occurs while fetching item details.
103
     */
1961 ankur.sing 104
    Item getItem(long itemId);
2066 ankur.sing 105
 
2427 ankur.sing 106
    /**
107
     * return map of all vendors with key-value pairs of vendor Id and vendor name
108
     */
2066 ankur.sing 109
    Map<Long,String> getAllVendors();
2427 ankur.sing 110
 
111
    /**
3558 rajveer 112
     * return map of all sources with key-value pairs of source Id and source name
113
     */
114
    Map<Long,String> getAllSources();
115
 
116
    /**
2427 ankur.sing 117
     * @return map of all warehouses with key-value pairs of warehouse Id and warehouse name
118
     */
2066 ankur.sing 119
    Map<Long,String> getAllWarehouses();
2105 ankur.sing 120
 
2427 ankur.sing 121
    /**
122
     * Changes the status of an item to PHASED_OUT
123
     * @param itemId
124
     */
2105 ankur.sing 125
    void phaseoutItem(long itemId);
2427 ankur.sing 126
 
127
    /**
128
     * Changes the status of an item to ACTIVE
129
     * @param itemId
130
     */
2105 ankur.sing 131
    void activateItem(long itemId);
2427 ankur.sing 132
 
133
    /**
134
     * Changes the status of an item to PAUSED
135
     * @param itemId
136
     */
2126 ankur.sing 137
    void pauseItem(long itemId);
2427 ankur.sing 138
 
139
    /**
140
     * Changes the status of an item to IN_PROCESS
141
     * @param itemId
142
     */
2126 ankur.sing 143
    void markInProcess(long itemId);
2427 ankur.sing 144
 
145
    /**
146
     * Adds a new item to catalog database.
147
     * It also adds the vendor item pricings and vendor keys.
148
     * @param item
149
     * @return Id of the newly added item
150
     */
2105 ankur.sing 151
    long addItem(Item item);
2119 ankur.sing 152
 
2427 ankur.sing 153
    /**
154
     * This method is called while adding a new item.
155
     * This method is used to check if the dashboard user is trying to add an item which exits already.
156
     * If the item already exists, then its id is shown to the user. 
157
     * @param productGroup
158
     * @param brand
159
     * @param modelNumber
160
     * @param color
161
     * @return Id of an item with the same product group, brand, model number and color if exists
162
     *     <br>else 0
163
     */
2119 ankur.sing 164
    long checkSimilarItem(String productGroup, String brand, String modelNumber, String color);
2359 ankur.sing 165
 
2427 ankur.sing 166
    /**
167
     * Sets/Resets the risky flag of an item.
168
     * This method will change the flag on the staging server and then on the production server.
169
     * @return true if the flag is changed successfully
170
     * <br> false if any error occurred while changing risky flag on staging and production
171
     */
2359 ankur.sing 172
    boolean changeItemRiskyFlag(long itemId, boolean risky);
4423 phani.kuma 173
 
174
    boolean deleteSimilarItem(long itemId, long catalogItemId);
175
 
176
	Item addSimilarItem(long itemId, long catalogItemId);
1961 ankur.sing 177
}