Skip to content
Extraits de code Groupes Projets
Valider 8041e757 rédigé par oussama aftys's avatar oussama aftys
Parcourir les fichiers

Merge branch 'develop' into 'staging'

add gift card to cart delete and duplicate gift card in cart

See merge request !82
parents a03d719f f525ac46
Branches staging
1 requête de fusion!82add gift card to cart delete and duplicate gift card in cart
Pipeline #8544 réussi avec les étapes
in 3 minutes et 4 secondes
Affichage de
avec 489 ajouts et 75 suppressions
## [1.0.60-RELEASE]
### Added
- calculate Theoretical Amount
### Changed
- Changes in existing function.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
## [1.0.59-RELEASE]
### Added
- Add new conditions in apply promo code to cart.
### Changed
- Changes in existing function.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
## [1.0.58-RELEASE]
### Added
- Rate of adding products to the cart.
### Changed
- Changes in isItemIncludedOrExcluded function.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
## [1.0.57-RELEASE]
### Added
- calculate THEORETICAL_TURNOVER.
### Changed
- Changes in isItemIncludedOrExcluded function.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
## [1.0.56-RELEASE]
### Added
- Add new conditions in apply promo code to cart.
### Changed
- Changes in isItemIncludedOrExcluded function.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
## [1.0.54-RELEASE]
### Added
- Add fetching gift card and voucher by code.
### Changed
- Changes in dto, mapper,
- Changes in reload method to calculate total price and apply all discount of Promo Code, Gift Card and Voucher.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
## [1.0.54-RELEASE]
### Added
- Add features to add, remove and apply promo code to cart.
- Add method to remove invalid promo codes from cart.
- Add method to execute all existing methods of Gift Card and Voucher.
### Changed
- Changes in dto, mapper,
- Changes in reload method to calculate total price and apply all discount of Promo Code, Gift Card and Voucher.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
## [1.0.55-RELEASE]
### Added
- Add two endpoints to apply and remove gift card code
### Changed
- apply and remove Voucher from cart
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
## [1.0.55-RELEASE]
### Added
- add gift card to cart delete and duplicate gift card in cart
### Changed
- Changes in existing functionality.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
## [1.0.54-RELEASE]
### Added
- MYD-619/some changes
......@@ -1029,4 +1157,4 @@
- Any bug fixes.
### Security
- Any security improvements.
- Any security improvements.
\ No newline at end of file
......@@ -18,7 +18,7 @@
<dependency>
<groupId>com.marketingconfort</groupId>
<artifactId>mydressin-common</artifactId>
<version>1.0.119-RELEASE</version>
<version>1.0.145-RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
......@@ -50,7 +50,6 @@
<artifactId>modelmapper</artifactId>
<version>2.4.4</version>
</dependency>
</dependencies>
<build>
<plugins>
......
......@@ -5,9 +5,24 @@ public class Paths {
public static final String API_CART_CONFIG = "/api/cart/cart-count-config";
public static final String GET_BY_ID= "/{id}";
public static final String CHECK_STOCK_CART_PRODUCTS= "/check-stock-cart-products/{clientId}";
public static final String DECREMENT_STOCK_CART_PRODUCTS= "/decrement-stock-cart-products/{clientId}";
public static final String APPLY_GIFT_CARD= "/apply-giftcard";
public static final String REMOVE_GIFT_CARD= "/remove-giftcard";
public static final String APPLY_VOUCHER= "/apply-voucher";
public static final String REMOVE_VOUCHER= "/remove-voucher";
public static final String API_CART_PROMO_CODE = "/api/cart/promoCode";
public static final String CHECK_APPLY_PROMO_CODE = "/check-apply-promoCode";
public static final String REMOVE_PROMO_CODE = "/delete-promoCode";
//////// Statistic paths
public static final String STATISTICS_API ="/api/cart/statistics";
public static final String THEORETICAL_TURNOVER = "/theoretical-revenue";
public static final String ADD_TO_CART_TRENDS = "/add-to-cart-trends";
public static final String CART_COUNT = "/cart-count";
public static final String THEORETICAL_AMOUNT = "/theoretical-amount";
}
......@@ -15,6 +15,8 @@ import com.marketingconfort.mydressin.mappers.CartMapper;
import com.marketingconfort.mydressin.services.CartService;
import com.marketingconfort.mydressin.services.ClientService;
import com.marketingconfort.mydressin.services.ProductStockService;
import com.marketingconfort.starter.core.exceptions.FunctionalException;
import com.marketingconfort.starter.core.exceptions.TechnicalException;
import lombok.AllArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......@@ -65,6 +67,8 @@ public class CartController {
return ResponseEntity.ok(cartDTO);
} catch (CartNotFoundException e) {
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null); // HTTP 404 si le panier n'est pas trouvé
} catch (TechnicalException e) {
throw new RuntimeException(e);
}
}
@GetMapping("/{clientId}")
......@@ -72,7 +76,7 @@ public class CartController {
try{
CartDTO cartDTO = cartService.getCartByClientId(clientId);
return ResponseEntity.ok(cartDTO);
}catch (CartNotFoundException e){
}catch (CartNotFoundException | TechnicalException e){
return ResponseEntity.status(HttpStatus.NOT_FOUND).body( e.getMessage());
}
......@@ -105,12 +109,12 @@ public class CartController {
}
@PostMapping("/add-products-from-localStorage")
public ResponseEntity<CartDTO> addProductsFromLocalStorage(@RequestBody
LocalStorageRequest request) {
LocalStorageRequest request) throws TechnicalException {
CartDTO updatedCart = cartService.addProductsToCartFromLocalStorage(request.getId(), request.getCart());
return ResponseEntity.ok(updatedCart);
}
@PostMapping("/reload")
public ResponseEntity<CartDTO> reloadCart(@RequestBody LocalStorageRequest request) {
public ResponseEntity<CartDTO> reloadCart(@RequestBody LocalStorageRequest request) throws TechnicalException {
CartDTO updatedCart = cartService.reload(request.getCart());
return ResponseEntity.ok(updatedCart);
......@@ -136,4 +140,37 @@ public class CartController {
return cartService.decrementStockForAllCartProducts(clientId);
}
@PostMapping(Paths.APPLY_GIFT_CARD)
public ResponseEntity<CartDTO> applyGiftcard(@RequestParam Long clientId, @RequestParam String giftcardCode) {
try {
CartDTO cartDTO = cartService.applyGiftcardToCart(clientId, giftcardCode);
return ResponseEntity.ok(cartDTO);
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(null);
}
}
@PostMapping(Paths.REMOVE_GIFT_CARD)
public ResponseEntity<CartDTO> removeGiftcard(@RequestParam Long clientId) throws TechnicalException {
CartDTO cartDTO = cartService.removeGiftcardFromCart(clientId);
return ResponseEntity.ok(cartDTO);
}
@PostMapping(Paths.APPLY_VOUCHER)
public ResponseEntity<CartDTO> applyVoucher(@RequestParam Long clientId, @RequestParam String voucherCode) {
try {
CartDTO cartDTO = cartService.applyVoucherToCart(clientId, voucherCode);
return ResponseEntity.ok(cartDTO);
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(null);
}
}
@PostMapping(Paths.REMOVE_VOUCHER)
public ResponseEntity<CartDTO> removeVoucher(@RequestParam Long clientId) throws TechnicalException {
CartDTO cartDTO = cartService.removeVoucherFromCart(clientId);
return ResponseEntity.ok(cartDTO);
}
}
......@@ -5,6 +5,7 @@ import com.marketingconfort.mydressin.common.cart.models.ItemCart;
import com.marketingconfort.mydressin.dtos.*;
import com.marketingconfort.mydressin.repositories.ItemCartRepository;
import com.marketingconfort.mydressin.services.ItemCartService;
import com.marketingconfort.starter.core.exceptions.TechnicalException;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
......@@ -24,7 +25,7 @@ public class ItemCartController {
private ItemCartRepository itemCartRepository;
@PostMapping("/add-product")
public ResponseEntity<CartDTO> addProductToCartByClientId(@RequestBody ItemRequestDTO itemRequest) {
public ResponseEntity<CartDTO> addProductToCartByClientId(@RequestBody ItemRequestDTO itemRequest) throws TechnicalException {
System.out.println(itemRequest.getProductId());
CartDTO cartDTO = itemCartService.addProductToCartByClientId(itemRequest);
return ResponseEntity.ok(cartDTO);
......@@ -32,7 +33,7 @@ public class ItemCartController {
}
@PutMapping("/update-item")
public ResponseEntity<CartDTO> updateItemCartById(@RequestParam Long itemCartId, @RequestParam Long quantity) {
public ResponseEntity<CartDTO> updateItemCartById(@RequestParam Long itemCartId, @RequestParam Long quantity) throws TechnicalException {
CartDTO cartDTO = itemCartService.updateItemCartById(itemCartId, quantity);
......@@ -40,19 +41,19 @@ public class ItemCartController {
}
@DeleteMapping("/delete-item")
public ResponseEntity<CartDTO> deleteItemCartById(@RequestParam Long clientId, @RequestParam Long itemCartId) {
public ResponseEntity<CartDTO> deleteItemCartById(@RequestParam Long clientId, @RequestParam Long itemCartId) throws TechnicalException {
CartDTO cartDTO = itemCartService.deleteItemCartById(clientId, itemCartId);
return ResponseEntity.ok(cartDTO);
}
@DeleteMapping("/delete-itemBO")
public ResponseEntity<CartDTO> deleteItemCartByIdFromBO(@RequestParam Long clientId, @RequestParam Long itemCartId) {
public ResponseEntity<CartDTO> deleteItemCartByIdFromBO(@RequestParam Long clientId, @RequestParam Long itemCartId) throws TechnicalException {
CartDTO cartDTO = itemCartService.deleteItemCartByIdFromBO(clientId, itemCartId);
return ResponseEntity.ok(cartDTO);
}
@PostMapping("/add-product-localStorage")
public ResponseEntity<CartDTO> addProductToCartFromLocalStorage(@RequestBody LocalStorageRequest request) {
public ResponseEntity<CartDTO> addProductToCartFromLocalStorage(@RequestBody LocalStorageRequest request) throws TechnicalException {
if(request.getCart() == null || request.getId() == null || request.getQuantity() == null) {
return ResponseEntity.badRequest().body(null);
}
......@@ -63,12 +64,12 @@ public class ItemCartController {
return ResponseEntity.ok(updatedCart);
}
@PutMapping("/update-item-localStorage")
public ResponseEntity<CartDTO> updateItemCartInCartFromLocalStorage(@RequestBody LocalStorageRequest request) {
public ResponseEntity<CartDTO> updateItemCartInCartFromLocalStorage(@RequestBody LocalStorageRequest request) throws TechnicalException {
CartDTO updatedCart = itemCartService.updateItemCartById(request.getCart(), request.getId(), request.getQuantity());
return ResponseEntity.ok(updatedCart);
}
@DeleteMapping("/delete-item-localStorage")
public ResponseEntity<CartDTO> deleteItemCartInCartFromLocalStorage(@RequestBody LocalStorageRequest request) {
public ResponseEntity<CartDTO> deleteItemCartInCartFromLocalStorage(@RequestBody LocalStorageRequest request) throws TechnicalException {
CartDTO updatedCart = itemCartService.deleteItemCartById(request.getCart(), request.getId());
return ResponseEntity.ok(updatedCart);
}
......@@ -94,5 +95,4 @@ public class ItemCartController {
.collect(Collectors.toList());
}
}
\ No newline at end of file
}
package com.marketingconfort.mydressin.controllers;
import com.marketingconfort.mydressin.constants.Paths;
import com.marketingconfort.mydressin.dtos.CartDTO;
import com.marketingconfort.mydressin.exceptions.PromoCodeExpiredException;
import com.marketingconfort.mydressin.exceptions.PromoCodeNotFoundException;
import com.marketingconfort.mydressin.services.CodePromoService;
import lombok.AllArgsConstructor;
import com.marketingconfort.mydressin.services.CartService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/cart/promoCode")
@AllArgsConstructor
public class CodePromoController {
private final CodePromoService CodePromoService;
@RequestMapping(Paths.API_CART_PROMO_CODE)
public class PromoCodeController {
private final CartService cartService;
@PostMapping("/checkPromoCode")
public ResponseEntity<?> checkPromoCode(@RequestParam String Code, @RequestParam Long ClientId) {
public PromoCodeController(CartService cartService) {
this.cartService = cartService;
}
@PostMapping(Paths.CHECK_APPLY_PROMO_CODE)
public ResponseEntity<?> checkAndApplyPromoCode(@RequestParam String code, @RequestParam Long clientId) {
try {
CartDTO cartDto = CodePromoService.checkCodePromoByClientId(Code, ClientId);
return ResponseEntity.ok(cartDto);
return ResponseEntity.ok(cartService.checkAndApplyPromoCodeToCart(code, clientId));
} catch (PromoCodeNotFoundException e) {
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(e.getMessage());
} catch (PromoCodeExpiredException e) {
......@@ -31,11 +33,10 @@ public class CodePromoController {
}
}
@DeleteMapping("/delete")
@DeleteMapping(Paths.REMOVE_PROMO_CODE)
public ResponseEntity<CartDTO> removePromoCodeFromCartByClientId(@RequestParam Long clientId, @RequestParam Long promoCodeId) {
try {
CartDTO updatedCart = CodePromoService.removeCodePromoFromCart(clientId, promoCodeId);
CartDTO updatedCart = cartService.removeCodePromoFromCart(clientId, promoCodeId);
return ResponseEntity.ok(updatedCart);
......
......@@ -54,8 +54,6 @@ public class SessionOrderController {
}
}
@DeleteMapping("/delete-order/{orderId}")
public ResponseEntity<Void> deleteOrderById(@PathVariable Long orderId) {
boolean deleted = sessionOrderService.deleteOrderById(orderId);
......
package com.marketingconfort.mydressin.controllers;
import com.marketingconfort.mydressin.constants.Paths;
import com.marketingconfort.mydressin.dtos.StatisticsDTOs.ChartDataDTO;
import com.marketingconfort.mydressin.dtos.StatisticsDTOs.DailyAmountDTO;
import com.marketingconfort.mydressin.dtos.StatisticsDTOs.TheoreticalAmountRequestDTO;
import com.marketingconfort.mydressin.dtos.StatisticsDTOs.TheoreticalAmountResponseDTO;
import com.marketingconfort.mydressin.services.StatisticsService;
import com.marketingconfort.mydressin.common.cart.enumurations.ItemSource;
import com.marketingconfort.starter.core.exceptions.TechnicalException;
import com.marketingconfort.starter.core.exceptions.FunctionalException;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@RequestMapping(Paths.STATISTICS_API)
@AllArgsConstructor
public class StatisticsController {
private final StatisticsService statisticsService;
private static final Logger logger = LoggerFactory.getLogger(StatisticsController.class);
@GetMapping(Paths.THEORETICAL_TURNOVER)
public ResponseEntity<Double> getTheoreticalRevenue(
@RequestParam(required = false) List<String> sources,
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endDate) throws TechnicalException {
logger.info("Received request with sources: {}, startDate: {}, endDate: {}", sources, startDate, endDate);
List<ItemSource> itemSources = null;
if (sources != null) {
itemSources = sources.stream()
.map(sourceStr -> {
try {
return ItemSource.valueOf(sourceStr.toUpperCase());
} catch (IllegalArgumentException e) {
logger.error("Invalid ItemSource value: {}", sourceStr);
try {
throw new FunctionalException("INVALID_ITEM_SOURCE");
} catch (FunctionalException ex) {
throw new RuntimeException(ex);
}
}
})
.collect(Collectors.toList());
}
double revenue = statisticsService.calculateTheoreticalRevenue(itemSources, startDate, endDate);
logger.info("Calculated theoretical revenue: {}", revenue);
return ResponseEntity.ok(revenue);
}
@GetMapping(Paths.ADD_TO_CART_TRENDS)
public ResponseEntity<ChartDataDTO> getAddToCartTrends(
@RequestParam(required = false) List<String> sources) throws TechnicalException {
List<ItemSource> itemSources = null;
if (sources != null && !sources.isEmpty()) {
itemSources = sources.stream()
.map(sourceStr -> {
try {
return ItemSource.valueOf(sourceStr.toUpperCase());
} catch (IllegalArgumentException e) {
logger.error("Invalid ItemSource value: {}", sourceStr);
try {
throw new FunctionalException("INVALID_ITEM_SOURCE");
} catch (FunctionalException ex) {
throw new RuntimeException(ex);
}
}
})
.collect(Collectors.toList());
}
ChartDataDTO chartData = statisticsService.getAddToCartTrends(itemSources);
return ResponseEntity.ok(chartData);
}
@GetMapping(Paths.CART_COUNT)
public ResponseEntity<Long> getTotalCarts(
@RequestParam(required = false) List<String> sources,
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endDate) {
List<ItemSource> itemSources = null;
if (sources != null) {
itemSources = sources.stream()
.map(sourceStr -> {
try {
return ItemSource.valueOf(sourceStr.toUpperCase());
} catch (IllegalArgumentException e) {
logger.error("Invalid ItemSource value: {}", sourceStr);
try {
throw new FunctionalException("INVALID_ITEM_SOURCE");
} catch (FunctionalException ex) {
throw new RuntimeException(ex);
}
}
})
.collect(Collectors.toList());
}
Long totalCarts = statisticsService.getTotalCarts(itemSources, startDate, endDate);
return ResponseEntity.ok(totalCarts);
}
@PostMapping(Paths.THEORETICAL_AMOUNT)
public ResponseEntity<TheoreticalAmountResponseDTO> getTheoreticalAmount(@RequestBody TheoreticalAmountRequestDTO requestDTO) {
TheoreticalAmountResponseDTO responseDTO = statisticsService.getTheoreticalAmountResponse(requestDTO);
return ResponseEntity.ok(responseDTO);
}
}
package com.marketingconfort.mydressin.converters;
import com.marketingconfort.mydressin.common.cart.enumurations.ItemSource;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;
@Component
public class StringToItemSourceConverter implements Converter<String, ItemSource> {
@Override
public ItemSource convert(String source) {
if (source == null || source.isEmpty()) {
return null;
}
return ItemSource.valueOf(source.toUpperCase());
}
}
\ No newline at end of file
package com.marketingconfort.mydressin.dtos;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder
public class ApplyPromoCodeRequest {
private String promoCode;
private Long clientId;
}
package com.marketingconfort.mydressin.dtos;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder
@AllArgsConstructor
public class ApplyPromoCodeResponse {
private boolean applied;
private String message;
private CartDTO updatedCart;
}
package com.marketingconfort.mydressin.dtos;
import com.marketingconfort.mydressin.common.Addons.dtos.PromoCodeDTO;
import com.marketingconfort.mydressin.common.cart.dtos.GiftCardDTO;
import com.marketingconfort.mydressin.common.cart.dtos.VoucherDTO;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
......@@ -14,6 +18,8 @@ public class CartDTO {
private Long id;
private Long clientId;
private double totalPrice;
private double subTotalPrice;
private double promoCodeDiscounts;
private String typeCountDown;
private List<String> errorsMessages = new ArrayList<>();
......@@ -25,6 +31,13 @@ public class CartDTO {
private List<Long> promoCodeIds = new ArrayList<>();
private List<Long> giftCardIds;
private CountdownDTO countdown;
private GiftCardDTO appliedGiftCard;
private String appliedGiftCardCode;
private Long giftCardBalanceUsed;
private VoucherDTO appliedVoucher;
private String appliedVoucherCode;
private Long voucherBalanceUsed;
public CartDTO(Long clientId, String message) {
......
package com.marketingconfort.mydressin.dtos;
import com.marketingconfort.mydressin.common.cart.dtos.GiftCardDTO;
import com.marketingconfort.mydressin.common.cart.dtos.ProductCartDTO;
import com.marketingconfort.mydressin.common.cart.enumurations.ItemCartStatus;
......@@ -9,8 +9,9 @@ import com.marketingconfort.mydressin.common.stockmanagement.enumurations.Produc
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@Setter
@Getter
......@@ -20,6 +21,8 @@ public class ItemCartDTO {
private ProductType productType;
private Long productId;
private double totalPrice;
private double subTotalPrice;
private double promoCodeDiscounts;
private ProductCartDTO product;
private ItemSource source;
private ItemCartStatus status;
......@@ -27,5 +30,6 @@ public class ItemCartDTO {
private LocalDateTime expirationDate;
private Long sessionId;
private CountdownDTO countdown;
private List<GiftCardDTO> giftCards;
private List<Long> giftCardIds;
}
package com.marketingconfort.mydressin.dtos;
import com.marketingconfort.mydressin.common.cart.dtos.GiftCardDTO;
import com.marketingconfort.mydressin.common.stockmanagement.enumurations.ProductType;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.List;
@Setter
@Getter
@NoArgsConstructor
......@@ -17,6 +20,8 @@ public class ItemRequestDTO {
private Long quantity;
private ProductType type;
private boolean useWebStockForLive;
private GiftCardDTO giftCardDTO;
public ItemRequestDTO(Long id, Long quantity, ProductType type) {
this.productId=id;
......
package com.marketingconfort.mydressin.dtos;
import com.marketingconfort.mydressin.common.Addons.dtos.CategoryDTO;
import com.marketingconfort.mydressin.common.Addons.enumerations.PromoCodeType;
import com.marketingconfort.mydressin.common.cart.dtos.ProductCartDTO;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class PromoCodeDTO {
private Long id;
private String code;
private PromoCodeType promoCodeType;
private Integer valueCode;
private String description;
private List<Long> productsIncludedIds;
private List<Long> categoriesIncludedIds;
private List<ProductCartDTO> productsIncluded;
private List<CategoryDTO> categoriesIncluded;
private Integer usage;
private Integer usageLimit;
private LocalDate startDate;
private LocalDate expirationDate;
private BigDecimal minAmount;
private List<Long> productsExcludedIds;
private List<Long> categoriesExcludedIds;
private List<ProductCartDTO> productsExcluded;
private List<CategoryDTO> categoriesExcluded;
private Boolean freeShipping;
private Boolean uniquePromoCode;
}
package com.marketingconfort.mydressin.dtos.StatisticsDTOs;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class ChartDataDTO {
private List<String> labels;
private List<SeriesDataDTO> series;
}
package com.marketingconfort.mydressin.dtos.StatisticsDTOs;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDate;
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class DailyAmountDTO {
private LocalDate date;
private double amount;
}
package com.marketingconfort.mydressin.dtos.StatisticsDTOs;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDate;
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class DateCountDTO {
private LocalDate date;
private Long count;
}
package com.marketingconfort.mydressin.dtos.StatisticsDTOs;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class SeriesDataDTO {
private String name;
private String type;
private String fill;
private List<Long> data;
}
package com.marketingconfort.mydressin.dtos.StatisticsDTOs;
import com.marketingconfort.mydressin.common.cart.enumurations.ItemSource;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class TheoreticalAmountRequestDTO {
private List<ItemSource> sources;
private LocalDateTime startDate;
private LocalDateTime endDate;
}
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