fix: Check if is under restricted

This commit is contained in:
js0ny 2025-11-28 03:54:40 +00:00
parent 72eb53817c
commit e96c0896b9
3 changed files with 12 additions and 2 deletions

View file

@ -31,6 +31,7 @@
newman newman
gron gron
fx fx
google-java-format
]; ];
shellHook = '' shellHook = ''
export JAVA_HOME=${pkgs.jdk21} export JAVA_HOME=${pkgs.jdk21}

View file

@ -118,6 +118,15 @@ public class PathFinderService {
return new DeliveryPathResponse(0f, 0, new DronePath[0]); return new DeliveryPathResponse(0f, 0, new DronePath[0]);
} }
for (var r : records) {
if (isRestricted(r.delivery())) {
throw new IllegalStateException(
"Delivery "
+ r.id()
+ " is located within a restricted area and cannot be fulfilled");
}
}
Map<String, List<MedDispatchRecRequest>> assigned = assignDeliveries(records); Map<String, List<MedDispatchRecRequest>> assigned = assignDeliveries(records);
List<DronePath> paths = new ArrayList<>(); List<DronePath> paths = new ArrayList<>();