| Line 44... |
Line 44... |
| 44 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
44 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 45 |
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
|
45 |
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
|
| 46 |
import com.spice.profitmandi.dao.enumuration.fofo.PaymentStatus;
|
46 |
import com.spice.profitmandi.dao.enumuration.fofo.PaymentStatus;
|
| 47 |
import com.spice.profitmandi.dao.model.AddCartRequest;
|
47 |
import com.spice.profitmandi.dao.model.AddCartRequest;
|
| 48 |
import com.spice.profitmandi.dao.model.CartItem;
|
48 |
import com.spice.profitmandi.dao.model.CartItem;
|
| - |
|
49 |
import com.spice.profitmandi.dao.model.CartItemResponseModel;
|
| 49 |
import com.spice.profitmandi.dao.model.CartResponse;
|
50 |
import com.spice.profitmandi.dao.model.CartResponse;
|
| - |
|
51 |
import com.spice.profitmandi.dao.model.ProductPojo;
|
| 50 |
import com.spice.profitmandi.dao.model.UserCart;
|
52 |
import com.spice.profitmandi.dao.model.UserCart;
|
| 51 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
53 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 52 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelByPassRepository;
|
54 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelByPassRepository;
|
| 53 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
|
55 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
|
| 54 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
56 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| Line 207... |
Line 209... |
| 207 |
|
209 |
|
| 208 |
int cartId = userAccountRepository.selectByUserIdType(userId, AccountType.cartId).getAccountKey();
|
210 |
int cartId = userAccountRepository.selectByUserIdType(userId, AccountType.cartId).getAccountKey();
|
| 209 |
List<CartItem> cartItems = cartRequest.getCartItems();
|
211 |
List<CartItem> cartItems = cartRequest.getCartItems();
|
| 210 |
cartService.addItemsToCart(cartId, cartItems);
|
212 |
cartService.addItemsToCart(cartId, cartItems);
|
| 211 |
CartResponse cartValidationResponse = cartService.getCartValidation(cartId);
|
213 |
CartResponse cartValidationResponse = cartService.getCartValidation(cartId);
|
| 212 |
/*
|
214 |
|
| 213 |
* for (CartItemResponseModel cartItem : cartValidationResponse.getCartItems())
|
215 |
for (CartItemResponseModel cartItem : cartValidationResponse.getCartItems()) {
|
| 214 |
* { ProductPojo pp =
|
- |
|
| 215 |
* contentPojoPopulator.getShortContent(cartItem.getCatalogItemId());
|
216 |
ProductPojo pp = contentPojoPopulator.getShortContent(cartItem.getCatalogItemId());
|
| 216 |
*
|
217 |
|
| 217 |
* log.info("pp {}", pp); if (pp != null) {
|
218 |
log.info("pp {}", pp);
|
| - |
|
219 |
if (pp != null) {
|
| 218 |
* cartItem.setImageUrl(pp.getImageUrl()); // cartItem.setTitle(pp.getTitle());
|
220 |
cartItem.setImageUrl(pp.getImageUrl()); // cartItem.setTitle(pp.getTitle());
|
| 219 |
* } }
|
221 |
}
|
| 220 |
*/
|
222 |
}
|
| - |
|
223 |
|
| 221 |
vc = new ValidateCartResponse(cartValidationResponse, "Success", "Items added to cart successfully");
|
224 |
vc = new ValidateCartResponse(cartValidationResponse, "Success", "Items added to cart successfully");
|
| 222 |
return responseSender.ok(vc);
|
225 |
return responseSender.ok(vc);
|
| 223 |
}
|
226 |
}
|
| 224 |
|
227 |
|
| 225 |
@RequestMapping(value = ProfitMandiConstants.URL_CART_CHANGE_ADDRESS, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
228 |
@RequestMapping(value = ProfitMandiConstants.URL_CART_CHANGE_ADDRESS, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|