fixed bug
This commit is contained in:
@@ -12,7 +12,7 @@ public record InsuranceContract(Animal animal, LocalDate insuranceStartDate, Str
|
|||||||
|
|
||||||
List<String> violations = new ArrayList<>();
|
List<String> violations = new ArrayList<>();
|
||||||
|
|
||||||
if (animal() == null) {
|
if (animal == null) {
|
||||||
violations.add("Animal darf nicht leer sein");
|
violations.add("Animal darf nicht leer sein");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ public record InsuranceContract(Animal animal, LocalDate insuranceStartDate, Str
|
|||||||
violations.add("Versicherungsstart darf nicht leer sein");
|
violations.add("Versicherungsstart darf nicht leer sein");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (animal() != null && insuranceStartDate != null
|
if (animal != null && insuranceStartDate != null
|
||||||
&& animal.birthday().isAfter(insuranceStartDate)) {
|
&& animal.birthday().isAfter(insuranceStartDate)) {
|
||||||
violations.add("Start der Versicherung kann nicht vor dem Geburtstag sein.");
|
violations.add("Start der Versicherung kann nicht vor dem Geburtstag sein.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user