Subversion Repositories SmartDukaan

Rev

Rev 3558 | Rev 3872 | 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
    /**
83
     * This method makes a fresh call to the service to fetch details for item Id.
84
     * It also gets the vendor pricing details and vendor key mappings
85
     * and sets them as java.util.Map in item object.
86
     * @param itemId
87
     * @return item object containing details of item corresponding to the item id.
88
     *         <br>null if any error occurs while fetching item details.
89
     */
1961 ankur.sing 90
    Item getItem(long itemId);
2066 ankur.sing 91
 
2427 ankur.sing 92
    /**
93
     * return map of all vendors with key-value pairs of vendor Id and vendor name
94
     */
2066 ankur.sing 95
    Map<Long,String> getAllVendors();
2427 ankur.sing 96
 
97
    /**
3558 rajveer 98
     * return map of all sources with key-value pairs of source Id and source name
99
     */
100
    Map<Long,String> getAllSources();
101
 
102
    /**
2427 ankur.sing 103
     * @return map of all warehouses with key-value pairs of warehouse Id and warehouse name
104
     */
2066 ankur.sing 105
    Map<Long,String> getAllWarehouses();
2105 ankur.sing 106
 
2427 ankur.sing 107
    /**
108
     * Changes the status of an item to PHASED_OUT
109
     * @param itemId
110
     */
2105 ankur.sing 111
    void phaseoutItem(long itemId);
2427 ankur.sing 112
 
113
    /**
114
     * Changes the status of an item to ACTIVE
115
     * @param itemId
116
     */
2105 ankur.sing 117
    void activateItem(long itemId);
2427 ankur.sing 118
 
119
    /**
120
     * Changes the status of an item to PAUSED
121
     * @param itemId
122
     */
2126 ankur.sing 123
    void pauseItem(long itemId);
2427 ankur.sing 124
 
125
    /**
126
     * Changes the status of an item to IN_PROCESS
127
     * @param itemId
128
     */
2126 ankur.sing 129
    void markInProcess(long itemId);
2427 ankur.sing 130
 
131
    /**
132
     * Adds a new item to catalog database.
133
     * It also adds the vendor item pricings and vendor keys.
134
     * @param item
135
     * @return Id of the newly added item
136
     */
2105 ankur.sing 137
    long addItem(Item item);
2119 ankur.sing 138
 
2427 ankur.sing 139
    /**
140
     * This method is called while adding a new item.
141
     * This method is used to check if the dashboard user is trying to add an item which exits already.
142
     * If the item already exists, then its id is shown to the user. 
143
     * @param productGroup
144
     * @param brand
145
     * @param modelNumber
146
     * @param color
147
     * @return Id of an item with the same product group, brand, model number and color if exists
148
     *     <br>else 0
149
     */
2119 ankur.sing 150
    long checkSimilarItem(String productGroup, String brand, String modelNumber, String color);
2359 ankur.sing 151
 
2427 ankur.sing 152
    /**
153
     * Sets/Resets the risky flag of an item.
154
     * This method will change the flag on the staging server and then on the production server.
155
     * @return true if the flag is changed successfully
156
     * <br> false if any error occurred while changing risky flag on staging and production
157
     */
2359 ankur.sing 158
    boolean changeItemRiskyFlag(long itemId, boolean risky);
1961 ankur.sing 159
}