| Line 106... |
Line 106... |
| 106 |
model.addAttribute("currentInventorySnapshot", new Gson().toJson(customCurrentInventorySnapshot));
|
106 |
model.addAttribute("currentInventorySnapshot", new Gson().toJson(customCurrentInventorySnapshot));
|
| 107 |
return "current-item-availability";
|
107 |
return "current-item-availability";
|
| 108 |
|
108 |
|
| 109 |
}
|
109 |
}
|
| 110 |
|
110 |
|
| 111 |
@RequestMapping(value = "/cart")
|
111 |
@RequestMapping(value = "/cart", method = RequestMethod.POST)
|
| 112 |
public String addToCart(HttpServletRequest request, @RequestParam(name = "cartData") String cartData, Model model) throws ProfitMandiBusinessException{
|
112 |
public String addToCart(HttpServletRequest request, @RequestParam(name = "cartData") String cartData, Model model) throws ProfitMandiBusinessException{
|
| 113 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
113 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 114 |
|
114 |
|
| 115 |
Map<String, Object> map = inventoryService.addToCart(cartData, loginDetails.getFofoId());
|
115 |
Map<String, Object> map = inventoryService.addToCart(cartData, loginDetails.getFofoId());
|
| 116 |
model.addAllAttributes(map);
|
116 |
model.addAllAttributes(map);
|
| 117 |
return "cart";
|
117 |
return "cart";
|
| 118 |
}
|
118 |
}
|
| 119 |
|
119 |
|
| 120 |
@RequestMapping(value = "/validate-cart")
|
120 |
@RequestMapping(value = "/validate-cart", method = RequestMethod.POST)
|
| 121 |
public String validateCart(HttpServletRequest request, HttpServletResponse response,@RequestParam(name = "cartData") String cartData, Model model) throws ProfitMandiBusinessException{
|
121 |
public String validateCart(HttpServletRequest request, HttpServletResponse response,@RequestParam(name = "cartData") String cartData, Model model) throws ProfitMandiBusinessException{
|
| 122 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
122 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 123 |
|
123 |
|
| 124 |
Map<String, Object> map = inventoryService.validateCart(cartData, loginDetails.getFofoId());
|
124 |
Map<String, Object> map = inventoryService.validateCart(cartData, loginDetails.getFofoId());
|
| 125 |
model.addAllAttributes(map);
|
125 |
model.addAllAttributes(map);
|