Skip to content

Commit

Permalink
fix sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
stormer-wc committed Mar 31, 2024
1 parent 5a6261e commit 5570851
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.kampus.kbazaar.cart;

import com.kampus.kbazaar.cartitem.CartItemService;
import com.kampus.kbazaar.promotion.PromotionApplyCartRequest;
import com.kampus.kbazaar.shopper.Shopper;
import com.kampus.kbazaar.shopper.ShopperRepository;
import java.util.List;
Expand All @@ -14,11 +13,6 @@ public class CartService {

private final ShopperRepository shopperRepository;

public CartResponse applyCartPromotion(
String username, PromotionApplyCartRequest promotionApplyCartRequest) {
return new CartResponse();
}

public CartService(ShopperRepository shopperRepository, CartItemService cartItemService) {
this.shopperRepository = shopperRepository;
this.cartItemService = cartItemService;
Expand All @@ -27,7 +21,7 @@ public CartService(ShopperRepository shopperRepository, CartItemService cartItem
// get all carts
public List<CartResponse> getAllCart() {

// getb all user
// get all user
List<String> usernameList =
shopperRepository.findAll().stream().map(Shopper::getUsername).toList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@ public class PromotionService {

private final CartItemService cartItemService;

private final CartRepository cartRepository;

public PromotionService(
PromotionRepository promotionRepository,
CartItemRepository cartItemRepository,
CartRepository cartRepository,
CartItemService cartItemService) {
this.promotionRepository = promotionRepository;
this.cartItemRepository = cartItemRepository;
this.cartRepository = cartRepository;
this.cartItemService = cartItemService;
}

Expand Down Expand Up @@ -57,8 +54,6 @@ public CartResponse applyPromotion(String username, Promotion promotion) {
}
}

CartResponse response = cartItemService.getCartByUsername(username);

return response;
return cartItemService.getCartByUsername(username);
}
}

0 comments on commit 5570851

Please sign in to comment.