Skip to content

Commit

Permalink
Merge pull request #345 from catchroom/develop
Browse files Browse the repository at this point in the history
Fix : 체크인날짜가 지난 경우 UNABLESELL enum 추가
  • Loading branch information
HyemIin authored Jan 27, 2024
2 parents 912001a + eeabb5b commit 9af4b29
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,15 @@ public void applyProductUnsold() {
product.updateDealState(DealState.UNSOLD);
}
}

@Scheduled(cron = "0 0 0 * * *",zone = "Asia/Seoul")
@Transactional
public void applyUnableSold() {
List<Product> productList = productRepository.findAll();
for (Product product : productList) {
if (product.getOrderHistory().getCheckIn().isBefore(LocalDate.now()) && product.getDealState() != DealState.DONEDEAL) {
product.updateDealState(DealState.UNABLESELL);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.example.catchroom_be.domain.product.type;

public enum DealState {
ONSALE,EXPIRED,UNSOLD,DONEDEAL
ONSALE,EXPIRED,UNSOLD,DONEDEAL,UNABLESELL
}

0 comments on commit 9af4b29

Please sign in to comment.