🐛 Problem
Currently, visits can be created with any date (past, present, or future).
There is no validation to prevent booking visits in the past.
✅ Expected Behavior
- New visits should only be allowed from tomorrow onwards.
- Past dates should trigger validation errors.
- Validation should be applied in both:
- Frontend (
<input type="date" min="...">)
- Backend (in
VisitController.processNewVisitForm).
📍 Affected Areas
pets/createOrUpdateVisitForm.html: add min attribute to date input.
VisitController.java: add check
if (visit.getDate() != null && !visit.getDate().isAfter(LocalDate.now())) {
result.rejectValue("date", "invalid", "Visit date must be in the future");
}
🧪 Testing
- ❌ Past date → error
- ✅ Future date → allowed
🐛 Problem
Currently, visits can be created with any date (past, present, or future).
There is no validation to prevent booking visits in the past.
✅ Expected Behavior
<input type="date" min="...">)VisitController.processNewVisitForm).📍 Affected Areas
pets/createOrUpdateVisitForm.html: addminattribute to date input.VisitController.java: add check🧪 Testing