| Line 170... |
Line 170... |
| 170 |
1:i64 id, //identifier
|
170 |
1:i64 id, //identifier
|
| 171 |
2:list<Line> lines, //list of lines
|
171 |
2:list<Line> lines, //list of lines
|
| 172 |
3:CartStatus status, //current status
|
172 |
3:CartStatus status, //current status
|
| 173 |
4:i64 createdOn, //creation timestamp
|
173 |
4:i64 createdOn, //creation timestamp
|
| 174 |
5:i64 updatedOn, //time of last update in cart (like addition/deletion/updation of cart items )
|
174 |
5:i64 updatedOn, //time of last update in cart (like addition/deletion/updation of cart items )
|
| 175 |
6:i64 committedOn, //commited timestamp
|
175 |
6:i64 checkedOutOn, //commited timestamp
|
| 176 |
7:i64 userId, //user id to which it belongs
|
176 |
7:i64 userId, //user id to which it belongs
|
| 177 |
8:i64 addressId, //address on which this will be shipped
|
177 |
8:i64 addressId, //address on which this will be shipped
|
| 178 |
}
|
178 |
}
|
| 179 |
|
179 |
|
| 180 |
enum WidgetType{
|
180 |
enum WidgetType{
|
| Line 255... |
Line 255... |
| 255 |
void addItemToCart(1:i64 cartId, 2:i64 itemId, 3:i64 quantity) throws (1:ShoppingCartException scx),
|
255 |
void addItemToCart(1:i64 cartId, 2:i64 itemId, 3:i64 quantity) throws (1:ShoppingCartException scx),
|
| 256 |
void deleteItemFromCart(1:i64 cartId, 2:i64 itemId) throws (1:ShoppingCartException scx),
|
256 |
void deleteItemFromCart(1:i64 cartId, 2:i64 itemId) throws (1:ShoppingCartException scx),
|
| 257 |
void changeQuantity(1:i64 cartId, 2:i64 itemId, 3:i64 quantity) throws (1:ShoppingCartException scx),
|
257 |
void changeQuantity(1:i64 cartId, 2:i64 itemId, 3:i64 quantity) throws (1:ShoppingCartException scx),
|
| 258 |
void changeItemStatus(1:i64 cartId, 2:i64 itemId, 3:LineStatus status) throws (1:ShoppingCartException scx),
|
258 |
void changeItemStatus(1:i64 cartId, 2:i64 itemId, 3:LineStatus status) throws (1:ShoppingCartException scx),
|
| 259 |
void addAddressToCart(1:i64 cartId, 2:i64 addressId) throws (1:ShoppingCartException scx),
|
259 |
void addAddressToCart(1:i64 cartId, 2:i64 addressId) throws (1:ShoppingCartException scx),
|
| - |
|
260 |
|
| - |
|
261 |
/**
|
| - |
|
262 |
Creates a transaction and multiple orders for the given cart. Returns the transaction ID created.
|
| - |
|
263 |
*/
|
| 260 |
i64 commitCart(1:i64 cartId) throws (1:ShoppingCartException scx),
|
264 |
i64 createOrders(1:i64 cartId) throws (1:ShoppingCartException scx),
|
| - |
|
265 |
|
| - |
|
266 |
/**
|
| - |
|
267 |
Validates that:
|
| - |
|
268 |
1. The checkout timestamp is greater than the updatedOn timestamp.
|
| - |
|
269 |
2. None of the lines in the cart for an inactive item.
|
| - |
|
270 |
3. The estimate for any of the lines in cart doesn't change.
|
| - |
|
271 |
Returns true only if all three hold.
|
| - |
|
272 |
*/
|
| 261 |
bool validateCart(1:i64 cartId) throws (1:ShoppingCartException scex),
|
273 |
bool validateCart(1:i64 cartId) throws (1:ShoppingCartException scex),
|
| - |
|
274 |
|
| - |
|
275 |
/**
|
| 262 |
bool refreshCart(1:i64 cartId) throws (1:ShoppingCartException scex),
|
276 |
Merges the lines from the first cart into the second cart. Lines with duplicate items are removed.
|
| - |
|
277 |
*/
|
| 263 |
void mergeCart(1:i64 fromCartId, 2:i64 toCartId)
|
278 |
void mergeCart(1:i64 fromCartId, 2:i64 toCartId),
|
| - |
|
279 |
|
| - |
|
280 |
/**
|
| - |
|
281 |
Sets the checkedOutOn timestamp of the cart. Raises an exception if the specified cart can't be found.
|
| - |
|
282 |
*/
|
| - |
|
283 |
bool checkOut(1:i64 cartId) throws (1:ShoppingCartException scex),
|
| - |
|
284 |
|
| - |
|
285 |
/**
|
| - |
|
286 |
The second parameter is a map of item ids and their quantities which have been successfully processed.
|
| - |
|
287 |
This methods removes the specified quantiry of the specified item from the cart.
|
| - |
|
288 |
*/
|
| - |
|
289 |
bool resetCart(1:i64 cartId, 2:map<i64, i64> items) throws (1:ShoppingCartException scex),
|
| 264 |
|
290 |
|
| 265 |
void addWidget(1:Widget widget) throws (1:WidgetException scx),
|
291 |
void addWidget(1:Widget widget) throws (1:WidgetException scx),
|
| 266 |
void addItemToWidget(1:i64 widget_id, 2:list<i64> items) throws (1:WidgetException scx),
|
292 |
void addItemToWidget(1:i64 widget_id, 2:list<i64> items) throws (1:WidgetException scx),
|
| 267 |
void deleteItemFromWidget(1:i64 widget_id, 2:i64 item_id) throws (1:WidgetException scx),
|
293 |
void deleteItemFromWidget(1:i64 widget_id, 2:i64 item_id) throws (1:WidgetException scx),
|
| 268 |
void updateWidget(1:i64 widgetId, 2:bool enable) throws (1:WidgetException scx),
|
294 |
void updateWidget(1:i64 widgetId, 2:bool enable) throws (1:WidgetException scx),
|