Skip to content
Extraits de code Groupes Projets
Valider 74f7c5c9 rédigé par Mohamed Lemine BAILLAHI's avatar Mohamed Lemine BAILLAHI
Parcourir les fichiers

Merge branch 'feature/VS-70' into 'develop'

VS-70/Excluding deleted items based on status and source

Closes VS-70

See merge request !118
parents 9882a82c 1102ed57
1 requête de fusion!118VS-70/Excluding deleted items based on status and source
Pipeline #14449 en échec avec les étapes
in 37 secondes
......@@ -24,6 +24,8 @@
### Added
- MYD-739/Fix List with sale sessions stats
- Add delete item functionality in back office and display sale session ID
- Enhance item filtering by excluding deleted items based on status and source
### Changed
......
......@@ -76,9 +76,8 @@ public interface CartRepository extends JpaRepository<Cart, Long>, JpaSpecificat
List<Object[]> findActiveClientsCountByDay(LocalDateTime startDate,
LocalDateTime endDate,
ItemSource source);
@Query("SELECT c FROM Cart c " +
"WHERE EXISTS (SELECT ic1 FROM c.items ic1) " +
"WHERE EXISTS (SELECT ic1 FROM c.items ic1 WHERE ic1.status != 'DELETED_BO' ) " +
" AND LOWER(c.status) = 'open' " +
" AND ((-1L) in :clientIds OR c.clientId IN :clientIds) " +
" AND ((-1L) in :productIds OR EXISTS (SELECT ic2 FROM c.items ic2 WHERE ic2.productId IN :productIds))")
......
......@@ -1036,11 +1036,15 @@ public class CartServiceImp implements CartService {
}
});
}
List<ProductDetailsCartDTO> productDetailsCartDTOS = cart.getItems().stream()
.map(item -> mapItemToProductDetails(item, productMap))
.filter(Objects::nonNull)
.filter(item -> !item.getStatus().equals(ItemCartStatus.DELETED_BO))
.filter(item -> !(item.getStatus().equals(ItemCartStatus.DELETED_SITE) && item.getSource().equals(ItemSource.WEB)))
.toList();
cartDTO.setSubTotalPrice(productDetailsCartDTOS.stream()
.mapToDouble(ProductDetailsCartDTO::getTotalPrice)
.sum());
......
0% ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter