File tree Expand file tree Collapse file tree
src/main/java/ceos/backend/domain/subscriber/helper Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package ceos .backend .domain .subscriber .helper ;
22
33import ceos .backend .domain .subscriber .exception .DuplicateData ;
4- import ceos .backend .domain .subscriber .exception .InvalidAction ;
4+ import ceos .backend .domain .subscriber .exception .InvalidActionAfter ;
5+ import ceos .backend .domain .subscriber .exception .InvalidActionBefore ;
56import ceos .backend .domain .subscriber .repository .SubscriberRepository ;
67import ceos .backend .global .common .dto .AwsSESRecruitMail ;
78import ceos .backend .global .common .event .Event ;
@@ -22,9 +23,11 @@ public void validateEmail(String email) {
2223 }
2324 }
2425
25- public void validateDate (LocalDate date , LocalDate now ) {
26- if (!date .equals (now )) {
27- throw InvalidAction .EXCEPTION ;
26+ public void validateDate (LocalDate startDate , LocalDate endDate , LocalDate now ) {
27+ if (startDate .isBefore (now )) {
28+ throw InvalidActionBefore .EXCEPTION ;
29+ } else if (endDate .isAfter (now )) {
30+ throw InvalidActionAfter .EXCEPTION ;
2831 }
2932 }
3033
You can’t perform that action at this time.
0 commit comments