class ProposePlaceServiceImpl implements ProposePlaceService {

    @Override
    public void checkInputTime(Set<OpeningHoursDto> dto) {
        dto.forEach(hours -> {
            if (hours.getOpenTime().getHour() > hours.getCloseTime().getHour()) {
                throw new BadRequestException(ErrorMessage.CLOSE_TIME_LATE_THAN_OPEN_TIME);
            }
            if (hours.getBreakTime() != null) {
                if (hours.getBreakTime().getStartTime().getHour() < hours.getOpenTime().getHour()
                        || hours.getBreakTime().getEndTime().getHour() > hours.getCloseTime().getHour()) {
                    throw new BadRequestException(ErrorMessage.WRONG_BREAK_TIME);
                }
            }
        });
    }

}