Skip to content

Commit

Permalink
[PBS-65][HoangHN] refactor: πŸ™‰ no params situation
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoang-Nguyen-Huy committed Oct 29, 2024
1 parent abf1f36 commit 8b3724a
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,12 @@ public double calculateRevenue(LocalDateTime startTime, LocalDateTime endTime) {
[GET]: /order-detail/revenue-chart
*/
public List<RevenueChartDto> calculateRevenueByMonth(LocalDateTime startTime, LocalDateTime endTime, String viewWith) {
if (startTime == null) {
startTime = LocalDate.now().atStartOfDay();
}
if (endTime == null) {
endTime = LocalDate.now().atTime(LocalTime.MAX);
}
if (viewWith == null) {
return Collections.singletonList(orderDetailRepository.calculateRevenueForSingleDay(startTime));
}
Expand Down

0 comments on commit 8b3724a

Please sign in to comment.