Subversion Repositories SmartDukaan

Rev

Rev 2359 | Rev 3558 | 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
    /**
99
     * @return map of all warehouses with key-value pairs of warehouse Id and warehouse name
100
     */
2066 ankur.sing 101
    Map<Long,String> getAllWarehouses();
2105 ankur.sing 102
 
2427 ankur.sing 103
    /**
104
     * Changes the status of an item to PHASED_OUT
105
     * @param itemId
106
     */
2105 ankur.sing 107
    void phaseoutItem(long itemId);
2427 ankur.sing 108
 
109
    /**
110
     * Changes the status of an item to ACTIVE
111
     * @param itemId
112
     */
2105 ankur.sing 113
    void activateItem(long itemId);
2427 ankur.sing 114
 
115
    /**
116
     * Changes the status of an item to PAUSED
117
     * @param itemId
118
     */
2126 ankur.sing 119
    void pauseItem(long itemId);
2427 ankur.sing 120
 
121
    /**
122
     * Changes the status of an item to IN_PROCESS
123
     * @param itemId
124
     */
2126 ankur.sing 125
    void markInProcess(long itemId);
2427 ankur.sing 126
 
127
    /**
128
     * Adds a new item to catalog database.
129
     * It also adds the vendor item pricings and vendor keys.
130
     * @param item
131
     * @return Id of the newly added item
132
     */
2105 ankur.sing 133
    long addItem(Item item);
2119 ankur.sing 134
 
2427 ankur.sing 135
    /**
136
     * This method is called while adding a new item.
137
     * This method is used to check if the dashboard user is trying to add an item which exits already.
138
     * If the item already exists, then its id is shown to the user. 
139
     * @param productGroup
140
     * @param brand
141
     * @param modelNumber
142
     * @param color
143
     * @return Id of an item with the same product group, brand, model number and color if exists
144
     *     <br>else 0
145
     */
2119 ankur.sing 146
    long checkSimilarItem(String productGroup, String brand, String modelNumber, String color);
2359 ankur.sing 147
 
2427 ankur.sing 148
    /**
149
     * Sets/Resets the risky flag of an item.
150
     * This method will change the flag on the staging server and then on the production server.
151
     * @return true if the flag is changed successfully
152
     * <br> false if any error occurred while changing risky flag on staging and production
153
     */
2359 ankur.sing 154
    boolean changeItemRiskyFlag(long itemId, boolean risky);
1961 ankur.sing 155
}