I am developing a booking spring java application to book a request for specific time (year , month , day , hour , minutes) the request time is fixed by the variable REQUEST_PERIOD , i want a solution to see if the request time is valid or not . more explanation for the problem : the user reserve an appointment if the appointment is valid (not in any other reserved appointment range [request_Time ]) then the system will reserve the request else will reject it .
example :
REQUEST_PERIOD = 100 min;
reserved requests :
requestA [year : 2018 , month : 5 , day : 1 , hour : 12 , minutes : 40]
requestB [year : 2018 , month : 5 , day : 1 , hour : 15 , minutes : 30]
new request (valid) :
requestC [year : 2018 , month : 5 , day : 1 , hour : 18 , minutes : 20]
new request (not valid) :
requestD [year : 2018 , month : 5 , day : 1 , hour : 15 , minutes : 40]
requestF [year : 2018 , month : 5 , day : 1 , hour : 15 , minutes : 50]
requestT [year : 2018 , month : 5 , day : 1 , hour : 15 , minutes : 50]
not valid becouse it in the range requestB time + REQUEST_PERIOD