Subversion Repositories SmartDukaan

Rev

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